aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_versions/ajax
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-01-11 14:23:28 +0100
committerBjörn Schießle <schiessle@owncloud.com>2013-01-11 14:23:28 +0100
commit67d00bc6bbcb2cbd39753c279f8449f593fa2f06 (patch)
tree776a6b9ce8406743e0edf1b4e03f6a7946db11b7 /apps/files_versions/ajax
parent6be9c0a97462272674cd6892aee00df752fc99b8 (diff)
downloadnextcloud-server-67d00bc6bbcb2cbd39753c279f8449f593fa2f06.tar.gz
nextcloud-server-67d00bc6bbcb2cbd39753c279f8449f593fa2f06.zip
some more clean-up, isVersioned() is no longer needed; rename hook fixed if a complete folder gets renamed
Diffstat (limited to 'apps/files_versions/ajax')
-rw-r--r--apps/files_versions/ajax/getVersions.php5
-rw-r--r--apps/files_versions/ajax/rollbackVersion.php11
2 files changed, 7 insertions, 9 deletions
diff --git a/apps/files_versions/ajax/getVersions.php b/apps/files_versions/ajax/getVersions.php
index 8476e5e8a51..600e69cf798 100644
--- a/apps/files_versions/ajax/getVersions.php
+++ b/apps/files_versions/ajax/getVersions.php
@@ -4,10 +4,9 @@ OCP\JSON::checkAppEnabled('files_versions');
$userDirectory = "/".OCP\USER::getUser()."/files";
$source = $_GET['source'];
-if( OCA_Versions\Storage::isversioned( $source ) ) {
+$count = 5; //show the newest revisions
+if( ($versions = OCA_Versions\Storage::getVersions( $source, $count)) ) {
- $count=5; //show the newest revisions
- $versions = OCA_Versions\Storage::getVersions( $source, $count);
$versionsFormatted = array();
foreach ( $versions AS $version ) {
diff --git a/apps/files_versions/ajax/rollbackVersion.php b/apps/files_versions/ajax/rollbackVersion.php
index f1b02eb4b92..f2c211d9c1e 100644
--- a/apps/files_versions/ajax/rollbackVersion.php
+++ b/apps/files_versions/ajax/rollbackVersion.php
@@ -8,10 +8,9 @@ $userDirectory = "/".OCP\USER::getUser()."/files";
$file = $_GET['file'];
$revision=(int)$_GET['revision'];
-if( OCA_Versions\Storage::isversioned( $file ) ) {
- if(OCA_Versions\Storage::rollback( $file, $revision )) {
- OCP\JSON::success(array("data" => array( "revision" => $revision, "file" => $file )));
- }else{
- OCP\JSON::error(array("data" => array( "message" => "Could not revert:" . $file )));
- }
+if(OCA_Versions\Storage::rollback( $file, $revision )) {
+ OCP\JSON::success(array("data" => array( "revision" => $revision, "file" => $file )));
+}else{
+ OCP\JSON::error(array("data" => array( "message" => "Could not revert:" . $file )));
}
+