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


PHP Themes::getThemeList方法代码示例

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


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

示例1: create_display

 public static function create_display()
 {
     i18n::set('admin');
     if ($_POST['cc_form'] == 'create_page') {
         plugin('admin_create_post_pre_proccessing');
         $id = $_GET['id'];
         $title = filter('admin_create_post_title', self::get('title'));
         $content = filter('admin_create_post_content', self::get('content_area'));
         $last_modified = filter('admin_create_post_last_modified', time());
         $settings = filter('admin_create_post_settings', self::get('settings'));
         $weight = filter('admin_create_post_weight', self::get('weight'));
         $menutitle = filter('admin_create_post_menutitle', self::get('menutitle'));
         $parent_id = filter('admin_create_post_parent_id', self::get('parent_id'));
         $slug = filter('admin_create_post_slug', self::get('slug'));
         if (empty($menutitle) || empty($slug)) {
             $message = Message::error(__('blank-error'));
             plugin('admin_create_post_blank_error');
         } else {
             plugin('admin_create_post_post_proccessing');
             $values = array('title' => $title, 'content' => $content, 'settings' => unserialize($settings), 'weight' => $weight, 'menutitle' => $menutitle, 'parent_id' => $parent_id, 'slug' => $slug);
             $values = filter('admin_create_post_posted_values', $values);
             $values['settings'] = serialize($values['settings']);
             $res = Content::createNode($_GET['type'], $values);
             if ($res) {
                 $message = Message::success(sprintf(__('page-creation-successful') . ' (<a href="%s">%s</a>)', Admin::link('content'), __('view-all-pages')));
             } else {
                 $message = Message::error(__('page-creation-failed'));
             }
         }
         //Hooks::bind('post_edit_page', 'EditPage::handlePost');
     }
     $r = $message;
     $themeList = array_subkeys(Themes::getThemeList(), 'name');
     $themeList['-1'] = 'Default Theme';
     ksort($themeList);
     $form = new Form('self', 'post', 'create_page');
     $form->addHidden('settings', 'a:0:{}');
     $form->startFieldset(__('page-info'), array('id' => 'page_info_f'));
     $form->addInput(__('page-title'), 'text', 'title', self::get('title'), array('class' => 'large'));
     $form->addHidden('content_type', self::get('type'));
     $form->addSelectList(__('theme-override'), 'theme', $themeList);
     $form->addSelectList(__('parent'), 'parent_id', self::buildParentOptions(), true, $_POST['parent_id'] ? $_POST['parent_id'] : '0');
     $form->endFieldset();
     plugin('admin_create_custom_fields', array(&$form));
     $form->startFieldset(__('menu-settings'), array('id' => 'menu_settings_f'));
     $form->addInput(__('menu-title'), 'text', 'menutitle', self::get('menutitle'));
     $form->addInput(__('slug'), 'text', 'slug', self::get('slug'));
     $form->addInput(__('weight'), 'text', 'weight', $_POST['weight'] ? $_POST['weight'] : '0');
     $form->endFieldset();
     plugin('admin_create_custom_fields2', array(&$form));
     $form->startFieldset(__('content'));
     $content = self::get('content_area');
     $form->addEditor('<p></p>', 'content_area', empty($content) ? "<p></p>" : $content);
     $form->endFieldset();
     plugin('admin_create_custom_fields3', array(&$form));
     $form->addSubmit('', 'save', __('save'));
     i18n::restore();
     return array(__('admin', 'add-page'), $r . $form->endAndGetHTML());
 }
开发者ID:alecgorge,项目名称:TopHat,代码行数:59,代码来源:page.php

示例2: display

 public static function display()
 {
     $r = "";
     if ($_POST['cc_form'] == 'settings') {
         $name_lookup = array();
         Database::beginTransaction();
         foreach ($_POST as $key => $value) {
             if ($key == 'cc_form') {
                 continue;
             }
             if (substr($key, 0, 12) == 'cc_settings_') {
                 $name_lookup[substr($key, 12)] = explode('|', $value);
                 continue;
             }
             $setting_name = $key;
             //var_dump(array_key_exists($key, $name_lookup),$name_lookup);
             if (!array_key_exists($setting_name, $name_lookup)) {
                 continue;
             }
             if ($key == 'clean-urls') {
                 $value = (bool) $value;
             }
             Database::update('settings', array('data'), array(serialize($value)), array('package = ? AND name = ?', $name_lookup[$setting_name][1], $name_lookup[$setting_name][0]));
         }
         $r .= Message::success(__('admin', 'settings-saved'));
         Database::endTransaction();
     }
     $settings = Database::select('settings', '*', array('package = ? OR package = ? OR package = ? OR package = ?', 'core', 'admin', 'site', 'gui'), array('package', 'ASC', 'name', 'ASC'));
     $settings = $settings->fetchAll(PDO::FETCH_ASSOC);
     $rows = array();
     foreach ($settings as $row) {
         if (!array_key_exists($row['package'], $rows)) {
             $rows[$row['package']] = array();
         }
         $rows[$row['package']][] = $row;
     }
     ksort($rows);
     $form = new Form('self', 'POST', 'settings');
     foreach ($rows as $cat => $catRows) {
         $form->startFieldset(__('settings', $cat));
         foreach ($catRows as $row) {
             $data = unserialize($row['data']);
             $form->addHidden('cc_settings_' . UTF8::slugify($row['name']), $row['name'] . '|' . $row['package']);
             if ($row['name'] == 'clean urls') {
                 $form->addSelectList(__('settings', $row['name']), UTF8::slugify($row['name']), array(1 => __('admin', 'yes'), 0 => __('admin', 'no')), true, $data);
             } else {
                 if ($row['name'] == 'theme') {
                     $themes = Themes::getThemeList();
                     $options = array();
                     foreach ($themes as $slug => $ini) {
                         $options[$slug] = $ini['name'];
                     }
                     $form->addSelectList(__('settings', $row['name']), UTF8::slugify($row['name']), $options, true, $data);
                 } else {
                     if ($row['name'] == 'locale') {
                         $locales = i18n::getLocales();
                         $form->addSelectList(__('settings', $row['name']), UTF8::slugify($row['name']), $locales, false, $data);
                     } else {
                         if ($row['name'] == 'homepage id') {
                             $form->addSelectList(__('settings', $row['name']), UTF8::slugify($row['name']), Content::optionListArrayFromArray(Content::parseNavigation()), true, $data);
                         } else {
                             if ($row['name'] == 'site name') {
                                 $form->addInput(__('settings', $row['name']), 'text', UTF8::slugify($row['name']), $data);
                             } else {
                                 if ($row['name'] == 'editor') {
                                     $editors = Editors::getNamesOfRegistered();
                                     $form->addSelectList(__('settings', $row['name']), UTF8::slugify($row['name']), $editors, false, $data);
                                 } else {
                                     if ($row['name'] == 'homepage') {
                                         $form->addSelectList(__('settings', $row['name']), UTF8::slugify($row['name']), Admin::getAdminPageOptions(), true, $data);
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
         $form->endFieldset();
     }
     $form->startFieldset('');
     $form->addSubmit('', 'save-settings', __('admin', 'save'));
     $form->endFieldset();
     return array(__('admin', 'settings'), $r . $form->endAndGetHTML());
 }
开发者ID:alecgorge,项目名称:TopHat,代码行数:85,代码来源:settings.php


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