本文整理汇总了PHP中theme::names方法的典型用法代码示例。如果您正苦于以下问题:PHP theme::names方法的具体用法?PHP theme::names怎么用?PHP theme::names使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类theme
的用法示例。
在下文中一共展示了theme::names方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: themename
/**
* Renders a HTML <select> list of installed admin-side themes.
*
* Can be altered by plugins via the 'prefs_ui > theme_name'
* pluggable UI callback event.
*
* @param string $name HTML name and id of the widget
* @param string $val Initial (or current) selected item
* @return string HTML
*/
function themename($name, $val)
{
$themes = theme::names();
foreach ($themes as $t) {
$theme = theme::factory($t);
if ($theme) {
$m = $theme->manifest();
$title = empty($m['title']) ? ucwords($theme->name) : $m['title'];
$vals[$t] = $title;
unset($theme);
}
}
asort($vals, SORT_STRING);
return pluggable_ui('prefs_ui', 'theme_name', selectInput($name, $vals, $val, '', '', $name));
}
示例2: getTxpLogin
function getTxpLogin()
{
$GLOBALS['textarray'] = setup_load_lang($_SESSION['lang']);
global $txpcfg;
echo n . '<div id="setup_container" class="txp-container">';
$problems = array();
if (!isset($txpcfg['db'])) {
if (!is_readable(txpath . '/config.php')) {
$problems[] = graf('<span class="error">' . setup_gTxt('config_php_not_found', array('{file}' => txpspecialchars(txpath . '/config.php')), 'raw') . '</span>');
} else {
@(include txpath . '/config.php');
}
}
if (!isset($txpcfg) || $txpcfg['db'] != $_SESSION['ddb'] || $txpcfg['table_prefix'] != $_SESSION['dprefix']) {
$problems[] = graf('<span class="error">' . setup_gTxt('config_php_does_not_match_input', 'raw') . '</span>');
echo txp_setup_progress_meter(2) . n . '<div class="txp-setup">' . n . join(n, $problems) . n . setup_config_contents() . n . '</div>' . n . '</div>';
exit;
}
// Default theme selector
$core_themes = array('classic', 'remora', 'hive');
$themes = theme::names();
foreach ($themes as $t) {
$theme = theme::factory($t);
if ($theme) {
$m = $theme->manifest();
$title = empty($m['title']) ? ucwords($theme->name) : $m['title'];
$vals[$t] = in_array($t, $core_themes) ? setup_gTxt('core_theme', array('{theme}' => $title)) : $title;
unset($theme);
}
}
asort($vals, SORT_STRING);
$theme_chooser = selectInput('theme', $vals, isset($_SESSION['theme']) ? txpspecialchars($_SESSION['theme']) : 'classic', '', '', '', 'setup_admin_theme');
echo txp_setup_progress_meter(3) . n . '<div class="txp-setup">';
echo '<form action="' . txpspecialchars($_SERVER['PHP_SELF']) . '" method="post">' . n . hed(setup_gTxt('creating_db_tables'), 2) . n . graf(setup_gTxt('about_to_create')) . n . graf('<span class="edit-label"><label for="setup_user_realname">' . setup_gTxt('your_full_name') . '</label></span>' . n . '<span class="edit-value">' . fInput('text', 'RealName', isset($_SESSION['realname']) ? txpspecialchars($_SESSION['realname']) : '', '', '', '', INPUT_REGULAR, '', 'setup_user_realname') . '</span>') . n . graf('<span class="edit-label"><label for="setup_user_login">' . setup_gTxt('setup_login') . '</label>' . sp . popHelp('setup_user_login') . '</span>' . n . '<span class="edit-value">' . fInput('text', 'name', isset($_SESSION['name']) ? txpspecialchars($_SESSION['name']) : '', '', '', '', INPUT_REGULAR, '', 'setup_user_login') . '</span>') . n . graf('<span class="edit-label"><label for="setup_user_pass">' . setup_gTxt('choose_password') . '</label>' . sp . popHelp('setup_user_pass') . '</span>' . n . '<span class="edit-value">' . fInput('text', 'pass', isset($_SESSION['pass']) ? txpspecialchars($_SESSION['pass']) : '', '', '', '', INPUT_REGULAR, '', 'setup_user_pass') . '</span>') . n . graf('<span class="edit-label"><label for="setup_user_email">' . setup_gTxt('your_email') . '</label></span>' . n . '<span class="edit-value">' . fInput('text', 'email', isset($_SESSION['email']) ? txpspecialchars($_SESSION['email']) : '', '', '', '', INPUT_REGULAR, '', 'setup_user_email') . '</span>') . n . hed(setup_gTxt('site_config'), 2) . n . graf('<span class="edit-label"><label for="setup_admin_theme">' . setup_gTxt('admin_theme') . '</label>' . sp . popHelp('theme_name') . '</span>' . n . '<span class="edit-value">' . $theme_chooser . '</span>') . n . graf(fInput('submit', 'Submit', setup_gTxt('next_step'), 'publish')) . n . sInput('createTxp') . n . '</form>' . n . '</div>' . n . '</div>';
}
示例3: themename
function themename($name, $val)
{
$themes = theme::names();
foreach ($themes as $t) {
$vals[$t] = ucwords($t);
}
return pluggable_ui('prefs_ui', 'theme_name', selectInput($name, $vals, $val, '', '', $name));
}