diff options
-rw-r--r-- | apps/files/css/files.css | 2 | ||||
-rw-r--r-- | apps/files_trashbin/ajax/delete.php | 3 | ||||
-rw-r--r-- | apps/files_trashbin/ajax/undelete.php | 6 | ||||
-rw-r--r-- | apps/files_versions/ajax/rollbackVersion.php | 3 | ||||
-rw-r--r-- | apps/files_versions/history.php | 19 | ||||
-rw-r--r-- | apps/files_versions/templates/history.php | 2 | ||||
-rw-r--r-- | core/ajax/vcategories/add.php | 2 | ||||
-rw-r--r-- | core/ajax/vcategories/removeFromFavorites.php | 4 | ||||
-rw-r--r-- | core/css/styles.css | 42 | ||||
-rw-r--r-- | core/js/js.js | 4 | ||||
-rw-r--r-- | core/js/setup.js | 8 | ||||
-rw-r--r-- | core/templates/installation.php | 6 | ||||
-rw-r--r-- | core/templates/layout.base.php | 1 | ||||
-rw-r--r-- | core/templates/layout.guest.php | 1 | ||||
-rw-r--r-- | core/templates/layout.user.php | 3 | ||||
-rw-r--r-- | core/templates/login.php | 2 | ||||
-rw-r--r-- | lib/base.php | 18 | ||||
-rw-r--r-- | lib/router.php | 6 | ||||
-rw-r--r-- | lib/templatelayout.php | 6 |
19 files changed, 77 insertions, 61 deletions
diff --git a/apps/files/css/files.css b/apps/files/css/files.css index f37ac4c262a..67bd569ceef 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -3,7 +3,7 @@ See the COPYING-README file. */ /* FILE MENU */ -.actions { padding:.3em; float:left; height:2em; width: 100%; } +.actions { padding:.3em; height:2em; width: 100%; } .actions input, .actions button, .actions .button { margin:0; float:left; } #new { diff --git a/apps/files_trashbin/ajax/delete.php b/apps/files_trashbin/ajax/delete.php index 7ea0155724f..7a6bd1342ea 100644 --- a/apps/files_trashbin/ajax/delete.php +++ b/apps/files_trashbin/ajax/delete.php @@ -18,6 +18,7 @@ if ($path_parts['dirname'] == '.') { if (OCA\Files_Trashbin\Trashbin::delete($filename, $timestamp)) { OCP\JSON::success(array("data" => array("filename" => $file))); } else { - OCP\JSON::error(array("data" => array("message" => "Couldn't delete ".$file. " permanently"))); + $l = OC_L10N::get('files_trashbin'); + OCP\JSON::error(array("data" => array("message" => $l->t("Couldn't delete %s permanently", array($file))))); } diff --git a/apps/files_trashbin/ajax/undelete.php b/apps/files_trashbin/ajax/undelete.php index a118d003de7..cc010979c51 100644 --- a/apps/files_trashbin/ajax/undelete.php +++ b/apps/files_trashbin/ajax/undelete.php @@ -37,8 +37,10 @@ if ( $error ) { foreach ( $error as $e ) { $filelist .= $e.', '; } - OCP\JSON::error(array("data" => array("message" => "Couldn't restore ".rtrim($filelist,', '), "success" => $success, "error" => $error))); + $l = OC_L10N::get('files_trashbin'); + $message = $l->t("Couldn't restore %s", array(rtrim($filelist,', '))); + OCP\JSON::error(array("data" => array("message" => $message, + "success" => $success, "error" => $error))); } else { OCP\JSON::success(array("data" => array("success" => $success))); } - diff --git a/apps/files_versions/ajax/rollbackVersion.php b/apps/files_versions/ajax/rollbackVersion.php index dc5a59cb4af..2970915ac63 100644 --- a/apps/files_versions/ajax/rollbackVersion.php +++ b/apps/files_versions/ajax/rollbackVersion.php @@ -11,6 +11,7 @@ $revision=(int)$_GET['revision']; if(OCA\Files_Versions\Storage::rollback( $file, $revision )) { OCP\JSON::success(array("data" => array( "revision" => $revision, "file" => $file ))); }else{ - OCP\JSON::error(array("data" => array( "message" => "Could not revert:" . $file ))); + $l = OC_L10N::get('files_versions'); + OCP\JSON::error(array("data" => array( "message" => $l->t("Could not revert: %s", array($file) )))); } diff --git a/apps/files_versions/history.php b/apps/files_versions/history.php index 1bd5cde44be..437a3fec065 100644 --- a/apps/files_versions/history.php +++ b/apps/files_versions/history.php @@ -24,6 +24,7 @@ OCP\User::checkLoggedIn( ); OCP\Util::addStyle('files_versions', 'versions'); $tmpl = new OCP\Template( 'files_versions', 'history', 'user' ); +$l = OC_L10N::get('files_versions'); if ( isset( $_GET['path'] ) ) { @@ -36,15 +37,21 @@ if ( isset( $_GET['path'] ) ) { if( $versions->rollback( $path, $_GET['revert'] ) ) { - $tmpl->assign( 'outcome_stat', 'success' ); + $tmpl->assign( 'outcome_stat', $l->t('success') ); - $tmpl->assign( 'outcome_msg', "File {$_GET['path']} was reverted to version ".OCP\Util::formatDate( doubleval($_GET['revert']) ) ); + $message = $l->t('File %s was reverted to version %s', + array($_GET['path'], OCP\Util::formatDate( doubleval($_GET['revert']) ) ) ); + + $tmpl->assign( 'outcome_msg', $message); } else { - $tmpl->assign( 'outcome_stat', 'failure' ); + $tmpl->assign( 'outcome_stat', $l->t('failure') ); + + $message = $l->t('File %s could not be reverted to version %s', + array($_GET['path'], OCP\Util::formatDate( doubleval($_GET['revert']) ) ) ); - $tmpl->assign( 'outcome_msg', "File {$_GET['path']} could not be reverted to version ".OCP\Util::formatDate( doubleval($_GET['revert']) ) ); + $tmpl->assign( 'outcome_msg', $message); } @@ -58,12 +65,12 @@ if ( isset( $_GET['path'] ) ) { }else{ - $tmpl->assign( 'message', 'No old versions available' ); + $tmpl->assign( 'message', $l->t('No old versions available') ); } }else{ - $tmpl->assign( 'message', 'No path specified' ); + $tmpl->assign( 'message', $l->t('No path specified') ); } diff --git a/apps/files_versions/templates/history.php b/apps/files_versions/templates/history.php index cc5a494f19e..850ece89c98 100644 --- a/apps/files_versions/templates/history.php +++ b/apps/files_versions/templates/history.php @@ -17,7 +17,7 @@ if( isset( $_['message'] ) ) { } echo( '<strong>Versions of '.$_['path'] ).'</strong><br>'; - echo('<p><em>Revert a file to a previous version by clicking on its revert button</em></p><br />'); + echo('<p><em>'.$l->t('Revert a file to a previous version by clicking on its revert button').'</em></p><br />'); foreach ( $_['versions'] as $v ) { echo ' '; diff --git a/core/ajax/vcategories/add.php b/core/ajax/vcategories/add.php index 23d00af70ab..16a1461be08 100644 --- a/core/ajax/vcategories/add.php +++ b/core/ajax/vcategories/add.php @@ -34,7 +34,7 @@ debug(print_r($category, true)); $categories = new OC_VCategories($type); if($categories->hasCategory($category)) { - bailOut(OC_Contacts_App::$l10n->t('This category already exists: '.$category)); + bailOut($l->t('This category already exists: %s', array($category))); } else { $categories->add($category, true); } diff --git a/core/ajax/vcategories/removeFromFavorites.php b/core/ajax/vcategories/removeFromFavorites.php index ba6e95c2497..78a528caa86 100644 --- a/core/ajax/vcategories/removeFromFavorites.php +++ b/core/ajax/vcategories/removeFromFavorites.php @@ -27,12 +27,12 @@ if(is_null($type)) { } if(is_null($id)) { - bailOut($l->t('%s ID not provided.', $type)); + bailOut($l->t('%s ID not provided.', array($type))); } $categories = new OC_VCategories($type); if(!$categories->removeFromFavorites($id, $type)) { - bailOut($l->t('Error removing %s from favorites.', $id)); + bailOut($l->t('Error removing %s from favorites.', array($id))); } OC_JSON::success(); diff --git a/core/css/styles.css b/core/css/styles.css index 268040525bf..cefab2d49ff 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -59,25 +59,6 @@ input[type="checkbox"]:hover+label, input[type="checkbox"]:focus+label { color:# ::-webkit-scrollbar-thumb { background:#ddd; } -#show { float: right; position: absolute; right: 1em; top: 0.8em; display:none; } -#login form input[name="show"] + label { background: url("../img/actions/toggle.png") no-repeat; opacity:0.3; -float: right; width: 24px; position: absolute !important; height: 14px; right: 1em; top: 1.25em;} -#login form input[name="show"]:checked + label { background:url("../img/actions/toggle.png") no-repeat; opacity:0.8; } - - - -/* SHOW PASSWORD TOGGLE */ -#show { - position:absolute; right:1em; top:.8em; float:right; - display:none; -} -#login form input[name="show"] + label { - position:absolute !important; height:14px; width:24px; right:1em; top:1.25em; float:right; - background-image:url("../img/actions/toggle.png"); background-repeat:no-repeat; opacity:.3; -} -#login form input[name="show"]:checked + label { opacity:.8; } - - /* BUTTONS */ input[type="submit"], input[type="button"], button, .button, #quota, div.jp-progress, select, .pager li a { width:auto; padding:.4em; @@ -166,17 +147,14 @@ input[type="submit"].enabled { background:#66f866; border:1px solid #5e5; -moz-b #login #datadirContent label { display:block; margin:0; color:#999; } #login form #datadirField legend { margin-bottom:15px; } - /* Icons for username and password fields to better recognize them */ #adminlogin, #adminpass, #user, #password { width:11.7em!important; padding-left:1.8em; } -#adminlogin+label+img, #adminpass+label+img, #user+label+img, #password+label+img { +#adminlogin+label+img, #adminpass-icon, #user+label+img, #password-icon { position:absolute; left:1.25em; top:1.65em; opacity:.3; } -#adminpass+label+img, #password+label+img { top:1.1em; } +#adminpass-icon, #password-icon { top:1.1em; } input[name="password-clone"] { padding-left:1.8em; width:11.7em !important; } -#pass_image { position: absolute; top: 1.2em; left: 1.4em; opacity: 0.3; } - /* Nicely grouping input field sets */ .grouptop input { @@ -194,15 +172,28 @@ input[name="password-clone"] { padding-left:1.8em; width:11.7em !important; } box-shadow:0 1px 1px #fff,0 1px 0 #ddd inset; } +/* In field labels. No, HTML placeholder does not work as well. */ #login form label { color:#666; } #login .groupmiddle label, #login .groupbottom label { top:.65em; } -/* NEEDED FOR INFIELD LABELS */ p.infield { position:relative; } label.infield { cursor:text !important; top:1.05em; left:.85em; } #login form label.infield { position:absolute; font-size:19px; color:#aaa; white-space:nowrap; padding-left:1.4em; } +#login #databaseField .infield { padding-left:0; } #login form input[type="checkbox"]+label { position:relative; margin:0; font-size:1em; text-shadow:#fff 0 1px 0; } #login form .errors { background:#fed7d7; border:1px solid #f00; list-style-indent:inside; margin:0 0 2em; padding:1em; } +/* Show password toggle */ +#show { + position:absolute; right:1em; top:.8em; float:right; + display:none; +} +#show + label { + position:absolute!important; height:14px; width:24px; right:1em; top:1.25em!important; + background-image:url("../img/actions/toggle.png"); background-repeat:no-repeat; opacity:.3; +} +#show:checked + label { opacity:.8; } + +/* Database selector */ #login form #selectDbType { text-align:center; } #login form #selectDbType label { position:static; margin:0 -3px 5px; padding:.4em; @@ -212,6 +203,7 @@ label.infield { cursor:text !important; top:1.05em; left:.85em; } } #login form #selectDbType label.ui-state-hover, #login form #selectDbType label.ui-state-active { color:#000; background-color:#e8e8e8; } +/* Warnings */ fieldset.warning { padding:8px; color:#b94a48; background-color:#f2dede; border:1px solid #eed3d7; diff --git a/core/js/js.js b/core/js/js.js index 6b0c289850c..c137f734d91 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -5,6 +5,10 @@ * To the end of config/config.php to enable debug mode. * The undefined checks fix the broken ie8 console */ +var oc_debug; +var oc_webroot; +var oc_requesttoken; +oc_webroot = oc_webroot || location.pathname.substr(0, location.pathname.lastIndexOf('/')); if (oc_debug !== true || typeof console === "undefined" || typeof console.log === "undefined") { if (!window.console) { window.console = {}; diff --git a/core/js/setup.js b/core/js/setup.js index 9aded6591ca..2656cac2f45 100644 --- a/core/js/setup.js +++ b/core/js/setup.js @@ -52,12 +52,10 @@ $(document).ready(function() { // Save form parameters var post = $(this).serializeArray(); - // FIXME: This lines are breaking the installation // Disable inputs - // $(':submit', this).attr('disabled','disabled').val('Finishing …'); - // $('input', this).addClass('ui-state-disabled').attr('disabled','disabled'); - // $('#selectDbType').button('disable'); - // $('label.ui-button', this).addClass('ui-state-disabled').attr('aria-disabled', 'true').button('disable'); + $(':submit', this).attr('disabled','disabled').val('Finishing …'); + $('input', this).addClass('ui-state-disabled').attr('disabled','disabled'); + $('#selectDbType').buttonset('disable'); // Create the form var form = $('<form>'); diff --git a/core/templates/installation.php b/core/templates/installation.php index 03c580c9b0b..f3d232b637e 100644 --- a/core/templates/installation.php +++ b/core/templates/installation.php @@ -40,9 +40,11 @@ <img class="svg" src="<?php echo image_path('', 'actions/user.svg'); ?>" alt="" /> </p> <p class="infield groupbottom"> - <input type="password" name="adminpass" id="adminpass" value="<?php print OC_Helper::init_var('adminpass'); ?>" required /> + <input type="password" name="adminpass" id="adminpass" value="<?php print OC_Helper::init_var('adminpass'); ?>" required data-typetoggle="#show" /> <label for="adminpass" class="infield"><?php echo $l->t( 'Password' ); ?></label> - <img class="svg" src="<?php echo image_path('', 'actions/password.svg'); ?>" alt="" /> + <img class="svg" id="adminpass-icon" src="<?php echo image_path('', 'actions/password.svg'); ?>" alt="" /> + <input type="checkbox" id="show" name="show" /> + <label for="show"></label> </p> </fieldset> diff --git a/core/templates/layout.base.php b/core/templates/layout.base.php index 47fb75612cf..2049bcb36da 100644 --- a/core/templates/layout.base.php +++ b/core/templates/layout.base.php @@ -7,7 +7,6 @@ <?php foreach ($_['cssfiles'] as $cssfile): ?> <link rel="stylesheet" href="<?php echo $cssfile; ?>" type="text/css" media="screen" /> <?php endforeach; ?> - <script type="text/javascript" src="<?php echo OC_Helper::linkToRoute('js_config');?>"></script> <?php foreach ($_['jsfiles'] as $jsfile): ?> <script type="text/javascript" src="<?php echo $jsfile; ?>"></script> <?php endforeach; ?> diff --git a/core/templates/layout.guest.php b/core/templates/layout.guest.php index 9aabc08acec..69330aa9fce 100644 --- a/core/templates/layout.guest.php +++ b/core/templates/layout.guest.php @@ -8,7 +8,6 @@ <?php foreach($_['cssfiles'] as $cssfile): ?> <link rel="stylesheet" href="<?php echo $cssfile; ?>" type="text/css" media="screen" /> <?php endforeach; ?> - <script type="text/javascript" src="<?php echo OC_Helper::linkToRoute('js_config');?>"></script> <?php foreach($_['jsfiles'] as $jsfile): ?> <script type="text/javascript" src="<?php echo $jsfile; ?>"></script> <?php endforeach; ?> diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index 2547278547f..c8b580b5fd9 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -1,14 +1,13 @@ <!DOCTYPE html> <html> <head> - <title><?php echo isset($_['application']) && !empty($_['application'])?$_['application'].' | ':'' ?>ownCloud <?php echo OC_User::getDisplayName()?' ('.OC_Util::sanitizeHTML(OC_User::getDisplayName()).') ':'' ?></title> + <title><?php echo !empty($_['application'])?$_['application'].' | ':'' ?>ownCloud <?php echo !empty($_['user_displayname'])?' ('.$_['user_displayname'].') ':'' ?></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="apple-itunes-app" content="app-id=543672169"> <link rel="shortcut icon" href="<?php echo image_path('', 'favicon.png'); ?>" /><link rel="apple-touch-icon-precomposed" href="<?php echo image_path('', 'favicon-touch.png'); ?>" /> <?php foreach($_['cssfiles'] as $cssfile): ?> <link rel="stylesheet" href="<?php echo $cssfile; ?>" type="text/css" media="screen" /> <?php endforeach; ?> - <script type="text/javascript" src="<?php echo OC_Helper::linkToRoute('js_config');?>"></script> <?php foreach($_['jsfiles'] as $jsfile): ?> <script type="text/javascript" src="<?php echo $jsfile; ?>"></script> <?php endforeach; ?> diff --git a/core/templates/login.php b/core/templates/login.php index e66d27f6d69..3be2b039b03 100644 --- a/core/templates/login.php +++ b/core/templates/login.php @@ -33,7 +33,7 @@ <input type="password" name="password" id="password" value="" data-typetoggle="#show" required<?php echo $_['user_autofocus'] ? '' : ' autofocus'; ?> /> <label for="password" class="infield"><?php echo $l->t('Password'); ?></label> - <img class="svg" id="pass_image" src="<?php echo image_path('', 'actions/password.svg'); ?>" alt=""/> + <img class="svg" id="password-icon" src="<?php echo image_path('', 'actions/password.svg'); ?>" alt=""/> <input type="checkbox" id="show" name="show" /> <label for="show"></label> </p> diff --git a/lib/base.php b/lib/base.php index b432f282aaf..5bfdb0b7c0a 100644 --- a/lib/base.php +++ b/lib/base.php @@ -554,14 +554,16 @@ class OC { self::checkUpgrade(); } - try { - OC::getRouter()->match(OC_Request::getPathInfo()); - return; - } catch (Symfony\Component\Routing\Exception\ResourceNotFoundException $e) { - //header('HTTP/1.0 404 Not Found'); - } catch (Symfony\Component\Routing\Exception\MethodNotAllowedException $e) { - OC_Response::setStatus(405); - return; + if (!self::$CLI) { + try { + OC::getRouter()->match(OC_Request::getPathInfo()); + return; + } catch (Symfony\Component\Routing\Exception\ResourceNotFoundException $e) { + //header('HTTP/1.0 404 Not Found'); + } catch (Symfony\Component\Routing\Exception\MethodNotAllowedException $e) { + OC_Response::setStatus(405); + return; + } } $app = OC::$REQUESTEDAPP; diff --git a/lib/router.php b/lib/router.php index 746b68c2c0c..dbaca9e0d5d 100644 --- a/lib/router.php +++ b/lib/router.php @@ -23,7 +23,11 @@ class OC_Router { public function __construct() { $baseUrl = OC_Helper::linkTo('', 'index.php'); - $method = $_SERVER['REQUEST_METHOD']; + if ( !OC::$CLI) { + $method = $_SERVER['REQUEST_METHOD']; + }else{ + $method = 'GET'; + } $host = OC_Request::serverHost(); $schema = OC_Request::serverProtocol(); $this->context = new RequestContext($baseUrl, $method, $host, $schema); diff --git a/lib/templatelayout.php b/lib/templatelayout.php index 37ece91047f..345f540af04 100644 --- a/lib/templatelayout.php +++ b/lib/templatelayout.php @@ -19,6 +19,7 @@ class OC_TemplateLayout extends OC_Template { } // Add navigation entry + $this->assign( 'application', '', false ); $navigation = OC_App::getNavigation(); $this->assign( 'navigation', $navigation, false); $this->assign( 'settingsnavigation', OC_App::getSettingsNavigation(), false); @@ -28,6 +29,8 @@ class OC_TemplateLayout extends OC_Template { break; } } + $user_displayname = OC_User::getDisplayName(); + $this->assign( 'user_displayname', $user_displayname ); } else if ($renderas == 'guest') { parent::__construct('core', 'layout.guest'); } else { @@ -36,6 +39,9 @@ class OC_TemplateLayout extends OC_Template { // Add the js files $jsfiles = self::findJavascriptFiles(OC_Util::$scripts); $this->assign('jsfiles', array(), false); + if (OC_Config::getValue('installed', false)) { + $this->append( 'jsfiles', OC_Helper::linkToRoute('js_config')); + } if (!empty(OC_Util::$core_scripts)) { $this->append( 'jsfiles', OC_Helper::linkToRemoteBase('core.js', false)); } |