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


PHP Layout::getThemeDir方法代码示例

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


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

示例1: settings

 public static function settings()
 {
     $content = array();
     $form = new PHPWS_Form('user_settings');
     $form->addHidden('module', 'users');
     $form->addHidden('action', 'admin');
     $form->addHidden('command', 'update_settings');
     $form->addSubmit('submit', dgettext('users', 'Update Settings'));
     $form->addText('site_contact', PHPWS_User::getUserSetting('site_contact'));
     $form->setLabel('site_contact', dgettext('users', 'Site contact email'));
     $form->setSize('site_contact', 40);
     if (Current_User::isDeity()) {
         $signup_modes = array(0, AUTO_SIGNUP, CONFIRM_SIGNUP);
         $signup_labels = array(dgettext('users', 'Not allowed'), dgettext('users', 'Immediate'), dgettext('users', 'Email Verification'));
         $form->addRadio('user_signup', $signup_modes);
         $form->setLabel('user_signup', $signup_labels);
         $form->addTplTag('USER_SIGNUP_LABEL', dgettext('users', 'User Signup Mode'));
         $form->setMatch('user_signup', PHPWS_User::getUserSetting('new_user_method'));
         if (extension_loaded('gd')) {
             $form->addCheckbox('graphic_confirm');
             $form->setLabel('graphic_confirm', dgettext('users', 'New user CAPTCHA confirmation'));
             $form->setMatch('graphic_confirm', PHPWS_User::getUserSetting('graphic_confirm'));
         }
         $included_usermenu = PHPWS_File::readDirectory(PHPWS_SOURCE_DIR . 'mod/users/templates/usermenus/', FALSE, TRUE, FALSE, array('tpl'));
         $theme_usermenu = PHPWS_File::readDirectory(PHPWS_SOURCE_DIR . Layout::getThemeDir() . 'templates/users/usermenus/', FALSE, TRUE, FALSE, array('tpl'));
         if ($theme_usermenu) {
             $options = array_unique(array_merge($included_usermenu, $theme_usermenu));
         } else {
             $options = $included_usermenu;
         }
         $menu_options = array_combine($options, $options);
         // Replace below with a directory read
         $menu_options['none'] = dgettext('users', 'None');
         $menu_options['css.tpl'] = 'css.tpl';
         $menu_options['Default.tpl'] = 'Default.tpl';
         $menu_options['top.tpl'] = 'top.tpl';
         $form->addSelect('user_menu', $menu_options);
         $form->setMatch('user_menu', PHPWS_User::getUserSetting('user_menu'));
         $form->setLabel('user_menu', dgettext('users', 'User Menu'));
         $form->addCheckBox('show_login', 1);
         $form->setMatch('show_login', PHPWS_Settings::get('users', 'show_login'));
         $form->setLabel('show_login', dgettext('users', 'Show login box'));
         $form->addTplTag('AFFIRM', dgettext('users', 'Yes'));
         $form->addCheckBox('allow_remember', 1);
         $form->setMatch('allow_remember', PHPWS_Settings::get('users', 'allow_remember'));
         $form->setLabel('allow_remember', dgettext('users', 'Allow Remember Me'));
         $form->addRadioAssoc('allow_new_users', array(1 => 'Yes', 0 => 'No'));
         $form->setMatch('allow_new_users', PHPWS_Settings::get('users', 'allow_new_users'));
         $form->addTplTag('ALLOW_NEW_USERS_LABEL', dgettext('users', 'Allow new user creation?'));
     }
     $form->addTextArea('forbidden_usernames', PHPWS_Settings::get('users', 'forbidden_usernames'));
     $form->setLabel('forbidden_usernames', dgettext('users', 'Forbidden usernames (one per line)'));
     $form->addCheckbox('session_warning', 1);
     $form->setMatch('session_warning', PHPWS_Settings::get('users', 'session_warning'));
     $form->setlabel('session_warning', 'Show session warning');
     $template = $form->getTemplate();
     if (Current_User::isDeity()) {
         $vars['action'] = 'admin';
         $vars['command'] = 'check_permission_tables';
         $template['VERIFY_PERMISSIONS'] = PHPWS_Text::secureLink(dgettext('users', 'Register user permissions'), 'users', $vars);
         $template['VERIFY_EXPLAIN'] = dgettext('users', 'Users module will re-register each module\'s permissions.');
     }
     return PHPWS_Template::process($template, 'users', 'forms/settings.tpl');
 }
开发者ID:par-orillonsoft,项目名称:phpwebsite,代码行数:64,代码来源:User_Form.php

示例2: loadTheme

 /**
  * Inserts the content data into the current theme
  */
 public static function loadTheme($theme, $template)
 {
     $tpl = new PHPWS_Template();
     $tpl->setRoot(PHPWS_SOURCE_DIR);
     $themeDir = Layout::getThemeDir();
     if (PHPWS_Error::isError($themeDir)) {
         PHPWS_Error::log($themeDir);
         PHPWS_Core::errorPage();
     }
     $result = $tpl->setFile($themeDir . 'theme.tpl', TRUE);
     if (PHPWS_Error::isError($result)) {
         return $result;
     }
     if (!empty($GLOBALS['Layout_Collapse'])) {
         $template['COLLAPSE'] = 'id="layout-collapse"';
     }
     $template['THEME_DIRECTORY'] = Layout::getThemeDirRoot() . $theme . '/';
     $template['THEME_HTTP'] = Layout::getThemeHttpRoot() . $theme . '/';
     $template['SOURCE_THEME_HTTP'] = PHPWS_SOURCE_HTTP . 'themes/';
     $template['SOURCE_THEME_DIR'] = PHPWS_SOURCE_DIR . 'themes/';
     $tpl->setData($template);
     return $tpl;
 }
开发者ID:sysulsj,项目名称:phpwebsite,代码行数:26,代码来源:Layout.php

示例3: getTemplateList

 public function getTemplateList()
 {
     $included_result = PHPWS_File::listDirectories(PHPWS_Template::getTemplateDirectory('menu') . 'menu_layout/');
     $theme_result = PHPWS_File::listDirectories(PHPWS_SOURCE_DIR . Layout::getThemeDir() . 'templates/menu/menu_layout/');
     if (PHPWS_Error::logIfError($included_result) || PHPWS_Error::logIfError($theme_result)) {
         return null;
     }
     if ($theme_result) {
         $result = array_unique(array_merge($included_result, $theme_result));
     } else {
         $result = $included_result;
     }
     $result = array_combine($result, $result);
     if (empty($result)) {
         return null;
     }
     foreach ($result as $dir) {
         $directories[$dir] = $dir;
     }
     return $directories;
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:21,代码来源:Menu_Item.php


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