mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 20:57:26 +02:00
details
This commit is contained in:
@@ -9,9 +9,9 @@
|
|||||||
* e107 Main
|
* e107 Main
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/e107_class.php,v $
|
* $Source: /cvs_backup/e107_0.8/e107_handlers/e107_class.php,v $
|
||||||
* $Revision: 1.78 $
|
* $Revision: 1.79 $
|
||||||
* $Date: 2009-11-20 05:01:30 $
|
* $Date: 2009-11-20 23:27:25 $
|
||||||
* $Author: e107coders $
|
* $Author: secretr $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
@@ -903,82 +903,70 @@ class e107
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves config() from addons such as e_url.php, e_cron.php, e_sitelink.php
|
* Retrieves config() from addons such as e_url.php, e_cron.php, e_sitelink.php
|
||||||
* @param str $addonName eg. e_cron, e_url
|
* @param string $addonName eg. e_cron, e_url
|
||||||
* @param str $className [optional] (if different from addonName)
|
* @param string $className [optional] (if different from addonName)
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public function getAddonConfig($addonName,$className='')
|
public function getAddonConfig($addonName, $className = '')
|
||||||
{
|
{
|
||||||
global $pref;
|
$new_addon = array();
|
||||||
|
|
||||||
$new_cron = array();
|
|
||||||
|
|
||||||
$filename = $addonName; // 'e_cron';
|
$filename = $addonName; // e.g. 'e_cron';
|
||||||
if(!$className)
|
if(!$className)
|
||||||
{
|
{
|
||||||
$className = str_replace("e_","",$filename);
|
$className = substr($filename, 2); // remove 'e_'
|
||||||
}
|
}
|
||||||
|
|
||||||
if(vartrue($pref[$filename.'_list']))
|
$elist = self::getPref($filename.'_list');
|
||||||
|
if($elist)
|
||||||
{
|
{
|
||||||
|
foreach(array_keys($elist) as $key)
|
||||||
foreach($pref[$filename.'_list'] as $key=>$val)
|
|
||||||
{
|
{
|
||||||
$eplug_cron = array();
|
if(is_readable(e_PLUGIN.$key.'/'.$filename.'.php'))
|
||||||
if(is_readable(e_PLUGIN.$key."/".$filename.".php"))
|
|
||||||
{
|
{
|
||||||
include_once(e_PLUGIN.$key."/".$filename.".php");
|
include_once(e_PLUGIN.$key.'/'.$filename.'.php');
|
||||||
|
|
||||||
$class_name = $key."_".$className;// cron";
|
$class_name = $key.'_'.$className;
|
||||||
$method_name = 'config';
|
$array = self::callMethod($class_name, 'config');
|
||||||
|
|
||||||
if($array = self::callMethod($class_name,$method_name))
|
if($array)
|
||||||
{
|
{
|
||||||
$new_cron[$key] = $array;
|
$new_addon[$key] = $array;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $new_cron;
|
return $new_addon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Safe way to call user methods.
|
* Safe way to call user methods.
|
||||||
* @param str $class_name
|
* @param string $class_name
|
||||||
* @param str $method_name
|
* @param string $method_name
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public function callMethod($class_name,$method_name)
|
public function callMethod($class_name, $method_name)
|
||||||
{
|
{
|
||||||
$mes = e107::getMessage();
|
$mes = e107::getMessage();
|
||||||
|
|
||||||
if(class_exists($class_name))
|
if(class_exists($class_name))
|
||||||
{
|
{
|
||||||
$obj = new $class_name;
|
$obj = new $class_name;
|
||||||
if(method_exists($obj,$method_name))
|
if(method_exists($obj, $method_name))
|
||||||
{
|
{
|
||||||
$mes->add("Executing <b>".$class_name." :: ".$method_name."()</b>", E_MESSAGE_DEBUG);
|
$mes->debug('Executing <strong>'.$class_name.' :: '.$method_name.'()</strong>');
|
||||||
return call_user_func(array($obj,$method_name));
|
return call_user_func(array($obj, $method_name));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$mes->add("Function <b>".$class_name." :: ".$method_name."()</b> NOT found.", E_MESSAGE_DEBUG);
|
$mes->debug('Function <strong>'.$class_name.' :: '.$method_name.'()</strong> NOT found.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve core template path
|
* Retrieve core template path
|
||||||
* Example: <code>echo e107::coreTemplatePath('admin_icons');</code>
|
* Example: <code>echo e107::coreTemplatePath('admin_icons');</code>
|
||||||
|
Reference in New Issue
Block a user