mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 21:57:51 +02:00
Removed the need for pre-registration of core shortcode classes
This commit is contained in:
@@ -125,7 +125,7 @@ function callScFunc($className, $scFuncName, $param= '')
|
||||
}
|
||||
|
||||
/**
|
||||
* Create shortcode object
|
||||
* Create shortcode object - DEPRECATED. use e_shortcode.php or
|
||||
*
|
||||
* @param string $class
|
||||
* @param boolean $force
|
||||
@@ -267,6 +267,18 @@ class e_shortcode
|
||||
}
|
||||
$path = e_PLUGIN.$key.'/e_shortcode.php';
|
||||
$classFunc = $key.'_shortcodes';
|
||||
|
||||
$this->registerClassMethods($classFunc,$path);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Common Auto-Register function for class methods.
|
||||
*
|
||||
*/
|
||||
private function registerClassMethods($classFunc,$path)
|
||||
{
|
||||
|
||||
$this->scClasses[$classFunc] = new $classFunc;
|
||||
|
||||
$tmp = get_class_methods($classFunc);
|
||||
@@ -282,9 +294,9 @@ class e_shortcode
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Register Core Shortcode Batches.
|
||||
* FIXME - currently loaded all the time (even on front-end)
|
||||
@@ -293,10 +305,15 @@ class e_shortcode
|
||||
*/
|
||||
function loadCoreShortcodes()
|
||||
{
|
||||
$coreBatchList = array('admin_shortcodes.php');
|
||||
$coreBatchList = array('admin_shortcodes');
|
||||
|
||||
foreach($coreBatchList as $cb)
|
||||
{
|
||||
include_once(e_CORE.'shortcodes/batch/'.$cb);
|
||||
$path = e_CORE.'shortcodes/batch/'.$cb.".php";
|
||||
if(include_once($path))
|
||||
{
|
||||
$this->registerClassMethods($cb,$path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user