introduce shortname themable string and split from title, use for image alt text

This commit is contained in:
Jan-Christoph Borchardt 2013-07-11 16:38:07 +02:00
parent c5f2ea9a95
commit aacca494c5
6 changed files with 21 additions and 11 deletions

View File

@ -10,7 +10,7 @@
<input type="hidden" name="mimetype" value="<?php p($_['mimetype']) ?>" id="mimetype"> <input type="hidden" name="mimetype" value="<?php p($_['mimetype']) ?>" id="mimetype">
<header><div id="header"> <header><div id="header">
<a href="<?php print_unescaped(link_to('', 'index.php')); ?>" title="" id="owncloud"><img class="svg" <a href="<?php print_unescaped(link_to('', 'index.php')); ?>" title="" id="owncloud"><img class="svg"
src="<?php print_unescaped(image_path('', 'logo-wide.svg')); ?>" alt="ownCloud" /></a> src="<?php print_unescaped(image_path('', 'logo-wide.svg')); ?>" alt="<?php p($defaults->getName()); ?>" /></a>
<div id="logo-claim" style="display:none;"><?php p($defaults->getLogoClaim()); ?></div> <div id="logo-claim" style="display:none;"><?php p($defaults->getLogoClaim()); ?></div>
<div class="header-right"> <div class="header-right">
<?php if (isset($_['folder'])): ?> <?php if (isset($_['folder'])): ?>

View File

@ -10,7 +10,7 @@
<head> <head>
<title> <title>
<?php p($defaults->getName()); ?> <?php p($defaults->getTitle()); ?>
</title> </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="<?php print_unescaped(image_path('', 'favicon.png')); ?>" /> <link rel="shortcut icon" href="<?php print_unescaped(image_path('', 'favicon.png')); ?>" />

View File

@ -10,7 +10,7 @@
<head data-requesttoken="<?php p($_['requesttoken']); ?>"> <head data-requesttoken="<?php p($_['requesttoken']); ?>">
<title> <title>
<?php p($defaults->getName()); ?> <?php p($defaults->getTitle()); ?>
</title> </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="apple-itunes-app" content="app-id=543672169"> <meta name="apple-itunes-app" content="app-id=543672169">
@ -22,7 +22,7 @@
<?php foreach($_['jsfiles'] as $jsfile): ?> <?php foreach($_['jsfiles'] as $jsfile): ?>
<script type="text/javascript" src="<?php print_unescaped($jsfile); ?>"></script> <script type="text/javascript" src="<?php print_unescaped($jsfile); ?>"></script>
<?php endforeach; ?> <?php endforeach; ?>
<?php foreach($_['headers'] as $header): ?> <?php foreach($_['headers'] as $header): ?>
<?php <?php
print_unescaped('<'.$header['tag'].' '); print_unescaped('<'.$header['tag'].' ');
@ -37,7 +37,7 @@
<body id="body-login"> <body id="body-login">
<div id="login"> <div id="login">
<header><div id="header"> <header><div id="header">
<img src="<?php print_unescaped(image_path('', 'logo.svg')); ?>" class="svg" alt="ownCloud" /> <img src="<?php print_unescaped(image_path('', 'logo.svg')); ?>" class="svg" alt="<?php p($defaults->getName()); ?>" />
<div id="logo-claim" style="display:none;"><?php p($defaults->getLogoClaim()); ?></div> <div id="logo-claim" style="display:none;"><?php p($defaults->getLogoClaim()); ?></div>
</div></header> </div></header>
<?php print_unescaped($_['content']); ?> <?php print_unescaped($_['content']); ?>

View File

@ -7,11 +7,11 @@
<!--[if !IE]><!--><html class="ng-csp"><!--<![endif]--> <!--[if !IE]><!--><html class="ng-csp"><!--<![endif]-->
<?php $defaults = new OC_Defaults(); // initialize themable default strings and urls ?> <?php $defaults = new OC_Defaults(); // initialize themable default strings and urls ?>
<head data-user="<?php p($_['user_uid']); ?>" data-requesttoken="<?php p($_['requesttoken']); ?>"> <head data-user="<?php p($_['user_uid']); ?>" data-requesttoken="<?php p($_['requesttoken']); ?>">
<title> <title>
<?php p(!empty($_['application'])?$_['application'].' | ':''); <?php p(!empty($_['application'])?$_['application'].' | ':'');
p($defaults->getName()); p($defaults->getTitle());
p(trim($_['user_displayname']) != '' ?' ('.$_['user_displayname'].') ':'') ?> p(trim($_['user_displayname']) != '' ?' ('.$_['user_displayname'].') ':'') ?>
</title> </title>
<meta charset="utf-8"> <meta charset="utf-8">
@ -45,7 +45,7 @@
</div> </div>
<header><div id="header"> <header><div id="header">
<a href="<?php print_unescaped(link_to('', 'index.php')); ?>" title="" id="owncloud"><img class="svg" <a href="<?php print_unescaped(link_to('', 'index.php')); ?>" title="" id="owncloud"><img class="svg"
src="<?php print_unescaped(image_path('', 'logo-wide.svg')); ?>" alt="ownCloud" /></a> src="<?php print_unescaped(image_path('', 'logo-wide.svg')); ?>" alt="<?php p($defaults->getName()); ?>" /></a>
<div id="logo-claim" style="display:none;"><?php p($defaults->getLogoClaim()); ?></div> <div id="logo-claim" style="display:none;"><?php p($defaults->getLogoClaim()); ?></div>
<ul id="settings" class="svg"> <ul id="settings" class="svg">
<span id="expand" tabindex="0" role="link"> <span id="expand" tabindex="0" role="link">

View File

@ -5,7 +5,7 @@
<tr> <tr>
<td bgcolor="#1d2d44" width="20px">&nbsp;</td> <td bgcolor="#1d2d44" width="20px">&nbsp;</td>
<td bgcolor="#1d2d44"> <td bgcolor="#1d2d44">
<img src="<?php print_unescaped(OC_Helper::makeURLAbsolute(image_path('', 'logo-mail.gif'))); ?>" alt="ownCloud"/> <img src="<?php print_unescaped(OC_Helper::makeURLAbsolute(image_path('', 'logo-mail.gif'))); ?>" alt="<?php p($defaults->getName()); ?>"/>
</td> </td>
</tr> </tr>
<tr><td bgcolor="#f8f8f8" colspan="2">&nbsp;</td></tr> <tr><td bgcolor="#f8f8f8" colspan="2">&nbsp;</td></tr>

View File

@ -16,6 +16,7 @@ class OC_Defaults {
private $defaultEntity; private $defaultEntity;
private $defaultName; private $defaultName;
private $defaultTitle;
private $defaultBaseUrl; private $defaultBaseUrl;
private $defaultSyncClientUrl; private $defaultSyncClientUrl;
private $defaultDocBaseUrl; private $defaultDocBaseUrl;
@ -25,8 +26,9 @@ class OC_Defaults {
function __construct() { function __construct() {
$l = OC_L10N::get('core'); $l = OC_L10N::get('core');
$this->defaultEntity = "ownCloud"; $this->defaultEntity = "ownCloud"; /* e.g. company name, used for footers and copyright notices */
$this->defaultName = "ownCloud"; $this->defaultName = "ownCloud"; /* short name, used when referring to the software */
$this->defaultTitle = "ownCloud"; /* can be a longer name, for titles */
$this->defaultBaseUrl = "http://owncloud.org"; $this->defaultBaseUrl = "http://owncloud.org";
$this->defaultSyncClientUrl = " http://owncloud.org/sync-clients/"; $this->defaultSyncClientUrl = " http://owncloud.org/sync-clients/";
$this->defaultDocBaseUrl = "http://doc.owncloud.org"; $this->defaultDocBaseUrl = "http://doc.owncloud.org";
@ -69,6 +71,14 @@ class OC_Defaults {
} }
} }
public function getTitle() {
if ($this->themeExist('getTitle')) {
return $this->theme->getTitle();
} else {
return $this->defaultTitle;
}
}
public function getName() { public function getName() {
if ($this->themeExist('getName')) { if ($this->themeExist('getName')) {
return $this->theme->getName(); return $this->theme->getName();