Setup fixed
authorMarcel Werk <burntime@woltlab.com>
Tue, 20 Sep 2011 13:20:19 +0000 (15:20 +0200)
committerMarcel Werk <burntime@woltlab.com>
Tue, 20 Sep 2011 13:20:19 +0000 (15:20 +0200)
wcfsetup/install/files/acp/templates/cronjobList.tpl
wcfsetup/install/files/lib/data/language/Language.class.php
wcfsetup/install/files/lib/system/WCFSetup.class.php
wcfsetup/install/files/lib/system/language/LanguageFactory.class.php
wcfsetup/install/files/options.inc.php

index 77bc7985bd82ccb844c693a20d0b1081a51f561b..a01e53012c46fbc7f1eeadfcc0abba9ac1253c7f 100644 (file)
                                                {/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&amp;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&amp;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>
index 76fe59a8d209d0129e355bbb2d9e4fa829b56c05..9873f7b2d80ed9f40d838eb7afb0e77b51e1d65a 100644 (file)
@@ -59,7 +59,7 @@ class Language extends DatabaseObject {
         * @return      string
         */
        public function getFixedLanguageCode() {
-               return LanguageFactory::getInstance()->fixLanguageCode($this->languageCode);
+               return LanguageFactory::fixLanguageCode($this->languageCode);
        }
                
        /**
index 0880c81eef4db27aed66824151dba44ad5a30e3d..91ef937ea4d9e6892d5e762d5dfb26f851790d80 100644 (file)
@@ -91,7 +91,7 @@ class WCFSetup extends WCF {
                        self::$selectedLanguageCode = $_REQUEST['languageCode'];
                }
                else {
-                       self::$selectedLanguageCode = LanguageFactory::getInstance()->getPreferredLanguage(self::$availableLanguages, self::$selectedLanguageCode);
+                       self::$selectedLanguageCode = LanguageFactory::getPreferredLanguage(self::$availableLanguages, self::$selectedLanguageCode);
                }
                
                if (isset($_POST['selectedLanguages']) && is_array($_POST['selectedLanguages'])) {
index 8be53f8c084029d91894951c434891c7e3ec4ccd..37a1d9fb2162ab3d479305e0799e02c73ab2e364 100644 (file)
@@ -112,7 +112,7 @@ class LanguageFactory extends SingletonFactory {
                $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) {
@@ -129,12 +129,12 @@ class LanguageFactory extends SingletonFactory {
         * @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;
@@ -205,13 +205,15 @@ class LanguageFactory extends SingletonFactory {
         * 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');
+               }
        }
        
        /**
@@ -241,7 +243,7 @@ class LanguageFactory extends SingletonFactory {
         * @param       string          $languageCode
         * @return      string          $languageCode
         */
-       public function fixLanguageCode($languageCode) {
+       public static function fixLanguageCode($languageCode) {
                return preg_replace('/-[a-z0-9]+/', '', $languageCode);
        }
        
index ef8957fd5beb3c76b411d637dcef55267f4523a4..c1aecf729781a5afa2c873a39a9fcbfde0fe3686 100644 (file)
@@ -19,6 +19,8 @@ define('BLACKLIST_USER_AGENTS', '');
 define('BLACKLIST_HOSTNAMES', '');
 
 define('SESSION_TIMEOUT', 3600);
+define('SESSION_VALIDATE_IP_ADDRESS', 0);
+define('SESSION_VALIDATE_USER_AGENT', 0);
 
 define('CACHE_SOURCE_TYPE', 'disk');
 define('ENABLE_SESSION_DATA_CACHE', 0);