diff options
Diffstat (limited to 'core')
48 files changed, 399 insertions, 64 deletions
diff --git a/core/avatar/controller.php b/core/avatar/controller.php new file mode 100644 index 00000000000..9f7c0517c4a --- /dev/null +++ b/core/avatar/controller.php @@ -0,0 +1,158 @@ +<?php +/** + * Copyright (c) 2013 Christopher Schäpers <christopher@schaepers.it> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OC\Core\Avatar; + +class Controller { + public static function getAvatar($args) { + \OC_JSON::checkLoggedIn(); + \OC_JSON::callCheck(); + + $user = stripslashes($args['user']); + $size = (int)$args['size']; + if ($size > 2048) { + $size = 2048; + } + // Undefined size + elseif ($size === 0) { + $size = 64; + } + + $avatar = new \OC_Avatar($user); + $image = $avatar->get($size); + + \OC_Response::disableCaching(); + \OC_Response::setLastModifiedHeader(time()); + if ($image instanceof \OC_Image) { + \OC_Response::setETagHeader(crc32($image->data())); + $image->show(); + } else { + // Signalizes $.avatar() to display a defaultavatar + \OC_JSON::success(); + } + } + + public static function postAvatar($args) { + \OC_JSON::checkLoggedIn(); + \OC_JSON::callCheck(); + + $user = \OC_User::getUser(); + + if (isset($_POST['path'])) { + $path = stripslashes($_POST['path']); + $view = new \OC\Files\View('/'.$user.'/files'); + $newAvatar = $view->file_get_contents($path); + } elseif (!empty($_FILES)) { + $files = $_FILES['files']; + if ( + $files['error'][0] === 0 && + is_uploaded_file($files['tmp_name'][0]) && + !\OC\Files\Filesystem::isFileBlacklisted($files['tmp_name'][0]) + ) { + $newAvatar = file_get_contents($files['tmp_name'][0]); + unlink($files['tmp_name'][0]); + } + } else { + $l = new \OC_L10n('core'); + \OC_JSON::error(array("data" => array("message" => $l->t("No image or file provided")) )); + return; + } + + try { + $avatar = new \OC_Avatar($user); + $avatar->set($newAvatar); + \OC_JSON::success(); + } catch (\OC\NotSquareException $e) { + $image = new \OC_Image($newAvatar); + + if ($image->valid()) { + \OC_Cache::set('tmpavatar', $image->data(), 7200); + \OC_JSON::error(array("data" => "notsquare")); + } else { + $l = new \OC_L10n('core'); + + $mimeType = $image->mimeType(); + if ($mimeType !== 'image/jpeg' && $mimeType !== 'image/png') { + \OC_JSON::error(array("data" => array("message" => $l->t("Unknown filetype")) )); + } + + if (!$image->valid()) { + \OC_JSON::error(array("data" => array("message" => $l->t("Invalid image")) )); + } + } + } catch (\Exception $e) { + \OC_JSON::error(array("data" => array("message" => $e->getMessage()) )); + } + } + + public static function deleteAvatar($args) { + \OC_JSON::checkLoggedIn(); + \OC_JSON::callCheck(); + + $user = \OC_User::getUser(); + + try { + $avatar = new \OC_Avatar($user); + $avatar->remove(); + \OC_JSON::success(); + } catch (\Exception $e) { + \OC_JSON::error(array("data" => array("message" => $e->getMessage()) )); + } + } + + public static function getTmpAvatar($args) { + \OC_JSON::checkLoggedIn(); + \OC_JSON::callCheck(); + + $tmpavatar = \OC_Cache::get('tmpavatar'); + if (is_null($tmpavatar)) { + $l = new \OC_L10n('core'); + \OC_JSON::error(array("data" => array("message" => $l->t("No temporary profile picture available, try again")) )); + return; + } + + $image = new \OC_Image($tmpavatar); + \OC_Response::disableCaching(); + \OC_Response::setLastModifiedHeader(time()); + \OC_Response::setETagHeader(crc32($image->data())); + $image->show(); + } + + public static function postCroppedAvatar($args) { + \OC_JSON::checkLoggedIn(); + \OC_JSON::callCheck(); + + $user = \OC_User::getUser(); + if (isset($_POST['crop'])) { + $crop = $_POST['crop']; + } else { + $l = new \OC_L10n('core'); + \OC_JSON::error(array("data" => array("message" => $l->t("No crop data provided")) )); + return; + } + + $tmpavatar = \OC_Cache::get('tmpavatar'); + if (is_null($tmpavatar)) { + $l = new \OC_L10n('core'); + \OC_JSON::error(array("data" => array("message" => $l->t("No temporary profile picture available, try again")) )); + return; + } + + $image = new \OC_Image($tmpavatar); + $image->crop($crop['x'], $crop['y'], $crop['w'], $crop['h']); + try { + $avatar = new \OC_Avatar($user); + $avatar->set($image->data()); + // Clean up + \OC_Cache::remove('tmpavatar'); + \OC_JSON::success(); + } catch (\Exception $e) { + \OC_JSON::error(array("data" => array("message" => $e->getMessage()) )); + } + } +} diff --git a/core/css/apps.css b/core/css/apps.css index 5de146feb1f..de63495e50e 100644 --- a/core/css/apps.css +++ b/core/css/apps.css @@ -50,8 +50,8 @@ #app-navigation li > a { display: block; width: 100%; - height: 44px; - padding: 12px; + line-height: 44px; + padding: 0 12px; overflow: hidden; -moz-box-sizing: border-box; box-sizing: border-box; white-space: nowrap; diff --git a/core/css/styles.css b/core/css/styles.css index bf78af15af5..dcdeda8a9c9 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -40,6 +40,11 @@ body { background:#fefefe; font:normal .8em/1.6em "Helvetica Neue",Helvetica,Ari .header-right { float:right; vertical-align:middle; padding:0.5em; } .header-right > * { vertical-align:middle; } +#header .avatardiv { + text-shadow: none; + float: left; + display: inline-block; +} /* INPUTS */ input[type="text"], input[type="password"], input[type="search"], input[type="number"], input[type="email"], input[type="url"], @@ -583,8 +588,18 @@ label.infield { cursor:text !important; top:1.05em; left:.85em; } /* USER MENU */ -#settings { float:right; margin-top:7px; color:#bbb; text-shadow:0 -1px 0 #000; } -#expand { padding:15px; cursor:pointer; font-weight:bold; } +#settings { + float: right; + margin-top: 7px; + margin-left: 10px; + color: #bbb; + text-shadow: 0 -1px 0 #000; +} +#expand { + padding: 15px 15px 15px 5px; + cursor: pointer; + font-weight: bold; +} #expand:hover, #expand:focus, #expand:active { color:#fff; } #expand img { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=70)"; filter:alpha(opacity=70); opacity:.7; margin-bottom:-2px; } #expand:hover img, #expand:focus img, #expand:active img { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; filter:alpha(opacity=100); opacity:1; } @@ -624,6 +639,7 @@ label.infield { cursor:text !important; top:1.05em; left:.85em; } .hidden { display:none; } .bold { font-weight:bold; } .center { text-align:center; } +.inlineblock { display: inline-block; } #notification-container { position: fixed; top: 0px; width: 100%; text-align: center; z-index: 101; line-height: 1.2;} #notification, #update-notification { z-index:101; background-color:#fc4; border:0; padding:0 .7em .3em; display:none; position: relative; top:0; -moz-border-radius-bottomleft:1em; -webkit-border-bottom-left-radius:1em; border-bottom-left-radius:1em; -moz-border-radius-bottomright:1em; -webkit-border-bottom-right-radius:1em; border-bottom-right-radius:1em; } diff --git a/core/js/avatar.js b/core/js/avatar.js new file mode 100644 index 00000000000..57e6daa0930 --- /dev/null +++ b/core/js/avatar.js @@ -0,0 +1,11 @@ +$(document).ready(function(){ + if (OC.currentUser) { + $('#header .avatardiv').avatar(OC.currentUser, 32); + // Personal settings + $('#avatar .avatardiv').avatar(OC.currentUser, 128); + } + // User settings + $.each($('td.avatar .avatardiv'), function(i, element) { + $(element).avatar($(element).parent().parent().data('uid'), 32); + }); +}); diff --git a/core/js/jquery.avatar.js b/core/js/jquery.avatar.js new file mode 100644 index 00000000000..f1382fd7d2d --- /dev/null +++ b/core/js/jquery.avatar.js @@ -0,0 +1,83 @@ +/** + * Copyright (c) 2013 Christopher Schäpers <christopher@schaepers.it> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +/** + * This plugin inserts the right avatar for the user, depending on, whether a + * custom avatar is uploaded - which it uses then - or not, and display a + * placeholder with the first letter of the users name instead. + * For this it queries the core_avatar_get route, thus this plugin is fit very + * tightly for owncloud, and it may not work anywhere else. + * + * You may use this on any <div></div> + * Here I'm using <div class="avatardiv"></div> as an example. + * + * There are 4 ways to call this: + * + * 1. $('.avatardiv').avatar('jdoe', 128); + * This will make the div to jdoe's fitting avatar, with a size of 128px. + * + * 2. $('.avatardiv').avatar('jdoe'); + * This will make the div to jdoe's fitting avatar. If the div aready has a + * height, it will be used for the avatars size. Otherwise this plugin will + * search for 'size' DOM data, to use for avatar size. If neither are available + * it will default to 64px. + * + * 3. $('.avatardiv').avatar(); + * This will search the DOM for 'user' data, to use as the username. If there + * is no username available it will default to a placeholder with the value of + * "x". The size will be determined the same way, as the second example. + * + * 4. $('.avatardiv').avatar('jdoe', 128, true); + * This will behave like the first example, except it will also append random + * hashes to the custom avatar images, to force image reloading in IE8. + */ + +(function ($) { + $.fn.avatar = function(user, size, ie8fix) { + if (typeof(size) === 'undefined') { + if (this.height() > 0) { + size = this.height(); + } else if (this.data('size') > 0) { + size = this.data('size'); + } else { + size = 64; + } + } + + this.height(size); + this.width(size); + + if (typeof(user) === 'undefined') { + if (typeof(this.data('user')) !== 'undefined') { + user = this.data('user'); + } else { + this.placeholder('x'); + return; + } + } + + // sanitize + user = user.replace(/\//g,''); + + var $div = this; + + OC.Router.registerLoadedCallback(function() { + var url = OC.Router.generate('core_avatar_get', {user: user, size: size})+'?requesttoken='+oc_requesttoken; + $.get(url, function(result) { + if (typeof(result) === 'object') { + $div.placeholder(user); + } else { + if (ie8fix === true) { + $div.html('<img src="'+url+'#'+Math.floor(Math.random()*1000)+'">'); + } else { + $div.html('<img src="'+url+'">'); + } + } + }); + }); + }; +}(jQuery)); diff --git a/core/js/jquery.ocdialog.js b/core/js/jquery.ocdialog.js index bafbd0e0e9f..f1836fd4727 100644 --- a/core/js/jquery.ocdialog.js +++ b/core/js/jquery.ocdialog.js @@ -39,7 +39,8 @@ return; } // Escape - if(event.keyCode === 27 && self.options.closeOnEscape) { + if(event.keyCode === 27 && event.type === 'keydown' && self.options.closeOnEscape) { + event.stopImmediatePropagation(); self.close(); return false; } @@ -83,20 +84,21 @@ var self = this; switch(key) { case 'title': - var $title = $('<h3 class="oc-dialog-title">' + this.options.title - + '</h3>'); //<hr class="oc-dialog-separator" />'); if(this.$title) { - this.$title.replaceWith($title); + this.$title.text(value); } else { + var $title = $('<h3 class="oc-dialog-title">' + + value + + '</h3>'); this.$title = $title.prependTo(this.$dialog); } this._setSizes(); break; case 'buttons': - var $buttonrow = $('<div class="oc-dialog-buttonrow" />'); if(this.$buttonrow) { - this.$buttonrow.replaceWith($buttonrow); + this.$buttonrow.empty(); } else { + var $buttonrow = $('<div class="oc-dialog-buttonrow" />'); this.$buttonrow = $buttonrow.appendTo(this.$dialog); } $.each(value, function(idx, val) { @@ -124,6 +126,8 @@ $closeButton.on('click', function() { self.close(); }); + } else { + this.$dialog.find('.oc-dialog-close').remove(); } break; case 'width': diff --git a/core/js/js.js b/core/js/js.js index 1999ff73d23..cb7287c02ae 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -322,6 +322,38 @@ var OC={ return date.getDate()+'.'+(date.getMonth()+1)+'.'+date.getFullYear()+', '+date.getHours()+':'+date.getMinutes(); }, /** + * Parses a URL query string into a JS map + * @param queryString query string in the format param1=1234¶m2=abcde¶m3=xyz + * @return map containing key/values matching the URL parameters + */ + parseQueryString:function(queryString){ + var parts, + components, + result = {}, + key, + value; + if (!queryString){ + return null; + } + if (queryString[0] === '?'){ + queryString = queryString.substr(1); + } + parts = queryString.split('&'); + for (var i = 0; i < parts.length; i++){ + components = parts[i].split('='); + if (!components.length){ + continue; + } + key = decodeURIComponent(components[0]); + if (!key){ + continue; + } + value = components[1]; + result[key] = value && decodeURIComponent(value); + } + return result; + }, + /** * Opens a popup with the setting for an app. * @param appid String. The ID of the app e.g. 'calendar', 'contacts' or 'files'. * @param loadJS boolean or String. If true 'js/settings.js' is loaded. If it's a string @@ -874,7 +906,7 @@ OC.set=function(name, value) { * @param {type} start * @param {type} end */ -$.fn.selectRange = function(start, end) { +jQuery.fn.selectRange = function(start, end) { return this.each(function() { if (this.setSelectionRange) { this.focus(); @@ -890,6 +922,15 @@ $.fn.selectRange = function(start, end) { }; /** + * check if an element exists. + * allows you to write if ($('#myid').exists()) to increase readability + * @link http://stackoverflow.com/questions/31044/is-there-an-exists-function-for-jquery + */ +jQuery.fn.exists = function(){ + return this.length > 0; +} + +/** * Calls the server periodically every 15 mins to ensure that session doesnt * time out */ diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js index f184a1022bc..8e8a477772b 100644 --- a/core/js/oc-dialogs.js +++ b/core/js/oc-dialogs.js @@ -139,8 +139,12 @@ var OCdialogs = { } }); }) - .fail(function() { - alert(t('core', 'Error loading file picker template')); + .fail(function(status, error) { + // If the method is called while navigating away + // from the page, it is probably not needed ;) + if(status !== 0) { + alert(t('core', 'Error loading file picker template: {error}', {error: error})); + } }); }, /** @@ -206,8 +210,14 @@ var OCdialogs = { }); OCdialogs.dialogs_counter++; }) - .fail(function() { - alert(t('core', 'Error loading file picker template')); + .fail(function(status, error) { + // If the method is called while navigating away from + // the page, we still want to deliver the message. + if(status === 0) { + alert(title + ': ' + content); + } else { + alert(t('core', 'Error loading message template: {error}', {error: error})); + } }); }, _getFilePickerTemplate: function() { @@ -219,8 +229,8 @@ var OCdialogs = { self.$listTmpl = self.$filePickerTemplate.find('.filelist li:first-child').detach(); defer.resolve(self.$filePickerTemplate); }) - .fail(function() { - defer.reject(); + .fail(function(jqXHR, textStatus, errorThrown) { + defer.reject(jqXHR.status, errorThrown); }); } else { defer.resolve(this.$filePickerTemplate); @@ -235,8 +245,8 @@ var OCdialogs = { self.$messageTemplate = $(tmpl); defer.resolve(self.$messageTemplate); }) - .fail(function() { - defer.reject(); + .fail(function(jqXHR, textStatus, errorThrown) { + defer.reject(jqXHR.status, errorThrown); }); } else { defer.resolve(this.$messageTemplate); @@ -244,9 +254,16 @@ var OCdialogs = { return defer.promise(); }, _getFileList: function(dir, mimeType) { + if (typeof(mimeType) === "string") { + mimeType = [mimeType]; + } + return $.getJSON( OC.filePath('files', 'ajax', 'rawlist.php'), - {dir: dir, mimetype: mimeType} + { + dir: dir, + mimetypes: JSON.stringify(mimeType) + } ); }, _determineValue: function(element) { @@ -285,11 +302,7 @@ var OCdialogs = { filename: entry.name, date: OC.mtime2date(entry.mtime) }); - if (entry.mimetype === "httpd/unix-directory") { - $li.find('img').attr('src', OC.imagePath('core', 'filetypes/folder.png')); - } else { - $li.find('img').attr('src', OC.Router.generate('core_ajax_preview', {x:32, y:32, file:escapeHTML(dir+'/'+entry.name)}) ); - } + $li.find('img').attr('src', entry.mimetype_icon); self.$filelist.append($li); }); diff --git a/core/js/share.js b/core/js/share.js index 27c16f38b92..5d34faf8a5d 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -233,6 +233,7 @@ OC.Share={ // } else { $.get(OC.filePath('core', 'ajax', 'share.php'), { fetch: 'getShareWith', search: search.term, itemShares: OC.Share.itemShares }, function(result) { if (result.status == 'success' && result.data.length > 0) { + $( "#shareWith" ).autocomplete( "option", "autoFocus", true ); response(result.data); } else { // Suggest sharing via email if valid email address @@ -240,6 +241,7 @@ OC.Share={ // if (pattern.test(search.term)) { // response([{label: t('core', 'Share via email:')+' '+search.term, value: {shareType: OC.Share.SHARE_TYPE_EMAIL, shareWith: search.term}}]); // } else { + $( "#shareWith" ).autocomplete( "option", "autoFocus", false ); response([t('core', 'No people found')]); // } } @@ -423,7 +425,7 @@ OC.Share={ dateFormat : 'dd-mm-yy' }); } -} +}; $(document).ready(function() { @@ -512,7 +514,7 @@ $(document).ready(function() { $(document).on('change', '#dropdown .permissions', function() { if ($(this).attr('name') == 'edit') { - var li = $(this).parent().parent() + var li = $(this).parent().parent(); var checkboxes = $('.permissions', li); var checked = $(this).is(':checked'); // Check/uncheck Create, Update, and Delete checkboxes if Edit is checked/unck diff --git a/core/l10n/ca.php b/core/l10n/ca.php index 76973490125..c86af43ada6 100644 --- a/core/l10n/ca.php +++ b/core/l10n/ca.php @@ -48,7 +48,6 @@ $TRANSLATIONS = array( "last year" => "l'any passat", "years ago" => "anys enrere", "Choose" => "Escull", -"Error loading file picker template" => "Error en carregar la plantilla del seleccionador de fitxers", "Yes" => "Sí", "No" => "No", "Ok" => "D'acord", diff --git a/core/l10n/cs_CZ.php b/core/l10n/cs_CZ.php index 1301dae32f3..be7af770015 100644 --- a/core/l10n/cs_CZ.php +++ b/core/l10n/cs_CZ.php @@ -48,7 +48,6 @@ $TRANSLATIONS = array( "last year" => "minulý rok", "years ago" => "před lety", "Choose" => "Vybrat", -"Error loading file picker template" => "Chyba při načítání šablony výběru souborů", "Yes" => "Ano", "No" => "Ne", "Ok" => "Ok", diff --git a/core/l10n/da.php b/core/l10n/da.php index abaea4ba6a5..3fd0fff94ef 100644 --- a/core/l10n/da.php +++ b/core/l10n/da.php @@ -48,7 +48,6 @@ $TRANSLATIONS = array( "last year" => "sidste år", "years ago" => "år siden", "Choose" => "Vælg", -"Error loading file picker template" => "Fejl ved indlæsning af filvælger skabelon", "Yes" => "Ja", "No" => "Nej", "Ok" => "OK", diff --git a/core/l10n/de.php b/core/l10n/de.php index 1f205a9db5b..f248734d01c 100644 --- a/core/l10n/de.php +++ b/core/l10n/de.php @@ -48,7 +48,6 @@ $TRANSLATIONS = array( "last year" => "Letztes Jahr", "years ago" => "Vor Jahren", "Choose" => "Auswählen", -"Error loading file picker template" => "Dateiauswahltemplate konnte nicht geladen werden", "Yes" => "Ja", "No" => "Nein", "Ok" => "OK", diff --git a/core/l10n/de_CH.php b/core/l10n/de_CH.php index 6e01b3e2083..5ac614b2575 100644 --- a/core/l10n/de_CH.php +++ b/core/l10n/de_CH.php @@ -42,7 +42,6 @@ $TRANSLATIONS = array( "last year" => "Letztes Jahr", "years ago" => "Vor Jahren", "Choose" => "Auswählen", -"Error loading file picker template" => "Es ist ein Fehler in der Vorlage des Datei-Auswählers aufgetreten.", "Yes" => "Ja", "No" => "Nein", "Ok" => "OK", diff --git a/core/l10n/de_DE.php b/core/l10n/de_DE.php index a29fc4547c6..4616f50c2be 100644 --- a/core/l10n/de_DE.php +++ b/core/l10n/de_DE.php @@ -48,7 +48,6 @@ $TRANSLATIONS = array( "last year" => "Letztes Jahr", "years ago" => "Vor Jahren", "Choose" => "Auswählen", -"Error loading file picker template" => "Es ist ein Fehler in der Vorlage des Datei-Auswählers aufgetreten.", "Yes" => "Ja", "No" => "Nein", "Ok" => "OK", diff --git a/core/l10n/el.php b/core/l10n/el.php index 54c13c89bfa..6e0733b7060 100644 --- a/core/l10n/el.php +++ b/core/l10n/el.php @@ -42,7 +42,6 @@ $TRANSLATIONS = array( "last year" => "τελευταίο χρόνο", "years ago" => "χρόνια πριν", "Choose" => "Επιλέξτε", -"Error loading file picker template" => "Σφάλμα φόρτωσης αρχείου επιλογέα προτύπου", "Yes" => "Ναι", "No" => "Όχι", "Ok" => "Οκ", diff --git a/core/l10n/en_GB.php b/core/l10n/en_GB.php index 3a42872366a..7ccdcbe5327 100644 --- a/core/l10n/en_GB.php +++ b/core/l10n/en_GB.php @@ -48,7 +48,6 @@ $TRANSLATIONS = array( "last year" => "last year", "years ago" => "years ago", "Choose" => "Choose", -"Error loading file picker template" => "Error loading file picker template", "Yes" => "Yes", "No" => "No", "Ok" => "OK", diff --git a/core/l10n/es.php b/core/l10n/es.php index 9e34e6f4ac3..a38050bccc2 100644 --- a/core/l10n/es.php +++ b/core/l10n/es.php @@ -48,7 +48,6 @@ $TRANSLATIONS = array( "last year" => "el año pasado", "years ago" => "años antes", "Choose" => "Seleccionar", -"Error loading file picker template" => "Error cargando la plantilla del seleccionador de archivos", "Yes" => "Sí", "No" => "No", "Ok" => "Aceptar", diff --git a/core/l10n/es_AR.php b/core/l10n/es_AR.php index 953a30c01d5..2c699266c51 100644 --- a/core/l10n/es_AR.php +++ b/core/l10n/es_AR.php @@ -48,7 +48,6 @@ $TRANSLATIONS = array( "last year" => "el año pasado", "years ago" => "años atrás", "Choose" => "Elegir", -"Error loading file picker template" => "Error al cargar la plantilla del seleccionador de archivos", "Yes" => "Sí", "No" => "No", "Ok" => "Aceptar", diff --git a/core/l10n/et_EE.php b/core/l10n/et_EE.php index 5391a144349..59c8e77a389 100644 --- a/core/l10n/et_EE.php +++ b/core/l10n/et_EE.php @@ -48,7 +48,6 @@ $TRANSLATIONS = array( "last year" => "viimasel aastal", "years ago" => "aastat tagasi", "Choose" => "Vali", -"Error loading file picker template" => "Viga failivalija malli laadimisel", "Yes" => "Jah", "No" => "Ei", "Ok" => "Ok", diff --git a/core/l10n/eu.php b/core/l10n/eu.php index 1e0eb36e1e3..1c11caee9e8 100644 --- a/core/l10n/eu.php +++ b/core/l10n/eu.php @@ -42,7 +42,6 @@ $TRANSLATIONS = array( "last year" => "joan den urtean", "years ago" => "urte", "Choose" => "Aukeratu", -"Error loading file picker template" => "Errorea fitxategi hautatzaile txantiloiak kargatzerakoan", "Yes" => "Bai", "No" => "Ez", "Ok" => "Ados", diff --git a/core/l10n/fa.php b/core/l10n/fa.php index 82356c0ab12..b0423577b0c 100644 --- a/core/l10n/fa.php +++ b/core/l10n/fa.php @@ -42,7 +42,6 @@ $TRANSLATIONS = array( "last year" => "سال قبل", "years ago" => "سالهای قبل", "Choose" => "انتخاب کردن", -"Error loading file picker template" => "خطا در بارگذاری قالب انتخاب کننده فایل", "Yes" => "بله", "No" => "نه", "Ok" => "قبول", diff --git a/core/l10n/fr.php b/core/l10n/fr.php index 0f338a09340..8b8b7c19f2a 100644 --- a/core/l10n/fr.php +++ b/core/l10n/fr.php @@ -48,7 +48,6 @@ $TRANSLATIONS = array( "last year" => "l'année dernière", "years ago" => "il y a plusieurs années", "Choose" => "Choisir", -"Error loading file picker template" => "Erreur de chargement du modèle du sélecteur de fichier", "Yes" => "Oui", "No" => "Non", "Ok" => "Ok", diff --git a/core/l10n/gl.php b/core/l10n/gl.php index 663d769ee98..ca07e510a30 100644 --- a/core/l10n/gl.php +++ b/core/l10n/gl.php @@ -48,7 +48,6 @@ $TRANSLATIONS = array( "last year" => "último ano", "years ago" => "anos atrás", "Choose" => "Escoller", -"Error loading file picker template" => "Produciuse un erro ao cargar o modelo do selector de ficheiros", "Yes" => "Si", "No" => "Non", "Ok" => "Aceptar", diff --git a/core/l10n/he.php b/core/l10n/he.php index d5d83fea330..a10765c3a80 100644 --- a/core/l10n/he.php +++ b/core/l10n/he.php @@ -42,7 +42,6 @@ $TRANSLATIONS = array( "last year" => "שנה שעברה", "years ago" => "שנים", "Choose" => "בחירה", -"Error loading file picker template" => "שגיאה בטעינת תבנית בחירת הקבצים", "Yes" => "כן", "No" => "לא", "Ok" => "בסדר", diff --git a/core/l10n/hu_HU.php b/core/l10n/hu_HU.php index 93f96e17847..92e51d977ef 100644 --- a/core/l10n/hu_HU.php +++ b/core/l10n/hu_HU.php @@ -42,7 +42,6 @@ $TRANSLATIONS = array( "last year" => "tavaly", "years ago" => "több éve", "Choose" => "Válasszon", -"Error loading file picker template" => "Nem sikerült betölteni a fájlkiválasztó sablont", "Yes" => "Igen", "No" => "Nem", "Ok" => "Ok", diff --git a/core/l10n/it.php b/core/l10n/it.php index 71f6ffdf50e..a8f9a6901f8 100644 --- a/core/l10n/it.php +++ b/core/l10n/it.php @@ -48,7 +48,6 @@ $TRANSLATIONS = array( "last year" => "anno scorso", "years ago" => "anni fa", "Choose" => "Scegli", -"Error loading file picker template" => "Errore durante il caricamento del modello del selezionatore di file", "Yes" => "Sì", "No" => "No", "Ok" => "Ok", diff --git a/core/l10n/ja_JP.php b/core/l10n/ja_JP.php index 82e4153367d..343fffd09b0 100644 --- a/core/l10n/ja_JP.php +++ b/core/l10n/ja_JP.php @@ -48,7 +48,6 @@ $TRANSLATIONS = array( "last year" => "一年前", "years ago" => "年前", "Choose" => "選択", -"Error loading file picker template" => "ファイルピッカーのテンプレートの読み込みエラー", "Yes" => "はい", "No" => "いいえ", "Ok" => "OK", diff --git a/core/l10n/km.php b/core/l10n/km.php new file mode 100644 index 00000000000..556cca20dac --- /dev/null +++ b/core/l10n/km.php @@ -0,0 +1,8 @@ +<?php +$TRANSLATIONS = array( +"_%n minute ago_::_%n minutes ago_" => array(""), +"_%n hour ago_::_%n hours ago_" => array(""), +"_%n day ago_::_%n days ago_" => array(""), +"_%n month ago_::_%n months ago_" => array("") +); +$PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/core/l10n/lb.php b/core/l10n/lb.php index 5f4c415bed7..6a0b41b6679 100644 --- a/core/l10n/lb.php +++ b/core/l10n/lb.php @@ -42,7 +42,6 @@ $TRANSLATIONS = array( "last year" => "Lescht Joer", "years ago" => "Joren hir", "Choose" => "Auswielen", -"Error loading file picker template" => "Feeler beim Luede vun der Virlag fir d'Fichiers-Selektioun", "Yes" => "Jo", "No" => "Nee", "Ok" => "OK", diff --git a/core/l10n/lt_LT.php b/core/l10n/lt_LT.php index 7b0c3ed4f80..7b5ad39b81e 100644 --- a/core/l10n/lt_LT.php +++ b/core/l10n/lt_LT.php @@ -2,6 +2,12 @@ $TRANSLATIONS = array( "%s shared »%s« with you" => "%s pasidalino »%s« su tavimi", "group" => "grupė", +"Turned on maintenance mode" => "Įjungta priežiūros veiksena", +"Turned off maintenance mode" => "Išjungta priežiūros veiksena", +"Updated database" => "Atnaujinta duomenų bazė", +"Updating filecache, this may take really long..." => "Atnaujinama failų talpykla, tai gali užtrukti labai ilgai...", +"Updated filecache" => "Atnaujinta failų talpykla", +"... %d%% done ..." => "... %d%% atlikta ...", "Category type not provided." => "Kategorija nenurodyta.", "No category to add?" => "Nepridėsite jokios kategorijos?", "This category already exists: %s" => "Ši kategorija jau egzistuoja: %s", @@ -35,14 +41,13 @@ $TRANSLATIONS = array( "_%n hour ago_::_%n hours ago_" => array("prieš %n valandą","prieš %n valandų","prieš %n valandų"), "today" => "šiandien", "yesterday" => "vakar", -"_%n day ago_::_%n days ago_" => array("","",""), +"_%n day ago_::_%n days ago_" => array("prieš %n dieną","prieš %n dienas","prieš %n dienų"), "last month" => "praeitą mėnesį", "_%n month ago_::_%n months ago_" => array("prieš %n mėnesį","prieš %n mėnesius","prieš %n mėnesių"), "months ago" => "prieš mėnesį", "last year" => "praeitais metais", "years ago" => "prieš metus", "Choose" => "Pasirinkite", -"Error loading file picker template" => "Klaida pakraunant failų naršyklę", "Yes" => "Taip", "No" => "Ne", "Ok" => "Gerai", @@ -61,6 +66,7 @@ $TRANSLATIONS = array( "Share with link" => "Dalintis nuoroda", "Password protect" => "Apsaugotas slaptažodžiu", "Password" => "Slaptažodis", +"Allow Public Upload" => "Leisti viešą įkėlimą", "Email link to person" => "Nusiųsti nuorodą paštu", "Send" => "Siųsti", "Set expiration date" => "Nustatykite galiojimo laiką", @@ -89,6 +95,7 @@ $TRANSLATIONS = array( "Request failed!<br>Did you make sure your email/username was right?" => "Klaida!<br>Ar tikrai jūsų el paštas/vartotojo vardas buvo teisingi?", "You will receive a link to reset your password via Email." => "Elektroniniu paštu gausite nuorodą, su kuria galėsite iš naujo nustatyti slaptažodį.", "Username" => "Prisijungimo vardas", +"Your files are encrypted. If you haven't enabled the recovery key, there will be no way to get your data back after your password is reset. If you are not sure what to do, please contact your administrator before you continue. Do you really want to continue?" => "Jūsų failai yra užšifruoti. Jei neįjungėte atstatymo rakto, nebus galimybės atstatyti duomenų po slaptažodžio atstatymo. Jei nesate tikri ką daryti, prašome susisiekti su administratoriumi prie tęsiant. Ar tikrai tęsti?", "Yes, I really want to reset my password now" => "Taip, aš tikrai noriu atnaujinti slaptažodį", "Request reset" => "Prašyti nustatymo iš najo", "Your password was reset" => "Jūsų slaptažodis buvo nustatytas iš naujo", @@ -102,13 +109,16 @@ $TRANSLATIONS = array( "Help" => "Pagalba", "Access forbidden" => "Priėjimas draudžiamas", "Cloud not found" => "Negalima rasti", +"Hey there,\n\njust letting you know that %s shared %s with you.\nView it: %s\n\nCheers!" => "Labas,\n\nInformuojame, kad %s pasidalino su Jumis %s.\nPažiūrėkite: %s\n\nLinkėjimai!", "Edit categories" => "Redaguoti kategorijas", "Add" => "Pridėti", "Security Warning" => "Saugumo pranešimas", "Your PHP version is vulnerable to the NULL Byte attack (CVE-2006-7243)" => "Jūsų PHP versija yra pažeidžiama prieš NULL Byte ataką (CVE-2006-7243)", +"Please update your PHP installation to use %s securely." => "Prašome atnaujinti savo PHP, kad saugiai naudoti %s.", "No secure random number generator is available, please enable the PHP OpenSSL extension." => "Saugaus atsitiktinių skaičių generatoriaus nėra, prašome įjungti PHP OpenSSL modulį.", "Without a secure random number generator an attacker may be able to predict password reset tokens and take over your account." => "Be saugaus atsitiktinių skaičių generatoriaus, piktavaliai gali atspėti Jūsų slaptažodį ir pasisavinti paskyrą.", "Your data directory and files are probably accessible from the internet because the .htaccess file does not work." => "Jūsų failai yra tikriausiai prieinami per internetą nes .htaccess failas neveikia.", +"For information how to properly configure your server, please see the <a href=\"%s\" target=\"_blank\">documentation</a>." => "Kad gauti informaciją apie tai kaip tinkamai sukonfigūruoti savo serverį, prašome skaityti <a href=\"%s\" target=\"_blank\">dokumentaciją</a>.", "Create an <strong>admin account</strong>" => "Sukurti <strong>administratoriaus paskyrą</strong>", "Advanced" => "Išplėstiniai", "Data folder" => "Duomenų katalogas", @@ -129,6 +139,7 @@ $TRANSLATIONS = array( "remember" => "prisiminti", "Log in" => "Prisijungti", "Alternative Logins" => "Alternatyvūs prisijungimai", +"Hey there,<br><br>just letting you know that %s shared »%s« with you.<br><a href=\"%s\">View it!</a><br><br>Cheers!" => "Labas,<br><br>tik informuojame, kad %s pasidalino su Jumis »%s«.<br><a href=\"%s\">Peržiūrėk!</a><br><br>Linkėjimai!", "Updating ownCloud to version %s, this may take a while." => "Atnaujinama ownCloud į %s versiją. tai gali šiek tiek užtrukti." ); $PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);"; diff --git a/core/l10n/lv.php b/core/l10n/lv.php index 57b9186f3cf..465a497e880 100644 --- a/core/l10n/lv.php +++ b/core/l10n/lv.php @@ -42,7 +42,6 @@ $TRANSLATIONS = array( "last year" => "gājušajā gadā", "years ago" => "gadus atpakaļ", "Choose" => "Izvēlieties", -"Error loading file picker template" => "Kļūda ielādējot datņu ņēmēja veidni", "Yes" => "Jā", "No" => "Nē", "Ok" => "Labi", diff --git a/core/l10n/nl.php b/core/l10n/nl.php index 6d5d5dc9917..e181eee702a 100644 --- a/core/l10n/nl.php +++ b/core/l10n/nl.php @@ -42,7 +42,6 @@ $TRANSLATIONS = array( "last year" => "vorig jaar", "years ago" => "jaar geleden", "Choose" => "Kies", -"Error loading file picker template" => "Fout bij laden van bestandsselectie sjabloon", "Yes" => "Ja", "No" => "Nee", "Ok" => "Ok", diff --git a/core/l10n/nn_NO.php b/core/l10n/nn_NO.php index 6d34d6e23c3..86c46471a14 100644 --- a/core/l10n/nn_NO.php +++ b/core/l10n/nn_NO.php @@ -48,7 +48,6 @@ $TRANSLATIONS = array( "last year" => "i fjor", "years ago" => "år sidan", "Choose" => "Vel", -"Error loading file picker template" => "Klarte ikkje å lasta filveljarmalen", "Yes" => "Ja", "No" => "Nei", "Ok" => "Greitt", diff --git a/core/l10n/pl.php b/core/l10n/pl.php index 2162de0e48c..deb4b4c81c8 100644 --- a/core/l10n/pl.php +++ b/core/l10n/pl.php @@ -48,7 +48,6 @@ $TRANSLATIONS = array( "last year" => "w zeszłym roku", "years ago" => "lat temu", "Choose" => "Wybierz", -"Error loading file picker template" => "Błąd podczas ładowania pliku wybranego szablonu", "Yes" => "Tak", "No" => "Nie", "Ok" => "OK", diff --git a/core/l10n/pt_BR.php b/core/l10n/pt_BR.php index 7b1c7b3702c..f758c0e9bc3 100644 --- a/core/l10n/pt_BR.php +++ b/core/l10n/pt_BR.php @@ -48,7 +48,6 @@ $TRANSLATIONS = array( "last year" => "último ano", "years ago" => "anos atrás", "Choose" => "Escolha", -"Error loading file picker template" => "Template selecionador Erro ao carregar arquivo", "Yes" => "Sim", "No" => "Não", "Ok" => "Ok", diff --git a/core/l10n/pt_PT.php b/core/l10n/pt_PT.php index 7f4e34cb555..4554b64d405 100644 --- a/core/l10n/pt_PT.php +++ b/core/l10n/pt_PT.php @@ -5,6 +5,8 @@ $TRANSLATIONS = array( "Turned on maintenance mode" => "Activado o modo de manutenção", "Turned off maintenance mode" => "Desactivado o modo de manutenção", "Updated database" => "Base de dados actualizada", +"Updating filecache, this may take really long..." => "A actualizar o cache dos ficheiros, poderá demorar algum tempo...", +"Updated filecache" => "Actualizado o cache dos ficheiros", "... %d%% done ..." => "... %d%% feito ...", "Category type not provided." => "Tipo de categoria não fornecido", "No category to add?" => "Nenhuma categoria para adicionar?", @@ -46,7 +48,6 @@ $TRANSLATIONS = array( "last year" => "ano passado", "years ago" => "anos atrás", "Choose" => "Escolha", -"Error loading file picker template" => "Erro ao carregar arquivo do separador modelo", "Yes" => "Sim", "No" => "Não", "Ok" => "Ok", @@ -88,6 +89,7 @@ $TRANSLATIONS = array( "Email sent" => "E-mail enviado", "The update was unsuccessful. Please report this issue to the <a href=\"https://github.com/owncloud/core/issues\" target=\"_blank\">ownCloud community</a>." => "A actualização falhou. Por favor reporte este incidente seguindo este link <a href=\"https://github.com/owncloud/core/issues\" target=\"_blank\">ownCloud community</a>.", "The update was successful. Redirecting you to ownCloud now." => "A actualização foi concluída com sucesso. Vai ser redireccionado para o ownCloud agora.", +"%s password reset" => "%s reposição da password", "Use the following link to reset your password: {link}" => "Use o seguinte endereço para repor a sua password: {link}", "The link to reset your password has been sent to your email.<br>If you do not receive it within a reasonable amount of time, check your spam/junk folders.<br>If it is not there ask your local administrator ." => "O link para fazer reset à sua password foi enviado para o seu e-mail. <br> Se não o recebeu dentro um espaço de tempo aceitável, por favor verifique a sua pasta de SPAM.<br> Se não o encontrar, por favor contacte o seu administrador.", "Request failed!<br>Did you make sure your email/username was right?" => "O pedido falhou! <br> Tem a certeza que introduziu o seu email/username correcto?", diff --git a/core/l10n/ro.php b/core/l10n/ro.php index ca0e409f71f..8b274cb1409 100644 --- a/core/l10n/ro.php +++ b/core/l10n/ro.php @@ -42,7 +42,6 @@ $TRANSLATIONS = array( "last year" => "ultimul an", "years ago" => "ani în urmă", "Choose" => "Alege", -"Error loading file picker template" => "Eroare la încărcarea șablonului selectorului de fișiere", "Yes" => "Da", "No" => "Nu", "Ok" => "Ok", diff --git a/core/l10n/ru.php b/core/l10n/ru.php index d79326aff32..0fe2e860917 100644 --- a/core/l10n/ru.php +++ b/core/l10n/ru.php @@ -42,7 +42,6 @@ $TRANSLATIONS = array( "last year" => "в прошлом году", "years ago" => "несколько лет назад", "Choose" => "Выбрать", -"Error loading file picker template" => "Ошибка при загрузке файла выбора шаблона", "Yes" => "Да", "No" => "Нет", "Ok" => "Ок", diff --git a/core/l10n/sk_SK.php b/core/l10n/sk_SK.php index ed061068b4b..f36445950a1 100644 --- a/core/l10n/sk_SK.php +++ b/core/l10n/sk_SK.php @@ -48,7 +48,6 @@ $TRANSLATIONS = array( "last year" => "minulý rok", "years ago" => "pred rokmi", "Choose" => "Výber", -"Error loading file picker template" => "Chyba pri načítaní šablóny výberu súborov", "Yes" => "Áno", "No" => "Nie", "Ok" => "Ok", diff --git a/core/l10n/sl.php b/core/l10n/sl.php index 460ca99eeab..e88b7a6fb5a 100644 --- a/core/l10n/sl.php +++ b/core/l10n/sl.php @@ -42,7 +42,6 @@ $TRANSLATIONS = array( "last year" => "lansko leto", "years ago" => "let nazaj", "Choose" => "Izbor", -"Error loading file picker template" => "Napaka pri nalaganju predloge za izbor dokumenta", "Yes" => "Da", "No" => "Ne", "Ok" => "V redu", diff --git a/core/l10n/sq.php b/core/l10n/sq.php index 6eaa909cad1..c8462573ffa 100644 --- a/core/l10n/sq.php +++ b/core/l10n/sq.php @@ -48,7 +48,6 @@ $TRANSLATIONS = array( "last year" => "vitin e shkuar", "years ago" => "vite më parë", "Choose" => "Zgjidh", -"Error loading file picker template" => "Veprim i gabuar gjatë ngarkimit të modelit të zgjedhësit të skedarëve", "Yes" => "Po", "No" => "Jo", "Ok" => "Në rregull", diff --git a/core/l10n/sv.php b/core/l10n/sv.php index 9bfd91d2691..b358fdc8a97 100644 --- a/core/l10n/sv.php +++ b/core/l10n/sv.php @@ -48,7 +48,6 @@ $TRANSLATIONS = array( "last year" => "förra året", "years ago" => "år sedan", "Choose" => "Välj", -"Error loading file picker template" => "Fel vid inläsning av filväljarens mall", "Yes" => "Ja", "No" => "Nej", "Ok" => "Ok", diff --git a/core/l10n/tr.php b/core/l10n/tr.php index 267e07189c7..a4c80638d82 100644 --- a/core/l10n/tr.php +++ b/core/l10n/tr.php @@ -48,7 +48,6 @@ $TRANSLATIONS = array( "last year" => "geçen yıl", "years ago" => "yıl önce", "Choose" => "seç", -"Error loading file picker template" => "Seçici şablon dosya yüklemesinde hata", "Yes" => "Evet", "No" => "Hayır", "Ok" => "Tamam", diff --git a/core/l10n/zh_CN.php b/core/l10n/zh_CN.php index ddcc902c8d7..ce61618111a 100644 --- a/core/l10n/zh_CN.php +++ b/core/l10n/zh_CN.php @@ -48,7 +48,6 @@ $TRANSLATIONS = array( "last year" => "去年", "years ago" => "年前", "Choose" => "选择(&C)...", -"Error loading file picker template" => "加载文件选择器模板出错", "Yes" => "是", "No" => "否", "Ok" => "好", diff --git a/core/l10n/zh_TW.php b/core/l10n/zh_TW.php index c25a58dc8ea..a6e2588e0d7 100644 --- a/core/l10n/zh_TW.php +++ b/core/l10n/zh_TW.php @@ -48,7 +48,6 @@ $TRANSLATIONS = array( "last year" => "去年", "years ago" => "幾年前", "Choose" => "選擇", -"Error loading file picker template" => "載入檔案選擇器樣板發生錯誤", "Yes" => "是", "No" => "否", "Ok" => "好", diff --git a/core/routes.php b/core/routes.php index d8c2d03236f..57e25c0f1f7 100644 --- a/core/routes.php +++ b/core/routes.php @@ -57,6 +57,23 @@ $this->create('core_lostpassword_reset_password', '/lostpassword/reset/{token}/{ ->post() ->action('OC\Core\LostPassword\Controller', 'resetPassword'); +// Avatar routes +$this->create('core_avatar_get_tmp', '/avatar/tmp') + ->get() + ->action('OC\Core\Avatar\Controller', 'getTmpAvatar'); +$this->create('core_avatar_get', '/avatar/{user}/{size}') + ->get() + ->action('OC\Core\Avatar\Controller', 'getAvatar'); +$this->create('core_avatar_post', '/avatar/') + ->post() + ->action('OC\Core\Avatar\Controller', 'postAvatar'); +$this->create('core_avatar_delete', '/avatar/') + ->delete() + ->action('OC\Core\Avatar\Controller', 'deleteAvatar'); +$this->create('core_avatar_post_cropped', '/avatar/cropped') + ->post() + ->action('OC\Core\Avatar\Controller', 'postCroppedAvatar'); + // Not specifically routed $this->create('app_css', '/apps/{app}/{file}') ->requirements(array('file' => '.*.css')) diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index 1e0f4a75c3c..71bec11d219 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -49,6 +49,9 @@ <span id="expand" tabindex="0" role="link"> <span id="expandDisplayName"><?php p(trim($_['user_displayname']) != '' ? $_['user_displayname'] : $_['user_uid']) ?></span> <img class="svg" src="<?php print_unescaped(image_path('', 'actions/caret.svg')); ?>" /> + <?php if ($_['enableAvatars']): ?> + <div class="avatardiv"></div> + <?php endif; ?> </span> <div id="expanddiv"> <?php foreach($_['settingsnavigation'] as $entry):?> |