From c097d61e420530174ab7ce798c7fece528b4fbcb Mon Sep 17 00:00:00 2001 From: Adam Zammit Date: Tue, 4 Aug 2015 10:32:49 +1000 Subject: [PATCH] Allow for titles not to appear where they don't need to be --- call.php | 8 ++++---- functions/functions.xhtml.php | 15 ++++++++++----- index.php | 2 +- info.php | 2 +- performance.php | 2 +- project_info.php | 2 +- respondent.php | 3 +-- status.php | 2 +- 8 files changed, 20 insertions(+), 16 deletions(-) diff --git a/call.php b/call.php index c0dc7905..3ff2b79f 100644 --- a/call.php +++ b/call.php @@ -188,7 +188,7 @@ if (isset($_POST['submit'])) $js = "js/window.js"; if (browser_ie()) $js = "js/window_ie6.js"; - xhtml_head(T_("Call"),true,array("css/call.css"),array($js),$btext); + xhtml_head(T_("Call"),true,array("css/call.css"),array($js),$btext,false,false,false,false); } } else if (isset($_POST['outcome'])) @@ -208,7 +208,7 @@ if (isset($_POST['submit'])) $js = "js/window.js"; if (browser_ie()) $js = "js/window_ie6.js"; - xhtml_head(T_("Call"),true,array("css/call.css"),array($js),"onload='toggleRec(\"$newtext\",\"record.php?start=start\",\"offline\"); openParentObject(\"main-content\",\"" . get_respondentselection_url($operator_id) . "\"); parent.closePopup();'"); + xhtml_head(T_("Call"),true,array("css/call.css"),array($js),"onload='toggleRec(\"$newtext\",\"record.php?start=start\",\"offline\"); openParentObject(\"main-content\",\"" . get_respondentselection_url($operator_id) . "\"); parent.closePopup();'",false,false,false,false); } else { @@ -224,7 +224,7 @@ if (isset($_POST['submit'])) $newtext = T_("Start REC"); $js = "js/window.js"; if (browser_ie()) $js = "js/window_ie6.js"; - xhtml_head(T_("Call"),true,array("css/call.css"),array($js),"onload='toggleRec(\"$newtext\",\"record.php?start=start\",\"offline\"); openParentObject(\"main-content\",\"" . get_respondentselection_url($operator_id) . "\"); parent.closePopup();'"); + xhtml_head(T_("Call"),true,array("css/call.css"),array($js),"onload='toggleRec(\"$newtext\",\"record.php?start=start\",\"offline\"); openParentObject(\"main-content\",\"" . get_respondentselection_url($operator_id) . "\"); parent.closePopup();'",false,false,false,false); } @@ -255,7 +255,7 @@ if (isset($_GET['newstate'])) $js = "js/window.js"; if (browser_ie()) $js = "js/window_ie6.js"; -xhtml_head(T_("Call"),true,array("css/call.css"),array($js,"include/jquery/jquery-1.4.2.min.js")); +xhtml_head(T_("Call"),true,array("css/call.css"),array($js,"include/jquery/jquery-1.4.2.min.js"),false,false,false,false,false); $state = is_on_call($operator_id); switch($state) diff --git a/functions/functions.xhtml.php b/functions/functions.xhtml.php index f679c69f..1eac9221 100644 --- a/functions/functions.xhtml.php +++ b/functions/functions.xhtml.php @@ -40,17 +40,19 @@ * @param string $bodytext Space in the body element: good for onload='top.close()' to close validly * @param bool|int $refresh False or 0 for no refresh otherwise the number of seconds to refresh * @param bool $clearrefresh False if we want to pass on any GET request in header, True to clear + * @param bool|string $subtitle False if we want no subtitle otherwise display a subtitle + * @param bool $displayinnertitle Whether to display the inner title or not * * @see xhtml_foot() */ -function xhtml_head($title="",$body=true,$css=false,$javascript=false,$bodytext=false,$refresh=false,$clearrefresh=false,$subtitle=false) +function xhtml_head($title="",$body=true,$css=false,$javascript=false,$bodytext=false,$refresh=false,$clearrefresh=false,$subtitle=false,$displayinnertitle=true) { print ""; ?> - <?php if (empty($title)) print "CATI"; else print "CATI: $title"; ?> + <?php if (empty($title)) print "queXS"; else print "queXS: $title"; ?> "; @@ -69,8 +71,11 @@ print ""; "; else print ""; - print "

" . "$title" . "  " . "$subtitle" . "

"; + if ($bodytext) print ""; else print ""; + if ($displayinnertitle) + { + print "

" . "$title" . "  " . "$subtitle" . "

"; + } /* Let's print header that equals to menu item and page title !!!, move previous headers to "subtitles"*/ } @@ -246,4 +251,4 @@ function browser_ie() else return false; } -?> \ No newline at end of file +?> diff --git a/index.php b/index.php index ea4b5bd8..738bae87 100644 --- a/index.php +++ b/index.php @@ -142,7 +142,7 @@ else if (HEADER_EXPANDER_MANUAL) $js[] = "js/headerexpandmanual.js"; } -xhtml_head(T_("queXS"), $body, array("css/index.css","css/tabber.css","include/jquery-ui/jquery-ui.min.css") , $js); +xhtml_head(T_("queXS"), $body, array("css/index.css","css/tabber.css","include/jquery-ui/jquery-ui.min.css") , $js,false,false,false,false,false); print $script; $case_id = get_case_id($operator_id,true); diff --git a/info.php b/info.php index 6f5be7f0..68bfddde 100644 --- a/info.php +++ b/info.php @@ -53,7 +53,7 @@ $js = false; if (AUTO_LOGOUT_MINUTES !== false) $js = array("include/jquery/jquery-1.4.2.min.js","js/childnap.js"); -xhtml_head(T_("Information"),true,false,$js); +xhtml_head(T_("Information"),true,false,$js,false,false,false,false,false); print get_setting("information"); diff --git a/performance.php b/performance.php index 7675f979..b3ac4af1 100644 --- a/performance.php +++ b/performance.php @@ -58,7 +58,7 @@ $js = false; if (AUTO_LOGOUT_MINUTES !== false) $js = array("include/jquery/jquery-1.4.2.min.js","js/childnap.js"); -xhtml_head(T_("Performance"),true,array("css/table.css"),$js); +xhtml_head(T_("Performance"),true,array("css/table.css"),$js,false,false,false,false,false); $operator_id = get_operator_id(); $questionnaire_id = get_questionnaire_id($operator_id); diff --git a/project_info.php b/project_info.php index 5fe8ace0..ff14ecb0 100644 --- a/project_info.php +++ b/project_info.php @@ -58,7 +58,7 @@ $js = false; if (AUTO_LOGOUT_MINUTES !== false) $js = array("include/jquery/jquery-1.4.2.min.js","js/childnap.js"); -xhtml_head(T_("Project information"),true,false,$js); +xhtml_head(T_("Project information"),true,false,$js,false,false,false,false,false); $operator_id = get_operator_id(); diff --git a/respondent.php b/respondent.php index f55c228b..f8b8db6b 100644 --- a/respondent.php +++ b/respondent.php @@ -67,8 +67,7 @@ if (AUTO_LOGOUT_MINUTES !== false) $js[] = "js/childnap.js"; } -xhtml_head(T_("Respondent Selector"),true,array("css/table.css","css/respondent.css"),$js); - +xhtml_head(T_("Respondent Selector"),true,array("css/table.css","css/respondent.css"),$js,false,false,false,false,false); //display the respondents as a drop down list for this call attempt // display in the operators time diff --git a/status.php b/status.php index b06b4fb1..1f0d4f74 100644 --- a/status.php +++ b/status.php @@ -74,7 +74,7 @@ if (AUTO_LOGOUT_MINUTES !== false) $js[] = "js/childnap.js"; } -xhtml_head(T_("Status"),true,array("css/status.css"),$js,$btext,60); +xhtml_head(T_("Status"),true,array("css/status.css"),$js,$btext,60,false,false,false,false); print "
" . get_operator_time($operator_id,DATE_TIME_FORMAT) ."
";