]> source.dussan.org Git - nextcloud-server.git/commitdiff
Implement a basic versioning configuration. Only a on/off switch for now.
authorFrank Karlitschek <frank@owncloud.org>
Mon, 30 Apr 2012 17:18:00 +0000 (19:18 +0200)
committerFrank Karlitschek <frank@owncloud.org>
Mon, 30 Apr 2012 17:18:00 +0000 (19:18 +0200)
I changed my mind about the more complex configuration options. We go with good default for now and don´t expose all the technical options to the users.
They can still override in the config file if it´s really really needed and they know what they are doing

apps/files_versions/js/versions.js
apps/files_versions/templates/settings.php

index c2dfcd9f3b60b937630df88ea18e8f6bb72a86bb..071efc9ef01a0b405f61ca413c31972b7e6ac50f 100644 (file)
@@ -1,3 +1,13 @@
+$(document).ready(function() {
+        $('#versions').bind('change', function() {
+                var checked = 1;
+                if (!this.checked) {
+                        checked = 0;
+                }
+                $.post(OC.filePath('files_versions','ajax','togglesettings.php'), 'versions='+checked);
+        });
+});
+
 $(document).ready(function(){
        
        // Add history button to files/index.php
@@ -103,4 +113,4 @@ function createVersionsDropdown(filename, files) {
        $('#dropdown').show('blind');
        $('#share_with').chosen();
        
-}
\ No newline at end of file
+}
index 2f918257360f68b9f570798600edbeef6fff3ff9..74882473168605501fc7c0238edb2d4096a60337 100644 (file)
@@ -1,7 +1,5 @@
-<form id="external">
-       <fieldset class="personalblock">
-               <strong>Versions</strong><br />
-
-               Configuration goes here...
-       </fieldset>
-</form>
\ No newline at end of file
+<form id="versions">
+        <fieldset class="personalblock">
+               <input type="checkbox" name="versions" id="versions" value="1" <?php if (OC_Config::getValue('versions', 'true')=='true') echo ' checked="checked"'; ?> /> <label for="versions"><?php echo $l->t('Enable Files Versioning'); ?></label> <br/>
+        </fieldset>
+</form>