Cmscout1.00rc2 > Includes / Internals / Core.load Plugins.php

Questions? Need Help? Want to share? » PHP Forum
Script Name:
Cmscout1.00rc2

Download:
cmscout1.00rc2.zip

Category:
Content Management

Archive Content:

Content:

Admin

Content:

Avatars

Cache

Calendar

Calendar > Lang

Content:

Docs

Content:

Downloads

Content:

Forums

Content:

Images

Includes

Includes > Internals

Includes > Plugins

Includes

Content:

Install

Install > Templates C

Install

Content:

Photos

Pm

Content:

Sidebox

Content:

Templates > Admin

Templates > Admin > Images

Templates > Admin

Templates > CMScout

Templates > CMScout > Images

Templates > CMScout

Templates

Templates C

Content:

Tiny Mce

Tiny Mce > Langs

Tiny Mce > Plugins > Advhr

Tiny Mce > Plugins > Advhr > Images

Tiny Mce > Plugins > Advhr > Jscripts

Tiny Mce > Plugins > Advhr > Langs

Tiny Mce > Plugins > Advhr

Tiny Mce > Plugins > Advimage > Css

Tiny Mce > Plugins > Advimage

Tiny Mce > Plugins > Advimage > Images

Tiny Mce > Plugins > Advimage > Jscripts

Tiny Mce > Plugins > Advimage > Langs

Tiny Mce > Plugins > Advlink > Css

Tiny Mce > Plugins > Advlink

Tiny Mce > Plugins > Advlink > Jscripts

Tiny Mce > Plugins > Advlink > Langs

Tiny Mce > Plugins > Advlink

Tiny Mce > Plugins > Autosave

Tiny Mce > Plugins > Autosave > Langs

Tiny Mce > Plugins > Contextmenu > Css

Tiny Mce > Plugins > Contextmenu

Tiny Mce > Plugins > Contextmenu > Images

Tiny Mce > Plugins > Directionality

Tiny Mce > Plugins > Directionality > Images

Tiny Mce > Plugins > Directionality > Langs

Tiny Mce > Plugins > Emotions

Tiny Mce > Plugins > Emotions > Images

Tiny Mce > Plugins > Emotions > Jscripts

Tiny Mce > Plugins > Emotions > Langs

Tiny Mce > Plugins > Fullscreen

Tiny Mce > Plugins > Fullscreen > Images

Tiny Mce > Plugins > Fullscreen > Langs

Tiny Mce > Plugins > Ibrowser > Config

Tiny Mce > Plugins > Ibrowser > Css

Tiny Mce > Plugins > Ibrowser

Tiny Mce > Plugins > Ibrowser > Images

Tiny Mce > Plugins > Ibrowser

Tiny Mce > Plugins > Ibrowser > Interface

Tiny Mce > Plugins > Ibrowser > Interface > Images > TinyMCE

Tiny Mce > Plugins > Ibrowser > Interface

Tiny Mce > Plugins > Ibrowser > Langs

Tiny Mce > Plugins > Ibrowser > Scripts

Tiny Mce > Plugins > Ibrowser > Scripts > PhpThumb > Cache

Tiny Mce > Plugins > Ibrowser > Scripts > PhpThumb > Cache > Source

Tiny Mce > Plugins > Ibrowser > Scripts > PhpThumb > Demo

Tiny Mce > Plugins > Ibrowser > Scripts > PhpThumb > Docs

Tiny Mce > Plugins > Ibrowser > Scripts > PhpThumb > Fonts

Tiny Mce > Plugins > Ibrowser > Scripts > PhpThumb

Tiny Mce > Plugins > Ibrowser > Scripts

Tiny Mce > Plugins > Ibrowser > Temp

Tiny Mce > Plugins

Tiny Mce > Plugins > Inlinepopups > Css

Tiny Mce > Plugins > Inlinepopups

Tiny Mce > Plugins > Inlinepopups > Images

Tiny Mce > Plugins > Inlinepopups > Jscripts

Tiny Mce > Plugins > Insertdatetime

Tiny Mce > Plugins > Insertdatetime > Images

Tiny Mce > Plugins > Insertdatetime > Langs

Tiny Mce > Plugins > Paste

Tiny Mce > Plugins > Paste > Css

Tiny Mce > Plugins > Paste

Tiny Mce > Plugins > Paste > Images

Tiny Mce > Plugins > Paste > Jscripts

Tiny Mce > Plugins > Paste > Langs

Tiny Mce > Plugins > Paste

Tiny Mce > Plugins > Preview

Tiny Mce > Plugins > Preview > Images

Tiny Mce > Plugins > Preview > Langs

Tiny Mce > Plugins > Print

Tiny Mce > Plugins > Print > Images

Tiny Mce > Plugins > Print > Langs

Tiny Mce > Plugins > Searchreplace

Tiny Mce > Plugins > Searchreplace > Images

Tiny Mce > Plugins > Searchreplace > Jscripts

Tiny Mce > Plugins > Searchreplace > Langs

Tiny Mce > Plugins > Searchreplace

Tiny Mce > Plugins > Table

Tiny Mce > Plugins > Table > Css

Tiny Mce > Plugins > Table

Tiny Mce > Plugins > Table > Images

Tiny Mce > Plugins > Table > Jscripts

Tiny Mce > Plugins > Table > Langs

Tiny Mce > Plugins > Table

Tiny Mce > Themes > Advanced

Tiny Mce > Themes > Advanced > Css

Tiny Mce > Themes > Advanced > Docs > En

Tiny Mce > Themes > Advanced > Docs > En > Images

Tiny Mce > Themes > Advanced > Docs > En

Tiny Mce > Themes > Advanced > Docs > Images

Tiny Mce > Themes > Advanced

Tiny Mce > Themes > Advanced > Images

Tiny Mce > Themes > Advanced > Images > Xp

Tiny Mce > Themes > Advanced > Jscripts

Tiny Mce > Themes > Advanced > Langs

Tiny Mce > Themes > Advanced

Tiny Mce

Tiny Mce > Utils

Content:

Core.load Plugins.php:


<?php
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */

/**
 * Load requested plugins
 *
 * @param array $plugins
 */

// $plugins

function smarty_core_load_plugins($params,  &$smarty)
{

    foreach (
$params['plugins'] as $_plugin_info) {
        list(
$_type,  $_name,  $_tpl_file,  $_tpl_line,  $_delayed_loading) = $_plugin_info;
        
$_plugin = &$smarty->_plugins[$_type][$_name];

        
/*
         * We do not load plugin more than once for each instance of Smarty.
         * The following code checks for that. The plugin can also be
         * registered dynamically at runtime,  in which case template file
         * and line number will be unknown,  so we fill them in.
         *
         * The final element of the info array is a flag that indicates
         * whether the dynamically registered plugin function has been
         * checked for existence yet or not.
         */
        
if (isset($_plugin)) {
            if (empty(
$_plugin[3])) {
                if (!
is_callable($_plugin[0])) {
                    
$smarty->_trigger_fatal_error("[plugin] $_type '$_name' is not implemented",  $_tpl_file,  $_tpl_line,  __FILE__,  __LINE__);
                } else {
                    
$_plugin[1] = $_tpl_file;
                    
$_plugin[2] = $_tpl_line;
                    
$_plugin[3] = true;
                    if (!isset(
$_plugin[4])) $_plugin[4] = true/* cacheable */
                
}
            }
            continue;
        } else if (
$_type == 'insert') {
            
/*
             * For backwards compatibility,  we check for insert functions in
             * the symbol table before trying to load them as a plugin.
             */
            
$_plugin_func 'insert_' $_name;
            if (
function_exists($_plugin_func)) {
                
$_plugin = array($_plugin_func,  $_tpl_file,  $_tpl_line,  true,  false);
                continue;
            }
        }

        
$_plugin_file $smarty->_get_plugin_filepath($_type,  $_name);

        if (! 
$_found = ($_plugin_file != false)) {
            
$_message "could not load plugin file '$_type.$_name.php'\n";
        }

        
/*
         * If plugin file is found,  it -must- provide the properly named
         * plugin function. In case it doesn't,  simply output the error and
         * do not fall back on any other method.
         */
        
if ($_found) {
            include_once 
$_plugin_file;

            
$_plugin_func 'smarty_' $_type '_' $_name;
            if (!
function_exists($_plugin_func)) {
                
$smarty->_trigger_fatal_error("[plugin] function $_plugin_func() not found in $_plugin_file",  $_tpl_file,  $_tpl_line,  __FILE__,  __LINE__);
                continue;
            }
        }
        
/*
         * In case of insert plugins,  their code may be loaded later via
         * 'script' attribute.
         */
        
else if ($_type == 'insert' && $_delayed_loading) {
            
$_plugin_func 'smarty_' $_type '_' $_name;
            
$_found true;
        }

        
/*
         * Plugin specific processing and error checking.
         */
        
if (!$_found) {
            if (
$_type == 'modifier') {
                
/*
                 * In case modifier falls back on using PHP functions
                 * directly,  we only allow those specified in the security
                 * context.
                 */
                
if ($smarty->security && !in_array($_name,  $smarty->security_settings['MODIFIER_FUNCS'])) {
                    
$_message "(secure mode) modifier '$_name' is not allowed";
                } else {
                    if (!
function_exists($_name)) {
                        
$_message "modifier '$_name' is not implemented";
                    } else {
                        
$_plugin_func $_name;
                        
$_found true;
                    }
                }
            } else if (
$_type == 'function') {
                
/*
                 * This is a catch-all situation.
                 */
                
$_message "unknown tag - '$_name'";
            }
        }

        if (
$_found) {
            
$smarty->_plugins[$_type][$_name] = array($_plugin_func,  $_tpl_file,  $_tpl_line,  true,  true);
        } else {
            
// output error
            
$smarty->_trigger_fatal_error('[plugin] ' $_message,  $_tpl_file,  $_tpl_line,  __FILE__,  __LINE__);
        }
    }
}

/* vim: set expandtab: */

?>



Other Content Management Scripts:

WebMaster Resources Home

©RingsWorld.com