XOOPS Cube Legacy base repository
リビジョン | 9d6ff8ea87cfcbe0bdc494e257429768d0fa132c (tree) |
---|---|
日時 | 2012-08-17 19:03:06 |
作者 | HIKAWA Kilica <kilica.hikawa@gmai...> |
コミッター | HIKAWA Kilica |
Merge pull request #25 from nao-pon/load_lang_trust
legacy: load trust side language file
@@ -150,16 +150,33 @@ class Legacy_LanguageManager extends XCube_LanguageManager | ||
150 | 150 | */ |
151 | 151 | function _loadLanguage($dirname, $fileBodyName) |
152 | 152 | { |
153 | - if (!$this->_loadFile(XOOPS_MODULE_PATH . '/' . $dirname . '/language/' . $this->mLanguageName . '/' . $fileBodyName . '.php')) { | |
154 | - $this->_loadFile(XOOPS_MODULE_PATH . '/' . $dirname . '/language/' . $this->getFallbackLanguage() . '/' . $fileBodyName . '.php'); | |
153 | + static $trust_dirnames = array(); | |
154 | + if (!isset($trust_dirnames[$dirname])) { | |
155 | + $trust_dirnames[$dirname] = Legacy_Utils::getTrustDirnameByDirname($dirname); | |
155 | 156 | } |
157 | + ( | |
158 | + $this->_loadFile(XOOPS_MODULE_PATH . '/' . $dirname . '/language/' . $this->mLanguageName . '/' . $fileBodyName . '.php') | |
159 | + || | |
160 | + $this->_loadFile(XOOPS_MODULE_PATH . '/' . $dirname . '/language/' . $this->getFallbackLanguage() . '/' . $fileBodyName . '.php') | |
161 | + || | |
162 | + ( | |
163 | + $trust_dirnames[$dirname] && | |
164 | + ( | |
165 | + $this->_loadFile(XOOPS_TRUST_PATH . '/modules/' . $trust_dirnames[$dirname] . '/language/' . $this->mLanguageName . '/' . $fileBodyName . '.php', $dirname) | |
166 | + || | |
167 | + $this->_loadFile(XOOPS_TRUST_PATH . '/modules/' . $trust_dirnames[$dirname] . '/language/' . $this->getFallbackLanguage() . '/' . $fileBodyName . '.php', $dirname) | |
168 | + ) | |
169 | + ) | |
170 | + ); | |
156 | 171 | } |
157 | 172 | |
158 | 173 | |
159 | 174 | /** |
160 | 175 | * @access protected |
176 | + * @param $filename A filename. | |
177 | + * @param $dirname A dirname of module. (for D3 module) | |
161 | 178 | */ |
162 | - function _loadFile($filename) | |
179 | + function _loadFile($filename, $mydirname = null) | |
163 | 180 | { |
164 | 181 | if (file_exists($filename)) { |
165 | 182 | require_once $filename; |