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


PHP Theme::installedThemes方法代码示例

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


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

示例1: PageController

$controller = new PageController();
$controller->restrictAccess(Auth::isAdmin());
// Valid values for form variables
$ALL_EDIT_OPTIONS = array('none' => I18N::translate('Visitor'), 'access' => I18N::translate('Member'), 'edit' => I18N::translate('Editor'), 'accept' => I18N::translate('Moderator'), 'admin' => I18N::translate('Manager'));
// Form actions
switch (Filter::post('action')) {
    case 'save':
        if (Filter::checkCsrf()) {
            $user_id = Filter::postInteger('user_id');
            $user = User::find($user_id);
            $username = Filter::post('username');
            $real_name = Filter::post('real_name');
            $email = Filter::postEmail('email');
            $pass1 = Filter::post('pass1', WT_REGEX_PASSWORD);
            $pass2 = Filter::post('pass2', WT_REGEX_PASSWORD);
            $theme = Filter::post('theme', implode('|', array_keys(Theme::installedThemes())), '');
            $language = Filter::post('language');
            $timezone = Filter::post('timezone');
            $contact_method = Filter::post('contact_method');
            $comment = Filter::post('comment');
            $auto_accept = Filter::postBool('auto_accept');
            $canadmin = Filter::postBool('canadmin');
            $visible_online = Filter::postBool('visible_online');
            $verified = Filter::postBool('verified');
            $approved = Filter::postBool('approved');
            if ($user_id === 0) {
                // Create a new user
                if (User::findByIdentifier($username)) {
                    FlashMessages::addMessage(I18N::translate('Duplicate user name.  A user with that user name already exists.  Please choose another user name.'));
                } elseif (User::findByIdentifier($email)) {
                    FlashMessages::addMessage(I18N::translate('Duplicate email address.  A user with that email already exists.'));
开发者ID:bmhm,项目名称:webtrees,代码行数:31,代码来源:admin_users.php

示例2: menuThemes

 /**
  * Themes menu.
  *
  * @return Menu|null
  */
 public function menuThemes()
 {
     if ($this->tree && Site::getPreference('ALLOW_USER_THEMES') && $this->tree->getPreference('ALLOW_THEME_DROPDOWN')) {
         $submenus = array();
         foreach (Theme::installedThemes() as $theme) {
             $class = 'menu-theme-' . $theme->themeId() . ($theme === $this ? ' active' : '');
             $submenus[] = new Menu($theme->themeName(), '#', $class, array('onclick' => 'return false;', 'data-theme' => $theme->themeId()));
         }
         usort($submenus, function (Menu $x, Menu $y) {
             return I18N::strcasecmp($x->getLabel(), $y->getLabel());
         });
         $menu = new Menu(I18N::translate('Theme'), '#', 'menu-theme', array(), $submenus);
         return $menu;
     } else {
         return null;
     }
 }
开发者ID:tronsmit,项目名称:webtrees,代码行数:22,代码来源:AbstractTheme.php

示例3: foreach

} else {
    // Last theme used?
    $theme_id = Session::get('theme_id');
    // Default for tree
    if (!array_key_exists($theme_id, Theme::themeNames()) && $WT_TREE) {
        $theme_id = $WT_TREE->getPreference('THEME_DIR');
    }
    // Default for site
    if (!array_key_exists($theme_id, Theme::themeNames())) {
        $theme_id = Site::getPreference('THEME_DIR');
    }
    // Default
    if (!array_key_exists($theme_id, Theme::themeNames())) {
        $theme_id = 'webtrees';
    }
    foreach (Theme::installedThemes() as $theme) {
        if ($theme->themeId() === $theme_id) {
            Theme::theme($theme)->init($WT_TREE);
            // Remember this setting
            if (Site::getPreference('ALLOW_USER_THEMES')) {
                Session::put('theme_id', $theme_id);
            }
            break;
        }
    }
}
// Search engines are only allowed to see certain pages.
if (Auth::isSearchEngine() && !in_array(WT_SCRIPT_NAME, array('index.php', 'indilist.php', 'module.php', 'mediafirewall.php', 'individual.php', 'family.php', 'mediaviewer.php', 'note.php', 'repo.php', 'source.php'))) {
    http_response_code(403);
    $controller = new PageController();
    $controller->setPageTitle(I18N::translate('Search engine'));
开发者ID:tunandras,项目名称:webtrees,代码行数:31,代码来源:session.php


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