1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-08 07:36:32 +02:00

Merge remote-tracking branch 'origin/master'

This commit is contained in:
SecretR
2014-02-25 11:44:32 +02:00
2 changed files with 44 additions and 3 deletions

View File

@@ -580,9 +580,21 @@ echo "</head>\n";
{ {
foreach($LAYOUT as $key=>$template) foreach($LAYOUT as $key=>$template)
{ {
list($hd,$ft) = explode("{---}",$template); if($key == '_header_' || $key == '_footer_')
$HEADER[$key] = isset($LAYOUT['_header_']) ? $LAYOUT['_header_'] . $hd : $hd; {
$FOOTER[$key] = isset($LAYOUT['_footer_']) ? $ft . $LAYOUT['_footer_'] : $ft ; continue;
}
if(strpos($template,'{---}') !==false)
{
list($hd,$ft) = explode("{---}",$template);
$HEADER[$key] = isset($LAYOUT['_header_']) ? $LAYOUT['_header_'] . $hd : $hd;
$FOOTER[$key] = isset($LAYOUT['_footer_']) ? $ft . $LAYOUT['_footer_'] : $ft ;
}
else
{
e107::getMessage()->addDebug('Missing "{---}" in $LAYOUT["'.$key.'"] ');
}
} }
unset($hd,$ft); unset($hd,$ft);
} }

View File

@@ -78,6 +78,13 @@ class eMessage
* @var array * @var array
*/ */
protected $_unique = array(); protected $_unique = array();
/**
* @var array
*/
static $_customTitle = array();
/** /**
* Singleton instance * Singleton instance
@@ -367,12 +374,34 @@ class eMessage
*/ */
public static function getTitle($type, $message_stack = 'default') public static function getTitle($type, $message_stack = 'default')
{ {
if(!empty(self::$_customTitle[$type]))
{
return self::$_customTitle[$type];
}
if($message_stack && $message_stack != 'default' && defined('EMESSLAN_TITLE_'.strtoupper($type.'_'.$message_stack))) if($message_stack && $message_stack != 'default' && defined('EMESSLAN_TITLE_'.strtoupper($type.'_'.$message_stack)))
{ {
return constant('EMESSLAN_TITLE_'.strtoupper($type.'_'.$message_stack)); return constant('EMESSLAN_TITLE_'.strtoupper($type.'_'.$message_stack));
} }
return defsettrue('EMESSLAN_TITLE_'.strtoupper($type), ''); return defsettrue('EMESSLAN_TITLE_'.strtoupper($type), '');
} }
/**
* Set a custom title/caption (useful for front-end)
*
* @param string $title
* @param string $type E_MESSAGE_SUCCESS,E_MESSAGE_ERROR, E_MESSAGE_WARNING, E_MESSAGE_INFO
* @example e107::getMessage()->setTitle('Custom Title', E_MESSAGE_INFO);
*/
public function setTitle($title, $type)
{
$tp = e107::getParser();
self::$_customTitle[$type] = $tp->toText($title);
return $this;
}
/** /**
* Message getter * Message getter