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


PHP Plugins::getInstance方法代码示例

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


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

示例1: plugin_installed

/**
 * plugin_installed 
 *
 * returns true if plugin is installed
 * 
 * @param string $plugin_name 
 * @access public
 * @return bool
 */
function plugin_installed($plugin_name)
{
    $Plugins = Plugins::getInstance();
    $plugins = $Plugins->plugins();
    if (in_array($plugins, $plugin_name)) {
        return true;
    }
    return false;
}
开发者ID:letsdodjango,项目名称:furasta-org,代码行数:18,代码来源:plugin.php

示例2: getUninstalled

 function getUninstalled()
 {
     $built = $temp = array();
     $_this =& Plugins::getInstance();
     $installed = $_this->getInstalled();
     foreach ($installed as $key => $val) {
         $temp[] = $val['name'];
     }
     $template_dir = dir($this->plugin_path);
     while ($entry = $template_dir->read()) {
         $tpldir = realpath($this->plugin_path . '/' . $entry);
         if (!in_array($entry, array('.', '..', '.svn')) && !in_array($entry, $temp) && is_dir($tpldir) && file_exists($tpldir . DS . $entry . ".php")) {
             $data = $this->getSkinData($tpldir . DS . $entry . ".php");
             extract($data);
             $built[] = array('entry' => $entry, 'name' => $Name, 'title' => $Name, 'version' => $Version, 'available' => 0, 'author' => $Author, 'description' => $Description);
         }
     }
     return $built;
 }
开发者ID:vuong93st,项目名称:w-game,代码行数:19,代码来源:plugin_controller.php

示例3: __construct

 /**
  * __construct 
  * 
  * Loads plugin overview items into the
  * $items array.
  *
  * @access protected
  * @return void
  */
 function __construct()
 {
     $Template = Template::getInstance();
     /**
      * enable default overview items 
      */
     $items = array(array('name' => $Template->e('overview_website_overview'), 'id' => 'website-overview', 'status' => 'open'), array('name' => $Template->e('overview_recently_edited'), 'id' => 'recently-edited', 'status' => 'open'), array('name' => $Template->e('overview_recently_trashed'), 'id' => 'recently-trashed', 'status' => 'open'), array('name' => $Template->e('overview_furasta_development_blog'), 'id' => 'furasta-devblog', 'status' => 'open'));
     /**
      * add plugin overview items
      */
     $Plugins = Plugins::getInstance();
     $items = array_merge($Plugins->adminOverviewItems(), $items);
     /**
      * make sure user has permission to view trash item
      */
     $User = User::getInstance();
     if (!$User->hasPerm('t')) {
         unset($items[3]);
     }
     $this->items = $items;
 }
开发者ID:letsdodjango,项目名称:furasta-org,代码行数:30,代码来源:OverviewItems.php

示例4: frontend_page_content

/**
 * frontend_page_content
 *
 * gets the page content for the frontend
 *
 * @params object $smarty
 * @params array $params
 * @return void
 */
function frontend_page_content($params, $smarty, $silent = false)
{
    $type = $smarty->getTemplateVars('page_type');
    // capture output to variable
    ob_start();
    if ($type == 'Normal') {
        echo $smarty->getTemplateVars('__page_content');
    } else {
        $page_id = $smarty->getTemplateVars('page_id');
        $Plugins = Plugins::getInstance();
        $Plugins->frontendPageType($type, $page_id);
    }
    $content = ob_get_contents();
    ob_end_clean();
    /**
     * parse the page content as a smarty template
     */
    $content = $smarty->fetch('eval:' . $content);
    if ($silent) {
        return $content;
    }
    echo $content;
}
开发者ID:letsdodjango,项目名称:furasta-org,代码行数:32,代码来源:frontend.php

示例5: __construct

 /**
  * __construct
  *
  * sets up the class, fetches content area
  * info from the db
  */
 public function __construct()
 {
     $registered = rows('select * from ' . DB_PREFIX . 'content_areas');
     $reg = array();
     /**
      * add registered content areas to $this->registered
      */
     if (!empty($registered)) {
         for ($i = 0; $i < count($registered); ++$i) {
             $name = $registered[$i]['name'];
             $reg[$name] = array();
             foreach ($registered[$i] as $area => $val) {
                 if ($area == 'data' || $area == 'content') {
                     $reg[$name][$area] = json_decode($val, true);
                     continue;
                 }
                 $reg[$name][$area] = $val;
             }
         }
     }
     $this->registered = $reg;
     /**
      * get all widgets from plugins
      */
     $widgets = array();
     $Plugins = Plugins::getInstance();
     foreach ($Plugins->plugins() as $plugin) {
         if (isset($plugin['admin']['content_area_widgets']) && isset($plugin['frontend']['content_area_widgets'])) {
             $admin = $plugin['admin']['content_area_widgets'];
             $frontend = $plugin['frontend']['content_area_widgets'];
             foreach ($admin as $widget) {
                 $widgets[$widget['name']]['admin'] = $widget['function'];
             }
             foreach ($frontend as $widget) {
                 $widgets[$widget['name']]['frontend'] = $widget['function'];
             }
         }
     }
     $this->widgets = $widgets;
 }
开发者ID:letsdodjango,项目名称:furasta-org,代码行数:46,代码来源:ContentAreas.php

示例6: array

<?php

/**
 * Permissions, Furasta.Org
 *
 * defines default permissions
 *
 * @author     Conor Mac Aoidh <conormacaoidh@gmail.com>
 * @license    http://furasta.org/licence.txt The BSD License
 * @version    1.0
 * @package    admin_users
 */
/**
 * normal permissions, default
 * then filter by plugins
 */
$perms = array('a' => 'Login To Admin Area', 'e' => 'Edit Pages', 'c' => 'Create Pages', 'd' => 'Delete Pages', 't' => 'Manage Trash', 'f' => 'Manage Files', 's' => 'Edit Settings', 'u' => 'Edit Users');
if (!isset($Plugins)) {
    $Plugins = Plugins::getInstance();
}
$perms = $Plugins->filter('admin', 'filter_group_permissions', $perms);
开发者ID:letsdodjango,项目名称:furasta-org,代码行数:21,代码来源:permissions.php

示例7: resolve_dependencies

/**
 * resolve_dependencies
 *
 * Takes an array of plugin data and adds
 * plugins to the list which are dependencies
 * of other plugins
 *
 * This function is run when the settings.php file
 * is rewritten and automatically adds dependencies
 * to the list of installed plugins
 *
 * @param array $plugins
 * @param array $NEWPLUGINS
 * @return array
 */
function resolve_dependencies($plugins, $NEWPLUGINS)
{
    global $PLUGINS;
    /**
     * build list of dependencies
     */
    $dependencies = array();
    $resolved = array();
    $Plugins = Plugins::getInstance();
    for ($i = 0; $i < count($plugins); ++$i) {
        if (is_array($plugins[$i]['dependencies'])) {
            array_merge($dependencies, $plugins[$i]['dependencies']);
            foreach ($plugins[$i]['dependencies'] as $dependency) {
                /**
                 * if dependency was already resolved, skip
                 */
                if (in_array($dependency, $dependencies)) {
                    continue;
                }
                /**
                 * if plugin is being removed and is still a dependency
                 * of another plugin, throw error
                 */
                if (isset($PLUGINS[$dependency]) && !isset($NEWPLUGINS[$dependency])) {
                    error('The "' . $dependency . '" plugin cannot be uninstall as it is a dependency' . 'of the "' . $plugins[$i]['name'] . '" plugin. To uninstall, remove' . 'the "' . $plugins[$i]['name'] . '" plugin first.', 'Plugin Dependency Error');
                }
                /**
                 * if plugin is unavailable then throw an error
                 */
                if (!plugin_exists($dependency)) {
                    error('The plugin "' . $plugins[$i]['name'] . '" requires the "' . $dependency . '"' . ' plugin to be installed, however it is not available. In order to use' . ' this plugin you will have to download and install the dependency', 'Plugin Dependency Unavailable');
                }
                $plugin = $Plugins->plugins($p_name);
                if (!$plugin) {
                    require HOME . '_plugins/' . $p_name . '/plugin.php';
                }
                /**
                 * add dependency to list of plugins
                 */
                $NEWPLUGINS[$dependency] = $plugin['version'];
            }
        }
        $NEWPLUGINS[$plugins[$i]['sys_name']] = $plugins[$i]['version'];
    }
    return $NEWPLUGINS;
}
开发者ID:letsdodjango,项目名称:furasta-org,代码行数:61,代码来源:system.php

示例8: logout

 /**
  * logout
  *
  * logs out the current user 
  * 
  * @access public
  * @return void
  */
 public static function logout()
 {
     // trigger onlogout event
     $Plugins = Plugins::getInstance();
     $Plugins->hook('general', 'on_logout');
     @session_start();
     session_destroy();
     self::destroyCookie();
 }
开发者ID:letsdodjango,项目名称:furasta-org,代码行数:17,代码来源:User.php

示例9: __construct

 /**
  * __construct
  * 
  * loads up the language files, filters them through
  * plugin language files
  * 
  * @access public
  */
 public function __construct()
 {
     // include language file
     require_once HOME . 'admin/lang/' . LANG . '.php';
     // filter through plugins
     $Plugins = Plugins::getInstance();
     $lang_errors = $Plugins->filter('admin', 'filter_lang_errors', $lang_errors);
     $lang = $Plugins->filter('admin', 'filter_lang', $lang);
     $this->lang = $lang;
     $this->lang_errors = $lang_errors;
 }
开发者ID:letsdodjango,项目名称:furasta-org,代码行数:19,代码来源:Template.php

示例10: apiMain

function apiMain()
{
    $script = basename($_SERVER["SCRIPT_NAME"]);
    ApiFw_::$SOLO = $script == API_ENTRY_PAGE || $script == 'index.php';
    // optional plugins
    if (file_exists('plugin/index.php')) {
        include_once 'plugin/index.php';
    }
    foreach (array_keys(Plugins::$map) as $plugin) {
        // init plugins
        Plugins::getInstance($plugin, true);
    }
    if (ApiFw_::$SOLO) {
        $api = new ApiApp();
        $api->exec();
    }
}
开发者ID:skyshore2001,项目名称:JDCloud,代码行数:17,代码来源:api_fw.php


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