allow prefix/suffix page_title config options

git-svn-id: http://www.observium.org/svn/observer/trunk@3038 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2012-04-17 10:48:35 +00:00
parent 6e7239e82c
commit ffd95a120e
2 changed files with 10 additions and 3 deletions

View File

@@ -327,7 +327,16 @@ $('INPUT.auto-hint, TEXTAREA.auto-hint').focus(function() {
<?php
if (is_array($pagetitle))
{
array_unshift($pagetitle,$config['page_title']);
# page_title is put in front, unless page_title_prefix is set
if (!$config['page_title_prefix']) { $config['page_title_prefix'] = $config['page_title']; }
# if prefix is set, put it in front
if ($config['page_title_prefix']) { array_unshift($pagetitle,$config['page_title_prefix']); }
# if suffix is set, put it in the back
if ($config['page_title_suffix']) { $pagetitle[] = $config['page_title_suffix']; }
# create and set the title
$title = join(" - ",$pagetitle);
echo("<script type=\"text/javascript\">\ndocument.title = '$title';\n</script>");
}