summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-09-26 13:02:39 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2013-09-26 13:02:39 +0200
commitb9d6539d768bcad2cf7e07a95c379184f0ab2047 (patch)
treef83c2039dd9d890a8c7894add94a1ae349cd4ede /apps/files_sharing
parent663009f895f63235d65b32f32dba532e46b9057d (diff)
parent6b1d70f148de8ce9d1fa7944a114823bf6decd35 (diff)
downloadnextcloud-server-b9d6539d768bcad2cf7e07a95c379184f0ab2047.tar.gz
nextcloud-server-b9d6539d768bcad2cf7e07a95c379184f0ab2047.zip
Merge branch 'master' into ocs_share_api
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/js/public.js30
-rw-r--r--apps/files_sharing/js/share.js2
-rw-r--r--apps/files_sharing/l10n/de_CH.php19
-rw-r--r--apps/files_sharing/l10n/en_GB.php19
-rw-r--r--apps/files_sharing/l10n/es.php2
-rw-r--r--apps/files_sharing/l10n/es_AR.php6
-rw-r--r--apps/files_sharing/l10n/hi.php3
-rw-r--r--apps/files_sharing/l10n/lt_LT.php7
-rw-r--r--apps/files_sharing/l10n/nn_NO.php7
-rw-r--r--apps/files_sharing/l10n/pa.php8
-rw-r--r--apps/files_sharing/l10n/sq.php7
-rw-r--r--apps/files_sharing/lib/sharedstorage.php3
-rw-r--r--apps/files_sharing/public.php18
13 files changed, 112 insertions, 19 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
index 357c6fdf540..67320b1cdb6 100644
--- a/apps/files_sharing/js/public.js
+++ b/apps/files_sharing/js/public.js
@@ -7,8 +7,6 @@ function fileDownloadPath(dir, file) {
return url;
}
-var form_data;
-
$(document).ready(function() {
$('#data-upload-form').tipsy({gravity:'ne', fade:true});
@@ -50,19 +48,23 @@ $(document).ready(function() {
});
}
- // Add some form data to the upload handler
- file_upload_param.formData = {
- MAX_FILE_SIZE: $('#uploadMaxFilesize').val(),
- requesttoken: $('#publicUploadRequestToken').val(),
- dirToken: $('#dirToken').val(),
- appname: 'files_sharing',
- subdir: $('input#dir').val()
- };
+ var file_upload_start = $('#file_upload_start');
+ file_upload_start.on('fileuploadadd', function(e, data) {
+ // Add custom data to the upload handler
+ data.formData = {
+ requesttoken: $('#publicUploadRequestToken').val(),
+ dirToken: $('#dirToken').val(),
+ subdir: $('input#dir').val()
+ };
+ });
- // Add Uploadprogress Wrapper to controls bar
- $('#controls').append($('#additional_controls div#uploadprogresswrapper'));
+ // Add Uploadprogress Wrapper to controls bar
+ $('#controls').append($('#additional_controls div#uploadprogresswrapper'));
- // Cancel upload trigger
- $('#cancel_upload_button').click(Files.cancelUploads);
+ // Cancel upload trigger
+ $('#cancel_upload_button').click(function() {
+ OC.Upload.cancelUploads();
+ procesSelection();
+ });
});
diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js
index 3be89a39fa0..03ed02f41ef 100644
--- a/apps/files_sharing/js/share.js
+++ b/apps/files_sharing/js/share.js
@@ -4,7 +4,7 @@ $(document).ready(function() {
if (typeof OC.Share !== 'undefined' && typeof FileActions !== 'undefined' && !disableSharing) {
- $('#fileList').one('fileActionsReady',function(){
+ $('#fileList').on('fileActionsReady',function(){
OC.Share.loadIcons('file');
});
diff --git a/apps/files_sharing/l10n/de_CH.php b/apps/files_sharing/l10n/de_CH.php
new file mode 100644
index 00000000000..1bd24f9d9c4
--- /dev/null
+++ b/apps/files_sharing/l10n/de_CH.php
@@ -0,0 +1,19 @@
+<?php
+$TRANSLATIONS = array(
+"The password is wrong. Try again." => "Das Passwort ist falsch. Bitte versuchen Sie es erneut.",
+"Password" => "Passwort",
+"Submit" => "Bestätigen",
+"Sorry, this link doesn’t seem to work anymore." => "Entschuldigung, dieser Link scheint nicht mehr zu funktionieren.",
+"Reasons might be:" => "Gründe könnten sein:",
+"the item was removed" => "Das Element wurde entfernt",
+"the link expired" => "Der Link ist abgelaufen",
+"sharing is disabled" => "Teilen ist deaktiviert",
+"For more info, please ask the person who sent this link." => "Für mehr Informationen, fragen Sie bitte die Person, die Ihnen diesen Link geschickt hat.",
+"%s shared the folder %s with you" => "%s hat den Ordner %s mit Ihnen geteilt",
+"%s shared the file %s with you" => "%s hat die Datei %s mit Ihnen geteilt",
+"Download" => "Herunterladen",
+"Upload" => "Hochladen",
+"Cancel upload" => "Upload abbrechen",
+"No preview available for" => "Es ist keine Vorschau verfügbar für"
+);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/apps/files_sharing/l10n/en_GB.php b/apps/files_sharing/l10n/en_GB.php
new file mode 100644
index 00000000000..337c108651e
--- /dev/null
+++ b/apps/files_sharing/l10n/en_GB.php
@@ -0,0 +1,19 @@
+<?php
+$TRANSLATIONS = array(
+"The password is wrong. Try again." => "The password is wrong. Try again.",
+"Password" => "Password",
+"Submit" => "Submit",
+"Sorry, this link doesn’t seem to work anymore." => "Sorry, this link doesn’t seem to work anymore.",
+"Reasons might be:" => "Reasons might be:",
+"the item was removed" => "the item was removed",
+"the link expired" => "the link expired",
+"sharing is disabled" => "sharing is disabled",
+"For more info, please ask the person who sent this link." => "For more info, please ask the person who sent this link.",
+"%s shared the folder %s with you" => "%s shared the folder %s with you",
+"%s shared the file %s with you" => "%s shared the file %s with you",
+"Download" => "Download",
+"Upload" => "Upload",
+"Cancel upload" => "Cancel upload",
+"No preview available for" => "No preview available for"
+);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/apps/files_sharing/l10n/es.php b/apps/files_sharing/l10n/es.php
index 1f238d083fb..e163da766f3 100644
--- a/apps/files_sharing/l10n/es.php
+++ b/apps/files_sharing/l10n/es.php
@@ -3,7 +3,7 @@ $TRANSLATIONS = array(
"The password is wrong. Try again." => "La contraseña introducida es errónea. Inténtelo de nuevo.",
"Password" => "Contraseña",
"Submit" => "Enviar",
-"Sorry, this link doesn’t seem to work anymore." => "Este enlace parece no funcionar más.",
+"Sorry, this link doesn’t seem to work anymore." => "Vaya, este enlace parece que no volverá a funcionar.",
"Reasons might be:" => "Las causas podrían ser:",
"the item was removed" => "el elemento fue eliminado",
"the link expired" => "el enlace expiró",
diff --git a/apps/files_sharing/l10n/es_AR.php b/apps/files_sharing/l10n/es_AR.php
index fed0b1e7b30..7c9dcb94ac1 100644
--- a/apps/files_sharing/l10n/es_AR.php
+++ b/apps/files_sharing/l10n/es_AR.php
@@ -3,6 +3,12 @@ $TRANSLATIONS = array(
"The password is wrong. Try again." => "La contraseña no es correcta. Probá de nuevo.",
"Password" => "Contraseña",
"Submit" => "Enviar",
+"Sorry, this link doesn’t seem to work anymore." => "Perdón, este enlace parece no funcionar más.",
+"Reasons might be:" => "Las causas podrían ser:",
+"the item was removed" => "el elemento fue borrado",
+"the link expired" => "el enlace expiró",
+"sharing is disabled" => "compartir está desactivado",
+"For more info, please ask the person who sent this link." => "Para mayor información, contactá a la persona que te mandó el enlace.",
"%s shared the folder %s with you" => "%s compartió la carpeta %s con vos",
"%s shared the file %s with you" => "%s compartió el archivo %s con vos",
"Download" => "Descargar",
diff --git a/apps/files_sharing/l10n/hi.php b/apps/files_sharing/l10n/hi.php
index 74a2c320438..63a5d528f3b 100644
--- a/apps/files_sharing/l10n/hi.php
+++ b/apps/files_sharing/l10n/hi.php
@@ -1,5 +1,6 @@
<?php
$TRANSLATIONS = array(
-"Password" => "पासवर्ड"
+"Password" => "पासवर्ड",
+"Upload" => "अपलोड "
);
$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/apps/files_sharing/l10n/lt_LT.php b/apps/files_sharing/l10n/lt_LT.php
index 5d0e58e2fb2..90ae6a39a07 100644
--- a/apps/files_sharing/l10n/lt_LT.php
+++ b/apps/files_sharing/l10n/lt_LT.php
@@ -1,7 +1,14 @@
<?php
$TRANSLATIONS = array(
+"The password is wrong. Try again." => "Netinka slaptažodis: Bandykite dar kartą.",
"Password" => "Slaptažodis",
"Submit" => "Išsaugoti",
+"Sorry, this link doesn’t seem to work anymore." => "Atleiskite, panašu, kad nuoroda yra neveiksni.",
+"Reasons might be:" => "Galimos priežastys:",
+"the item was removed" => "elementas buvo pašalintas",
+"the link expired" => "baigėsi nuorodos galiojimo laikas",
+"sharing is disabled" => "dalinimasis yra išjungtas",
+"For more info, please ask the person who sent this link." => "Dėl tikslesnės informacijos susisiekite su asmeniu atsiuntusiu nuorodą.",
"%s shared the folder %s with you" => "%s pasidalino su jumis %s aplanku",
"%s shared the file %s with you" => "%s pasidalino su jumis %s failu",
"Download" => "Atsisiųsti",
diff --git a/apps/files_sharing/l10n/nn_NO.php b/apps/files_sharing/l10n/nn_NO.php
index bcb6538b09f..94272943e40 100644
--- a/apps/files_sharing/l10n/nn_NO.php
+++ b/apps/files_sharing/l10n/nn_NO.php
@@ -1,7 +1,14 @@
<?php
$TRANSLATIONS = array(
+"The password is wrong. Try again." => "Passordet er gale. Prøv igjen.",
"Password" => "Passord",
"Submit" => "Send",
+"Sorry, this link doesn’t seem to work anymore." => "Orsak, denne lenkja fungerer visst ikkje lenger.",
+"Reasons might be:" => "Moglege grunnar:",
+"the item was removed" => "fila/mappa er fjerna",
+"the link expired" => "lenkja har gått ut på dato",
+"sharing is disabled" => "deling er slått av",
+"For more info, please ask the person who sent this link." => "Spør den som sende deg lenkje om du vil ha meir informasjon.",
"%s shared the folder %s with you" => "%s delte mappa %s med deg",
"%s shared the file %s with you" => "%s delte fila %s med deg",
"Download" => "Last ned",
diff --git a/apps/files_sharing/l10n/pa.php b/apps/files_sharing/l10n/pa.php
new file mode 100644
index 00000000000..6c14eda59df
--- /dev/null
+++ b/apps/files_sharing/l10n/pa.php
@@ -0,0 +1,8 @@
+<?php
+$TRANSLATIONS = array(
+"Password" => "ਪਾਸਵਰ",
+"Download" => "ਡਾਊਨਲੋਡ",
+"Upload" => "ਅੱਪਲੋਡ",
+"Cancel upload" => "ਅੱਪਲੋਡ ਰੱਦ ਕਰੋ"
+);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/apps/files_sharing/l10n/sq.php b/apps/files_sharing/l10n/sq.php
index ae29e5738ff..d2077663e8d 100644
--- a/apps/files_sharing/l10n/sq.php
+++ b/apps/files_sharing/l10n/sq.php
@@ -1,7 +1,14 @@
<?php
$TRANSLATIONS = array(
+"The password is wrong. Try again." => "Kodi është i gabuar. Provojeni përsëri.",
"Password" => "Kodi",
"Submit" => "Parashtro",
+"Sorry, this link doesn’t seem to work anymore." => "Ju kërkojmë ndjesë, kjo lidhje duket sikur nuk punon më.",
+"Reasons might be:" => "Arsyet mund të jenë:",
+"the item was removed" => "elementi është eliminuar",
+"the link expired" => "lidhja ka skaduar",
+"sharing is disabled" => "ndarja është çaktivizuar",
+"For more info, please ask the person who sent this link." => "Për më shumë informacione, ju lutem pyesni personin që iu dërgoi këtë lidhje.",
"%s shared the folder %s with you" => "%s ndau me ju dosjen %s",
"%s shared the file %s with you" => "%s ndau me ju skedarin %s",
"Download" => "Shkarko",
diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php
index d91acbbb2bd..257da89c84e 100644
--- a/apps/files_sharing/lib/sharedstorage.php
+++ b/apps/files_sharing/lib/sharedstorage.php
@@ -221,7 +221,8 @@ class Shared extends \OC\Files\Storage\Common {
public function filemtime($path) {
if ($path == '' || $path == '/') {
$mtime = 0;
- if ($dh = $this->opendir($path)) {
+ $dh = $this->opendir($path);
+ if(is_resource($dh)) {
while (($filename = readdir($dh)) !== false) {
$tempmtime = $this->filemtime($filename);
if ($tempmtime > $mtime) {
diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index ec6b4e815f8..136767aeb45 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -19,6 +19,20 @@ function fileCmp($a, $b) {
}
}
+function determineIcon($file, $sharingRoot, $sharingToken) {
+ // for folders we simply reuse the files logic
+ if($file['type'] == 'dir') {
+ return \OCA\Files\Helper::determineIcon($file);
+ }
+
+ $relativePath = substr($file['path'], 6);
+ $relativePath = substr($relativePath, strlen($sharingRoot));
+ if($file['isPreviewAvailable']) {
+ return OCP\publicPreview_icon($relativePath, $sharingToken);
+ }
+ return OCP\mimetype_icon($file['mimetype']);
+}
+
if (isset($_GET['t'])) {
$token = $_GET['t'];
$linkItem = OCP\Share::getShareByToken($token);
@@ -133,6 +147,7 @@ if (isset($path)) {
$tmpl->assign('mimetype', \OC\Files\Filesystem::getMimeType($path));
$tmpl->assign('fileTarget', basename($linkItem['file_target']));
$tmpl->assign('dirToken', $linkItem['token']);
+ $tmpl->assign('disableSharing', true);
$allowPublicUploadEnabled = (bool) ($linkItem['permissions'] & OCP\PERMISSION_CREATE);
if (\OCP\App::isEnabled('files_encryption')) {
$allowPublicUploadEnabled = false;
@@ -155,6 +170,7 @@ if (isset($path)) {
$tmpl->assign('dir', $getPath);
OCP\Util::addStyle('files', 'files');
+ OCP\Util::addStyle('files', 'upload');
OCP\Util::addScript('files', 'files');
OCP\Util::addScript('files', 'filelist');
OCP\Util::addscript('files', 'keyboardshortcuts');
@@ -176,6 +192,7 @@ if (isset($path)) {
}
$i['directory'] = $getPath;
$i['permissions'] = OCP\PERMISSION_READ;
+ $i['icon'] = determineIcon($i, $basePath, $token);
$files[] = $i;
}
usort($files, "fileCmp");
@@ -191,7 +208,6 @@ if (isset($path)) {
}
$list = new OCP\Template('files', 'part.list', '');
$list->assign('files', $files);
- $list->assign('disableSharing', true);
$list->assign('baseURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&path=');
$list->assign('downloadURL',
OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&download&path=');