1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-11 09:04:38 +02:00

Fixes #326, #331 and corrects markup issues with pull-request #390.

Also added check for theme_shortcodes.php for including batches of theme shortcodes.
theme_config.php is now the correct file name for a theme config.
This commit is contained in:
Cameron
2013-06-19 22:50:51 -07:00
parent 29f74508c2
commit 2d21d0e7d2
7 changed files with 56 additions and 17 deletions

View File

@@ -335,7 +335,13 @@ class e_parse_shortcode
}
}
if(!$pluginName)
if($className == '_theme__shortcodes') // Check for theme shortcode batch. - @see header_default.php //XXX Discuss.
{
$className = 'theme_shortcodes';
$path = THEME.'theme_shortcodes.php';
}
elseif(!$pluginName)
{
if(!$globalOverride)
{
@@ -366,6 +372,10 @@ class e_parse_shortcode
$className = 'override_'.$className;
}
}
// Includes global Shortcode Classes (e_shortcode.php) or already loaded batch
if ($this->isScClass($className))
@@ -377,7 +387,7 @@ class e_parse_shortcode
if (class_exists($className, false)) // don't allow __autoload()
{
// $this->registerClassMethods($className, $path); // XXX Global registration should happen separately - here we want only the object.
$this->scClasses[$className] = new $className(); // located inside registerClassMethods()
$this->scClasses[$className] = new $className();
return $this->scClasses[$className];
}
@@ -387,7 +397,7 @@ class e_parse_shortcode
if (class_exists($className, false)) // don't allow __autoload()
{
// register instance directly to allow override
$this->scClasses[$className] = new $className(); // located inside registerClassMethods()
$this->scClasses[$className] = new $className();
// $this->registerClassMethods($className, $path); // XXX Global registration should happen separately - here we want only the object.
return $this->scClasses[$className];
}
@@ -444,10 +454,18 @@ class e_parse_shortcode
*
* @return e_parse_shortcode
*/
public function loadThemeShortcodes()
protected function loadThemeShortcodes()
{
global $register_sc;
// $this->registered_codes[$code]['type'] = 'plugin';
// $this->registered_codes[$code]['function'] = strtolower($code).'_shortcode';
// $this->registered_codes[$code]['path'] = e_PLUGIN.$path.'/shortcodes/single/';
// $this->registered_codes[$code]['perms'] = $uclass;
if (isset($register_sc) && is_array($register_sc))
{
foreach ($register_sc as $code)
@@ -459,6 +477,7 @@ class e_parse_shortcode
}
}
}
return $this;
}