Fix translation of headings for pre-translated headings, remove i18n calls from send_header calls that dont need it

This commit is contained in:
james 2008-10-30 16:55:31 +00:00
parent fe07722b5b
commit 566fb9ea3c
4 changed files with 14 additions and 9 deletions

View File

@ -354,7 +354,7 @@ function happy($str,$type="normal")
} }
$HEADER_SENT=false; $HEADER_SENT=false;
function send_header($title="", $nav=null, $icon=null) function send_header($title="", $nav=null, $icon=null, $titletranslated=false)
{ {
global $HEADER_SENT; global $HEADER_SENT;
global $config; global $config;
@ -369,7 +369,7 @@ function send_header($title="", $nav=null, $icon=null)
?> ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head><title><? if($title) echo i18n($title); else echo i18n($config['fairname']); ?></title> <head><title><? if($title && !$titletranslated) echo i18n($title); else if($title) echo $title; else echo i18n($config['fairname']); ?></title>
<link rel="stylesheet" href="<?=$config['SFIABDIRECTORY']?>/theme/<?=$config['theme']?>/sfiab.css" type="text/css" media="all" /> <link rel="stylesheet" href="<?=$config['SFIABDIRECTORY']?>/theme/<?=$config['theme']?>/sfiab.css" type="text/css" media="all" />
<link rel="stylesheet" href="<?=$config['SFIABDIRECTORY']?>/tableeditor.css" type="text/css" media="all" /> <link rel="stylesheet" href="<?=$config['SFIABDIRECTORY']?>/tableeditor.css" type="text/css" media="all" />
</head> </head>
@ -580,7 +580,10 @@ if(is_array($nav)) {
foreach($nav as $t=>$l) { foreach($nav as $t=>$l) {
echo "<a href=\"{$config['SFIABDIRECTORY']}/$l\">".i18n($t).'</a> &raquo; '; echo "<a href=\"{$config['SFIABDIRECTORY']}/$l\">".i18n($t).'</a> &raquo; ';
} }
echo i18n($title); if(!$titletranslated)
echo i18n($title);
else
echo $title;
echo '</div>'; echo '</div>';
} }
?> ?>
@ -606,8 +609,10 @@ else
echo "<td>"; echo "<td>";
if($title) if($title && !$titletranslated)
echo "<h2>".i18n($title)."</h2>"; echo "<h2>".i18n($title)."</h2>";
else if($title)
echo "<h2>".$title."</h2>";
//if we're under /admin or /config then we want to show the ? help icon //if we're under /admin or /config then we want to show the ? help icon
if(substr(getcwd(),-6)=="/admin" || substr(getcwd(),-7)=="/config") if(substr(getcwd(),-6)=="/admin" || substr(getcwd(),-7)=="/config")
@ -1023,7 +1028,7 @@ function output_page_cms($filename)
if(mysql_num_rows($q)) if(mysql_num_rows($q))
{ {
$r=mysql_fetch_object($q); $r=mysql_fetch_object($q);
send_header($r->title); send_header($r->title,null,null,true);
if(file_exists("data/logo-200.gif") && $r->showlogo==1) if(file_exists("data/logo-200.gif") && $r->showlogo==1)
echo "<img align=\"right\" src=\"".$config['SFIABDIRECTORY']."/data/logo-200.gif\" border=\"0\">"; echo "<img align=\"right\" src=\"".$config['SFIABDIRECTORY']."/data/logo-200.gif\" border=\"0\">";
@ -1035,7 +1040,7 @@ function output_page_cms($filename)
echo $r->text; echo $r->text;
} }
else { else {
send_header(i18n("Error: File not found")); send_header("Error: File not found");
echo error(i18n("The file you have requested (%1), does not exist on the server.",array($filename))); echo error(i18n("The file you have requested (%1), does not exist on the server.",array($filename)));
return; return;
//not defined, lets grab the default text //not defined, lets grab the default text

View File

@ -23,7 +23,7 @@
?> ?>
<? <?
include "common.inc.php"; include "common.inc.php";
send_header(i18n("Important Dates"),null,"important_dates"); send_header("Important Dates",null,"important_dates");
echo "<table>"; echo "<table>";

View File

@ -20,7 +20,7 @@ if($_GET['action']=="logout")
unset($_SESSION['schoolaccesscode']); unset($_SESSION['schoolaccesscode']);
$happymsg=i18n("You have been logged out from the school access page"); $happymsg=i18n("You have been logged out from the school access page");
} }
send_header(i18n("School Access")); send_header("School Access");

View File

@ -3,7 +3,7 @@ include "common.inc.php";
if($_SESSION['schoolid'] && $_SESSION['schoolaccesscode']) if($_SESSION['schoolid'] && $_SESSION['schoolaccesscode'])
{ {
send_header(i18n("School Participant Invitations")); send_header("School Participant Invitations");
echo "<a href=\"schoolaccess.php\">&lt;&lt; ".i18n("Return to school access main page")."</a><br />"; echo "<a href=\"schoolaccess.php\">&lt;&lt; ".i18n("Return to school access main page")."</a><br />";
echo "<br />"; echo "<br />";