mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 13:47:31 +02:00
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:
@@ -82,11 +82,13 @@ if (!function_exists("parseheader"))
|
|||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
$tmp = explode("\n", $LAYOUT);
|
$tmp = explode("\n", $LAYOUT);
|
||||||
|
|
||||||
|
$sc = e107::getScBatch('_theme_');
|
||||||
|
|
||||||
foreach ($tmp as $line)
|
foreach ($tmp as $line)
|
||||||
{
|
{
|
||||||
if (preg_match("/{.+?}/", $line))
|
if (preg_match("/{.+?}/", $line))
|
||||||
{
|
{
|
||||||
echo $tp->parseTemplate($line)."\n"; // retain line-breaks.
|
echo $tp->parseTemplate($line, true, $sc)."\n"; // retain line-breaks.
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -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)
|
if(!$globalOverride)
|
||||||
{
|
{
|
||||||
@@ -367,6 +373,10 @@ class e_parse_shortcode
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Includes global Shortcode Classes (e_shortcode.php) or already loaded batch
|
// Includes global Shortcode Classes (e_shortcode.php) or already loaded batch
|
||||||
if ($this->isScClass($className))
|
if ($this->isScClass($className))
|
||||||
{
|
{
|
||||||
@@ -377,7 +387,7 @@ class e_parse_shortcode
|
|||||||
if (class_exists($className, false)) // don't allow __autoload()
|
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->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];
|
return $this->scClasses[$className];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -387,7 +397,7 @@ class e_parse_shortcode
|
|||||||
if (class_exists($className, false)) // don't allow __autoload()
|
if (class_exists($className, false)) // don't allow __autoload()
|
||||||
{
|
{
|
||||||
// register instance directly to allow override
|
// 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.
|
// $this->registerClassMethods($className, $path); // XXX Global registration should happen separately - here we want only the object.
|
||||||
return $this->scClasses[$className];
|
return $this->scClasses[$className];
|
||||||
}
|
}
|
||||||
@@ -444,10 +454,18 @@ class e_parse_shortcode
|
|||||||
*
|
*
|
||||||
* @return e_parse_shortcode
|
* @return e_parse_shortcode
|
||||||
*/
|
*/
|
||||||
public function loadThemeShortcodes()
|
protected function loadThemeShortcodes()
|
||||||
{
|
{
|
||||||
global $register_sc;
|
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))
|
if (isset($register_sc) && is_array($register_sc))
|
||||||
{
|
{
|
||||||
foreach ($register_sc as $code)
|
foreach ($register_sc as $code)
|
||||||
@@ -459,6 +477,7 @@ class e_parse_shortcode
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -910,9 +910,27 @@ class themeHandler
|
|||||||
function loadThemeConfig()
|
function loadThemeConfig()
|
||||||
{
|
{
|
||||||
$mes = e107::getMessage();
|
$mes = e107::getMessage();
|
||||||
$confile = e_THEME.$this->id."/".$this->id."_config.php";
|
|
||||||
|
|
||||||
if(($this->themeConfigObj === null) && is_readable($confile))
|
$newConfile = e_THEME.$this->id."/theme_config.php";
|
||||||
|
|
||||||
|
$legacyConfile = e_THEME.$this->id."/".$this->id."_config.php"; // @Deprecated
|
||||||
|
|
||||||
|
if(is_readable($newConfile))
|
||||||
|
{
|
||||||
|
$confile = $newConfile;
|
||||||
|
}
|
||||||
|
elseif(is_readable($legacyConfile))// TODO Eventually remove it.
|
||||||
|
{
|
||||||
|
// NOTE: this is debug info.. do not translate.
|
||||||
|
e107::getMessage()->addDebug("Deprecated Theme Config File found! Rename <b>".$this->id."_config.php.</b> to <b>theme_config.php</b> to correct this issue. .");
|
||||||
|
$confile = $legacyConfile;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(($this->themeConfigObj === null) )
|
||||||
{
|
{
|
||||||
$mes->addDebug("Loading : ".$confile);
|
$mes->addDebug("Loading : ".$confile);
|
||||||
include ($confile);
|
include ($confile);
|
||||||
|
@@ -35,7 +35,7 @@ $login_menu_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
|
|||||||
/*
|
/*
|
||||||
SC_BEGIN LM_USERNAME_INPUT
|
SC_BEGIN LM_USERNAME_INPUT
|
||||||
global $pref;
|
global $pref;
|
||||||
return "<input class='tbox login user' type='text' name='username' required='required' id='username' size='15' value='' maxlength='".varset($pref['loginname_maxlength'],30)."' />\n";
|
return "<input class='tbox login user' type='text' name='username' placeholder='Username' required='required' id='username' size='15' value='' maxlength='".varset($pref['loginname_maxlength'],30)."' />\n";
|
||||||
SC_END
|
SC_END
|
||||||
|
|
||||||
SC_BEGIN LM_USERNAME_LABEL
|
SC_BEGIN LM_USERNAME_LABEL
|
||||||
@@ -54,7 +54,7 @@ SC_END
|
|||||||
|
|
||||||
SC_BEGIN LM_PASSWORD_INPUT
|
SC_BEGIN LM_PASSWORD_INPUT
|
||||||
global $pref;
|
global $pref;
|
||||||
$t_password = "<input class='tbox login pass' type='password' required='required' name='userpass' id='userpass' size='15' value='' maxlength='30' />\n";
|
$t_password = "<input class='tbox login pass' type='password' placeholder='Password' required='required' name='userpass' id='userpass' size='15' value='' maxlength='30' />\n";
|
||||||
if (!USER && e107::getSession()->is('challenge') && varset($pref['password_CHAP'],0)) $t_password .= "<input type='hidden' name='hashchallenge' id='hashchallenge' value='".e107::getSession()->get('challenge')."' />\n\n";
|
if (!USER && e107::getSession()->is('challenge') && varset($pref['password_CHAP'],0)) $t_password .= "<input type='hidden' name='hashchallenge' id='hashchallenge' value='".e107::getSession()->get('challenge')."' />\n\n";
|
||||||
return $t_password;
|
return $t_password;
|
||||||
SC_END
|
SC_END
|
||||||
|
@@ -7,10 +7,7 @@ body { padding-top: 75px; }
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.navbar-inverse .brand, .navbar-inverse .nav > li > a.no-block {
|
|
||||||
display: inline;
|
|
||||||
padding: 10px 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.well { padding:10px; }
|
.well { padding:10px; }
|
||||||
footer { padding:60px }
|
footer { padding:60px }
|
||||||
|
@@ -155,6 +155,11 @@ $SC_WRAPPER['NAVIGATION|s'] = '<div class="well sidebar-nav">{---}</div><!--/.we
|
|||||||
// TODO Convert to : default-home and default-other layouts.
|
// TODO Convert to : default-home and default-other layouts.
|
||||||
|
|
||||||
|
|
||||||
|
//// <ul class="nav nav-pills pull-right">
|
||||||
|
// <li class="dropdown">'.(!USERID ? '<a class="dropdown-toggle" role="button" href="'.e_LOGIN.'">Sign in</a>': '<span class="navbar-text">Logged in as</span> <a class="dropdown-toggle no-block" role="button" href="user.php?id.'.USERID.'">'.USERNAME.'</a>').'</li>
|
||||||
|
// </ul>
|
||||||
|
|
||||||
|
|
||||||
$HEADER['default'] = '
|
$HEADER['default'] = '
|
||||||
<div class="navbar navbar-inverse navbar-fixed-top">
|
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||||
<div class="navbar-inner">
|
<div class="navbar-inner">
|
||||||
@@ -167,9 +172,7 @@ $HEADER['default'] = '
|
|||||||
<a class="brand" href="'.SITEURL.'">{SITENAME}</a>
|
<a class="brand" href="'.SITEURL.'">{SITENAME}</a>
|
||||||
<div class="nav-collapse collapse">
|
<div class="nav-collapse collapse">
|
||||||
{NAVIGATION=main}
|
{NAVIGATION=main}
|
||||||
<ul class="nav nav-pills pull-right">
|
<div class="pull-right">{BOOTSTRAP_USERNAV}</div>
|
||||||
<li class="dropdown">'.(!USERID ? '<a class="dropdown-toggle" role="button" href="'.e_LOGIN.'">Sign in</a>': '<span class="navbar-text">Logged in as</span> <a class="dropdown-toggle no-block" role="button" href="user.php?id.'.USERID.'">'.USERNAME.'</a>').'</li>
|
|
||||||
</ul>
|
|
||||||
</div><!--/.nav-collapse -->
|
</div><!--/.nav-collapse -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user