Merge branch 'master' into master-sqlserver

Conflicts:
	core/templates/installation.php
This commit is contained in:
Thomas Mueller 2013-02-22 22:59:09 +01:00
commit 9898ba4daf
476 changed files with 7640 additions and 3852 deletions

View File

@ -26,8 +26,7 @@ foreach ($_FILES['files']['error'] as $error) {
UPLOAD_ERR_OK => $l->t('There is no error, the file uploaded with success'), UPLOAD_ERR_OK => $l->t('There is no error, the file uploaded with success'),
UPLOAD_ERR_INI_SIZE => $l->t('The uploaded file exceeds the upload_max_filesize directive in php.ini: ') UPLOAD_ERR_INI_SIZE => $l->t('The uploaded file exceeds the upload_max_filesize directive in php.ini: ')
. ini_get('upload_max_filesize'), . ini_get('upload_max_filesize'),
UPLOAD_ERR_FORM_SIZE => $l->t('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified' UPLOAD_ERR_FORM_SIZE => $l->t('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form'),
. ' in the HTML form'),
UPLOAD_ERR_PARTIAL => $l->t('The uploaded file was only partially uploaded'), UPLOAD_ERR_PARTIAL => $l->t('The uploaded file was only partially uploaded'),
UPLOAD_ERR_NO_FILE => $l->t('No file was uploaded'), UPLOAD_ERR_NO_FILE => $l->t('No file was uploaded'),
UPLOAD_ERR_NO_TMP_DIR => $l->t('Missing a temporary folder'), UPLOAD_ERR_NO_TMP_DIR => $l->t('Missing a temporary folder'),

View File

@ -316,7 +316,7 @@ var FileList={
if(files.substr){ if(files.substr){
files=[files]; files=[files];
} }
for (var i in files) { for (var i=0; i<files.length; i++) {
var deleteAction = $('tr').filterAttr('data-file',files[i]).children("td.date").children(".action.delete"); var deleteAction = $('tr').filterAttr('data-file',files[i]).children("td.date").children(".action.delete");
var oldHTML = deleteAction[0].outerHTML; var oldHTML = deleteAction[0].outerHTML;
var newHTML = '<img class="move2trash" data-action="Delete" title="'+t('files', 'perform delete operation')+'" src="'+ OC.imagePath('core', 'loading.gif') +'"></a>'; var newHTML = '<img class="move2trash" data-action="Delete" title="'+t('files', 'perform delete operation')+'" src="'+ OC.imagePath('core', 'loading.gif') +'"></a>';

View File

@ -162,9 +162,10 @@ $(document).ready(function() {
var tr=$('tr').filterAttr('data-file',filename); var tr=$('tr').filterAttr('data-file',filename);
var renaming=tr.data('renaming'); var renaming=tr.data('renaming');
if(!renaming && !FileList.isLoading(filename)){ if(!renaming && !FileList.isLoading(filename)){
var mime=$(this).parent().parent().data('mime'); FileActions.currentFile = $(this).parent();
var type=$(this).parent().parent().data('type'); var mime=FileActions.getCurrentMimeType();
var permissions = $(this).parent().parent().data('permissions'); var type=FileActions.getCurrentType();
var permissions = FileActions.getCurrentPermissions();
var action=FileActions.getDefault(mime,type, permissions); var action=FileActions.getDefault(mime,type, permissions);
if(action){ if(action){
event.preventDefault(); event.preventDefault();

View File

@ -24,7 +24,7 @@
"replaced {new_name}" => "{new_name} wurde ersetzt", "replaced {new_name}" => "{new_name} wurde ersetzt",
"undo" => "rückgängig machen", "undo" => "rückgängig machen",
"replaced {new_name} with {old_name}" => "{old_name} wurde ersetzt durch {new_name}", "replaced {new_name} with {old_name}" => "{old_name} wurde ersetzt durch {new_name}",
"perform delete operation" => "Führe das Löschen aus", "perform delete operation" => "führe das Löschen aus",
"'.' is an invalid file name." => "'.' ist kein gültiger Dateiname.", "'.' is an invalid file name." => "'.' ist kein gültiger Dateiname.",
"File name cannot be empty." => "Der Dateiname darf nicht leer sein.", "File name cannot be empty." => "Der Dateiname darf nicht leer sein.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Ungültiger Name, '\\', '/', '<', '>', ':', '\"', '|', '?' und '*' sind nicht zulässig.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Ungültiger Name, '\\', '/', '<', '>', ':', '\"', '|', '?' und '*' sind nicht zulässig.",
@ -69,5 +69,5 @@
"The files you are trying to upload exceed the maximum size for file uploads on this server." => "Die Datei überschreitet die Maximalgröße für Uploads auf diesem Server.", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Die Datei überschreitet die Maximalgröße für Uploads auf diesem Server.",
"Files are being scanned, please wait." => "Dateien werden gescannt, bitte warten.", "Files are being scanned, please wait." => "Dateien werden gescannt, bitte warten.",
"Current scanning" => "Scanne", "Current scanning" => "Scanne",
"Upgrading filesystem cache..." => "Aktualisiere den Dateisystem-Cache" "Upgrading filesystem cache..." => "Aktualisiere den Dateisystem-Cache..."
); );

6
apps/files/l10n/hy.php Normal file
View File

@ -0,0 +1,6 @@
<?php $TRANSLATIONS = array(
"Delete" => "Ջնջել",
"Close" => "Փակել",
"Save" => "Պահպանել",
"Download" => "Բեռնել"
);

View File

@ -19,6 +19,10 @@
"Name" => "Nama", "Name" => "Nama",
"Size" => "Ukuran", "Size" => "Ukuran",
"Modified" => "Dimodifikasi", "Modified" => "Dimodifikasi",
"1 folder" => "1 map",
"{count} folders" => "{count} map",
"1 file" => "1 berkas",
"{count} files" => "{count} berkas",
"Upload" => "Unggah", "Upload" => "Unggah",
"File handling" => "Penanganan berkas", "File handling" => "Penanganan berkas",
"Maximum upload size" => "Ukuran unggah maksimum", "Maximum upload size" => "Ukuran unggah maksimum",

View File

@ -0,0 +1,3 @@
<?php $TRANSLATIONS = array(
"Files" => "ဖိုင်များ"
);

View File

@ -60,6 +60,7 @@
"Text file" => "Arquivo texto", "Text file" => "Arquivo texto",
"Folder" => "Pasta", "Folder" => "Pasta",
"From link" => "Do link", "From link" => "Do link",
"Deleted files" => "Arquivos apagados",
"Cancel upload" => "Cancelar upload", "Cancel upload" => "Cancelar upload",
"Nothing in here. Upload something!" => "Nada aqui.Carrege alguma coisa!", "Nothing in here. Upload something!" => "Nada aqui.Carrege alguma coisa!",
"Download" => "Baixar", "Download" => "Baixar",

View File

@ -1,4 +1,7 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"Encryption" => "enkripsi", "Encryption" => "Enkripsi",
"None" => "tidak ada" "File encryption is enabled." => "Enkripsi berkas aktif.",
"The following file types will not be encrypted:" => "Tipe berkas berikut tidak akan dienkripsi:",
"Exclude the following file types from encryption:" => "Kecualikan tipe berkas berikut dari enkripsi:",
"None" => "Tidak ada"
); );

View File

@ -0,0 +1,3 @@
<?php $TRANSLATIONS = array(
"Delete" => "Ջնջել"
);

View File

@ -1,14 +1,26 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"Access granted" => "akses diberikan", "Access granted" => "Akses diberikan",
"Grant access" => "berikan hak akses", "Error configuring Dropbox storage" => "Kesalahan dalam mengkonfigurasi penyimpanan Dropbox",
"Fill out all required fields" => "isi semua field yang dibutuhkan", "Grant access" => "Berikan hak akses",
"External Storage" => "penyimpanan eksternal", "Fill out all required fields" => "Isi semua field yang dibutuhkan",
"Configuration" => "konfigurasi", "Please provide a valid Dropbox app key and secret." => "Masukkan kunci dan sandi aplikasi Dropbox yang benar.",
"Options" => "pilihan", "Error configuring Google Drive storage" => "Kesalahan dalam mengkonfigurasi penyimpanan Google Drive",
"Applicable" => "berlaku", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Peringatan:</b> \"smbclient\" tidak terpasang. Mount direktori CIFS/SMB tidak dapat dilakukan. Silakan minta administrator sistem untuk memasangnya.",
"None set" => "tidak satupun di set", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Peringatan:</b> Dukungan FTP di PHP tidak aktif atau tidak terpasang. Mount direktori FTP tidak dapat dilakukan. Silakan minta administrator sistem untuk memasangnya.",
"All Users" => "semua pengguna", "External Storage" => "Penyimpanan Eksternal",
"Groups" => "grup", "Mount point" => "Lokasi mount",
"Users" => "pengguna", "Backend" => "Backend",
"Delete" => "hapus" "Configuration" => "Konfigurasi",
"Options" => "Pilihan",
"Applicable" => "Berlaku",
"Add mount point" => "Tambah lokasi mount",
"None set" => "Tidak satupun di set",
"All Users" => "Semua Pengguna",
"Groups" => "Grup",
"Users" => "Pengguna",
"Delete" => "Hapus",
"Enable User External Storage" => "Aktifkan Penyimpanan Eksternal Pengguna",
"Allow users to mount their own external storage" => "Ijinkan pengguna untuk me-mount penyimpanan eksternal mereka",
"SSL root certificates" => "Sertifikat root SSL",
"Import Root Certificate" => "Impor Sertifikat Root"
); );

View File

@ -0,0 +1,3 @@
<?php $TRANSLATIONS = array(
"Users" => "သုံးစွဲသူ"
);

View File

@ -52,7 +52,10 @@ if (version_compare($installedVersion, '0.3', '<')) {
} }
catch (Exception $e) { catch (Exception $e) {
$update_error = true; $update_error = true;
OCP\Util::writeLog('files_sharing', 'Upgrade Routine: Skipping sharing "'.$row['source'].'" to "'.$shareWith.'" (error is "'.$e->getMessage().'")', OCP\Util::WARN); OCP\Util::writeLog('files_sharing',
'Upgrade Routine: Skipping sharing "'.$row['source'].'" to "'.$shareWith
.'" (error is "'.$e->getMessage().'")',
OCP\Util::WARN);
} }
OC_Util::tearDownFS(); OC_Util::tearDownFS();
} }

View File

@ -71,8 +71,9 @@ class Shared_Cache extends Cache {
} }
} else { } else {
$query = \OC_DB::prepare( $query = \OC_DB::prepare(
'SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`, `encrypted` 'SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`,'
FROM `*PREFIX*filecache` WHERE `fileid` = ?'); .' `size`, `mtime`, `encrypted`'
.' FROM `*PREFIX*filecache` WHERE `fileid` = ?');
$result = $query->execute(array($file)); $result = $query->execute(array($file));
$data = $result->fetchRow(); $data = $result->fetchRow();
$data['fileid'] = (int)$data['fileid']; $data['fileid'] = (int)$data['fileid'];

View File

@ -33,7 +33,8 @@ class Shared_Permissions extends Permissions {
if ($fileId == -1) { if ($fileId == -1) {
return \OCP\PERMISSION_READ; return \OCP\PERMISSION_READ;
} }
$source = \OCP\Share::getItemSharedWithBySource('file', $fileId, \OC_Share_Backend_File::FORMAT_SHARED_STORAGE, null, true); $source = \OCP\Share::getItemSharedWithBySource('file', $fileId, \OC_Share_Backend_File::FORMAT_SHARED_STORAGE,
null, true);
if ($source) { if ($source) {
return $source['permissions']; return $source['permissions'];
} else { } else {

View File

@ -72,7 +72,11 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent {
public function formatItems($items, $format, $parameters = null) { public function formatItems($items, $format, $parameters = null) {
if ($format == self::FORMAT_SHARED_STORAGE) { if ($format == self::FORMAT_SHARED_STORAGE) {
// Only 1 item should come through for this format call // Only 1 item should come through for this format call
return array('path' => $items[key($items)]['path'], 'permissions' => $items[key($items)]['permissions'], 'uid_owner' => $items[key($items)]['uid_owner']); return array(
'path' => $items[key($items)]['path'],
'permissions' => $items[key($items)]['permissions'],
'uid_owner' => $items[key($items)]['uid_owner']
);
} else if ($format == self::FORMAT_GET_FOLDER_CONTENTS) { } else if ($format == self::FORMAT_GET_FOLDER_CONTENTS) {
$files = array(); $files = array();
foreach ($items as $item) { foreach ($items as $item) {
@ -99,7 +103,13 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent {
} }
$size += (int)$item['size']; $size += (int)$item['size'];
} }
return array('fileid' => -1, 'name' => 'Shared', 'mtime' => $mtime, 'mimetype' => 'httpd/unix-directory', 'size' => $size); return array(
'fileid' => -1,
'name' => 'Shared',
'mtime' => $mtime,
'mimetype' => 'httpd/unix-directory',
'size' => $size
);
} else if ($format == self::FORMAT_OPENDIR) { } else if ($format == self::FORMAT_OPENDIR) {
$files = array(); $files = array();
foreach ($items as $item) { foreach ($items as $item) {

View File

@ -33,7 +33,8 @@ class OC_Share_Backend_Folder extends OC_Share_Backend_File implements OCP\Share
} }
while (!empty($parents)) { while (!empty($parents)) {
$parents = "'".implode("','", $parents)."'"; $parents = "'".implode("','", $parents)."'";
$query = OC_DB::prepare('SELECT `fileid`, `name`, `mimetype` FROM `*PREFIX*filecache` WHERE `parent` IN ('.$parents.')'); $query = OC_DB::prepare('SELECT `fileid`, `name`, `mimetype` FROM `*PREFIX*filecache`'
.' WHERE `parent` IN ('.$parents.')');
$result = $query->execute(); $result = $query->execute();
$parents = array(); $parents = array();
while ($file = $result->fetchRow()) { while ($file = $result->fetchRow()) {

View File

@ -240,7 +240,8 @@ class Shared extends \OC\Files\Storage\Common {
public function file_put_contents($path, $data) { public function file_put_contents($path, $data) {
if ($source = $this->getSourcePath($path)) { if ($source = $this->getSourcePath($path)) {
// Check if permission is granted // Check if permission is granted
if (($this->file_exists($path) && !$this->isUpdatable($path)) || ($this->is_dir($path) && !$this->isCreatable($path))) { if (($this->file_exists($path) && !$this->isUpdatable($path))
|| ($this->is_dir($path) && !$this->isCreatable($path))) {
return false; return false;
} }
$info = array( $info = array(
@ -390,9 +391,12 @@ class Shared extends \OC\Files\Storage\Common {
} }
public static function setup($options) { public static function setup($options) {
if (!\OCP\User::isLoggedIn() || \OCP\User::getUser() != $options['user'] || \OCP\Share::getItemsSharedWith('file')) { if (!\OCP\User::isLoggedIn() || \OCP\User::getUser() != $options['user']
|| \OCP\Share::getItemsSharedWith('file')) {
$user_dir = $options['user_dir']; $user_dir = $options['user_dir'];
\OC\Files\Filesystem::mount('\OC\Files\Storage\Shared', array('sharedFolder' => '/Shared'), $user_dir.'/Shared/'); \OC\Files\Filesystem::mount('\OC\Files\Storage\Shared',
array('sharedFolder' => '/Shared'),
$user_dir.'/Shared/');
} }
} }

View File

@ -171,7 +171,9 @@ if (isset($path)) {
$list->assign('files', $files, false); $list->assign('files', $files, false);
$list->assign('disableSharing', true); $list->assign('disableSharing', true);
$list->assign('baseURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&path=', false); $list->assign('baseURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&path=', false);
$list->assign('downloadURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&download&path=', false); $list->assign('downloadURL',
OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&download&path=',
false);
$breadcrumbNav = new OCP\Template('files', 'part.breadcrumb', ''); $breadcrumbNav = new OCP\Template('files', 'part.breadcrumb', '');
$breadcrumbNav->assign('breadcrumb', $breadcrumb, false); $breadcrumbNav->assign('breadcrumb', $breadcrumb, false);
$breadcrumbNav->assign('baseURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&path=', false); $breadcrumbNav->assign('baseURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&path=', false);
@ -188,7 +190,8 @@ if (isset($path)) {
$folder->assign('usedSpacePercent', 0); $folder->assign('usedSpacePercent', 0);
$tmpl->assign('folder', $folder->fetchPage(), false); $tmpl->assign('folder', $folder->fetchPage(), false);
$tmpl->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true))); $tmpl->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true)));
$tmpl->assign('downloadURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&download&path=' . urlencode($getPath)); $tmpl->assign('downloadURL',
OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&download&path=' . urlencode($getPath));
} else { } else {
$tmpl->assign('dir', $dir); $tmpl->assign('dir', $dir);

View File

@ -3,15 +3,20 @@
<input type="hidden" name="filename" value="<?php echo $_['filename'] ?>" id="filename"> <input type="hidden" name="filename" value="<?php echo $_['filename'] ?>" id="filename">
<input type="hidden" name="mimetype" value="<?php echo $_['mimetype'] ?>" id="mimetype"> <input type="hidden" name="mimetype" value="<?php echo $_['mimetype'] ?>" id="mimetype">
<header><div id="header"> <header><div id="header">
<a href="<?php echo link_to('', 'index.php'); ?>" title="" id="owncloud"><img class="svg" src="<?php echo image_path('', 'logo-wide.svg'); ?>" alt="ownCloud" /></a> <a href="<?php echo link_to('', 'index.php'); ?>" title="" id="owncloud"><img class="svg"
src="<?php echo image_path('', 'logo-wide.svg'); ?>" alt="ownCloud" /></a>
<div class="header-right"> <div class="header-right">
<?php if (isset($_['folder'])): ?> <?php if (isset($_['folder'])): ?>
<span id="details"><?php echo $l->t('%s shared the folder %s with you', array($_['displayName'], $_['fileTarget'])) ?></span> <span id="details"><?php echo $l->t('%s shared the folder %s with you',
array($_['displayName'], $_['fileTarget'])) ?></span>
<?php else: ?> <?php else: ?>
<span id="details"><?php echo $l->t('%s shared the file %s with you', array($_['displayName'], $_['fileTarget'])) ?></span> <span id="details"><?php echo $l->t('%s shared the file %s with you',
array($_['displayName'], $_['fileTarget'])) ?></span>
<?php endif; ?> <?php endif; ?>
<?php if (!isset($_['folder']) || $_['allowZipDownload']): ?> <?php if (!isset($_['folder']) || $_['allowZipDownload']): ?>
<a href="<?php echo $_['downloadURL']; ?>" class="button" id="download"><img class="svg" alt="Download" src="<?php echo OCP\image_path("core", "actions/download.svg"); ?>" /><?php echo $l->t('Download')?></a> <a href="<?php echo $_['downloadURL']; ?>" class="button" id="download"><img
class="svg" alt="Download" src="<?php echo OCP\image_path("core", "actions/download.svg"); ?>"
/><?php echo $l->t('Download')?></a>
<?php endif; ?> <?php endif; ?>
</div> </div>
</div></header> </div></header>
@ -27,9 +32,12 @@
<ul id="noPreview"> <ul id="noPreview">
<li class="error"> <li class="error">
<?php echo $l->t('No preview available for').' '.$_['fileTarget']; ?><br /> <?php echo $l->t('No preview available for').' '.$_['fileTarget']; ?><br />
<a href="<?php echo $_['downloadURL']; ?>" id="download"><img class="svg" alt="Download" src="<?php echo OCP\image_path("core", "actions/download.svg"); ?>" /><?php echo $l->t('Download')?></a> <a href="<?php echo $_['downloadURL']; ?>" id="download"><img class="svg" alt="Download"
src="<?php echo OCP\image_path("core", "actions/download.svg"); ?>"
/><?php echo $l->t('Download')?></a>
</li> </li>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</div> </div>
<footer><p class="info"><a href="http://owncloud.org/">ownCloud</a> &ndash; <?php echo $l->t('web services under your control'); ?></p></footer> <footer><p class="info"><a href="http://owncloud.org/">ownCloud</a> &ndash;
<?php echo $l->t('web services under your control'); ?></p></footer>

View File

@ -3,24 +3,43 @@
OCP\JSON::checkLoggedIn(); OCP\JSON::checkLoggedIn();
OCP\JSON::callCheck(); OCP\JSON::callCheck();
$file = $_REQUEST['file']; $files = $_POST['files'];
$dirlisting = $_POST['dirlisting'];
$list = json_decode($files);
$path_parts = pathinfo($file); $error = array();
if ($path_parts['dirname'] == '.') { $success = array();
$i = 0;
foreach ($list as $file) {
if ( $dirlisting=='0') {
$delimiter = strrpos($file, '.d'); $delimiter = strrpos($file, '.d');
$filename = substr($file, 0, $delimiter); $filename = substr($file, 0, $delimiter);
$timestamp = substr($file, $delimiter+2); $timestamp = substr($file, $delimiter+2);
} else { } else {
$filename = $file; $filename = $file;
$timestamp = null; $timestamp = null;
}
OCA\Files_Trashbin\Trashbin::delete($filename, $timestamp);
if (!OCA\Files_Trashbin\Trashbin::file_exists($filename, $timestamp)) {
$success[$i]['filename'] = $file;
$success[$i]['timestamp'] = $timestamp;
$i++;
} else {
$error[] = $filename;
}
} }
OCA\Files_Trashbin\Trashbin::delete($filename, $timestamp); if ( $error ) {
$filelist = '';
if (!OCA\Files_Trashbin\Trashbin::file_exists($filename)) { foreach ( $error as $e ) {
OCP\JSON::success(array("data" => array("filename" => $file))); $filelist .= $e.', ';
} else { }
$l = OC_L10N::get('files_trashbin'); $l = OC_L10N::get('files_trashbin');
OCP\JSON::error(array("data" => array("message" => $l->t("Couldn't delete %s permanently", array($file))))); $message = $l->t("Couldn't delete %s permanently", array(rtrim($filelist, ', ')));
OCP\JSON::error(array("data" => array("message" => $message,
"success" => $success, "error" => $error)));
} else {
OCP\JSON::success(array("data" => array("success" => $success)));
} }

View File

@ -3,9 +3,9 @@
OCP\JSON::checkLoggedIn(); OCP\JSON::checkLoggedIn();
OCP\JSON::callCheck(); OCP\JSON::callCheck();
$files = $_REQUEST['files']; $files = $_POST['files'];
$dirlisting = $_REQUEST['dirlisting']; $dirlisting = $_POST['dirlisting'];
$list = explode(';', $files); $list = json_decode($files);
$error = array(); $error = array();
$success = array(); $success = array();

View File

@ -1,7 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<info> <info>
<id>files_trashbin</id> <id>files_trashbin</id>
<name>Trash bin</name> <name>Deleted files</name>
<description>Keep a copy of deleted files so that they can be restored if needed</description> <description>Keep a copy of deleted files so that they can be restored if needed</description>
<licence>AGPL</licence> <licence>AGPL</licence>
<author>Bjoern Schiessle</author> <author>Bjoern Schiessle</author>

View File

@ -16,6 +16,7 @@ OCP\Util::addScript('files', 'filelist');
$dir = isset($_GET['dir']) ? stripslashes($_GET['dir']) : ''; $dir = isset($_GET['dir']) ? stripslashes($_GET['dir']) : '';
$result = array();
if ($dir) { if ($dir) {
$dirlisting = true; $dirlisting = true;
$view = new \OC_FilesystemView('/'.\OCP\User::getUser().'/files_trashbin'); $view = new \OC_FilesystemView('/'.\OCP\User::getUser().'/files_trashbin');
@ -37,7 +38,7 @@ if ($dir) {
); );
} }
} }
closedir($fullpath); closedir($dirContent);
} else { } else {
$dirlisting = false; $dirlisting = false;

View File

@ -6,9 +6,10 @@ $(document).ready(function() {
var tr=$('tr').filterAttr('data-file', filename); var tr=$('tr').filterAttr('data-file', filename);
var spinner = '<img class="move2trash" title="'+t('files_trashbin', 'perform restore operation')+'" src="'+ OC.imagePath('core', 'loader.gif') +'"></a>'; var spinner = '<img class="move2trash" title="'+t('files_trashbin', 'perform restore operation')+'" src="'+ OC.imagePath('core', 'loader.gif') +'"></a>';
var undeleteAction = $('tr').filterAttr('data-file',filename).children("td.date"); var undeleteAction = $('tr').filterAttr('data-file',filename).children("td.date");
var files = tr.attr('data-file');
undeleteAction[0].innerHTML = undeleteAction[0].innerHTML+spinner; undeleteAction[0].innerHTML = undeleteAction[0].innerHTML+spinner;
$.post(OC.filePath('files_trashbin','ajax','undelete.php'), $.post(OC.filePath('files_trashbin','ajax','undelete.php'),
{files:tr.attr('data-file'), dirlisting:tr.attr('data-dirlisting') }, {files:JSON.stringify([files]), dirlisting:tr.attr('data-dirlisting') },
function(result){ function(result){
for (var i = 0; i < result.data.success.length; i++) { for (var i = 0; i < result.data.success.length; i++) {
var row = document.getElementById(result.data.success[i].filename); var row = document.getElementById(result.data.success[i].filename);
@ -31,16 +32,17 @@ $(document).ready(function() {
var deleteAction = $('tr').filterAttr('data-file',filename).children("td.date").children(".action.delete"); var deleteAction = $('tr').filterAttr('data-file',filename).children("td.date").children(".action.delete");
var oldHTML = deleteAction[0].outerHTML; var oldHTML = deleteAction[0].outerHTML;
var newHTML = '<img class="move2trash" data-action="Delete" title="'+t('files', 'delete file permanently')+'" src="'+ OC.imagePath('core', 'loading.gif') +'"></a>'; var newHTML = '<img class="move2trash" data-action="Delete" title="'+t('files', 'delete file permanently')+'" src="'+ OC.imagePath('core', 'loading.gif') +'"></a>';
var files = tr.attr('data-file');
deleteAction[0].outerHTML = newHTML; deleteAction[0].outerHTML = newHTML;
$.post(OC.filePath('files_trashbin','ajax','delete.php'), $.post(OC.filePath('files_trashbin','ajax','delete.php'),
{file:tr.attr('data-file') }, {files:JSON.stringify([files]), dirlisting:tr.attr('data-dirlisting') },
function(result){ function(result){
if ( result.status == 'success' ) { for (var i = 0; i < result.data.success.length; i++) {
var row = document.getElementById(result.data.filename); var row = document.getElementById(result.data.success[i].filename);
row.parentNode.removeChild(row); row.parentNode.removeChild(row);
} else { }
deleteAction[0].outerHTML = oldHTML; if (result.status != 'success') {
OC.dialogs.alert(result.data.message, 'Error'); OC.dialogs.alert(result.data.message, 'Error');
} }
}); });
@ -93,10 +95,10 @@ $(document).ready(function() {
$('.undelete').click('click',function(event) { $('.undelete').click('click',function(event) {
var spinner = '<img class="move2trash" title="'+t('files_trashbin', 'perform restore operation')+'" src="'+ OC.imagePath('core', 'loader.gif') +'"></a>'; var spinner = '<img class="move2trash" title="'+t('files_trashbin', 'perform restore operation')+'" src="'+ OC.imagePath('core', 'loader.gif') +'"></a>';
var files=getSelectedFiles('file'); var files=getSelectedFiles('file');
var fileslist=files.join(';'); var fileslist = JSON.stringify(files);
var dirlisting=getSelectedFiles('dirlisting')[0]; var dirlisting=getSelectedFiles('dirlisting')[0];
for (var i in files) { for (var i=0; i<files.length; i++) {
var undeleteAction = $('tr').filterAttr('data-file',files[i]).children("td.date"); var undeleteAction = $('tr').filterAttr('data-file',files[i]).children("td.date");
undeleteAction[0].innerHTML = undeleteAction[0].innerHTML+spinner; undeleteAction[0].innerHTML = undeleteAction[0].innerHTML+spinner;
} }
@ -114,6 +116,30 @@ $(document).ready(function() {
}); });
}); });
$('.delete').click('click',function(event) {
console.log("delete selected");
var spinner = '<img class="move2trash" title="'+t('files_trashbin', 'Delete permanently')+'" src="'+ OC.imagePath('core', 'loading.gif') +'"></a>';
var files=getSelectedFiles('file');
var fileslist = JSON.stringify(files);
var dirlisting=getSelectedFiles('dirlisting')[0];
for (var i=0; i<files.length; i++) {
var deleteAction = $('tr').filterAttr('data-file',files[i]).children("td.date");
deleteAction[0].innerHTML = deleteAction[0].innerHTML+spinner;
}
$.post(OC.filePath('files_trashbin','ajax','delete.php'),
{files:fileslist, dirlisting:dirlisting},
function(result){
for (var i = 0; i < result.data.success.length; i++) {
var row = document.getElementById(result.data.success[i].filename);
row.parentNode.removeChild(row);
}
if (result.status != 'success') {
OC.dialogs.alert(result.data.message, 'Error');
}
});
});
}); });

View File

@ -1,3 +1,4 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"Name" => "اسم" "Name" => "اسم",
"Delete" => "إلغاء"
); );

View File

@ -10,5 +10,6 @@
"1 file" => "1 файл", "1 file" => "1 файл",
"{count} files" => "{count} файла", "{count} files" => "{count} файла",
"Nothing in here. Your trash bin is empty!" => "Няма нищо. Кофата е празна!", "Nothing in here. Your trash bin is empty!" => "Няма нищо. Кофата е празна!",
"Restore" => "Възтановяване" "Restore" => "Възтановяване",
"Delete" => "Изтриване"
); );

View File

@ -3,5 +3,6 @@
"1 folder" => "১টি ফোল্ডার", "1 folder" => "১টি ফোল্ডার",
"{count} folders" => "{count} টি ফোল্ডার", "{count} folders" => "{count} টি ফোল্ডার",
"1 file" => "১টি ফাইল", "1 file" => "১টি ফাইল",
"{count} files" => "{count} টি ফাইল" "{count} files" => "{count} টি ফাইল",
"Delete" => "মুছে"
); );

View File

@ -3,6 +3,7 @@
"Couldn't restore %s" => "No s'ha pogut restaurar %s", "Couldn't restore %s" => "No s'ha pogut restaurar %s",
"perform restore operation" => "executa l'operació de restauració", "perform restore operation" => "executa l'operació de restauració",
"delete file permanently" => "esborra el fitxer permanentment", "delete file permanently" => "esborra el fitxer permanentment",
"Delete permanently" => "Esborra permanentment",
"Name" => "Nom", "Name" => "Nom",
"Deleted" => "Eliminat", "Deleted" => "Eliminat",
"1 folder" => "1 carpeta", "1 folder" => "1 carpeta",
@ -10,5 +11,6 @@
"1 file" => "1 fitxer", "1 file" => "1 fitxer",
"{count} files" => "{count} fitxers", "{count} files" => "{count} fitxers",
"Nothing in here. Your trash bin is empty!" => "La paperera està buida!", "Nothing in here. Your trash bin is empty!" => "La paperera està buida!",
"Restore" => "Recupera" "Restore" => "Recupera",
"Delete" => "Esborra"
); );

View File

@ -3,6 +3,7 @@
"Couldn't restore %s" => "Nelze obnovit %s", "Couldn't restore %s" => "Nelze obnovit %s",
"perform restore operation" => "provést obnovu", "perform restore operation" => "provést obnovu",
"delete file permanently" => "trvale odstranit soubor", "delete file permanently" => "trvale odstranit soubor",
"Delete permanently" => "Trvale odstranit",
"Name" => "Název", "Name" => "Název",
"Deleted" => "Smazáno", "Deleted" => "Smazáno",
"1 folder" => "1 složka", "1 folder" => "1 složka",
@ -10,5 +11,6 @@
"1 file" => "1 soubor", "1 file" => "1 soubor",
"{count} files" => "{count} soubory", "{count} files" => "{count} soubory",
"Nothing in here. Your trash bin is empty!" => "Žádný obsah. Váš koš je prázdný.", "Nothing in here. Your trash bin is empty!" => "Žádný obsah. Váš koš je prázdný.",
"Restore" => "Obnovit" "Restore" => "Obnovit",
"Delete" => "Smazat"
); );

View File

@ -3,6 +3,7 @@
"Couldn't restore %s" => "Kunne ikke gendanne %s", "Couldn't restore %s" => "Kunne ikke gendanne %s",
"perform restore operation" => "udfør gendannelsesoperation", "perform restore operation" => "udfør gendannelsesoperation",
"delete file permanently" => "slet fil permanent", "delete file permanently" => "slet fil permanent",
"Delete permanently" => "Slet permanent",
"Name" => "Navn", "Name" => "Navn",
"Deleted" => "Slettet", "Deleted" => "Slettet",
"1 folder" => "1 mappe", "1 folder" => "1 mappe",
@ -10,5 +11,6 @@
"1 file" => "1 fil", "1 file" => "1 fil",
"{count} files" => "{count} filer", "{count} files" => "{count} filer",
"Nothing in here. Your trash bin is empty!" => "Intet at se her. Din papirkurv er tom!", "Nothing in here. Your trash bin is empty!" => "Intet at se her. Din papirkurv er tom!",
"Restore" => "Gendan" "Restore" => "Gendan",
"Delete" => "Slet"
); );

View File

@ -1,8 +1,9 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"Couldn't delete %s permanently" => "Konnte %s nicht permanent löschen", "Couldn't delete %s permanently" => "Konnte %s nicht dauerhaft löschen",
"Couldn't restore %s" => "Konnte %s nicht wiederherstellen", "Couldn't restore %s" => "Konnte %s nicht wiederherstellen",
"perform restore operation" => "Wiederherstellung ausführen", "perform restore operation" => "Wiederherstellung ausführen",
"delete file permanently" => "Datei permanent löschen", "delete file permanently" => "Datei dauerhaft löschen",
"Delete permanently" => "Permanent löschen",
"Name" => "Name", "Name" => "Name",
"Deleted" => "gelöscht", "Deleted" => "gelöscht",
"1 folder" => "1 Ordner", "1 folder" => "1 Ordner",
@ -10,5 +11,6 @@
"1 file" => "1 Datei", "1 file" => "1 Datei",
"{count} files" => "{count} Dateien", "{count} files" => "{count} Dateien",
"Nothing in here. Your trash bin is empty!" => "Nichts zu löschen, der Papierkorb ist leer!", "Nothing in here. Your trash bin is empty!" => "Nichts zu löschen, der Papierkorb ist leer!",
"Restore" => "Wiederherstellen" "Restore" => "Wiederherstellen",
"Delete" => "Löschen"
); );

View File

@ -1,8 +1,9 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"Couldn't delete %s permanently" => "Konnte %s nicht entgültig löschen", "Couldn't delete %s permanently" => "Konnte %s nicht dauerhaft löschen",
"Couldn't restore %s" => "Konnte %s nicht wiederherstellen", "Couldn't restore %s" => "Konnte %s nicht wiederherstellen",
"perform restore operation" => "Wiederherstellung ausführen", "perform restore operation" => "Wiederherstellung ausführen",
"delete file permanently" => "Datei entgültig löschen", "delete file permanently" => "Datei dauerhaft löschen",
"Delete permanently" => "Entgültig löschen",
"Name" => "Name", "Name" => "Name",
"Deleted" => "Gelöscht", "Deleted" => "Gelöscht",
"1 folder" => "1 Ordner", "1 folder" => "1 Ordner",
@ -10,5 +11,6 @@
"1 file" => "1 Datei", "1 file" => "1 Datei",
"{count} files" => "{count} Dateien", "{count} files" => "{count} Dateien",
"Nothing in here. Your trash bin is empty!" => "Nichts zu löschen, Ihr Papierkorb ist leer!", "Nothing in here. Your trash bin is empty!" => "Nichts zu löschen, Ihr Papierkorb ist leer!",
"Restore" => "Wiederherstellen" "Restore" => "Wiederherstellen",
"Delete" => "Löschen"
); );

View File

@ -3,6 +3,7 @@
"Couldn't restore %s" => "Αδυναμία επαναφοράς %s", "Couldn't restore %s" => "Αδυναμία επαναφοράς %s",
"perform restore operation" => "εκτέλεση λειτουργία επαναφοράς", "perform restore operation" => "εκτέλεση λειτουργία επαναφοράς",
"delete file permanently" => "μόνιμη διαγραφή αρχείου", "delete file permanently" => "μόνιμη διαγραφή αρχείου",
"Delete permanently" => "Μόνιμη διαγραφή",
"Name" => "Όνομα", "Name" => "Όνομα",
"Deleted" => "Διαγράφηκε", "Deleted" => "Διαγράφηκε",
"1 folder" => "1 φάκελος", "1 folder" => "1 φάκελος",
@ -10,5 +11,6 @@
"1 file" => "1 αρχείο", "1 file" => "1 αρχείο",
"{count} files" => "{count} αρχεία", "{count} files" => "{count} αρχεία",
"Nothing in here. Your trash bin is empty!" => "Δεν υπάρχει τίποτα εδώ. Ο κάδος σας είναι άδειος!", "Nothing in here. Your trash bin is empty!" => "Δεν υπάρχει τίποτα εδώ. Ο κάδος σας είναι άδειος!",
"Restore" => "Επαναφορά" "Restore" => "Επαναφορά",
"Delete" => "Διαγραφή"
); );

View File

@ -4,5 +4,6 @@
"{count} folders" => "{count} dosierujoj", "{count} folders" => "{count} dosierujoj",
"1 file" => "1 dosiero", "1 file" => "1 dosiero",
"{count} files" => "{count} dosierujoj", "{count} files" => "{count} dosierujoj",
"Restore" => "Restaŭri" "Restore" => "Restaŭri",
"Delete" => "Forigi"
); );

View File

@ -3,6 +3,7 @@
"Couldn't restore %s" => "No se puede restaurar %s", "Couldn't restore %s" => "No se puede restaurar %s",
"perform restore operation" => "Restaurar", "perform restore operation" => "Restaurar",
"delete file permanently" => "Eliminar archivo permanentemente", "delete file permanently" => "Eliminar archivo permanentemente",
"Delete permanently" => "Eliminar permanentemente",
"Name" => "Nombre", "Name" => "Nombre",
"Deleted" => "Eliminado", "Deleted" => "Eliminado",
"1 folder" => "1 carpeta", "1 folder" => "1 carpeta",
@ -10,5 +11,6 @@
"1 file" => "1 archivo", "1 file" => "1 archivo",
"{count} files" => "{count} archivos", "{count} files" => "{count} archivos",
"Nothing in here. Your trash bin is empty!" => "Nada aqui. La papelera esta vacia!", "Nothing in here. Your trash bin is empty!" => "Nada aqui. La papelera esta vacia!",
"Restore" => "Recuperar" "Restore" => "Recuperar",
"Delete" => "Eliminar"
); );

View File

@ -3,6 +3,7 @@
"Couldn't restore %s" => "No se pudo restaurar %s", "Couldn't restore %s" => "No se pudo restaurar %s",
"perform restore operation" => "Restaurar", "perform restore operation" => "Restaurar",
"delete file permanently" => "Borrar archivo de manera permanente", "delete file permanently" => "Borrar archivo de manera permanente",
"Delete permanently" => "Borrar de manera permanente",
"Name" => "Nombre", "Name" => "Nombre",
"Deleted" => "Borrado", "Deleted" => "Borrado",
"1 folder" => "1 directorio", "1 folder" => "1 directorio",
@ -10,5 +11,6 @@
"1 file" => "1 archivo", "1 file" => "1 archivo",
"{count} files" => "{count} archivos", "{count} files" => "{count} archivos",
"Nothing in here. Your trash bin is empty!" => "No hay nada acá. ¡La papelera está vacía!", "Nothing in here. Your trash bin is empty!" => "No hay nada acá. ¡La papelera está vacía!",
"Restore" => "Recuperar" "Restore" => "Recuperar",
"Delete" => "Borrar"
); );

View File

@ -3,6 +3,7 @@
"Couldn't restore %s" => "%s ei saa taastada", "Couldn't restore %s" => "%s ei saa taastada",
"perform restore operation" => "soorita taastamine", "perform restore operation" => "soorita taastamine",
"delete file permanently" => "kustuta fail jäädavalt", "delete file permanently" => "kustuta fail jäädavalt",
"Delete permanently" => "Kustuta jäädavalt",
"Name" => "Nimi", "Name" => "Nimi",
"Deleted" => "Kustutatud", "Deleted" => "Kustutatud",
"1 folder" => "1 kaust", "1 folder" => "1 kaust",
@ -10,5 +11,6 @@
"1 file" => "1 fail", "1 file" => "1 fail",
"{count} files" => "{count} faili", "{count} files" => "{count} faili",
"Nothing in here. Your trash bin is empty!" => "Siin pole midagi. Sinu prügikast on tühi!", "Nothing in here. Your trash bin is empty!" => "Siin pole midagi. Sinu prügikast on tühi!",
"Restore" => "Taasta" "Restore" => "Taasta",
"Delete" => "Kustuta"
); );

View File

@ -3,6 +3,7 @@
"Couldn't restore %s" => "Ezin izan da %s berreskuratu", "Couldn't restore %s" => "Ezin izan da %s berreskuratu",
"perform restore operation" => "berreskuratu", "perform restore operation" => "berreskuratu",
"delete file permanently" => "ezabatu fitxategia betirako", "delete file permanently" => "ezabatu fitxategia betirako",
"Delete permanently" => "Ezabatu betirako",
"Name" => "Izena", "Name" => "Izena",
"Deleted" => "Ezabatuta", "Deleted" => "Ezabatuta",
"1 folder" => "karpeta bat", "1 folder" => "karpeta bat",
@ -10,5 +11,6 @@
"1 file" => "fitxategi bat", "1 file" => "fitxategi bat",
"{count} files" => "{count} fitxategi", "{count} files" => "{count} fitxategi",
"Nothing in here. Your trash bin is empty!" => "Ez dago ezer ez. Zure zakarrontzia hutsik dago!", "Nothing in here. Your trash bin is empty!" => "Ez dago ezer ez. Zure zakarrontzia hutsik dago!",
"Restore" => "Berrezarri" "Restore" => "Berrezarri",
"Delete" => "Ezabatu"
); );

View File

@ -4,5 +4,6 @@
"{count} folders" => "{ شمار} پوشه ها", "{count} folders" => "{ شمار} پوشه ها",
"1 file" => "1 پرونده", "1 file" => "1 پرونده",
"{count} files" => "{ شمار } فایل ها", "{count} files" => "{ شمار } فایل ها",
"Restore" => "بازیابی" "Restore" => "بازیابی",
"Delete" => "حذف"
); );

View File

@ -3,6 +3,7 @@
"Couldn't restore %s" => "Kohteen %s palautus epäonnistui", "Couldn't restore %s" => "Kohteen %s palautus epäonnistui",
"perform restore operation" => "suorita palautustoiminto", "perform restore operation" => "suorita palautustoiminto",
"delete file permanently" => "poista tiedosto pysyvästi", "delete file permanently" => "poista tiedosto pysyvästi",
"Delete permanently" => "Poista pysyvästi",
"Name" => "Nimi", "Name" => "Nimi",
"Deleted" => "Poistettu", "Deleted" => "Poistettu",
"1 folder" => "1 kansio", "1 folder" => "1 kansio",
@ -10,5 +11,6 @@
"1 file" => "1 tiedosto", "1 file" => "1 tiedosto",
"{count} files" => "{count} tiedostoa", "{count} files" => "{count} tiedostoa",
"Nothing in here. Your trash bin is empty!" => "Tyhjää täynnä! Roskakorissa ei ole mitään.", "Nothing in here. Your trash bin is empty!" => "Tyhjää täynnä! Roskakorissa ei ole mitään.",
"Restore" => "Palauta" "Restore" => "Palauta",
"Delete" => "Poista"
); );

View File

@ -3,6 +3,7 @@
"Couldn't restore %s" => "Impossible de restaurer %s", "Couldn't restore %s" => "Impossible de restaurer %s",
"perform restore operation" => "effectuer l'opération de restauration", "perform restore operation" => "effectuer l'opération de restauration",
"delete file permanently" => "effacer définitivement le fichier", "delete file permanently" => "effacer définitivement le fichier",
"Delete permanently" => "Supprimer de façon définitive",
"Name" => "Nom", "Name" => "Nom",
"Deleted" => "Effacé", "Deleted" => "Effacé",
"1 folder" => "1 dossier", "1 folder" => "1 dossier",
@ -10,5 +11,6 @@
"1 file" => "1 fichier", "1 file" => "1 fichier",
"{count} files" => "{count} fichiers", "{count} files" => "{count} fichiers",
"Nothing in here. Your trash bin is empty!" => "Il n'y a rien ici. Votre corbeille est vide !", "Nothing in here. Your trash bin is empty!" => "Il n'y a rien ici. Votre corbeille est vide !",
"Restore" => "Restaurer" "Restore" => "Restaurer",
"Delete" => "Supprimer"
); );

View File

@ -3,6 +3,7 @@
"Couldn't restore %s" => "Non foi posíbel restaurar %s", "Couldn't restore %s" => "Non foi posíbel restaurar %s",
"perform restore operation" => "realizar a operación de restauración", "perform restore operation" => "realizar a operación de restauración",
"delete file permanently" => "eliminar o ficheiro permanentemente", "delete file permanently" => "eliminar o ficheiro permanentemente",
"Delete permanently" => "Eliminar permanentemente",
"Name" => "Nome", "Name" => "Nome",
"Deleted" => "Eliminado", "Deleted" => "Eliminado",
"1 folder" => "1 cartafol", "1 folder" => "1 cartafol",
@ -10,5 +11,6 @@
"1 file" => "1 ficheiro", "1 file" => "1 ficheiro",
"{count} files" => "{count} ficheiros", "{count} files" => "{count} ficheiros",
"Nothing in here. Your trash bin is empty!" => "Aquí non hai nada. O cesto do lixo está baleiro!", "Nothing in here. Your trash bin is empty!" => "Aquí non hai nada. O cesto do lixo está baleiro!",
"Restore" => "Restablecer" "Restore" => "Restablecer",
"Delete" => "Eliminar"
); );

View File

@ -3,5 +3,6 @@
"1 folder" => "תיקייה אחת", "1 folder" => "תיקייה אחת",
"{count} folders" => "{count} תיקיות", "{count} folders" => "{count} תיקיות",
"1 file" => "קובץ אחד", "1 file" => "קובץ אחד",
"{count} files" => "{count} קבצים" "{count} files" => "{count} קבצים",
"Delete" => "מחיקה"
); );

View File

@ -1,3 +1,4 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"Name" => "Ime" "Name" => "Ime",
"Delete" => "Obriši"
); );

View File

@ -3,6 +3,7 @@
"Couldn't restore %s" => "Nem sikerült %s visszaállítása", "Couldn't restore %s" => "Nem sikerült %s visszaállítása",
"perform restore operation" => "a visszaállítás végrehajtása", "perform restore operation" => "a visszaállítás végrehajtása",
"delete file permanently" => "az állomány végleges törlése", "delete file permanently" => "az állomány végleges törlése",
"Delete permanently" => "Végleges törlés",
"Name" => "Név", "Name" => "Név",
"Deleted" => "Törölve", "Deleted" => "Törölve",
"1 folder" => "1 mappa", "1 folder" => "1 mappa",
@ -10,5 +11,6 @@
"1 file" => "1 fájl", "1 file" => "1 fájl",
"{count} files" => "{count} fájl", "{count} files" => "{count} fájl",
"Nothing in here. Your trash bin is empty!" => "Itt nincs semmi. Az Ön szemetes mappája üres!", "Nothing in here. Your trash bin is empty!" => "Itt nincs semmi. Az Ön szemetes mappája üres!",
"Restore" => "Visszaállítás" "Restore" => "Visszaállítás",
"Delete" => "Törlés"
); );

View File

@ -0,0 +1,3 @@
<?php $TRANSLATIONS = array(
"Delete" => "Ջնջել"
);

View File

@ -1,3 +1,4 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"Name" => "Nomine" "Name" => "Nomine",
"Delete" => "Deler"
); );

View File

@ -1,3 +1,15 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"Name" => "nama" "Couldn't delete %s permanently" => "Tidak dapat menghapus permanen %s",
"Couldn't restore %s" => "Tidak dapat memulihkan %s",
"perform restore operation" => "jalankan operasi pemulihan",
"delete file permanently" => "hapus berkas secara permanen",
"Name" => "Nama",
"Deleted" => "Dihapus",
"1 folder" => "1 map",
"{count} folders" => "{count} map",
"1 file" => "1 berkas",
"{count} files" => "{count} berkas",
"Nothing in here. Your trash bin is empty!" => "Tempat sampah anda kosong!",
"Restore" => "Pulihkan",
"Delete" => "Hapus"
); );

View File

@ -3,5 +3,6 @@
"1 folder" => "1 mappa", "1 folder" => "1 mappa",
"{count} folders" => "{count} möppur", "{count} folders" => "{count} möppur",
"1 file" => "1 skrá", "1 file" => "1 skrá",
"{count} files" => "{count} skrár" "{count} files" => "{count} skrár",
"Delete" => "Eyða"
); );

View File

@ -3,6 +3,7 @@
"Couldn't restore %s" => "Impossibile ripristinare %s", "Couldn't restore %s" => "Impossibile ripristinare %s",
"perform restore operation" => "esegui operazione di ripristino", "perform restore operation" => "esegui operazione di ripristino",
"delete file permanently" => "elimina il file definitivamente", "delete file permanently" => "elimina il file definitivamente",
"Delete permanently" => "Elimina definitivamente",
"Name" => "Nome", "Name" => "Nome",
"Deleted" => "Eliminati", "Deleted" => "Eliminati",
"1 folder" => "1 cartella", "1 folder" => "1 cartella",
@ -10,5 +11,6 @@
"1 file" => "1 file", "1 file" => "1 file",
"{count} files" => "{count} file", "{count} files" => "{count} file",
"Nothing in here. Your trash bin is empty!" => "Qui non c'è niente. Il tuo cestino è vuoto.", "Nothing in here. Your trash bin is empty!" => "Qui non c'è niente. Il tuo cestino è vuoto.",
"Restore" => "Ripristina" "Restore" => "Ripristina",
"Delete" => "Elimina"
); );

View File

@ -3,6 +3,7 @@
"Couldn't restore %s" => "%s を復元出来ませんでした", "Couldn't restore %s" => "%s を復元出来ませんでした",
"perform restore operation" => "復元操作を実行する", "perform restore operation" => "復元操作を実行する",
"delete file permanently" => "ファイルを完全に削除する", "delete file permanently" => "ファイルを完全に削除する",
"Delete permanently" => "完全に削除する",
"Name" => "名前", "Name" => "名前",
"Deleted" => "削除済み", "Deleted" => "削除済み",
"1 folder" => "1 フォルダ", "1 folder" => "1 フォルダ",
@ -10,5 +11,6 @@
"1 file" => "1 ファイル", "1 file" => "1 ファイル",
"{count} files" => "{count} ファイル", "{count} files" => "{count} ファイル",
"Nothing in here. Your trash bin is empty!" => "ここには何もありません。ゴミ箱は空です!", "Nothing in here. Your trash bin is empty!" => "ここには何もありません。ゴミ箱は空です!",
"Restore" => "復元" "Restore" => "復元",
"Delete" => "削除"
); );

View File

@ -3,5 +3,6 @@
"1 folder" => "1 საქაღალდე", "1 folder" => "1 საქაღალდე",
"{count} folders" => "{count} საქაღალდე", "{count} folders" => "{count} საქაღალდე",
"1 file" => "1 ფაილი", "1 file" => "1 ფაილი",
"{count} files" => "{count} ფაილი" "{count} files" => "{count} ფაილი",
"Delete" => "წაშლა"
); );

View File

@ -4,5 +4,6 @@
"{count} folders" => "폴더 {count}개", "{count} folders" => "폴더 {count}개",
"1 file" => "파일 1개", "1 file" => "파일 1개",
"{count} files" => "파일 {count}개", "{count} files" => "파일 {count}개",
"Restore" => "복원" "Restore" => "복원",
"Delete" => "삭제"
); );

View File

@ -1,3 +1,4 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"Name" => "Numm" "Name" => "Numm",
"Delete" => "Läschen"
); );

View File

@ -3,5 +3,6 @@
"1 folder" => "1 aplankalas", "1 folder" => "1 aplankalas",
"{count} folders" => "{count} aplankalai", "{count} folders" => "{count} aplankalai",
"1 file" => "1 failas", "1 file" => "1 failas",
"{count} files" => "{count} failai" "{count} files" => "{count} failai",
"Delete" => "Ištrinti"
); );

View File

@ -3,6 +3,7 @@
"Couldn't restore %s" => "Nevarēja atjaunot %s", "Couldn't restore %s" => "Nevarēja atjaunot %s",
"perform restore operation" => "veikt atjaunošanu", "perform restore operation" => "veikt atjaunošanu",
"delete file permanently" => "dzēst datni pavisam", "delete file permanently" => "dzēst datni pavisam",
"Delete permanently" => "Dzēst pavisam",
"Name" => "Nosaukums", "Name" => "Nosaukums",
"Deleted" => "Dzēsts", "Deleted" => "Dzēsts",
"1 folder" => "1 mape", "1 folder" => "1 mape",
@ -10,5 +11,6 @@
"1 file" => "1 datne", "1 file" => "1 datne",
"{count} files" => "{count} datnes", "{count} files" => "{count} datnes",
"Nothing in here. Your trash bin is empty!" => "Šeit nekā nav. Jūsu miskaste ir tukša!", "Nothing in here. Your trash bin is empty!" => "Šeit nekā nav. Jūsu miskaste ir tukša!",
"Restore" => "Atjaunot" "Restore" => "Atjaunot",
"Delete" => "Dzēst"
); );

View File

@ -3,5 +3,6 @@
"1 folder" => "1 папка", "1 folder" => "1 папка",
"{count} folders" => "{count} папки", "{count} folders" => "{count} папки",
"1 file" => "1 датотека", "1 file" => "1 датотека",
"{count} files" => "{count} датотеки" "{count} files" => "{count} датотеки",
"Delete" => "Избриши"
); );

View File

@ -1,3 +1,4 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"Name" => "Nama" "Name" => "Nama",
"Delete" => "Padam"
); );

View File

@ -3,5 +3,6 @@
"1 folder" => "1 mappe", "1 folder" => "1 mappe",
"{count} folders" => "{count} mapper", "{count} folders" => "{count} mapper",
"1 file" => "1 fil", "1 file" => "1 fil",
"{count} files" => "{count} filer" "{count} files" => "{count} filer",
"Delete" => "Slett"
); );

View File

@ -3,6 +3,7 @@
"Couldn't restore %s" => "Kon %s niet herstellen", "Couldn't restore %s" => "Kon %s niet herstellen",
"perform restore operation" => "uitvoeren restore operatie", "perform restore operation" => "uitvoeren restore operatie",
"delete file permanently" => "verwijder bestanden definitief", "delete file permanently" => "verwijder bestanden definitief",
"Delete permanently" => "Verwijder definitief",
"Name" => "Naam", "Name" => "Naam",
"Deleted" => "Verwijderd", "Deleted" => "Verwijderd",
"1 folder" => "1 map", "1 folder" => "1 map",
@ -10,5 +11,6 @@
"1 file" => "1 bestand", "1 file" => "1 bestand",
"{count} files" => "{count} bestanden", "{count} files" => "{count} bestanden",
"Nothing in here. Your trash bin is empty!" => "Niets te vinden. Uw prullenbak is leeg!", "Nothing in here. Your trash bin is empty!" => "Niets te vinden. Uw prullenbak is leeg!",
"Restore" => "Herstellen" "Restore" => "Herstellen",
"Delete" => "Verwijder"
); );

View File

@ -1,3 +1,4 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"Name" => "Namn" "Name" => "Namn",
"Delete" => "Slett"
); );

View File

@ -1,3 +1,4 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"Name" => "Nom" "Name" => "Nom",
"Delete" => "Escafa"
); );

View File

@ -4,5 +4,6 @@
"{count} folders" => "{count} foldery", "{count} folders" => "{count} foldery",
"1 file" => "1 plik", "1 file" => "1 plik",
"{count} files" => "{count} pliki", "{count} files" => "{count} pliki",
"Restore" => "Przywróć" "Restore" => "Przywróć",
"Delete" => "Usuń"
); );

View File

@ -3,6 +3,7 @@
"Couldn't restore %s" => "Não foi possível restaurar %s", "Couldn't restore %s" => "Não foi possível restaurar %s",
"perform restore operation" => "realizar operação de restauração", "perform restore operation" => "realizar operação de restauração",
"delete file permanently" => "excluir arquivo permanentemente", "delete file permanently" => "excluir arquivo permanentemente",
"Delete permanently" => "Excluir permanentemente",
"Name" => "Nome", "Name" => "Nome",
"Deleted" => "Excluído", "Deleted" => "Excluído",
"1 folder" => "1 pasta", "1 folder" => "1 pasta",
@ -10,5 +11,6 @@
"1 file" => "1 arquivo", "1 file" => "1 arquivo",
"{count} files" => "{count} arquivos", "{count} files" => "{count} arquivos",
"Nothing in here. Your trash bin is empty!" => "Nada aqui. Sua lixeira está vazia!", "Nothing in here. Your trash bin is empty!" => "Nada aqui. Sua lixeira está vazia!",
"Restore" => "Restaurar" "Restore" => "Restaurar",
"Delete" => "Excluir"
); );

View File

@ -3,6 +3,7 @@
"Couldn't restore %s" => "Não foi possível restaurar %s", "Couldn't restore %s" => "Não foi possível restaurar %s",
"perform restore operation" => "Restaurar", "perform restore operation" => "Restaurar",
"delete file permanently" => "Eliminar permanentemente o(s) ficheiro(s)", "delete file permanently" => "Eliminar permanentemente o(s) ficheiro(s)",
"Delete permanently" => "Eliminar permanentemente",
"Name" => "Nome", "Name" => "Nome",
"Deleted" => "Apagado", "Deleted" => "Apagado",
"1 folder" => "1 pasta", "1 folder" => "1 pasta",
@ -10,5 +11,6 @@
"1 file" => "1 ficheiro", "1 file" => "1 ficheiro",
"{count} files" => "{count} ficheiros", "{count} files" => "{count} ficheiros",
"Nothing in here. Your trash bin is empty!" => "Não ha ficheiros. O lixo está vazio", "Nothing in here. Your trash bin is empty!" => "Não ha ficheiros. O lixo está vazio",
"Restore" => "Restaurar" "Restore" => "Restaurar",
"Delete" => "Apagar"
); );

View File

@ -3,5 +3,6 @@
"1 folder" => "1 folder", "1 folder" => "1 folder",
"{count} folders" => "{count} foldare", "{count} folders" => "{count} foldare",
"1 file" => "1 fisier", "1 file" => "1 fisier",
"{count} files" => "{count} fisiere" "{count} files" => "{count} fisiere",
"Delete" => "Șterge"
); );

View File

@ -3,6 +3,7 @@
"Couldn't restore %s" => "%s не может быть восстановлен", "Couldn't restore %s" => "%s не может быть восстановлен",
"perform restore operation" => "выполнить операцию восстановления", "perform restore operation" => "выполнить операцию восстановления",
"delete file permanently" => "удалить файл навсегда", "delete file permanently" => "удалить файл навсегда",
"Delete permanently" => "Удалено навсегда",
"Name" => "Имя", "Name" => "Имя",
"Deleted" => "Удалён", "Deleted" => "Удалён",
"1 folder" => "1 папка", "1 folder" => "1 папка",
@ -10,5 +11,6 @@
"1 file" => "1 файл", "1 file" => "1 файл",
"{count} files" => "{count} файлов", "{count} files" => "{count} файлов",
"Nothing in here. Your trash bin is empty!" => "Здесь ничего нет. Ваша корзина пуста!", "Nothing in here. Your trash bin is empty!" => "Здесь ничего нет. Ваша корзина пуста!",
"Restore" => "Восстановить" "Restore" => "Восстановить",
"Delete" => "Удалить"
); );

View File

@ -3,6 +3,7 @@
"Couldn't restore %s" => "%s не может быть восстановлен", "Couldn't restore %s" => "%s не может быть восстановлен",
"perform restore operation" => "выполнить операцию восстановления", "perform restore operation" => "выполнить операцию восстановления",
"delete file permanently" => "удалить файл навсегда", "delete file permanently" => "удалить файл навсегда",
"Delete permanently" => "Удалить навсегда",
"Name" => "Имя", "Name" => "Имя",
"Deleted" => "Удалён", "Deleted" => "Удалён",
"1 folder" => "1 папка", "1 folder" => "1 папка",
@ -10,5 +11,6 @@
"1 file" => "1 файл", "1 file" => "1 файл",
"{count} files" => "{количество} файлов", "{count} files" => "{количество} файлов",
"Nothing in here. Your trash bin is empty!" => "Здесь ничего нет. Ваша корзина пуста!", "Nothing in here. Your trash bin is empty!" => "Здесь ничего нет. Ваша корзина пуста!",
"Restore" => "Восстановить" "Restore" => "Восстановить",
"Delete" => "Удалить"
); );

View File

@ -1,5 +1,6 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"Name" => "නම", "Name" => "නම",
"1 folder" => "1 ෆොල්ඩරයක්", "1 folder" => "1 ෆොල්ඩරයක්",
"1 file" => "1 ගොනුවක්" "1 file" => "1 ගොනුවක්",
"Delete" => "මකා දමන්න"
); );

View File

@ -3,6 +3,7 @@
"Couldn't restore %s" => "Nemožno obnoviť %s", "Couldn't restore %s" => "Nemožno obnoviť %s",
"perform restore operation" => "vykonať obnovu", "perform restore operation" => "vykonať obnovu",
"delete file permanently" => "trvalo zmazať súbor", "delete file permanently" => "trvalo zmazať súbor",
"Delete permanently" => "Zmazať trvalo",
"Name" => "Meno", "Name" => "Meno",
"Deleted" => "Zmazané", "Deleted" => "Zmazané",
"1 folder" => "1 priečinok", "1 folder" => "1 priečinok",
@ -10,5 +11,6 @@
"1 file" => "1 súbor", "1 file" => "1 súbor",
"{count} files" => "{count} súborov", "{count} files" => "{count} súborov",
"Nothing in here. Your trash bin is empty!" => "Žiadny obsah. Kôš je prázdny!", "Nothing in here. Your trash bin is empty!" => "Žiadny obsah. Kôš je prázdny!",
"Restore" => "Obnoviť" "Restore" => "Obnoviť",
"Delete" => "Zmazať"
); );

View File

@ -3,5 +3,6 @@
"1 folder" => "1 mapa", "1 folder" => "1 mapa",
"{count} folders" => "{count} map", "{count} folders" => "{count} map",
"1 file" => "1 datoteka", "1 file" => "1 datoteka",
"{count} files" => "{count} datotek" "{count} files" => "{count} datotek",
"Delete" => "Izbriši"
); );

View File

@ -7,5 +7,6 @@
"1 file" => "1 датотека", "1 file" => "1 датотека",
"{count} files" => "{count} датотеке/а", "{count} files" => "{count} датотеке/а",
"Nothing in here. Your trash bin is empty!" => "Овде нема ништа. Корпа за отпатке је празна.", "Nothing in here. Your trash bin is empty!" => "Овде нема ништа. Корпа за отпатке је празна.",
"Restore" => "Врати" "Restore" => "Врати",
"Delete" => "Обриши"
); );

View File

@ -1,3 +1,4 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"Name" => "Ime" "Name" => "Ime",
"Delete" => "Obriši"
); );

View File

@ -3,6 +3,7 @@
"Couldn't restore %s" => "Kunde inte återställa %s", "Couldn't restore %s" => "Kunde inte återställa %s",
"perform restore operation" => "utför återställning", "perform restore operation" => "utför återställning",
"delete file permanently" => "radera filen permanent", "delete file permanently" => "radera filen permanent",
"Delete permanently" => "Radera permanent",
"Name" => "Namn", "Name" => "Namn",
"Deleted" => "Raderad", "Deleted" => "Raderad",
"1 folder" => "1 mapp", "1 folder" => "1 mapp",
@ -10,5 +11,6 @@
"1 file" => "1 fil", "1 file" => "1 fil",
"{count} files" => "{count} filer", "{count} files" => "{count} filer",
"Nothing in here. Your trash bin is empty!" => "Ingenting här. Din papperskorg är tom!", "Nothing in here. Your trash bin is empty!" => "Ingenting här. Din papperskorg är tom!",
"Restore" => "Återskapa" "Restore" => "Återskapa",
"Delete" => "Radera"
); );

View File

@ -3,5 +3,6 @@
"1 folder" => "1 கோப்புறை", "1 folder" => "1 கோப்புறை",
"{count} folders" => "{எண்ணிக்கை} கோப்புறைகள்", "{count} folders" => "{எண்ணிக்கை} கோப்புறைகள்",
"1 file" => "1 கோப்பு", "1 file" => "1 கோப்பு",
"{count} files" => "{எண்ணிக்கை} கோப்புகள்" "{count} files" => "{எண்ணிக்கை} கோப்புகள்",
"Delete" => "நீக்குக"
); );

View File

@ -7,5 +7,6 @@
"1 file" => "1 ไฟล์", "1 file" => "1 ไฟล์",
"{count} files" => "{count} ไฟล์", "{count} files" => "{count} ไฟล์",
"Nothing in here. Your trash bin is empty!" => "ไม่มีอะไรอยู่ในนี้ ถังขยะของคุณยังว่างอยู่", "Nothing in here. Your trash bin is empty!" => "ไม่มีอะไรอยู่ในนี้ ถังขยะของคุณยังว่างอยู่",
"Restore" => "คืนค่า" "Restore" => "คืนค่า",
"Delete" => "ลบ"
); );

View File

@ -3,6 +3,7 @@
"Couldn't restore %s" => "%s Geri yüklenemedi", "Couldn't restore %s" => "%s Geri yüklenemedi",
"perform restore operation" => "Geri yükleme işlemini gerçekleştir", "perform restore operation" => "Geri yükleme işlemini gerçekleştir",
"delete file permanently" => "Dosyayı kalıcı olarak sil", "delete file permanently" => "Dosyayı kalıcı olarak sil",
"Delete permanently" => "Kalıcı olarak sil",
"Name" => "İsim", "Name" => "İsim",
"Deleted" => "Silindi", "Deleted" => "Silindi",
"1 folder" => "1 dizin", "1 folder" => "1 dizin",
@ -10,5 +11,6 @@
"1 file" => "1 dosya", "1 file" => "1 dosya",
"{count} files" => "{count} dosya", "{count} files" => "{count} dosya",
"Nothing in here. Your trash bin is empty!" => "Burası boş. Çöp kutun tamamen boş.", "Nothing in here. Your trash bin is empty!" => "Burası boş. Çöp kutun tamamen boş.",
"Restore" => "Geri yükle" "Restore" => "Geri yükle",
"Delete" => "Sil"
); );

View File

@ -3,6 +3,7 @@
"Couldn't restore %s" => "Неможливо відновити %s", "Couldn't restore %s" => "Неможливо відновити %s",
"perform restore operation" => "виконати операцію відновлення", "perform restore operation" => "виконати операцію відновлення",
"delete file permanently" => "видалити файл назавжди", "delete file permanently" => "видалити файл назавжди",
"Delete permanently" => "Видалити назавжди",
"Name" => "Ім'я", "Name" => "Ім'я",
"Deleted" => "Видалено", "Deleted" => "Видалено",
"1 folder" => "1 папка", "1 folder" => "1 папка",
@ -10,5 +11,6 @@
"1 file" => "1 файл", "1 file" => "1 файл",
"{count} files" => "{count} файлів", "{count} files" => "{count} файлів",
"Nothing in here. Your trash bin is empty!" => "Нічого немає. Ваший кошик для сміття пустий!", "Nothing in here. Your trash bin is empty!" => "Нічого немає. Ваший кошик для сміття пустий!",
"Restore" => "Відновити" "Restore" => "Відновити",
"Delete" => "Видалити"
); );

View File

@ -3,6 +3,7 @@
"Couldn't restore %s" => "Không thể khôi phục %s", "Couldn't restore %s" => "Không thể khôi phục %s",
"perform restore operation" => "thực hiện phục hồi", "perform restore operation" => "thực hiện phục hồi",
"delete file permanently" => "xóa file vĩnh viễn", "delete file permanently" => "xóa file vĩnh viễn",
"Delete permanently" => "Xóa vĩnh vễn",
"Name" => "Tên", "Name" => "Tên",
"Deleted" => "Đã xóa", "Deleted" => "Đã xóa",
"1 folder" => "1 thư mục", "1 folder" => "1 thư mục",
@ -10,5 +11,6 @@
"1 file" => "1 tập tin", "1 file" => "1 tập tin",
"{count} files" => "{count} tập tin", "{count} files" => "{count} tập tin",
"Nothing in here. Your trash bin is empty!" => "Không có gì ở đây. Thùng rác của bạn rỗng!", "Nothing in here. Your trash bin is empty!" => "Không có gì ở đây. Thùng rác của bạn rỗng!",
"Restore" => "Khôi phục" "Restore" => "Khôi phục",
"Delete" => "Xóa"
); );

View File

@ -3,5 +3,6 @@
"1 folder" => "1 个文件夹", "1 folder" => "1 个文件夹",
"{count} folders" => "{count} 个文件夹", "{count} folders" => "{count} 个文件夹",
"1 file" => "1 个文件", "1 file" => "1 个文件",
"{count} files" => "{count} 个文件" "{count} files" => "{count} 个文件",
"Delete" => "删除"
); );

View File

@ -3,5 +3,6 @@
"1 folder" => "1个文件夹", "1 folder" => "1个文件夹",
"{count} folders" => "{count} 个文件夹", "{count} folders" => "{count} 个文件夹",
"1 file" => "1 个文件", "1 file" => "1 个文件",
"{count} files" => "{count} 个文件" "{count} files" => "{count} 个文件",
"Delete" => "删除"
); );

View File

@ -1,7 +1,9 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"Delete permanently" => "永久刪除",
"Name" => "名稱", "Name" => "名稱",
"1 folder" => "1 個資料夾", "1 folder" => "1 個資料夾",
"{count} folders" => "{count} 個資料夾", "{count} folders" => "{count} 個資料夾",
"1 file" => "1 個檔案", "1 file" => "1 個檔案",
"{count} files" => "{count} 個檔案" "{count} files" => "{count} 個檔案",
"Delete" => "刪除"
); );

View File

@ -23,9 +23,11 @@
namespace OCA\Files_Trashbin; namespace OCA\Files_Trashbin;
class Trashbin { class Trashbin {
// how long do we keep files in the trash bin if no other value is defined in the config file (unit: days)
const DEFAULT_RETENTION_OBLIGATION=180;
const DEFAULT_RETENTION_OBLIGATION=180; // how long do we keep files in the trash bin if no other value is defined in the config file (unit: days) // unit: percentage; 50% of available disk space/quota
const DEFAULTMAXSIZE=50; // unit: percentage; 50% of available disk space/quota const DEFAULTMAXSIZE=50;
/** /**
* move file to the trash bin * move file to the trash bin
@ -60,7 +62,8 @@ class Trashbin {
$trashbinSize += self::copy_recursive($file_path, 'files_trashbin/'.$deleted.'.d'.$timestamp, $view); $trashbinSize += self::copy_recursive($file_path, 'files_trashbin/'.$deleted.'.d'.$timestamp, $view);
if ( $view->file_exists('files_trashbin/'.$deleted.'.d'.$timestamp) ) { if ( $view->file_exists('files_trashbin/'.$deleted.'.d'.$timestamp) ) {
$query = \OC_DB::prepare("INSERT INTO *PREFIX*files_trash (id,timestamp,location,type,mime,user) VALUES (?,?,?,?,?,?)"); $query = \OC_DB::prepare("INSERT INTO *PREFIX*files_trash (id,timestamp,location,type,mime,user)"
." VALUES (?,?,?,?,?,?)");
$result = $query->execute(array($deleted, $timestamp, $location, $type, $mime, $user)); $result = $query->execute(array($deleted, $timestamp, $location, $type, $mime, $user));
if ( !$result ) { // if file couldn't be added to the database than also don't store it in the trash bin. if ( !$result ) { // if file couldn't be added to the database than also don't store it in the trash bin.
$view->deleteAll('files_trashbin/'.$deleted.'.d'.$timestamp); $view->deleteAll('files_trashbin/'.$deleted.'.d'.$timestamp);
@ -70,12 +73,15 @@ class Trashbin {
if ( \OCP\App::isEnabled('files_versions') ) { if ( \OCP\App::isEnabled('files_versions') ) {
if ( $view->is_dir('files_versions'.$file_path) ) { if ( $view->is_dir('files_versions'.$file_path) ) {
$trashbinSize += self::calculateSize(new \OC_FilesystemView('/'. $user.'/files_versions/'.$file_path)); $trashbinSize += self::calculateSize(
new \OC_FilesystemView('/'. $user.'/files_versions/'.$file_path)
);
$view->rename('files_versions'.$file_path, 'versions_trashbin/'. $deleted.'.d'.$timestamp); $view->rename('files_versions'.$file_path, 'versions_trashbin/'. $deleted.'.d'.$timestamp);
} else if ( $versions = \OCA\Files_Versions\Storage::getVersions($file_path) ) { } else if ( $versions = \OCA\Files_Versions\Storage::getVersions($file_path) ) {
foreach ($versions as $v) { foreach ($versions as $v) {
$trashbinSize += $view->filesize('files_versions'.$v['path'].'.v'.$v['version']); $trashbinSize += $view->filesize('files_versions'.$v['path'].'.v'.$v['version']);
$view->rename('files_versions'.$v['path'].'.v'.$v['version'], 'versions_trashbin/'. $deleted.'.v'.$v['version'].'.d'.$timestamp); $view->rename('files_versions'.$v['path'].'.v'.$v['version'],
'versions_trashbin/'. $deleted.'.v'.$v['version'].'.d'.$timestamp);
} }
} }
} }
@ -121,7 +127,8 @@ class Trashbin {
$trashbinSize += self::calculateSize(new \OC_FilesystemView('/'. $user.'/versions_trashbin')); $trashbinSize += self::calculateSize(new \OC_FilesystemView('/'. $user.'/versions_trashbin'));
} }
if ( $timestamp ) { if ( $timestamp ) {
$query = \OC_DB::prepare('SELECT location,type FROM *PREFIX*files_trash WHERE user=? AND id=? AND timestamp=?'); $query = \OC_DB::prepare('SELECT location,type FROM *PREFIX*files_trash'
.' WHERE user=? AND id=? AND timestamp=?');
$result = $query->execute(array($user,$filename,$timestamp))->fetchAll(); $result = $query->execute(array($user,$filename,$timestamp))->fetchAll();
if ( count($result) != 1 ) { if ( count($result) != 1 ) {
\OC_Log::write('files_trashbin', 'trash bin database inconsistent!', \OC_Log::ERROR); \OC_Log::write('files_trashbin', 'trash bin database inconsistent!', \OC_Log::ERROR);
@ -165,16 +172,21 @@ class Trashbin {
$versionedFile = $file; $versionedFile = $file;
} }
if ( $result[0]['type'] == 'dir' ) { if ( $result[0]['type'] == 'dir' ) {
$trashbinSize -= self::calculateSize(new \OC_FilesystemView('/'.$user.'/'.'versions_trashbin/'. $file)); $trashbinSize -= self::calculateSize(
$view->rename(\OC_Filesystem::normalizePath('versions_trashbin/'. $file), \OC_Filesystem::normalizePath('files_versions/'.$location.'/'.$filename.$ext)); new \OC_FilesystemView('/'.$user.'/'.'versions_trashbin/'. $file)
);
$view->rename(\OC_Filesystem::normalizePath('versions_trashbin/'. $file),
\OC_Filesystem::normalizePath('files_versions/'.$location.'/'.$filename.$ext));
} else if ( $versions = self::getVersionsFromTrash($versionedFile, $timestamp) ) { } else if ( $versions = self::getVersionsFromTrash($versionedFile, $timestamp) ) {
foreach ($versions as $v) { foreach ($versions as $v) {
if ($timestamp ) { if ($timestamp ) {
$trashbinSize -= $view->filesize('versions_trashbin/'.$versionedFile.'.v'.$v.'.d'.$timestamp); $trashbinSize -= $view->filesize('versions_trashbin/'.$versionedFile.'.v'.$v.'.d'.$timestamp);
$view->rename('versions_trashbin/'.$versionedFile.'.v'.$v.'.d'.$timestamp, 'files_versions/'.$location.'/'.$filename.$ext.'.v'.$v); $view->rename('versions_trashbin/'.$versionedFile.'.v'.$v.'.d'.$timestamp,
'files_versions/'.$location.'/'.$filename.$ext.'.v'.$v);
} else { } else {
$trashbinSize -= $view->filesize('versions_trashbin/'.$versionedFile.'.v'.$v); $trashbinSize -= $view->filesize('versions_trashbin/'.$versionedFile.'.v'.$v);
$view->rename('versions_trashbin/'.$versionedFile.'.v'.$v, 'files_versions/'.$location.'/'.$filename.$ext.'.v'.$v); $view->rename('versions_trashbin/'.$versionedFile.'.v'.$v,
'files_versions/'.$location.'/'.$filename.$ext.'.v'.$v);
} }
} }
} }
@ -280,7 +292,8 @@ class Trashbin {
$query = \OC_DB::prepare('SELECT location,type,id,timestamp FROM *PREFIX*files_trash WHERE user=?'); $query = \OC_DB::prepare('SELECT location,type,id,timestamp FROM *PREFIX*files_trash WHERE user=?');
$result = $query->execute(array($user))->fetchAll(); $result = $query->execute(array($user))->fetchAll();
$retention_obligation = \OC_Config::getValue('trashbin_retention_obligation', self::DEFAULT_RETENTION_OBLIGATION); $retention_obligation = \OC_Config::getValue('trashbin_retention_obligation',
self::DEFAULT_RETENTION_OBLIGATION);
$limit = time() - ($retention_obligation * 86400); $limit = time() - ($retention_obligation * 86400);
@ -289,13 +302,17 @@ class Trashbin {
$filename = $r['id']; $filename = $r['id'];
if ( $r['timestamp'] < $limit ) { if ( $r['timestamp'] < $limit ) {
if ($view->is_dir('files_trashbin/'.$filename.'.d'.$timestamp)) { if ($view->is_dir('files_trashbin/'.$filename.'.d'.$timestamp)) {
$size += self::calculateSize(new \OC_FilesystemView('/'.$user.'/files_trashbin/'.$filename.'.d'.$timestamp)); $size += self::calculateSize(
new \OC_FilesystemView('/'.$user.'/files_trashbin/'.$filename.'.d'.$timestamp)
);
} else { } else {
$size += $view->filesize('files_trashbin/'.$filename.'.d'.$timestamp); $size += $view->filesize('files_trashbin/'.$filename.'.d'.$timestamp);
} }
$view->unlink('files_trashbin/'.$filename.'.d'.$timestamp); $view->unlink('files_trashbin/'.$filename.'.d'.$timestamp);
if ($r['type'] == 'dir') { if ($r['type'] == 'dir') {
$size += self::calculateSize(new \OC_FilesystemView('/'.$user.'/versions_trashbin/'.$filename.'.d'.$timestamp)); $size += self::calculateSize(
new \OC_FilesystemView('/'.$user.'/versions_trashbin/'.$filename.'.d'.$timestamp)
);
$view->unlink('versions_trashbin/'.$filename.'.d'.$timestamp); $view->unlink('versions_trashbin/'.$filename.'.d'.$timestamp);
} else if ( $versions = self::getVersionsFromTrash($filename, $timestamp) ) { } else if ( $versions = self::getVersionsFromTrash($filename, $timestamp) ) {
foreach ($versions as $v) { foreach ($versions as $v) {
@ -312,7 +329,8 @@ class Trashbin {
$availableSpace = $availableSpace + $size; $availableSpace = $availableSpace + $size;
// if size limit for trash bin reached, delete oldest files in trash bin // if size limit for trash bin reached, delete oldest files in trash bin
if ($availableSpace < 0) { if ($availableSpace < 0) {
$query = \OC_DB::prepare('SELECT location,type,id,timestamp FROM *PREFIX*files_trash WHERE user=? ORDER BY timestamp ASC'); $query = \OC_DB::prepare('SELECT location,type,id,timestamp FROM *PREFIX*files_trash'
.' WHERE user=? ORDER BY timestamp ASC');
$result = $query->execute(array($user))->fetchAll(); $result = $query->execute(array($user))->fetchAll();
$length = count($result); $length = count($result);
$i = 0; $i = 0;
@ -418,7 +436,8 @@ class Trashbin {
if (!file_exists($root)) { if (!file_exists($root)) {
return 0; return 0;
} }
$iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($root), \RecursiveIteratorIterator::CHILD_FIRST); $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($root),
\RecursiveIteratorIterator::CHILD_FIRST);
$size = 0; $size = 0;
foreach ($iterator as $path) { foreach ($iterator as $path) {

View File

@ -25,6 +25,13 @@
</th> </th>
<th id="headerDate"> <th id="headerDate">
<span id="modified"><?php echo $l->t( 'Deleted' ); ?></span> <span id="modified"><?php echo $l->t( 'Deleted' ); ?></span>
<span class="selectedActions">
<a href="" class="delete">
<?php echo $l->t('Delete')?>
<img class="svg" alt="<?php echo $l->t('Delete')?>"
src="<?php echo OCP\image_path("core", "actions/delete.svg"); ?>" />
</a>
</span>
</th> </th>
</tr> </tr>
</thead> </thead>

View File

@ -1,12 +1,8 @@
<input type="hidden" id="disableSharing" data-status="<?php echo $_['disableSharing']; ?>"> <input type="hidden" id="disableSharing" data-status="<?php echo $_['disableSharing']; ?>">
<?php foreach($_['files'] as $file): <?php foreach($_['files'] as $file):
$simple_file_size = OCP\simple_file_size($file['size']);
// the bigger the file, the darker the shade of grey; megabytes*2
$simple_size_color = intval(200-$file['size']/(1024*1024)*2);
if($simple_size_color<0) $simple_size_color = 0;
$relative_deleted_date = OCP\relative_modified_date($file['timestamp']); $relative_deleted_date = OCP\relative_modified_date($file['timestamp']);
// the older the file, the brighter the shade of grey; days*14 // the older the file, the brighter the shade of grey; days*14
$relative_date_color = round((time()-$file['mtime'])/60/60/24*14); $relative_date_color = round((time()-$file['date'])/60/60/24*14);
if($relative_date_color>200) $relative_date_color = 200; if($relative_date_color>200) $relative_date_color = 200;
$name = str_replace('+', '%20', urlencode($file['name'])); $name = str_replace('+', '%20', urlencode($file['name']));
$name = str_replace('%2F', '/', $name); $name = str_replace('%2F', '/', $name);

View File

@ -11,5 +11,5 @@ OCP\Util::addscript('files_versions', 'versions');
// Listen to write signals // Listen to write signals
OCP\Util::connectHook('OC_Filesystem', 'write', "OCA\Files_Versions\Hooks", "write_hook"); OCP\Util::connectHook('OC_Filesystem', 'write', "OCA\Files_Versions\Hooks", "write_hook");
// Listen to delete and rename signals // Listen to delete and rename signals
OCP\Util::connectHook('OC_Filesystem', 'post-delete', "OCA\Files_Versions\Hooks", "remove_hook"); OCP\Util::connectHook('OC_Filesystem', 'post_delete', "OCA\Files_Versions\Hooks", "remove_hook");
OCP\Util::connectHook('OC_Filesystem', 'rename', "OCA\Files_Versions\Hooks", "rename_hook"); OCP\Util::connectHook('OC_Filesystem', 'rename', "OCA\Files_Versions\Hooks", "rename_hook");

View File

@ -41,6 +41,10 @@ $(document).ready(function(){
} }
}); });
function goToVersionPage(url){
window.location(url);
}
function createVersionsDropdown(filename, files) { function createVersionsDropdown(filename, files) {
var historyUrl = OC.linkTo('files_versions', 'history.php') + '?path='+encodeURIComponent( $( '#dir' ).val() ).replace( /%2F/g, '/' )+'/'+encodeURIComponent( filename ); var historyUrl = OC.linkTo('files_versions', 'history.php') + '?path='+encodeURIComponent( $( '#dir' ).val() ).replace( /%2F/g, '/' )+'/'+encodeURIComponent( filename );
@ -51,7 +55,7 @@ function createVersionsDropdown(filename, files) {
html += '<option value=""></option>'; html += '<option value=""></option>';
html += '</select>'; html += '</select>';
html += '</div>'; html += '</div>';
html += '<input type="button" value="All versions..." onclick="window.location=\''+historyUrl+'\'" name="makelink" id="makelink" />'; html += '<input type="button" value="All versions..." name="makelink" id="makelink" />';
html += '<input id="link" style="display:none; width:90%;" />'; html += '<input id="link" style="display:none; width:90%;" />';
if (filename) { if (filename) {
@ -61,6 +65,10 @@ function createVersionsDropdown(filename, files) {
$(html).appendTo($('thead .share')); $(html).appendTo($('thead .share'));
} }
$("#makelink").click(function() {
goToVersionPage(historyUrl);
});
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: OC.filePath('files_versions', 'ajax', 'getVersions.php'), url: OC.filePath('files_versions', 'ajax', 'getVersions.php'),

View File

@ -1,4 +1,11 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"Could not revert: %s" => "بازگردانی امکان ناپذیر است: %s",
"success" => "موفقیت",
"failure" => "شکست",
"No old versions available" => "هیچ نسخه قدیمی در دسترس نیست",
"No path specified" => "هیچ مسیری مشخص نشده است",
"History" => "تاریخچه", "History" => "تاریخچه",
"Revert a file to a previous version by clicking on its revert button" => "بازگردانی یک پرورنده به نسخه قدیمی اش از طریق دکمه بازگردانی امکان پذیر است",
"Files Versioning" => "نسخه بندی پرونده ها",
"Enable" => "فعال" "Enable" => "فعال"
); );

View File

@ -1,5 +1,13 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"Could not revert: %s" => "Tidak dapat mengembalikan: %s",
"success" => "sukses",
"File %s was reverted to version %s" => "Berkas %s telah dikembalikan ke versi %s",
"failure" => "gagal",
"File %s could not be reverted to version %s" => "Berkas %s gagal dikembalikan ke versi %s",
"No old versions available" => "Versi lama tidak tersedia",
"No path specified" => "Lokasi tidak ditentukan",
"History" => "riwayat", "History" => "riwayat",
"Revert a file to a previous version by clicking on its revert button" => "Kembalikan berkas ke versi sebelumnya dengan mengklik tombol kembalikan",
"Files Versioning" => "pembuatan versi file", "Files Versioning" => "pembuatan versi file",
"Enable" => "aktifkan" "Enable" => "aktifkan"
); );

View File

@ -20,13 +20,10 @@ class Hooks {
public static function write_hook( $params ) { public static function write_hook( $params ) {
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
$versions = new Storage( new \OC\Files\View('') );
$path = $params[\OC\Files\Filesystem::signal_param_path]; $path = $params[\OC\Files\Filesystem::signal_param_path];
if($path<>'') {
if($path<>'') $versions->store( $path ); Storage::store($path);
}
} }
} }
@ -40,12 +37,10 @@ class Hooks {
*/ */
public static function remove_hook($params) { public static function remove_hook($params) {
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
$versions = new Storage( new \OC_FilesystemView('') );
$path = $params[\OC\Files\Filesystem::signal_param_path]; $path = $params[\OC\Files\Filesystem::signal_param_path];
if($path<>'') {
if($path<>'') $versions->delete( $path ); Storage::delete($path);
}
} }
} }
@ -59,13 +54,11 @@ class Hooks {
*/ */
public static function rename_hook($params) { public static function rename_hook($params) {
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
$versions = new Storage( new \OC_FilesystemView('') );
$oldpath = $params['oldpath']; $oldpath = $params['oldpath'];
$newpath = $params['newpath']; $newpath = $params['newpath'];
if($oldpath<>'' && $newpath<>'') {
if($oldpath<>'' && $newpath<>'') $versions->rename( $oldpath, $newpath ); Storage::rename( $oldpath, $newpath );
}
} }
} }

View File

@ -21,33 +21,27 @@ class Storage {
const DEFAULTMAXSIZE=50; // unit: percentage; 50% of available disk space/quota const DEFAULTMAXSIZE=50; // unit: percentage; 50% of available disk space/quota
private static $max_versions_per_interval = array( private static $max_versions_per_interval = array(
1 => array('intervalEndsAfter' => 10, //first 10sec, one version every 2sec //first 10sec, one version every 2sec
'step' => 2), 1 => array('intervalEndsAfter' => 10, 'step' => 2),
2 => array('intervalEndsAfter' => 60, //next minute, one version every 10sec //next minute, one version every 10sec
'step' => 10), 2 => array('intervalEndsAfter' => 60, 'step' => 10),
3 => array('intervalEndsAfter' => 3600, //next hour, one version every minute //next hour, one version every minute
'step' => 60), 3 => array('intervalEndsAfter' => 3600, 'step' => 60),
4 => array('intervalEndsAfter' => 86400, //next 24h, one version every hour //next 24h, one version every hour
'step' => 3600), 4 => array('intervalEndsAfter' => 86400, 'step' => 3600),
5 => array('intervalEndsAfter' => 2592000, //next 30days, one version per day //next 30days, one version per day
'step' => 86400), 5 => array('intervalEndsAfter' => 2592000, 'step' => 86400),
6 => array('intervalEndsAfter' => -1, //until the end one version per week //until the end one version per week
'step' => 604800), 6 => array('intervalEndsAfter' => -1, 'step' => 604800),
); );
private static function getUidAndFilename($filename) private static function getUidAndFilename($filename) {
{ $uid = \OC\Files\Filesystem::getOwner($filename);
if (\OCP\App::isEnabled('files_sharing') \OC\Files\Filesystem::initMountPoints($uid);
&& substr($filename, 0, 7) == '/Shared' if ( $uid != \OCP\User::getUser() ) {
&& $source = \OCP\Share::getItemSharedWith('file', $info = \OC\Files\Filesystem::getFileInfo($filename);
substr($filename, 7), $ownerView = new \OC\Files\View('/'.$uid.'/files');
\OC_Share_Backend_File::FORMAT_SHARED_STORAGE)) { $filename = $ownerView->getPath($info['fileid']);
$filename = $source['path'];
$pos = strpos($filename, '/files', 1);
$uid = substr($filename, 1, $pos - 1);
$filename = substr($filename, $pos + 6);
} else {
$uid = \OCP\User::getUser();
} }
return array($uid, $filename); return array($uid, $filename);
} }
@ -55,17 +49,12 @@ class Storage {
/** /**
* store a new version of a file. * store a new version of a file.
*/ */
public function store($filename) { public static function store($filename) {
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
list($uid, $filename) = self::getUidAndFilename($filename); list($uid, $filename) = self::getUidAndFilename($filename);
$files_view = new \OC\Files\View('/'.\OCP\User::getUser() .'/files');
$users_view = new \OC\Files\View('/'.\OCP\User::getUser());
//check if source file already exist as version to avoid recursions. $files_view = new \OC\Files\View('/'.$uid .'/files');
// todo does this check work? $users_view = new \OC\Files\View('/'.$uid);
if ($users_view->file_exists($filename)) {
return false;
}
// check if filename is a directory // check if filename is a directory
if($files_view->is_dir($filename)) { if($files_view->is_dir($filename)) {
@ -106,10 +95,10 @@ class Storage {
*/ */
public static function delete($filename) { public static function delete($filename) {
list($uid, $filename) = self::getUidAndFilename($filename); list($uid, $filename) = self::getUidAndFilename($filename);
$versions_fileview = new \OC_FilesystemView('/'.$uid .'/files_versions'); $versions_fileview = new \OC\Files\View('/'.$uid .'/files_versions');
$abs_path = \OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath('').$filename.'.v'; $abs_path = \OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath('').$filename.'.v';
if( ($versions = self::getVersions($filename)) ) { if( ($versions = self::getVersions($uid, $filename)) ) {
if ( ($versionsSize = \OCP\Config::getAppValue('files_versions', 'size')) === null ) { if ( ($versionsSize = \OCP\Config::getAppValue('files_versions', 'size')) === null ) {
$versionsSize = self::calculateSize($uid); $versionsSize = self::calculateSize($uid);
} }
@ -127,16 +116,15 @@ class Storage {
public static function rename($oldpath, $newpath) { public static function rename($oldpath, $newpath) {
list($uid, $oldpath) = self::getUidAndFilename($oldpath); list($uid, $oldpath) = self::getUidAndFilename($oldpath);
list($uidn, $newpath) = self::getUidAndFilename($newpath); list($uidn, $newpath) = self::getUidAndFilename($newpath);
$versions_view = new \OC_FilesystemView('/'.$uid .'/files_versions'); $versions_view = new \OC\Files\View('/'.$uid .'/files_versions');
$files_view = new \OC_FilesystemView('/'.$uid .'/files'); $files_view = new \OC\Files\View('/'.$uid .'/files');
$abs_newpath = \OCP\Config::getSystemValue('datadirectory').$versions_view->getAbsolutePath('').$newpath; $abs_newpath = \OCP\Config::getSystemValue('datadirectory').$versions_view->getAbsolutePath('').$newpath;
if ( $files_view->is_dir($oldpath) && $versions_view->is_dir($oldpath) ) { if ( $files_view->is_dir($oldpath) && $versions_view->is_dir($oldpath) ) {
$versions_view->rename($oldpath, $newpath); $versions_view->rename($oldpath, $newpath);
} else if ( ($versions = Storage::getVersions($oldpath)) ) { } else if ( ($versions = Storage::getVersions($uid, $oldpath)) ) {
$info=pathinfo($abs_newpath); $info=pathinfo($abs_newpath);
if(!file_exists($info['dirname'])) mkdir($info['dirname'], 0750, true); if(!file_exists($info['dirname'])) mkdir($info['dirname'], 0750, true);
$versions = Storage::getVersions($oldpath);
foreach ($versions as $v) { foreach ($versions as $v) {
$versions_view->rename($oldpath.'.v'.$v['version'], $newpath.'.v'.$v['version']); $versions_view->rename($oldpath.'.v'.$v['version'], $newpath.'.v'.$v['version']);
} }
@ -177,14 +165,14 @@ class Storage {
/** /**
* @brief get a list of all available versions of a file in descending chronological order * @brief get a list of all available versions of a file in descending chronological order
* @param $uid user id from the owner of the file
* @param $filename file to find versions of, relative to the user files dir * @param $filename file to find versions of, relative to the user files dir
* @param $count number of versions to return * @param $count number of versions to return
* @returns array * @returns array
*/ */
public static function getVersions( $filename, $count = 0 ) { public static function getVersions($uid, $filename, $count = 0 ) {
if( \OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true' ) { if( \OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true' ) {
list($uid, $filename) = self::getUidAndFilename($filename); $versions_fileview = new \OC\Files\View('/' . $uid . '/files_versions');
$versions_fileview = new \OC\Files\View('/' . \OCP\User::getUser() . '/files_versions');
$versionsName = \OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath($filename); $versionsName = \OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath($filename);
$versions = array(); $versions = array();
@ -197,7 +185,7 @@ class Storage {
sort( $matches ); sort( $matches );
$files_view = new \OC_FilesystemView('/'.$uid.'/files'); $files_view = new \OC\Files\View('/'.$uid.'/files');
$local_file = $files_view->getLocalFile($filename); $local_file = $files_view->getLocalFile($filename);
$local_file_md5 = \md5_file( $local_file ); $local_file_md5 = \md5_file( $local_file );
@ -248,10 +236,13 @@ class Storage {
*/ */
private static function calculateSize($uid) { private static function calculateSize($uid) {
if( \OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true' ) { if( \OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true' ) {
$versions_fileview = new \OC_FilesystemView('/'.$uid.'/files_versions'); $versions_fileview = new \OC\Files\View('/'.$uid.'/files_versions');
$versionsRoot = \OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath(''); $versionsRoot = \OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath('');
$iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($versionsRoot), \RecursiveIteratorIterator::CHILD_FIRST); $iterator = new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator($versionsRoot),
\RecursiveIteratorIterator::CHILD_FIRST
);
$size = 0; $size = 0;
@ -273,10 +264,13 @@ class Storage {
*/ */
private static function getAllVersions($uid) { private static function getAllVersions($uid) {
if( \OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true' ) { if( \OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true' ) {
$versions_fileview = new \OC_FilesystemView('/'.$uid.'/files_versions'); $versions_fileview = new \OC\Files\View('/'.$uid.'/files_versions');
$versionsRoot = \OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath(''); $versionsRoot = \OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath('');
$iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($versionsRoot), \RecursiveIteratorIterator::CHILD_FIRST); $iterator = new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator($versionsRoot),
\RecursiveIteratorIterator::CHILD_FIRST
);
$versions = array(); $versions = array();
@ -319,7 +313,7 @@ class Storage {
private static function expire($filename, $versionsSize = null) { private static function expire($filename, $versionsSize = null) {
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
list($uid, $filename) = self::getUidAndFilename($filename); list($uid, $filename) = self::getUidAndFilename($filename);
$versions_fileview = new \OC_FilesystemView('/'.$uid.'/files_versions'); $versions_fileview = new \OC\Files\View('/'.$uid.'/files_versions');
// get available disk space for user // get available disk space for user
$quota = \OCP\Util::computerFileSize(\OC_Preferences::getValue($uid, 'files', 'quota')); $quota = \OCP\Util::computerFileSize(\OC_Preferences::getValue($uid, 'files', 'quota'));
@ -338,7 +332,7 @@ class Storage {
} }
// calculate available space for version history // calculate available space for version history
$files_view = new \OC_FilesystemView('/'.$uid.'/files'); $files_view = new \OC\Files\View('/'.$uid.'/files');
$rootInfo = $files_view->getFileInfo('/'); $rootInfo = $files_view->getFileInfo('/');
$free = $quota-$rootInfo['size']; // remaining free space for user $free = $quota-$rootInfo['size']; // remaining free space for user
if ( $free > 0 ) { if ( $free > 0 ) {
@ -354,7 +348,7 @@ class Storage {
$versions_by_file = $result['by_file']; $versions_by_file = $result['by_file'];
$all_versions = $result['all']; $all_versions = $result['all'];
} else { } else {
$all_versions = Storage::getVersions($filename); $all_versions = Storage::getVersions($uid, $filename);
$versions_by_file[$filename] = $all_versions; $versions_by_file[$filename] = $all_versions;
} }

View File

@ -22,7 +22,8 @@ if( isset( $_['message'] ) ) {
foreach ( $_['versions'] as $v ) { foreach ( $_['versions'] as $v ) {
echo ' '; echo ' ';
echo OCP\Util::formatDate( doubleval($v['version']) ); echo OCP\Util::formatDate( doubleval($v['version']) );
echo ' <a href="'.OCP\Util::linkTo('files_versions', 'history.php', array('path' => $_['path'], 'revert' => $v['version'])) .'" class="button">Revert</a><br /><br />'; echo ' <a href="'.OCP\Util::linkTo('files_versions', 'history.php',
array('path' => $_['path'], 'revert' => $v['version'])) .'" class="button">Revert</a><br /><br />';
if ( $v['cur'] ) { if ( $v['cur'] ) {
echo ' (<b>Current</b>)'; echo ' (<b>Current</b>)';
} }

View File

@ -1,6 +1,9 @@
<form id="versionssettings"> <form id="versionssettings">
<fieldset class="personalblock"> <fieldset class="personalblock">
<legend><strong><?php echo $l->t('Files Versioning');?></strong></legend> <legend><strong><?php echo $l->t('Files Versioning');?></strong></legend>
<input type="checkbox" name="versions" id="versions" value="1" <?php if (OCP\Config::getSystemValue('versions', 'true')=='true') echo ' checked="checked"'; ?> /> <label for="versions"><?php echo $l->t('Enable'); ?></label> <br/> <input type="checkbox" name="versions" id="versions" value="1"
<?php if (OCP\Config::getSystemValue('versions', 'true')=='true')
echo ' checked="checked"';
?> /> <label for="versions"><?php echo $l->t('Enable'); ?></label> <br/>
</fieldset> </fieldset>
</form> </form>

View File

@ -12,7 +12,7 @@
"Do you really want to delete the current Server Configuration?" => "Wollen Sie die aktuelle Serverkonfiguration wirklich löschen?", "Do you really want to delete the current Server Configuration?" => "Wollen Sie die aktuelle Serverkonfiguration wirklich löschen?",
"Confirm Deletion" => "Löschung bestätigen", "Confirm Deletion" => "Löschung bestätigen",
"<b>Warning:</b> Apps user_ldap and user_webdavauth are incompatible. You may experience unexpected behaviour. Please ask your system administrator to disable one of them." => "<b>Warnung:</b> Die Anwendungen user_ldap und user_webdavauth sind inkompatibel. Es kann demzufolge zu unerwarteten Verhalten kommen. Bitte Deinen Systemadministator eine der beiden Anwendungen zu deaktivieren.", "<b>Warning:</b> Apps user_ldap and user_webdavauth are incompatible. You may experience unexpected behaviour. Please ask your system administrator to disable one of them." => "<b>Warnung:</b> Die Anwendungen user_ldap und user_webdavauth sind inkompatibel. Es kann demzufolge zu unerwarteten Verhalten kommen. Bitte Deinen Systemadministator eine der beiden Anwendungen zu deaktivieren.",
"<b>Warning:</b> The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it." => "<b>Warnung:</b> Da das PHP-Modul für LDAP nicht installiert ist, wird das Backend nicht funktionieren. Bitte deinen Systemadministrator das Modul zu installieren.", "<b>Warning:</b> The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it." => "<b>Warnung:</b> Da das PHP-Modul für LDAP nicht installiert ist, wird das Backend nicht funktionieren. Bitte Deinen Systemadministrator das Modul zu installieren.",
"Server configuration" => "Serverkonfiguration", "Server configuration" => "Serverkonfiguration",
"Add Server Configuration" => "Serverkonfiguration hinzufügen", "Add Server Configuration" => "Serverkonfiguration hinzufügen",
"Host" => "Host", "Host" => "Host",
@ -38,12 +38,12 @@
"When unchecked, this configuration will be skipped." => "Konfiguration wird übersprungen wenn deaktiviert", "When unchecked, this configuration will be skipped." => "Konfiguration wird übersprungen wenn deaktiviert",
"Port" => "Port", "Port" => "Port",
"Backup (Replica) Host" => "Backup Host (Kopie)", "Backup (Replica) Host" => "Backup Host (Kopie)",
"Give an optional backup host. It must be a replica of the main LDAP/AD server." => "Gib einen optionalen Backup Host an. Es muss sich um eine kopie des Haupt LDAP/AD Servers handeln.", "Give an optional backup host. It must be a replica of the main LDAP/AD server." => "Gib einen optionalen Backup Host an. Es muss sich um eine Kopie des Haupt LDAP/AD Servers handeln.",
"Backup (Replica) Port" => "Backup Port", "Backup (Replica) Port" => "Backup Port",
"Disable Main Server" => "Hauptserver deaktivieren", "Disable Main Server" => "Hauptserver deaktivieren",
"When switched on, ownCloud will only connect to the replica server." => "Wenn aktiviert wird ownCloud ausschließlich den Backupserver verwenden", "When switched on, ownCloud will only connect to the replica server." => "Wenn aktiviert, wird ownCloud ausschließlich den Backupserver verwenden.",
"Use TLS" => "Nutze TLS", "Use TLS" => "Nutze TLS",
"Do not use it additionally for LDAPS connections, it will fail." => "Benutze es nicht zusätzlich für LDAPS Verbindungen, es wird scheitern.", "Do not use it additionally for LDAPS connections, it will fail." => "Benutze es nicht zusammen mit LDAPS Verbindungen, es wird fehlschlagen.",
"Case insensitve LDAP server (Windows)" => "LDAP-Server (Windows: Groß- und Kleinschreibung bleibt unbeachtet)", "Case insensitve LDAP server (Windows)" => "LDAP-Server (Windows: Groß- und Kleinschreibung bleibt unbeachtet)",
"Turn off SSL certificate validation." => "Schalte die SSL-Zertifikatsprüfung aus.", "Turn off SSL certificate validation." => "Schalte die SSL-Zertifikatsprüfung aus.",
"If connection only works with this option, import the LDAP server's SSL certificate in your ownCloud server." => "Falls die Verbindung es erfordert, muss das SSL-Zertifikat des LDAP-Server importiert werden.", "If connection only works with this option, import the LDAP server's SSL certificate in your ownCloud server." => "Falls die Verbindung es erfordert, muss das SSL-Zertifikat des LDAP-Server importiert werden.",
@ -55,7 +55,7 @@
"Base User Tree" => "Basis-Benutzerbaum", "Base User Tree" => "Basis-Benutzerbaum",
"One User Base DN per line" => "Ein Benutzer Base DN pro Zeile", "One User Base DN per line" => "Ein Benutzer Base DN pro Zeile",
"User Search Attributes" => "Benutzersucheigenschaften", "User Search Attributes" => "Benutzersucheigenschaften",
"Optional; one attribute per line" => "Optional, eine Eigenschaft pro Zeile", "Optional; one attribute per line" => "Optional; eine Eigenschaft pro Zeile",
"Group Display Name Field" => "Feld für den Anzeigenamen der Gruppe", "Group Display Name Field" => "Feld für den Anzeigenamen der Gruppe",
"The LDAP attribute to use to generate the groups`s ownCloud name." => "Das LDAP-Attribut für die Generierung des Gruppennamens in ownCloud. ", "The LDAP attribute to use to generate the groups`s ownCloud name." => "Das LDAP-Attribut für die Generierung des Gruppennamens in ownCloud. ",
"Base Group Tree" => "Basis-Gruppenbaum", "Base Group Tree" => "Basis-Gruppenbaum",

View File

@ -43,7 +43,7 @@
"Disable Main Server" => "Hauptserver deaktivieren", "Disable Main Server" => "Hauptserver deaktivieren",
"When switched on, ownCloud will only connect to the replica server." => "Wenn eingeschaltet wird sich die ownCloud nur mit dem Replikat-Server verbinden.", "When switched on, ownCloud will only connect to the replica server." => "Wenn eingeschaltet wird sich die ownCloud nur mit dem Replikat-Server verbinden.",
"Use TLS" => "Nutze TLS", "Use TLS" => "Nutze TLS",
"Do not use it additionally for LDAPS connections, it will fail." => "Benutzen Sie es nicht zusätzlich für LDAPS Verbindungen, es wird fehlschlagen.", "Do not use it additionally for LDAPS connections, it will fail." => "Benutzen Sie es nicht in Verbindung mit LDAPS Verbindungen, es wird fehlschlagen.",
"Case insensitve LDAP server (Windows)" => "LDAP-Server (Windows: Groß- und Kleinschreibung bleibt unbeachtet)", "Case insensitve LDAP server (Windows)" => "LDAP-Server (Windows: Groß- und Kleinschreibung bleibt unbeachtet)",
"Turn off SSL certificate validation." => "Schalten Sie die SSL-Zertifikatsprüfung aus.", "Turn off SSL certificate validation." => "Schalten Sie die SSL-Zertifikatsprüfung aus.",
"If connection only works with this option, import the LDAP server's SSL certificate in your ownCloud server." => "Falls die Verbindung es erfordert, muss das SSL-Zertifikat des LDAP-Server importiert werden.", "If connection only works with this option, import the LDAP server's SSL certificate in your ownCloud server." => "Falls die Verbindung es erfordert, muss das SSL-Zertifikat des LDAP-Server importiert werden.",
@ -55,7 +55,7 @@
"Base User Tree" => "Basis-Benutzerbaum", "Base User Tree" => "Basis-Benutzerbaum",
"One User Base DN per line" => "Ein Benutzer Base DN pro Zeile", "One User Base DN per line" => "Ein Benutzer Base DN pro Zeile",
"User Search Attributes" => "Benutzer-Suche Eigenschaften", "User Search Attributes" => "Benutzer-Suche Eigenschaften",
"Optional; one attribute per line" => "Optional; Ein Attribut pro Zeile", "Optional; one attribute per line" => "Optional; ein Attribut pro Zeile",
"Group Display Name Field" => "Feld für den Anzeigenamen der Gruppe", "Group Display Name Field" => "Feld für den Anzeigenamen der Gruppe",
"The LDAP attribute to use to generate the groups`s ownCloud name." => "Das LDAP-Attribut für die Generierung des Gruppennamens in ownCloud. ", "The LDAP attribute to use to generate the groups`s ownCloud name." => "Das LDAP-Attribut für die Generierung des Gruppennamens in ownCloud. ",
"Base Group Tree" => "Basis-Gruppenbaum", "Base Group Tree" => "Basis-Gruppenbaum",

View File

@ -1,14 +1,69 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"Failed to delete the server configuration" => "Gagal menghapus konfigurasi server",
"The configuration is valid and the connection could be established!" => "Konfigurasi valid dan koneksi dapat dilakukan!",
"The configuration is valid, but the Bind failed. Please check the server settings and credentials." => "Konfigurasi valid, tetapi Bind gagal. Silakan cek pengaturan server dan keamanan.",
"The configuration is invalid. Please look in the ownCloud log for further details." => "Konfigurasi salah. Silakan lihat log ownCloud untuk lengkapnya.",
"Deletion failed" => "penghapusan gagal", "Deletion failed" => "penghapusan gagal",
"Take over settings from recent server configuration?" => "Ambil alih pengaturan dari konfigurasi server saat ini?",
"Keep settings?" => "Biarkan pengaturan?",
"Cannot add server configuration" => "Gagal menambah konfigurasi server",
"Connection test succeeded" => "Tes koneksi sukses",
"Connection test failed" => "Tes koneksi gagal",
"Do you really want to delete the current Server Configuration?" => "Anda ingin menghapus Konfigurasi Server saat ini?",
"Confirm Deletion" => "Konfirmasi Penghapusan",
"<b>Warning:</b> Apps user_ldap and user_webdavauth are incompatible. You may experience unexpected behaviour. Please ask your system administrator to disable one of them." => "<b>Peringatan:/b> Aplikasi user_ldap dan user_webdavauth tidak kompatibel. Anda mungkin akan mengalami kejadian yang tidak diharapkan. Silakan minta administrator sistem untuk menonaktifkan salah satunya.",
"<b>Warning:</b> The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it." => "<b>Peringatan:</b> Modul LDAP PHP tidak terpasang, perangkat tidak akan bekerja. Silakan minta administrator sistem untuk memasangnya.",
"Server configuration" => "Konfigurasi server",
"Add Server Configuration" => "Tambah Konfigurasi Server",
"Host" => "host", "Host" => "host",
"You can omit the protocol, except you require SSL. Then start with ldaps://" => "Protokol dapat tidak ditulis, kecuali anda menggunakan SSL. Lalu jalankan dengan ldaps://",
"Base DN" => "Base DN",
"One Base DN per line" => "Satu Base DN per baris",
"You can specify Base DN for users and groups in the Advanced tab" => "Anda dapat menetapkan Base DN untuk pengguna dan grup dalam tab Lanjutan",
"User DN" => "User DN",
"The DN of the client user with which the bind shall be done, e.g. uid=agent,dc=example,dc=com. For anonymous access, leave DN and Password empty." => "DN dari klien pengguna yang dengannya tautan akan diterapkan, mis. uid=agen,dc=contoh,dc=com. Untuk akses anonim, biarkan DN dan kata sandi kosong.",
"Password" => "kata kunci", "Password" => "kata kunci",
"For anonymous access, leave DN and Password empty." => "Untuk akses anonim, biarkan DN dan Kata sandi kosong.",
"User Login Filter" => "gunakan saringan login", "User Login Filter" => "gunakan saringan login",
"Defines the filter to apply, when login is attempted. %%uid replaces the username in the login action." => "Definisikan filter untuk diterapkan, saat login dilakukan. %%uid menggantikan username saat login.",
"use %%uid placeholder, e.g. \"uid=%%uid\"" => "gunakan pengganti %%uid, mis. \"uid=%%uid\"",
"User List Filter" => "Daftar Filter Pengguna",
"Defines the filter to apply, when retrieving users." => "Definisikan filter untuk diterapkan saat menerima pengguna.",
"without any placeholder, e.g. \"objectClass=person\"." => "tanpa pengganti apapun, mis. \"objectClass=seseorang\".",
"Group Filter" => "saringan grup", "Group Filter" => "saringan grup",
"Defines the filter to apply, when retrieving groups." => "Definisikan filter untuk diterapkan saat menerima grup.",
"without any placeholder, e.g. \"objectClass=posixGroup\"." => "tanpa pengganti apapaun, mis. \"objectClass=posixGroup\".",
"Connection Settings" => "Pengaturan Koneksi",
"Configuration Active" => "Konfigurasi Aktif",
"When unchecked, this configuration will be skipped." => "Jika tidak dicentang, konfigurasi ini dilewati.",
"Port" => "port", "Port" => "port",
"Backup (Replica) Host" => "Host Cadangan (Replika)",
"Give an optional backup host. It must be a replica of the main LDAP/AD server." => "Berikan pilihan host cadangan. Harus merupakan replika dari server LDAP/AD utama.",
"Backup (Replica) Port" => "Port Cadangan (Replika)",
"Disable Main Server" => "Nonaktifkan Server Utama",
"When switched on, ownCloud will only connect to the replica server." => "Saat diaktifkan, ownCloud hanya akan terhubung ke server replika.",
"Use TLS" => "gunakan TLS", "Use TLS" => "gunakan TLS",
"Do not use it additionally for LDAPS connections, it will fail." => "Jangan gunakan utamanya untuk koneksi LDAPS, koneksi akan gagal.",
"Case insensitve LDAP server (Windows)" => "Server LDAP dengan kapitalisasi tidak sensitif (Windows)",
"Turn off SSL certificate validation." => "matikan validasi sertivikat SSL", "Turn off SSL certificate validation." => "matikan validasi sertivikat SSL",
"If connection only works with this option, import the LDAP server's SSL certificate in your ownCloud server." => "Jika koneksi hanya bekerja dengan opsi ini, impor sertifikat SSL server LDAP dari server ownCloud anda.",
"Not recommended, use for testing only." => "tidak disarankan, gunakan hanya untuk pengujian.", "Not recommended, use for testing only." => "tidak disarankan, gunakan hanya untuk pengujian.",
"in seconds. A change empties the cache." => "dalam detik. perubahan mengosongkan cache", "in seconds. A change empties the cache." => "dalam detik. perubahan mengosongkan cache",
"Directory Settings" => "Pengaturan Direktori",
"User Display Name Field" => "Bidang Tampilan Nama Pengguna",
"The LDAP attribute to use to generate the user`s ownCloud name." => "Atribut LDAP yang digunakan untuk menghasilkan nama pengguna ownCloud.",
"Base User Tree" => "Pohon Pengguna Dasar",
"One User Base DN per line" => "Satu Pengguna Base DN per baris",
"User Search Attributes" => "Atribut Pencarian Pengguna",
"Optional; one attribute per line" => "Pilihan; satu atribut per baris",
"Group Display Name Field" => "Bidang Tampilan Nama Grup",
"The LDAP attribute to use to generate the groups`s ownCloud name." => "Atribut LDAP yang digunakan untuk menghasilkan nama grup ownCloud.",
"Base Group Tree" => "Pohon Grup Dasar",
"One Group Base DN per line" => "Satu Grup Base DN per baris",
"Group Search Attributes" => "Atribut Pencarian Grup",
"Group-Member association" => "asosiasi Anggota-Grup",
"Special Attributes" => "Atribut Khusus",
"in bytes" => "dalam bytes", "in bytes" => "dalam bytes",
"Leave empty for user name (default). Otherwise, specify an LDAP/AD attribute." => "Biarkan nama pengguna kosong (default). Atau tetapkan atribut LDAP/AD.",
"Help" => "bantuan" "Help" => "bantuan"
); );

View File

@ -0,0 +1,3 @@
<?php $TRANSLATIONS = array(
"Help" => "အကူအညီ"
);

View File

@ -4,6 +4,7 @@
"The configuration is valid, but the Bind failed. Please check the server settings and credentials." => "A configuração é válida, mas o Bind falhou. Confira as configurações do servidor e as credenciais.", "The configuration is valid, but the Bind failed. Please check the server settings and credentials." => "A configuração é válida, mas o Bind falhou. Confira as configurações do servidor e as credenciais.",
"The configuration is invalid. Please look in the ownCloud log for further details." => "A configuração é inválida. Leia o \"log\" do ownCloud para mais detalhes.", "The configuration is invalid. Please look in the ownCloud log for further details." => "A configuração é inválida. Leia o \"log\" do ownCloud para mais detalhes.",
"Deletion failed" => "Remoção falhou", "Deletion failed" => "Remoção falhou",
"Take over settings from recent server configuration?" => "Tomar parámetros de recente configuração de servidor?",
"Keep settings?" => "Manter ajustes?", "Keep settings?" => "Manter ajustes?",
"Cannot add server configuration" => "Não foi possível adicionar a configuração do servidor", "Cannot add server configuration" => "Não foi possível adicionar a configuração do servidor",
"Connection test succeeded" => "Teste de conexão bem sucedido", "Connection test succeeded" => "Teste de conexão bem sucedido",

View File

@ -34,7 +34,13 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
$shareWith = null; $shareWith = null;
} }
$token = OCP\Share::shareItem($_POST['itemType'], $_POST['itemSource'], $shareType, $shareWith, $_POST['permissions']); $token = OCP\Share::shareItem(
$_POST['itemType'],
$_POST['itemSource'],
$shareType,
$shareWith,
$_POST['permissions']
);
if (is_string($token)) { if (is_string($token)) {
OC_JSON::success(array('data' => array('token' => $token))); OC_JSON::success(array('data' => array('token' => $token)));
@ -59,7 +65,13 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
break; break;
case 'setPermissions': case 'setPermissions':
if (isset($_POST['shareType']) && isset($_POST['shareWith']) && isset($_POST['permissions'])) { if (isset($_POST['shareType']) && isset($_POST['shareWith']) && isset($_POST['permissions'])) {
$return = OCP\Share::setPermissions($_POST['itemType'], $_POST['itemSource'], $_POST['shareType'], $_POST['shareWith'], $_POST['permissions']); $return = OCP\Share::setPermissions(
$_POST['itemType'],
$_POST['itemSource'],
$_POST['shareType'],
$_POST['shareWith'],
$_POST['permissions']
);
($return) ? OC_JSON::success() : OC_JSON::error(); ($return) ? OC_JSON::success() : OC_JSON::error();
} }
break; break;
@ -86,9 +98,11 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
if ($type === 'dir') if ($type === 'dir')
$subject = (string)$l->t('User %s shared a folder with you', $displayName); $subject = (string)$l->t('User %s shared a folder with you', $displayName);
$text = (string)$l->t('User %s shared the file "%s" with you. It is available for download here: %s', array($displayName, $file, $link)); $text = (string)$l->t('User %s shared the file "%s" with you. It is available for download here: %s',
array($displayName, $file, $link));
if ($type === 'dir') if ($type === 'dir')
$text = (string)$l->t('User %s shared the folder "%s" with you. It is available for download here: %s', array($displayName, $file, $link)); $text = (string)$l->t('User %s shared the folder "%s" with you. It is available for download here: %s',
array($displayName, $file, $link));
$default_from = OCP\Util::getDefaultEmailAddress('sharing-noreply'); $default_from = OCP\Util::getDefaultEmailAddress('sharing-noreply');
@ -112,14 +126,29 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
} }
break; break;
case 'getItem': case 'getItem':
if (isset($_GET['itemType']) && isset($_GET['itemSource']) && isset($_GET['checkReshare']) && isset($_GET['checkShares'])) { if (isset($_GET['itemType'])
&& isset($_GET['itemSource'])
&& isset($_GET['checkReshare'])
&& isset($_GET['checkShares'])) {
if ($_GET['checkReshare'] == 'true') { if ($_GET['checkReshare'] == 'true') {
$reshare = OCP\Share::getItemSharedWithBySource($_GET['itemType'], $_GET['itemSource'], OCP\Share::FORMAT_NONE, null, true); $reshare = OCP\Share::getItemSharedWithBySource(
$_GET['itemType'],
$_GET['itemSource'],
OCP\Share::FORMAT_NONE,
null,
true
);
} else { } else {
$reshare = false; $reshare = false;
} }
if ($_GET['checkShares'] == 'true') { if ($_GET['checkShares'] == 'true') {
$shares = OCP\Share::getItemShared($_GET['itemType'], $_GET['itemSource'], OCP\Share::FORMAT_NONE, null, true); $shares = OCP\Share::getItemShared(
$_GET['itemType'],
$_GET['itemSource'],
OCP\Share::FORMAT_NONE,
null,
true
);
} else { } else {
$shares = false; $shares = false;
} }
@ -165,8 +194,15 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
} }
$offset += $limit; $offset += $limit;
foreach ($users as $uid => $displayName) { foreach ($users as $uid => $displayName) {
if ((!isset($_GET['itemShares']) || !is_array($_GET['itemShares'][OCP\Share::SHARE_TYPE_USER]) || !in_array($uid, $_GET['itemShares'][OCP\Share::SHARE_TYPE_USER])) && $uid != OC_User::getUser()) { if ((!isset($_GET['itemShares'])
$shareWith[] = array('label' => $displayName, 'value' => array('shareType' => OCP\Share::SHARE_TYPE_USER, 'shareWith' => $uid)); || !is_array($_GET['itemShares'][OCP\Share::SHARE_TYPE_USER])
|| !in_array($uid, $_GET['itemShares'][OCP\Share::SHARE_TYPE_USER]))
&& $uid != OC_User::getUser()) {
$shareWith[] = array(
'label' => $displayName,
'value' => array('shareType' => OCP\Share::SHARE_TYPE_USER,
'shareWith' => $uid)
);
$count++; $count++;
} }
} }
@ -179,7 +215,13 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
|| !isset($_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP]) || !isset($_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP])
|| !is_array($_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP]) || !is_array($_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP])
|| !in_array($group, $_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP]))) { || !in_array($group, $_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP]))) {
$shareWith[] = array('label' => $group.' (group)', 'value' => array('shareType' => OCP\Share::SHARE_TYPE_GROUP, 'shareWith' => $group)); $shareWith[] = array(
'label' => $group.' (group)',
'value' => array(
'shareType' => OCP\Share::SHARE_TYPE_GROUP,
'shareWith' => $group
)
);
$count++; $count++;
} }
} else { } else {

Some files were not shown because too many files have changed in this diff Show More