{/if}
{if $cronjob->canBeDisabled()}
- <img src="{@RELATIVE_WCF_DIR}icon/{if $cronjob->active}enabled{else}disabled{/if}1.svg" alt="" data-objectID="{@$cronjob->cronjobID}" data-disableMessage="{lang}wcf.acp.cronjob.disable{/lang}" data-enableMessage="{lang}wcf.acp.cronjob.enable{/lang}" title="{lang}wcf.acp.cronjob.{if $cronjob->active}disable{else}enable{/if}{/lang}" class="toggleButton balloonTooltip" />
+ <img src="{@RELATIVE_WCF_DIR}icon/{if $cronjob->active}enabled{else}disabled{/if}1.svg" alt="" data-objectID="{@$cronjob->cronjobID}" data-disableMessage="{lang}wcf.global.button.disable{/lang}" data-enableMessage="{lang}wcf.global.button.enable{/lang}" title="{lang}wcf.global.button.{if $cronjob->active}disable{else}enable{/if}{/lang}" class="toggleButton balloonTooltip" />
{else}
{if $cronjob->active}
- <img src="{@RELATIVE_WCF_DIR}icon/enabled1D.svg" alt="" title="{lang}wcf.acp.cronjob.disabled{/lang}" />
+ <img src="{@RELATIVE_WCF_DIR}icon/enabled1D.svg" alt="" title="{lang}wcf.global.button.disable{/lang}" />
{else}
- <img src="{@RELATIVE_WCF_DIR}icon/disabled1D.svg" alt="" title="{lang}wcf.acp.cronjob.enabled{/lang}" />
+ <img src="{@RELATIVE_WCF_DIR}icon/disabled1D.svg" alt="" title="{lang}wcf.global.button.enable{/lang}" />
{/if}
{/if}
{if $cronjob->isEditable()}
- <a href="index.php?form=CronjobEdit&cronjobID={@$cronjob->cronjobID}{@SID_ARG_2ND}"><img src="{@RELATIVE_WCF_DIR}icon/edit1.svg" alt="" title="{lang}wcf.acp.cronjob.edit{/lang}" class="balloonTooltip" /></a>
+ <a href="index.php?form=CronjobEdit&cronjobID={@$cronjob->cronjobID}{@SID_ARG_2ND}"><img src="{@RELATIVE_WCF_DIR}icon/edit1.svg" alt="" title="{lang}wcf.global.button.edit{/lang}" class="balloonTooltip" /></a>
{else}
- <img src="{@RELATIVE_WCF_DIR}icon/edit1D.svg" alt="" title="{lang}wcf.acp.cronjob.edit.disabled{/lang}" />
+ <img src="{@RELATIVE_WCF_DIR}icon/edit1D.svg" alt="" title="{lang}wcf.global.button.edit{/lang}" />
{/if}
{if $cronjob->isDeletable()}
- <img src="{@RELATIVE_WCF_DIR}icon/delete1.svg" alt="" data-objectID="{@$cronjob->cronjobID}" data-confirmMessage="{lang}wcf.acp.cronjob.delete.sure{/lang}" title="{lang}wcf.acp.cronjob.delete{/lang}" class="deleteButton balloonTooltip" />
+ <img src="{@RELATIVE_WCF_DIR}icon/delete1.svg" alt="" data-objectID="{@$cronjob->cronjobID}" data-confirmMessage="{lang}wcf.acp.cronjob.delete.sure{/lang}" title="{lang}wcf.global.button.delete{/lang}" class="deleteButton balloonTooltip" />
{else}
- <img src="{@RELATIVE_WCF_DIR}icon/delete1D.svg" alt="" title="{lang}wcf.acp.cronjob.delete.disabled{/lang}" />
+ <img src="{@RELATIVE_WCF_DIR}icon/delete1D.svg" alt="" title="{lang}wcf.global.button.delete{/lang}" />
{/if}
{if $additionalButtons[$cronjob->cronjobID]|isset}{@$additionalButtons[$cronjob->cronjobID]}{/if}
</td>
$defaultLanguageCode = $this->cache['languages'][$this->cache['default']]['languageCode'];
// get preferred language
- $languageCode = $this->getPreferredLanguage($availableLanguageCodes, $defaultLanguageCode);
+ $languageCode = self::getPreferredLanguage($availableLanguageCodes, $defaultLanguageCode);
// get language id of preferred language
foreach ($this->cache['languages'] as $key => $language) {
* @param string $defaultLanguageCode
* @return string
*/
- public function getPreferredLanguage($availableLanguageCodes, $defaultLanguageCode) {
+ public static function getPreferredLanguage($availableLanguageCodes, $defaultLanguageCode) {
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) && $_SERVER['HTTP_ACCEPT_LANGUAGE']) {
$acceptedLanguages = explode(',', str_replace('_', '-', strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE'])));
foreach ($acceptedLanguages as $acceptedLanguage) {
foreach ($availableLanguageCodes as $availableLanguageCode) {
- $fixedCode = strtolower($this->fixLanguageCode($availableLanguageCode));
+ $fixedCode = strtolower(self::fixLanguageCode($availableLanguageCode));
if ($fixedCode == $acceptedLanguage || $fixedCode == preg_replace('%^([a-z]{2}).*$%i', '$1', $acceptedLanguage)) {
return $availableLanguageCode;
* Loads the language cache.
*/
protected function loadCache() {
- CacheHandler::getInstance()->addResource(
- 'languages',
- WCF_DIR.'cache/cache.languages.php',
- 'wcf\system\cache\builder\LanguageCacheBuilder'
- );
-
- $this->cache = CacheHandler::getInstance()->get('languages');
+ if (defined('WCF_N')) {
+ CacheHandler::getInstance()->addResource(
+ 'languages',
+ WCF_DIR.'cache/cache.languages.php',
+ 'wcf\system\cache\builder\LanguageCacheBuilder'
+ );
+
+ $this->cache = CacheHandler::getInstance()->get('languages');
+ }
}
/**
* @param string $languageCode
* @return string $languageCode
*/
- public function fixLanguageCode($languageCode) {
+ public static function fixLanguageCode($languageCode) {
return preg_replace('/-[a-z0-9]+/', '', $languageCode);
}