diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2013-03-01 23:11:03 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2013-03-01 23:11:03 +0100 |
commit | 5e7970f76158681876b51320d4f0e0b12ca01604 (patch) | |
tree | ae673236e344699d591bb9b4d512da2d58d44093 /apps/files_versions | |
parent | 301d065686b7cb4b49d7662e2edec9ed5fe4115b (diff) | |
parent | 31754a653b13fdf31273177f12c39e32cb8c4001 (diff) | |
download | nextcloud-server-5e7970f76158681876b51320d4f0e0b12ca01604.tar.gz nextcloud-server-5e7970f76158681876b51320d4f0e0b12ca01604.zip |
Merge master
Diffstat (limited to 'apps/files_versions')
-rw-r--r-- | apps/files_versions/history.php | 3 | ||||
-rw-r--r-- | apps/files_versions/js/versions.js | 2 | ||||
-rw-r--r-- | apps/files_versions/l10n/ar.php | 4 | ||||
-rw-r--r-- | apps/files_versions/l10n/bg_BG.php | 3 | ||||
-rw-r--r-- | apps/files_versions/l10n/bn_BD.php | 4 | ||||
-rw-r--r-- | apps/files_versions/l10n/ca.php | 1 | ||||
-rw-r--r-- | apps/files_versions/l10n/cs_CZ.php | 1 | ||||
-rw-r--r-- | apps/files_versions/l10n/de.php | 1 | ||||
-rw-r--r-- | apps/files_versions/l10n/de_DE.php | 1 | ||||
-rw-r--r-- | apps/files_versions/l10n/es.php | 1 | ||||
-rw-r--r-- | apps/files_versions/l10n/es_AR.php | 1 | ||||
-rw-r--r-- | apps/files_versions/l10n/gl.php | 1 | ||||
-rw-r--r-- | apps/files_versions/l10n/hu_HU.php | 1 | ||||
-rw-r--r-- | apps/files_versions/l10n/is.php | 4 | ||||
-rw-r--r-- | apps/files_versions/l10n/it.php | 1 | ||||
-rw-r--r-- | apps/files_versions/l10n/lv.php | 1 | ||||
-rw-r--r-- | apps/files_versions/l10n/mk.php | 4 | ||||
-rw-r--r-- | apps/files_versions/l10n/sk_SK.php | 1 | ||||
-rw-r--r-- | apps/files_versions/l10n/tr.php | 3 | ||||
-rw-r--r-- | apps/files_versions/lib/versions.php | 15 |
20 files changed, 29 insertions, 24 deletions
diff --git a/apps/files_versions/history.php b/apps/files_versions/history.php index 437a3fec065..719a7208fed 100644 --- a/apps/files_versions/history.php +++ b/apps/files_versions/history.php @@ -59,7 +59,8 @@ if ( isset( $_GET['path'] ) ) { // show the history only if there is something to show $count = 999; //show the newest revisions - if( ($versions = OCA\Files_Versions\Storage::getVersions( $path, $count)) ) { + list ($uid, $filename) = OCA\Files_Versions\Storage::getUidAndFilename($path); + if( ($versions = OCA\Files_Versions\Storage::getVersions($uid, $filename, $count)) ) { $tmpl->assign( 'versions', array_reverse( $versions ) ); diff --git a/apps/files_versions/js/versions.js b/apps/files_versions/js/versions.js index b82b9001fdb..a5b24417483 100644 --- a/apps/files_versions/js/versions.js +++ b/apps/files_versions/js/versions.js @@ -32,7 +32,7 @@ $(document).ready(function(){ }); function goToVersionPage(url){ - window.location(url); + window.location.assign(url); } function createVersionsDropdown(filename, files) { diff --git a/apps/files_versions/l10n/ar.php b/apps/files_versions/l10n/ar.php index 1f1f3100405..b84445972d3 100644 --- a/apps/files_versions/l10n/ar.php +++ b/apps/files_versions/l10n/ar.php @@ -1,5 +1,3 @@ <?php $TRANSLATIONS = array( -"History" => "السجل الزمني", -"Files Versioning" => "أصدرة الملفات", -"Enable" => "تفعيل" +"Versions" => "الإصدارات" ); diff --git a/apps/files_versions/l10n/bg_BG.php b/apps/files_versions/l10n/bg_BG.php index 6ecf12d0b00..6a1882c2bfd 100644 --- a/apps/files_versions/l10n/bg_BG.php +++ b/apps/files_versions/l10n/bg_BG.php @@ -1,4 +1,3 @@ <?php $TRANSLATIONS = array( -"History" => "История", -"Enable" => "Включено" +"Versions" => "Версии" ); diff --git a/apps/files_versions/l10n/bn_BD.php b/apps/files_versions/l10n/bn_BD.php index dffa4d79a06..f3b0071a356 100644 --- a/apps/files_versions/l10n/bn_BD.php +++ b/apps/files_versions/l10n/bn_BD.php @@ -1,5 +1,3 @@ <?php $TRANSLATIONS = array( -"History" => "ইতিহাস", -"Files Versioning" => "ফাইল ভার্সন করা", -"Enable" => "সক্রিয় " +"Versions" => "ভার্সন" ); diff --git a/apps/files_versions/l10n/ca.php b/apps/files_versions/l10n/ca.php index 47ff232235c..433d974c8cb 100644 --- a/apps/files_versions/l10n/ca.php +++ b/apps/files_versions/l10n/ca.php @@ -6,5 +6,6 @@ "File %s could not be reverted to version %s" => "El fitxer %s no s'ha pogut revertir a la versió %s", "No old versions available" => "No hi ha versións antigues disponibles", "No path specified" => "No heu especificat el camí", +"Versions" => "Versions", "Revert a file to a previous version by clicking on its revert button" => "Reverteix un fitxer a una versió anterior fent clic en el seu botó de reverteix" ); diff --git a/apps/files_versions/l10n/cs_CZ.php b/apps/files_versions/l10n/cs_CZ.php index 4ebd329332c..087d800137e 100644 --- a/apps/files_versions/l10n/cs_CZ.php +++ b/apps/files_versions/l10n/cs_CZ.php @@ -6,5 +6,6 @@ "File %s could not be reverted to version %s" => "Soubor %s nemohl být navrácen na verzi %s", "No old versions available" => "Nejsou dostupné žádné starší verze", "No path specified" => "Nezadána cesta", +"Versions" => "Verze", "Revert a file to a previous version by clicking on its revert button" => "Navraťte soubor do předchozí verze kliknutím na tlačítko navrátit" ); diff --git a/apps/files_versions/l10n/de.php b/apps/files_versions/l10n/de.php index ac7fb39ae82..c34a8c1fd3e 100644 --- a/apps/files_versions/l10n/de.php +++ b/apps/files_versions/l10n/de.php @@ -6,5 +6,6 @@ "File %s could not be reverted to version %s" => "Datei %s konnte nicht auf Version %s zurückgesetzt werden", "No old versions available" => "Keine älteren Versionen verfügbar", "No path specified" => "Kein Pfad angegeben", +"Versions" => "Versionen", "Revert a file to a previous version by clicking on its revert button" => "Setze eine Datei durch klicken auf den Zurücksetzen Button zurück" ); diff --git a/apps/files_versions/l10n/de_DE.php b/apps/files_versions/l10n/de_DE.php index 6543c3ed45e..c0b2f2a83f7 100644 --- a/apps/files_versions/l10n/de_DE.php +++ b/apps/files_versions/l10n/de_DE.php @@ -6,5 +6,6 @@ "File %s could not be reverted to version %s" => "Die Datei %s konnte nicht zur Version %s zurückgesetzt werden", "No old versions available" => "Keine älteren Versionen verfügbar", "No path specified" => "Kein Pfad angegeben", +"Versions" => "Versionen", "Revert a file to a previous version by clicking on its revert button" => "Setze eine Datei durch Klicken auf den Zurücksetzen-Button auf eine frühere Version zurück" ); diff --git a/apps/files_versions/l10n/es.php b/apps/files_versions/l10n/es.php index c43dbe77c2f..8c1a30f822a 100644 --- a/apps/files_versions/l10n/es.php +++ b/apps/files_versions/l10n/es.php @@ -6,5 +6,6 @@ "File %s could not be reverted to version %s" => "El archivo %s no puede ser revertido a la version %s", "No old versions available" => "No hay versiones antiguas disponibles", "No path specified" => "Ruta no especificada", +"Versions" => "Revisiones", "Revert a file to a previous version by clicking on its revert button" => "Revertir un archivo a una versión anterior haciendo clic en el boton de revertir" ); diff --git a/apps/files_versions/l10n/es_AR.php b/apps/files_versions/l10n/es_AR.php index 1d40b712abe..363693c913b 100644 --- a/apps/files_versions/l10n/es_AR.php +++ b/apps/files_versions/l10n/es_AR.php @@ -6,5 +6,6 @@ "File %s could not be reverted to version %s" => "El archivo %s no pudo ser revertido a la versión %s", "No old versions available" => "No hay versiones antiguas disponibles", "No path specified" => "Ruta de acceso no especificada", +"Versions" => "Versiones", "Revert a file to a previous version by clicking on its revert button" => "Revertí un archivo a una versión anterior haciendo click en su botón de \"revertir\"" ); diff --git a/apps/files_versions/l10n/gl.php b/apps/files_versions/l10n/gl.php index feb7f59e9a4..586ef8c3a68 100644 --- a/apps/files_versions/l10n/gl.php +++ b/apps/files_versions/l10n/gl.php @@ -6,5 +6,6 @@ "File %s could not be reverted to version %s" => "Non foi posíbel reverter o ficheiro %s á versión %s", "No old versions available" => "Non hai versións antigas dispoñíbeis", "No path specified" => "Non foi indicada a ruta", +"Versions" => "Versións", "Revert a file to a previous version by clicking on its revert button" => "Reverta un ficheiro a unha versión anterior premendo no botón reversión" ); diff --git a/apps/files_versions/l10n/hu_HU.php b/apps/files_versions/l10n/hu_HU.php index f400b2f81f5..9f7420157e1 100644 --- a/apps/files_versions/l10n/hu_HU.php +++ b/apps/files_versions/l10n/hu_HU.php @@ -6,5 +6,6 @@ "File %s could not be reverted to version %s" => "%s állományt nem sikerült átállítani erre a változatra: %s", "No old versions available" => "Nincs régebbi változat", "No path specified" => "Nincs megadva az útvonal", +"Versions" => "Az állományok korábbi változatai", "Revert a file to a previous version by clicking on its revert button" => "Az állomány átállítható egy régebbi változatra, ha a gombra kattint" ); diff --git a/apps/files_versions/l10n/is.php b/apps/files_versions/l10n/is.php index ccb8287b71e..d165a78c31e 100644 --- a/apps/files_versions/l10n/is.php +++ b/apps/files_versions/l10n/is.php @@ -1,5 +1,3 @@ <?php $TRANSLATIONS = array( -"History" => "Saga", -"Files Versioning" => "Útgáfur af skrám", -"Enable" => "Virkja" +"Versions" => "Útgáfur" ); diff --git a/apps/files_versions/l10n/it.php b/apps/files_versions/l10n/it.php index 40ac14ffd95..bca00879993 100644 --- a/apps/files_versions/l10n/it.php +++ b/apps/files_versions/l10n/it.php @@ -6,5 +6,6 @@ "File %s could not be reverted to version %s" => "Il file %s non può essere ripristinato alla versione %s", "No old versions available" => "Non sono disponibili versioni precedenti", "No path specified" => "Nessun percorso specificato", +"Versions" => "Versioni", "Revert a file to a previous version by clicking on its revert button" => "Ripristina un file a una versione precedente facendo clic sul rispettivo pulsante di ripristino" ); diff --git a/apps/files_versions/l10n/lv.php b/apps/files_versions/l10n/lv.php index af699de02be..bf8d40fa0f0 100644 --- a/apps/files_versions/l10n/lv.php +++ b/apps/files_versions/l10n/lv.php @@ -6,5 +6,6 @@ "File %s could not be reverted to version %s" => "Datni %s nevarēja atgriezt uz versiju %s", "No old versions available" => "Nav pieejamu vecāku versiju", "No path specified" => "Nav norādīts ceļš", +"Versions" => "Versijas", "Revert a file to a previous version by clicking on its revert button" => "Atgriez datni uz iepriekšēju versiju, spiežot uz tās atgriešanas pogu" ); diff --git a/apps/files_versions/l10n/mk.php b/apps/files_versions/l10n/mk.php index d3ec233fe41..6a1882c2bfd 100644 --- a/apps/files_versions/l10n/mk.php +++ b/apps/files_versions/l10n/mk.php @@ -1,5 +1,3 @@ <?php $TRANSLATIONS = array( -"History" => "Историја", -"Files Versioning" => "Верзии на датотеки", -"Enable" => "Овозможи" +"Versions" => "Версии" ); diff --git a/apps/files_versions/l10n/sk_SK.php b/apps/files_versions/l10n/sk_SK.php index cbf81d4da2e..50e4af4d964 100644 --- a/apps/files_versions/l10n/sk_SK.php +++ b/apps/files_versions/l10n/sk_SK.php @@ -6,5 +6,6 @@ "File %s could not be reverted to version %s" => "Súbor %s nemohol byť obnovený na verziu %s", "No old versions available" => "Nie sú dostupné žiadne staršie verzie", "No path specified" => "Nevybrali ste cestu", +"Versions" => "Verzie", "Revert a file to a previous version by clicking on its revert button" => "Obnovte súbor do predošlej verzie kliknutím na tlačítko obnoviť" ); diff --git a/apps/files_versions/l10n/tr.php b/apps/files_versions/l10n/tr.php index 5ba8248a45d..745400d331c 100644 --- a/apps/files_versions/l10n/tr.php +++ b/apps/files_versions/l10n/tr.php @@ -5,5 +5,6 @@ "failure" => "hata", "File %s could not be reverted to version %s" => "Dosya %s, %s versiyonuna döndürülemedi.", "No old versions available" => "Eski versiyonlar mevcut değil.", -"No path specified" => "Yama belirtilmemiş" +"No path specified" => "Yama belirtilmemiş", +"Versions" => "Sürümler" ); diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php index 12f8fdaa0dc..6ee307c7e17 100644 --- a/apps/files_versions/lib/versions.php +++ b/apps/files_versions/lib/versions.php @@ -86,6 +86,7 @@ class Storage { $files_view = new \OC\Files\View('/'.$uid .'/files'); $users_view = new \OC\Files\View('/'.$uid); + $versions_view = new \OC\Files\View('/'.$uid.'/files_versions'); // check if filename is a directory if($files_view->is_dir($filename)) { @@ -99,7 +100,7 @@ class Storage { // create all parent folders $info=pathinfo($filename); - $versionsFolderName=\OCP\Config::getSystemValue('datadirectory').$users_view->getAbsolutePath('files_versions/'); + $versionsFolderName=$versions_view->getLocalFolder(''); if(!file_exists($versionsFolderName.'/'.$info['dirname'])) { mkdir($versionsFolderName.'/'.$info['dirname'], 0750, true); } @@ -130,7 +131,7 @@ class Storage { list($uid, $filename) = self::getUidAndFilename($filename); $versions_fileview = new \OC\Files\View('/'.$uid .'/files_versions'); - $abs_path = \OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath('').$filename.'.v'; + $abs_path = $versions_fileview->getLocalFile($filename.'.v'); if( ($versions = self::getVersions($uid, $filename)) ) { $versionsSize = self::getVersionsSize($uid); if ( $versionsSize === false || $versionsSize < 0 ) { @@ -152,7 +153,7 @@ class Storage { list($uidn, $newpath) = self::getUidAndFilename($newpath); $versions_view = new \OC\Files\View('/'.$uid .'/files_versions'); $files_view = new \OC\Files\View('/'.$uid .'/files'); - $abs_newpath = \OCP\Config::getSystemValue('datadirectory').$versions_view->getAbsolutePath('').$newpath; + $abs_newpath = $versions_view->getLocalFile($newpath); if ( $files_view->is_dir($oldpath) && $versions_view->is_dir($oldpath) ) { $versions_view->rename($oldpath, $newpath); @@ -207,8 +208,8 @@ class Storage { public static function getVersions($uid, $filename, $count = 0 ) { if( \OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true' ) { $versions_fileview = new \OC\Files\View('/' . $uid . '/files_versions'); - - $versionsName = \OC_Filesystem::normalizePath(\OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath($filename)); + $versionsName = $versions_fileview->getLocalFile($filename); + $versions = array(); // fetch for old versions $matches = glob(preg_quote($versionsName).'.v*' ); @@ -271,7 +272,7 @@ class Storage { private static function calculateSize($uid) { if( \OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true' ) { $versions_fileview = new \OC\Files\View('/'.$uid.'/files_versions'); - $versionsRoot = \OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath(''); + $versionsRoot = $versions_fileview->getLocalFolder(''); $iterator = new \RecursiveIteratorIterator( new \RecursiveDirectoryIterator($versionsRoot), @@ -299,7 +300,7 @@ class Storage { private static function getAllVersions($uid) { if( \OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true' ) { $versions_fileview = new \OC\Files\View('/'.$uid.'/files_versions'); - $versionsRoot = \OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath(''); + $versionsRoot = $versions_fileview->getLocalFolder(''); $iterator = new \RecursiveIteratorIterator( new \RecursiveDirectoryIterator($versionsRoot), |