st
includes/install.inc, строка 582
- Версии
- 5 – 6
st($string, $args = array())
Жёстко запрограммированная функция, являющаяся эквивалентом функции theme('placeholder')
, когда система темизации не доступна.
Код
<?php
function st($string, $args = array()) {
static $locale_strings = NULL;
global $profile, $install_locale;
if (!isset($locale_strings)) {
$locale_strings = array();
$filename = './profiles/' . $profile . '/' . $install_locale . '.po';
if (file_exists($filename)) {
require_once './includes/locale.inc';
$file = (object) array('filepath' => $filename);
_locale_import_read_po('mem-store', $file);
$locale_strings = _locale_import_one_string('mem-report');
}
}
require_once './includes/theme.inc';
$GLOBALS['theme'] = 'theme';
// Transform arguments before inserting them
foreach ($args as $key => $value) {
switch ($key[0]) {
// Escaped only
case '@':
$args[$key] = check_plain($value);
break;
// Escaped and placeholder
case '%':
default:
$args[$key] = '<em>'. check_plain($value) .'</em>';
break;
// Pass-through
case '!':
}
}
return strtr((!empty($locale_strings[$string]) ? $locale_strings[$string] : $string), $args);
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии