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


PHP Plugins::act_id方法代码示例

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


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

示例1: plugin_ui

	/**
	 * Produce the UI for a plugin based on the user's selected config option
	 * 
	 * @param string $configure The id of the configured plugin
	 * @param string $configuration The selected configuration option
	 **/	 	 	 	 	
	public static function plugin_ui( $configure, $configaction )
	{
		Plugins::act_id( 'plugin_ui_' . $configaction, $configure, $configure, $configaction );
		Plugins::act( 'plugin_ui_any_' . $configaction, $configure, $configaction );
		Plugins::act_id( 'plugin_ui', $configure, $configure, $configaction );
		Plugins::act( 'plugin_ui_any', $configure, $configaction );
	}
开发者ID:rynodivino,项目名称:system,代码行数:13,代码来源:plugins.php

示例2: create

	/**
	 * Returns a named Theme descendant.
	 * If no parameter is supplied, then
	 * load the active theme from the database.
	 *
	 * If no theme option is set, a fatal error is thrown
	 *
	 * @param name            ( optional ) override the default theme lookup
	 * @param template_engine ( optional ) specify a template engine
	 * @param theme_dir       ( optional ) specify a theme directory
	 **/
	public static function create( $name = null, $template_engine = null, $theme_dir = null )
	{
		// If the name is not supplied, load the active theme
		if(empty($name)) {
			$themedata = self::get_active();
			if ( empty( $themedata ) ) {
				die( _t( 'Theme not installed.' ) );
			}
		}
		// Otherwise, try to load the named theme from user themes that are present
		else {
			$themedata = self::get_by_name( $name );
		}
		// If a theme wasn't found by name, create a blank object
		if(!$themedata) {
			$themedata = array();
			$themedata['name'] = $name;
			$themedata['version'] = 0;
		}
		// If a specific template engine was supplied, use it
		if(!empty($template_engine)) {
			$themedata['template_engine'] = $template_engine;
		}
		// If a theme directory was supplied, use the directory that was supplied
		if(!empty($theme_dir)) {
			$themedata['theme_dir'] = $theme_dir;
		}

		// Set the default theme file
		$themefile = 'theme.php';
		if(isset($themedata->class['file']) && (string)$themedata->xml->class['file'] != '') {
			$themefile = (string)$themedata->xml->class['file'];
		}

		// Convert themedata to QueryRecord for legacy purposes
		// @todo: Potentially break themes by sending an array to the constructor instead of this QueryRecord
		$themedata = new QueryRecord($themedata);

		if ( file_exists( $themedata->theme_dir . $themefile ) ) {
			include_once( $themedata->theme_dir . $themefile );
		}

		if ( isset( $themedata->class ) ) {
			$classname = $themedata->class;
		}
		else {
			$classname = self::class_from_filename( $themedata->theme_dir . $themefile );
		}

		// the final fallback, for the admin "theme"
		if ( $classname == '' ) {
			$classname = 'Theme';
		}

		$created_theme = new $classname( $themedata );
		$created_theme->upgrade();
		Plugins::act_id( 'init_theme', $created_theme->plugin_id(), $created_theme );
		Plugins::act( 'init_theme_any', $created_theme );
		return $created_theme;

	}
开发者ID:rynodivino,项目名称:system,代码行数:72,代码来源:themes.php

示例3: upgrade

	/**
	 * Execute the upgrade action on any pluggable that has a version number change
	 * Update the version number of the pluggable in the database to what is installed
	 */
	public function upgrade()
	{
		if(DB::is_connected()) {
			$pluggable_class = get_class($this);
			$versions = Options::get( 'pluggable_versions' );
			if(isset($versions[$pluggable_class])) {
				$old_version = $versions[$pluggable_class];
				if($old_version != $this->get_version()) {
					Plugins::act_id('upgrade', $this->plugin_id(), $old_version);
					$versions[$pluggable_class] = $this->get_version();
					Options::set( 'pluggable_versions', $versions );
				}
			}
			else {
				$versions[$pluggable_class] = $this->get_version();
				Options::set( 'pluggable_versions', $versions );
			}
		}
	}
开发者ID:nerdfiles,项目名称:habari_boilerplate,代码行数:23,代码来源:pluggable.php

示例4: create

 /**
  * Returns a named Theme descendant.
  * If no parameter is supplied, then
  * load the active theme from the database.
  *
  * If no theme option is set, a fatal error is thrown
  *
  * @param name            ( optional ) override the default theme lookup
  * @param template_engine ( optional ) specify a template engine
  * @param theme_dir       ( optional ) specify a theme directory
  **/
 public static function create($name = null, $template_engine = null, $theme_dir = null)
 {
     static $bound = array();
     $hash = md5(serialize(array($name, $template_engine, $theme_dir)));
     if (isset($bound[$hash])) {
         return $bound[$hash];
     }
     // If the name is not supplied, load the active theme
     if (empty($name)) {
         $themedata = self::get_active();
         if (empty($themedata)) {
             die(_t('Theme not installed.'));
         }
     } else {
         $themedata = self::get_by_name($name);
     }
     // If a theme wasn't found by name, create a blank object
     if (!$themedata) {
         $themedata = array();
         $themedata['name'] = $name;
         $themedata['version'] = 0;
     }
     // If a specific template engine was supplied, use it
     if (!empty($template_engine)) {
         $themedata['template_engine'] = $template_engine;
     }
     // If a theme directory was supplied, use the directory that was supplied
     if (!empty($theme_dir)) {
         $themedata['theme_dir'] = $theme_dir;
     }
     // Set the default theme file
     $themefile = 'theme.php';
     if (isset($themedata['info']->class['file']) && (string) $themedata['info']->class['file'] != '') {
         $themefile = (string) $themedata->xml->class['file'];
     }
     // Convert themedata to QueryRecord for legacy purposes
     // @todo: Potentially break themes by sending an array to the constructor instead of this QueryRecord
     $themedata = new QueryRecord($themedata);
     // Deal with parent themes
     if (isset($themedata->parent)) {
         // @todo If the parent theme doesn't exist, provide a useful error
         $parent_data = self::get_by_name($themedata->parent);
         $parent_themefile = 'theme.php';
         if (isset($parent_data['info']->class['file']) && (string) $parent_data['info']->class['file'] != '') {
             $parent_themefile = (string) $parent_data['info']->class['file'];
         }
         include_once $parent_data['theme_dir'] . $parent_themefile;
         $themedata->parent_theme_dir = Utils::single_array($parent_data['theme_dir']);
         $themedata->theme_dir = array_merge(Utils::single_array($themedata->theme_dir), $themedata->parent_theme_dir);
     }
     $primary_theme_dir = $themedata->theme_dir;
     $primary_theme_dir = is_array($primary_theme_dir) ? reset($primary_theme_dir) : $primary_theme_dir;
     // Include the theme class file
     if (file_exists($primary_theme_dir . $themefile)) {
         include_once $primary_theme_dir . $themefile;
     }
     if (isset($themedata->class)) {
         $classname = $themedata->class;
     } else {
         $classname = self::class_from_filename($primary_theme_dir . $themefile);
     }
     // the final fallback, for the admin "theme"
     if ($classname == '') {
         $classname = 'Theme';
     }
     $created_theme = new $classname($themedata);
     $created_theme->upgrade();
     Plugins::act_id('init_theme', $created_theme->plugin_id(), $created_theme);
     Plugins::act('init_theme_any', $created_theme);
     $bound[$hash] = $created_theme;
     return $created_theme;
 }
开发者ID:wwxgitcat,项目名称:habari,代码行数:83,代码来源:themes.php

示例5: elseif

				<?php 
    }
    ?>
	</div>


	<div class="pluginhelp"<?php 
    if ($helpaction == '_help') {
        ?>
 class="active"<?php 
    }
    ?>
>
		<?php 
    if (Plugins::is_loaded((string) $plugin['info']->name)) {
        Plugins::act_id('plugin_ui', $plugin['plugin_id'], $plugin['plugin_id'], '_help');
    } elseif (isset($plugin['info']->help)) {
        foreach ($plugin['info']->help as $help) {
            if ((string) $help['name'] == '') {
                echo '<div class="help">' . $help->value . '</div>';
            }
        }
    }
    ?>
	</div>

	<?php 
    if (isset($this->engine_vars['configure']) && $configure == $plugin['plugin_id']) {
        ?>
	<div id="pluginconfigure">
		<?php 
开发者ID:ringmaster,项目名称:system,代码行数:31,代码来源:plugin.php

示例6: create

 /**
  * Returns a named Theme descendant.
  * If no parameter is supplied, then
  * load the active theme from the database.
  *
  * If no theme option is set, a fatal error is thrown
  *
  * @param name            ( optional ) override the default theme lookup
  * @param template_engine ( optional ) specify a template engine
  * @param theme_dir       ( optional ) specify a theme directory
  **/
 public static function create($name = '', $template_engine = '', $theme_dir = '')
 {
     if ($name != '') {
         /*
          * A theme name ( or more information ) was supplied.  This happens when we
          * want to use a pre-installed theme ( for instance, the
          * installer theme. )
          */
         if ($template_engine != '') {
             /* we load template engine from specified args, not DB */
             $themedata = new QueryRecord();
             $themedata->name = func_get_arg(0);
             $themedata->template_engine = $template_engine;
             $themedata->theme_dir = $themedata->name;
             $themedata->version = 0;
             if ($theme_dir != '') {
                 $themedata->theme_dir = $theme_dir;
             } else {
                 $themedata->theme_dir = HABARI_PATH . '/user/themes/' . $themedata->theme_dir . '/';
             }
         } else {
             /* lookup in DB for template engine info. */
             $themedata = self::get_by_name($name);
             if (empty($themedata)) {
                 die(_t('Theme not installed.'));
             }
             $themedata->theme_dir = HABARI_PATH . '/user/themes/' . $themedata->theme_dir . '/';
         }
     } else {
         // Grab the theme from the database
         $themedata = self::get_active();
         if (empty($themedata)) {
             die(_t('Theme not installed.'));
         }
     }
     // Set the default theme file
     $themefile = 'theme.php';
     if (isset($themedata->class['file']) && (string) $themedata->xml->class['file'] != '') {
         $themefile = (string) $themedata->xml->class['file'];
     }
     if (file_exists($themedata->theme_dir . $themefile)) {
         include_once $themedata->theme_dir . $themefile;
     }
     if (isset($themedata->class)) {
         $classname = $themedata->class;
     } else {
         $classname = self::class_from_filename($themedata->theme_dir . $themefile);
     }
     // the final fallback, for the admin "theme"
     if ($classname == '') {
         $classname = 'Theme';
     }
     $created_theme = new $classname($themedata);
     $created_theme->upgrade();
     Plugins::act_id('init_theme', $created_theme->plugin_id(), $created_theme);
     Plugins::act('init_theme_any', $created_theme);
     return $created_theme;
 }
开发者ID:ringmaster,项目名称:system,代码行数:69,代码来源:themes.php

示例7: upgrade

 /**
  * Execute the upgrade action on any pluggable that has a version number change
  * Update the version number of the pluggable in the database to what is installed
  */
 public function upgrade()
 {
     // This call to Options::get() is suppressed because if the database options table isn't created, it fails.
     if (DB::is_connected() && @Options::get('installed')) {
         $pluggable_class = get_class($this);
         $versions = Options::get('pluggable_versions');
         if (isset($versions[$pluggable_class])) {
             $old_version = $versions[$pluggable_class];
             if ($old_version != $this->get_version()) {
                 Plugins::act_id('upgrade', $this->plugin_id(), $old_version);
                 $versions[$pluggable_class] = $this->get_version();
                 Options::set('pluggable_versions', $versions);
             }
         } else {
             $versions[$pluggable_class] = $this->get_version();
             Options::set('pluggable_versions', $versions);
         }
     }
 }
开发者ID:habari,项目名称:system,代码行数:23,代码来源:pluggable.php


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