当前位置: 首页>>代码示例>>PHP>>正文


PHP theme::factory方法代码示例

本文整理汇总了PHP中theme::factory方法的典型用法代码示例。如果您正苦于以下问题:PHP theme::factory方法的具体用法?PHP theme::factory怎么用?PHP theme::factory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在theme的用法示例。


在下文中一共展示了theme::factory方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: based_on

 function based_on($name)
 {
     global $production_status;
     $theme = theme::factory($name);
     if (!$theme) {
         set_pref('theme_name', 'classic');
         if ($production_status === 'debug') {
             echo gTxt('cannot_instantiate_theme', array('{name}' => $name, '{class}' => "{$name}_theme", '{path}' => theme::path($name)));
         }
         return false;
     }
     return true;
 }
开发者ID:psic,项目名称:websites,代码行数:13,代码来源:txplib_theme.php

示例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>';
}
开发者ID:balcides,项目名称:Cathartic_server,代码行数:35,代码来源:index.php

示例3: themename

/**
 * Renders a HTML &lt;select&gt; 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));
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:25,代码来源:txp_prefs.php


注:本文中的theme::factory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。