1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 04:10: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

@@ -81,12 +81,14 @@ if (!function_exists("parseheader"))
{
$tp = e107::getParser();
$tmp = explode("\n", $LAYOUT);
$sc = e107::getScBatch('_theme_');
foreach ($tmp as $line)
{
if (preg_match("/{.+?}/", $line))
{
echo $tp->parseTemplate($line)."\n"; // retain line-breaks.
echo $tp->parseTemplate($line, true, $sc)."\n"; // retain line-breaks.
}
else
{

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;
}

View File

@@ -910,9 +910,27 @@ class themeHandler
function loadThemeConfig()
{
$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);
include ($confile);

View File

@@ -35,7 +35,7 @@ $login_menu_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
/*
SC_BEGIN LM_USERNAME_INPUT
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_BEGIN LM_USERNAME_LABEL
@@ -54,7 +54,7 @@ SC_END
SC_BEGIN LM_PASSWORD_INPUT
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";
return $t_password;
SC_END

View File

@@ -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; }
footer { padding:60px }

View File

@@ -155,6 +155,11 @@ $SC_WRAPPER['NAVIGATION|s'] = '<div class="well sidebar-nav">{---}</div><!--/.we
// 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'] = '
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
@@ -167,9 +172,7 @@ $HEADER['default'] = '
<a class="brand" href="'.SITEURL.'">{SITENAME}</a>
<div class="nav-collapse collapse">
{NAVIGATION=main}
<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>
<div class="pull-right">{BOOTSTRAP_USERNAV}</div>
</div><!--/.nav-collapse -->
</div>
</div>