A few more UI div recommendations and CSS touchups

Make php '$config' array available in javascript as javascript 'config' object
This commit is contained in:
james 2010-08-20 15:11:11 +00:00
parent a449fce300
commit 02998f98d6
3 changed files with 44 additions and 17 deletions

View File

@ -43,7 +43,8 @@ function send_header($title="", $nav=null, $icon=null, $titletranslated=false) {
?>
<!doctype html>
<html>
<head><title><? if($title && !$titletranslated) echo i18n($title); else if($title) echo $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']?>/jquery-ui-1.7.2.custom.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" />
@ -62,13 +63,14 @@ $(document).ready(function(){
if($("#importantdatesbox").length)
$("#importantdatesbox").load("important_dates.php?display=box");
});
//and dump the whole PHP configuration into a Javascript Object, so we can use it anywhere we need to refer to config variables in javascript
var config=<?=json_encode($config)?>;
</script>
<?
//if we're under /admin or /config we also want the translation editor
if(substr(getcwd(),-6)=="/admin" || substr(getcwd(),-7)=="/config")
//if we're under /admin or /config or /super we also want the translation editor
if(substr(getcwd(),-6)=="/admin" || substr(getcwd(),-7)=="/config" || substr(getcwd(),-6)=="/super")
require_once("../translationseditor.inc.php");
?>
<div id="page-wrapper">
<div id="page">
<div id="page-inner">
@ -382,11 +384,15 @@ if(substr(getcwd(),-6)!="/admin" && substr(getcwd(),-7)!="/config" && substr(get
<?
}
*/
?>
<div id="work-area">
<div id="main-title">
<?
if($icon && theme_icon($icon)) {
echo "<div style=\"float: left; margin-right: 5px;\">";
echo " <div id=\"main-icon\" class=\"link-icon\">";
echo theme_icon($icon);
echo "</div>";
echo "</div>\n";
}
//if we're under /admin or /config then we want to show the ? help icon
@ -395,23 +401,30 @@ if(substr(getcwd(),-6)=="/admin" || substr(getcwd(),-7)=="/config" || substr(get
$fname=substr($_SERVER['REDIRECT_SCRIPT_URL'],strlen($config['SFIABDIRECTORY'])+1);
else
$fname=substr($_SERVER['PHP_SELF'],strlen($config['SFIABDIRECTORY'])+1);
echo "<div style=\"float: right;\"<a target=\"_sfiabhelp\" href=\"http://www.sfiab.ca/wiki/index.php/Help_$fname\"><img border=\"0\" src=\"".$config['SFIABDIRECTORY']."/images/32/help.".$config['icon_extension']."\"></a></div>";
echo " <div id=\"help-icon\" class=\"link-icon\"><a target=\"_sfiabhelp\" href=\"http://www.sfiab.ca/wiki/index.php/Help_$fname\"><img border=\"0\" src=\"".$config['SFIABDIRECTORY']."/images/32/help.".$config['icon_extension']."\"></a></div>\n";
}
if($title && !$titletranslated)
echo "<h2>".i18n($title)."</h2>";
echo "<h2>".i18n($title)."</h2>\n";
else if($title)
echo "<h2>".$title."</h2>";
echo "<h2>".$title."</h2>\n";
display_messages();
?>
</div><!-- main-title-->
<div id="main-content">
<?
}
/* END OF send_header */
function send_footer() {
global $config;
?>
</div>
</div><!--main-content-->
</div><!--work-area-->
</div><!--main-->
<div id="lower-section" class="clear">
<div id="footer">
<?

View File

@ -2,11 +2,11 @@ function taskNavLevel(l1,l2,l3,l4) {
if(l2) {
//we have a secondary click, which implies we also have a primary nav selected
//we may or may not have l3 or l4 though, so they are handled separately below
$("#secondarymenu").load("<?=$config['SFIABDIRECTORY']?>/nav.php?level=1&id="+l1,null,function() {
$("#secondarymenu").load(config.SFIABDIRECTORY+"/nav.php?level=1&id="+l1,null,function() {
$("#secondarymenu").show();
$("#tertiarymenu_accordion").accordion("destroy");
$("#tertiarymenu_accordion").load("<?=$config['SFIABDIRECTORY']?>/nav.php?level=2&id="+l2,null,function() {
$("#tertiarymenu_accordion").load(config.SFIABDIRECTORY+"/nav.php?level=2&id="+l2,null,function() {
$("#tertiarymenu_accordion").accordion({clearStyle: true, collapsible: true, active: false}); //"option", "collapsible", true);
$("#tertiarymenu").show();
@ -30,7 +30,7 @@ function taskNavLevel(l1,l2,l3,l4) {
}
else {
//only the primary link clicked, so show the secondary, and thats it.
$("#secondarymenu").load("<?=$config['SFIABDIRECTORY']?>/nav.php?level=1&id="+l1,null,function() {
$("#secondarymenu").load(config.SFIABDIRECTORY+"/nav.php?level=1&id="+l1,null,function() {
$(".primarynav-selected").removeClass("primarynav-selected");
$("#primary_nav_"+l1).addClass("primarynav-selected");

View File

@ -117,6 +117,20 @@ table tr.odd {
margin: auto;
}
div#main-icon {
display: block;
float: left;
}
div#help-icon {
display: block;
float: right;
}
div.link-icon {
padding: 4px;
}
#mainwhere {
margin-left: 185px;
margin-right: 3px;