summaryrefslogtreecommitdiffstats
path: root/apps/files_versions/ajax
diff options
context:
space:
mode:
authorSam Tuke <sam@donttravelempty.com>2012-04-26 18:45:17 +0100
committerSam Tuke <sam@donttravelempty.com>2012-04-26 18:45:17 +0100
commit18a024e251cbcdaafb0ef2893cd5cf8544b03f4d (patch)
tree9633209305aec012458c1a60e372b39f5e1230d8 /apps/files_versions/ajax
parentc693ee2adb1b8b251d7905791eeca0946c31c68b (diff)
downloadnextcloud-server-18a024e251cbcdaafb0ef2893cd5cf8544b03f4d.tar.gz
nextcloud-server-18a024e251cbcdaafb0ef2893cd5cf8544b03f4d.zip
started implementing ajax file rollback
Diffstat (limited to 'apps/files_versions/ajax')
-rw-r--r--apps/files_versions/ajax/getVersions.php11
-rw-r--r--apps/files_versions/ajax/rollbackVersion.php26
2 files changed, 35 insertions, 2 deletions
diff --git a/apps/files_versions/ajax/getVersions.php b/apps/files_versions/ajax/getVersions.php
index fbe65146acc..32aac10b718 100644
--- a/apps/files_versions/ajax/getVersions.php
+++ b/apps/files_versions/ajax/getVersions.php
@@ -11,9 +11,16 @@ $source = strip_tags( $source );
if( OCA_Versions\Storage::isversioned( $source ) ) {
$count=5; //show the newest revisions
- $versions=OCA_Versions\Storage::getversions( $source, $count);
+ $versions = OCA_Versions\Storage::getversions( $source, $count);
+ $versionsFormatted = array();
+
+ foreach ( $versions AS $version ) {
+
+ $versionsFormatted[] = OC_Util::formatDate( $version );
+
+ }
- $versionsSorted = array_reverse( $versions );
+ $versionsSorted = array_reverse( $versionsFormatted );
if ( !empty( $versionsSorted ) ) {
OC_JSON::encodedPrint($versionsSorted);
diff --git a/apps/files_versions/ajax/rollbackVersion.php b/apps/files_versions/ajax/rollbackVersion.php
new file mode 100644
index 00000000000..660411973a2
--- /dev/null
+++ b/apps/files_versions/ajax/rollbackVersion.php
@@ -0,0 +1,26 @@
+<?php
+
+require_once('../../../lib/base.php');
+OC_JSON::checkAppEnabled('files_versions');
+require_once('../versions.php');
+
+$userDirectory = "/".OC_User::getUser()."/files";
+
+$source = $_GET['source'];
+
+$source = strip_tags( $source );
+
+echo "\n\n$source\n\n";
+
+$revision = strtotime( $source );
+
+echo "\n\n$revision\n\n";
+
+if( OCA_Versions\Storage::isversioned( $source ) ) {
+
+
+ #\OCA_Versions\Storage::rollback( $source, $revision );
+
+}
+
+?> \ No newline at end of file