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


PHP Themes::get_all_data方法代码示例

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


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

示例1: get_themes

 /**
  * Handles GET requests for the theme listing
  */
 public function get_themes()
 {
     $all_themes = Themes::get_all_data();
     $available_updates = Options::get('updates_available', array());
     foreach ($all_themes as $name => $theme) {
         // only themes with a guid can be checked for updates
         if (isset($theme['info']->guid)) {
             if (isset($available_updates[(string) $theme['info']->guid])) {
                 // @todo this doesn't use the URL and is therefore worthless
                 $all_themes[$name]['info']->update = $available_updates[(string) $theme['info']->guid]['latest_version'];
             }
         }
     }
     $this->theme->all_themes = $all_themes;
     $this->theme->active_theme = Themes::get_active_data(true);
     $this->theme->active_theme_dir = $this->theme->active_theme['path'];
     // If the active theme is configurable, allow it to configure
     $this->theme->active_theme_name = $this->theme->active_theme['info']->name;
     $this->theme->configurable = Plugins::filter('theme_config', false, $this->active_theme);
     $this->theme->assign('configure', Controller::get_var('configure'));
     $activedata = Themes::get_active_data(true);
     $areas = array();
     if (isset($activedata['info']->areas->area)) {
         foreach ($activedata['info']->areas->area as $area) {
             $areas[] = (string) $area;
         }
     }
     $this->theme->areas = $areas;
     $this->theme->previewed = Themes::get_theme_dir(false);
     $this->theme->blocks = Plugins::filter('block_list', array());
     $this->theme->block_instances = DB::get_results('SELECT b.* FROM {blocks} b ORDER BY b.title ASC', array(), 'Block');
     $blocks_areas_t = DB::get_results('SELECT b.*, ba.scope_id, ba.area, ba.display_order FROM {blocks} b INNER JOIN {blocks_areas} ba ON ba.block_id = b.id ORDER BY ba.scope_id ASC, ba.area ASC, ba.display_order ASC', array());
     $blocks_areas = array();
     foreach ($blocks_areas_t as $block) {
         if (!isset($blocks_areas[$block->scope_id])) {
             $blocks_areas[$block->scope_id] = array();
         }
         $blocks_areas[$block->scope_id][$block->area][$block->display_order] = $block;
     }
     $this->theme->blocks_areas = $blocks_areas;
     $scopes = DB::get_results('SELECT * FROM {scopes} ORDER BY name ASC;');
     $scopes = Plugins::filter('get_scopes', $scopes);
     $this->theme->scopes = $scopes;
     $this->theme->scopeid = 0;
     $this->theme->theme_loader = Plugins::filter('theme_loader', '', $this->theme);
     $this->theme->display('themes');
 }
开发者ID:ringmaster,项目名称:system,代码行数:50,代码来源:adminthemeshandler.php

示例2: get_themes

 /**
  * Handles GET requests for the theme listing
  */
 public function get_themes()
 {
     $all_themes = Themes::get_all_data();
     $theme_names = Utils::array_map_field($all_themes, 'name');
     $available_updates = Options::get('updates_available', array());
     foreach ($all_themes as $name => $theme) {
         // only themes with a guid can be checked for updates
         if (isset($theme['info']->guid)) {
             if (isset($available_updates[(string) $theme['info']->guid])) {
                 // @todo this doesn't use the URL and is therefore worthless
                 $all_themes[$name]['info']->update = $available_updates[(string) $theme['info']->guid]['latest_version'];
             }
         }
         // If this theme requires a parent to be present and it's not, send an error
         if (isset($theme['info']->parent) && !in_array((string) $theme['info']->parent, $theme_names)) {
             $all_themes[$name]['req_parent'] = $theme['info']->parent;
         }
     }
     $this->theme->all_themes = $all_themes;
     $this->theme->active_theme = Themes::get_active_data(true);
     $this->theme->active_theme_dir = $this->theme->active_theme['path'];
     // If the active theme is configurable, allow it to configure
     $this->theme->active_theme_name = $this->theme->active_theme['info']->name;
     $this->theme->configurable = Plugins::filter('theme_config', false, $this->active_theme);
     $this->theme->assign('configure', Controller::get_var('configure'));
     $this->theme->areas = $this->get_areas(0);
     $this->theme->previewed = Themes::get_theme_dir(false);
     $this->theme->help = isset($this->theme->active_theme['info']->help) ? $this->theme->active_theme['info']->help : false;
     $this->theme->help_active = Controller::get_var('help') == $this->theme->active_theme['dir'];
     $this->prepare_block_list();
     $blocks_areas_t = DB::get_results('SELECT b.*, ba.scope_id, ba.area, ba.display_order FROM {blocks} b INNER JOIN {blocks_areas} ba ON ba.block_id = b.id ORDER BY ba.scope_id ASC, ba.area ASC, ba.display_order ASC', array());
     $blocks_areas = array();
     foreach ($blocks_areas_t as $block) {
         if (!isset($blocks_areas[$block->scope_id])) {
             $blocks_areas[$block->scope_id] = array();
         }
         $blocks_areas[$block->scope_id][$block->area][$block->display_order] = $block;
     }
     $this->theme->blocks_areas = $blocks_areas;
     $scopes = DB::get_results('SELECT * FROM {scopes} ORDER BY name ASC;');
     $scopes = Plugins::filter('get_scopes', $scopes);
     $this->theme->scopes = $scopes;
     $this->theme->scopeid = 0;
     $this->theme->theme_loader = Plugins::filter('theme_loader', '', $this->theme);
     $this->theme->display('themes');
 }
开发者ID:wwxgitcat,项目名称:habari,代码行数:49,代码来源:adminthemeshandler.php

示例3: get_active_data

	/**
	 * Returns theme information for the active theme -- dir, path, theme.xml, screenshot url
	 * @params boolean $nopreview If true, return the real active theme, not the preview
	 * @return array An array of Theme data
	 */
	public static function get_active_data( $nopreview = false )
	{
		$all_data = Themes::get_all_data();
		$active_theme_dir = basename( Themes::get_active_theme_dir( $nopreview ) );
		$active_data = $all_data[$active_theme_dir];
		return $active_data;
	}
开发者ID:rynodivino,项目名称:system,代码行数:12,代码来源:themes.php

示例4: action_plugin_ui

 /**
  * Handle calls from FormUI actions.
  * Show the form to manage the plugin's options.
  *
  * @param string $plugin_id A unique plugin ID, it needs to match ours.
  * @param string $action The menu item the user clicked.
  */
 public function action_plugin_ui($plugin_id, $action)
 {
     if ($plugin_id == $this->plugin_id) {
         switch ($action) {
             case 'Configure':
                 $themes = array_keys(Themes::get_all_data());
                 $themes = array_combine($themes, $themes);
                 $ui = new FormUI('themeswitcher');
                 $ts_s = $ui->append('select', 'selected_themes', 'themeswitcher__selected_themes', 'Select themes to offer:');
                 $ts_s->multiple = true;
                 $ts_s->options = $themes;
                 $ts_y = $ui->append('select', 'show', 'themeswitcher__show', _t('If not showing with $theme->switcher() always show in footer: '));
                 $ts_y->options = array('0' => _t('No'), '1' => _t('Yes'));
                 $ui->append('submit', 'save', 'Save');
                 $ui->out();
                 break;
         }
     }
 }
开发者ID:habari-extras,项目名称:themeswitcher,代码行数:26,代码来源:themeswitcher.plugin.php

示例5: get_themes

 /**
  * Handles GET requests for the theme listing
  */
 public function get_themes()
 {
     $all_themes = Themes::get_all_data();
     foreach ($all_themes as $name => $theme) {
         if (isset($all_themes[$name]['info']->update) && $all_themes[$name]['info']->update != '' && isset($all_themes[$name]['info']->version) && $all_themes[$name]['info']->version != '') {
             Update::add($name, $all_themes[$name]['info']->update, $all_themes[$name]['info']->version);
         }
     }
     $updates = Update::check();
     foreach ($all_themes as $name => $theme) {
         if (isset($all_themes[$name]['info']->update) && isset($updates[$all_themes[$name]['info']->update])) {
             $all_themes[$name]['info']->update = $updates[$all_themes[$name]['info']->update]['latest_version'];
         } else {
             $all_themes[$name]['info']->update = '';
         }
     }
     $this->theme->all_themes = $all_themes;
     $this->theme->active_theme = Themes::get_active_data(true);
     $this->theme->active_theme_dir = $this->theme->active_theme['path'];
     // If the active theme is configurable, allow it to configure
     $this->theme->active_theme_name = $this->theme->active_theme['info']->name;
     $this->theme->configurable = Plugins::filter('theme_config', false, $this->active_theme);
     $this->theme->assign('configure', Controller::get_var('configure'));
     $activedata = Themes::get_active_data(true);
     $areas = array();
     if (isset($activedata['info']->areas->area)) {
         foreach ($activedata['info']->areas->area as $area) {
             $areas[] = (string) $area;
         }
     }
     $this->theme->areas = $areas;
     $this->theme->previewed = Themes::get_theme_dir(false);
     $this->theme->blocks = Plugins::filter('block_list', array());
     $this->theme->block_instances = DB::get_results('SELECT b.* FROM {blocks} b ORDER BY b.title ASC', array(), 'Block');
     $blocks_areas_t = DB::get_results('SELECT b.*, ba.scope_id, ba.area, ba.display_order FROM {blocks} b INNER JOIN {blocks_areas} ba ON ba.block_id = b.id ORDER BY ba.scope_id ASC, ba.area ASC, ba.display_order ASC', array());
     $blocks_areas = array();
     foreach ($blocks_areas_t as $block) {
         if (!isset($blocks_areas[$block->scope_id])) {
             $blocks_areas[$block->scope_id] = array();
         }
         $blocks_areas[$block->scope_id][$block->area][$block->display_order] = $block;
     }
     $this->theme->blocks_areas = $blocks_areas;
     $this->theme->scopes = DB::get_results('SELECT * FROM {scopes} ORDER BY id ASC;');
     $this->theme->theme_loader = Plugins::filter('theme_loader', '', $this->theme);
     $this->theme->display('themes');
 }
开发者ID:psaintlaurent,项目名称:Habari,代码行数:50,代码来源:adminhandler.php

示例6: validate_theme

 /**
  * Ensure that a theme meets requirements for activation/preview
  * @static
  * @param string $theme_dir the directory of the theme
  * @return bool True if the theme meets all requirements
  */
 public static function validate_theme($theme_dir)
 {
     $all_themes = Themes::get_all_data();
     // @todo Make this a closure in php 5.3
     $theme_names = Utils::array_map_field($all_themes, 'name');
     $theme_data = $all_themes[$theme_dir];
     $ok = true;
     if (isset($theme_data['info']->parent) && !in_array((string) $theme_data['info']->parent, $theme_names)) {
         Session::error(_t('This theme requires the parent theme named "%s" to be present prior to activation.', array($theme_data['info']->parent)));
         $ok = false;
     }
     if (isset($theme_data['info']->requires)) {
         $provided = Plugins::provided();
         foreach ($theme_data['info']->requires->feature as $requirement) {
             if (!isset($provided[(string) $requirement])) {
                 Session::error(_t('This theme requires the feature "<a href="%2$s">%1$s</a>" to be present prior to activation.', array((string) $requirement, $requirement['url'])));
                 $ok = false;
             }
         }
     }
     return $ok;
 }
开发者ID:wwxgitcat,项目名称:habari,代码行数:28,代码来源:themes.php

示例7: activate_theme

 public function activate_theme()
 {
     $theme_dir = $this->handler_vars['theme_dir'];
     if (!isset($theme_dir) || empty($theme_dir)) {
         return;
     }
     // set the user_id in the session in case theme activation methods need it
     if (!($u = User::get_by_name($this->handler_vars['admin_username']))) {
         // @todo die gracefully
         die(_t('No admin user found'));
     }
     $u->remember();
     $themes = Themes::get_all_data();
     $theme = $themes[$theme_dir];
     Themes::activate_theme((string) $theme['info']->name, $theme_dir);
     // unset the user_id session variable
     Session::clear_userid($_SESSION['user_id']);
     unset($_SESSION['user_id']);
 }
开发者ID:habari,项目名称:system,代码行数:19,代码来源:installhandler.php

示例8: get_themes

 /**
  * Handles GET requests for the theme listing
  */
 public function get_themes()
 {
     $all_themes = Themes::get_all_data();
     foreach ($all_themes as $name => $theme) {
         if (isset($all_themes[$name]['info']->update) && $all_themes[$name]['info']->update != '' && isset($all_themes[$name]['info']->version) && $all_themes[$name]['info']->version != '') {
             Update::add($name, $all_themes[$name]['info']->update, $all_themes[$name]['info']->version);
         }
     }
     $updates = Update::check();
     foreach ($all_themes as $name => $theme) {
         if (isset($all_themes[$name]['info']->update) && isset($updates[$all_themes[$name]['info']->update])) {
             $all_themes[$name]['info']->update = $updates[$all_themes[$name]['info']->update]['latest_version'];
         } else {
             $all_themes[$name]['info']->update = '';
         }
     }
     $this->theme->all_themes = $all_themes;
     $this->theme->active_theme = Themes::get_active_data();
     $this->theme->active_theme_dir = $this->theme->active_theme['path'];
     // If the active theme is configurable, allow it to configure
     $this->theme->active_theme_name = $this->theme->active_theme['info']->name;
     $this->theme->configurable = Plugins::filter('theme_config', false, $this->active_theme);
     $this->theme->assign('configure', Controller::get_var('configure'));
     $this->theme->display('themes');
 }
开发者ID:anupom,项目名称:my-blog,代码行数:28,代码来源:adminhandler.php

示例9: get_active_data

 /**
  * Returns theme information for the active theme -- dir, path, theme.xml, screenshot url
  * @return array An array of Theme data
  */
 public static function get_active_data()
 {
     $all_data = Themes::get_all_data();
     $active_theme_dir = basename(Themes::get_active_theme_dir());
     $active_data = $all_data[$active_theme_dir];
     return $active_data;
 }
开发者ID:anupom,项目名称:my-blog,代码行数:11,代码来源:themes.php

示例10:

<?php

$active_theme = Options::get('theme_dir');
$all_themes = Themes::get_all_data();
$selected_themes = Options::get('themeswitcher__selected_themes');
?>
	<div class="sb-switcher">
		<h2>Theme Switcher</h2>
		<form action="" method="post" name="themeswitcher">
			<select name="theme_dir" onChange="this.form.submit()">
				<?php 
foreach ($selected_themes as $selected_theme) {
    $theme = $all_themes[$selected_theme];
    ?>
					<option value="<?php 
    echo $theme['dir'];
    ?>
"<?php 
    echo $theme['dir'] == $active_theme ? 'selected' : '';
    ?>
><?php 
    echo $theme['info']->name;
    ?>
 <?php 
    echo $theme['info']->version;
    ?>
</option>
				<?php 
}
?>
			</select>
开发者ID:habari-extras,项目名称:themeswitcher,代码行数:31,代码来源:themeswitcher.php


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