/** * Получает текстовку по её имени * * @param string $sName * @param array $aReplace * @param bool $bDelete Удалять или нет параметры, которые не были заменены * @return string */ public function Get($sName, $aReplace = array(), $bDelete = true) { if (is_string($aReplace) and strpos($aReplace, '=>')) { list($sKey, $sVal) = explode('=>', $aReplace); $aReplace = array($sKey => $sVal); } $sResult = parent::Get($sName, $aReplace, $bDelete); if ($sResult == 'NOT_FOUND_LANG_TEXT') { if (isset($this->aLangMsg[$sName])) { return $this->aLangMsg[$sName]; } elseif (isset($this->aLangMsg['plugin']) and is_array($this->aLangMsg['plugin'])) { foreach ($this->aLangMsg['plugin'] as $sPluginName => $aPluginMessages) { if (isset($aPluginMessages[$sName])) { return $this->_subst($aPluginMessages[$sName], $aReplace, $bDelete); } } } if (strpos($sName, '_')) { list($sPlugin, $sKey) = explode('_', $sName, 2); if (isset($this->aLangMsg['plugin'][$sPlugin][$sKey])) { return $this->_subst($this->aLangMsg['plugin'][$sPlugin][$sKey], $aReplace, $bDelete); } } $sResult = strtoupper($sName); } return $sResult; }
/** * Получает текстовку по её имени * * @param unknown_type $sName */ public function Get($sName, $aReplace = array()) { if (isset($this->aLangMsg[$sName])) { return parent::Get($sName, $aReplace); } return strtoupper($sName); }