updated so that login page will destroy frames, cleaned up various other issues like better lang support in msgbox, now langs trailing char can be turned off. several other improvements

This commit is contained in:
seek3r 2002-05-31 08:29:19 +00:00
parent 03a64409f8
commit 4004c9a4e1
7 changed files with 80 additions and 75 deletions

View File

@ -43,6 +43,7 @@
$GLOBALS['phpgw']->template->set_block('phpgw','phpgw_main_basic','phpgw_main');
$GLOBALS['phpgw']->template->set_block('login','login_form_deny','login_form');
$GLOBALS['phpgw']->template->set_var('template_set','default');
$GLOBALS['phpgw']->template->set_var('phpgw_head_tags','<script><!-- if (window!= top) top.location.href=location.href// --></script>');
$GLOBALS['phpgw']->template->fp('phpgw_body','login_form');
$GLOBALS['phpgw']->template->pfp('out','phpgw_main');
exit;

View File

@ -1025,7 +1025,10 @@
$row = 1;
}
$prev_helper = $GLOBALS['phpgw']->translation->translator_helper;
$GLOBALS['phpgw']->translation->translator_helper = '';
$GLOBALS['phpgw']->template->set_var('msgbox_text',lang($key));
$GLOBALS['phpgw']->translation->translator_helper = $prev_helper;
if ($value == True)
{
$GLOBALS['phpgw']->template->set_var('msgbox_img',$this->image('phpgwapi','msgbox_good'));
@ -1042,7 +1045,9 @@
else
{
$GLOBALS['phpgw']->template->set_var('msgbox_row_color',$GLOBALS['phpgw_info']['theme']['row_on']);
$GLOBALS['phpgw']->template->set_var('msgbox_text',lang($text));
$GLOBALS['phpgw']->translation->translator_helper = '';
$GLOBALS['phpgw']->template->set_var('msgbox_text',lang($key));
$GLOBALS['phpgw']->translation->translator_helper = $prev_helper;
if ($type == True)
{
$GLOBALS['phpgw']->template->set_var('msgbox_img',$this->image('phpgwapi','msgbox_good'));
@ -1287,11 +1292,38 @@
$preload_image_string .= "'$value'";
}
}
$preload_image_string = "MM_preloadImages($preload_image_string); ";
$GLOBALS['phpgw']->template->set_var('phpgw_preload_images',$preload_image_string);
return " MM_preloadImages($preload_image_string);";
}
return '';
}
function load_phpgw_body_tags()
{
$GLOBALS['phpgw_info']['flags']['body_tags']['marginwidth']='0';
$GLOBALS['phpgw_info']['flags']['body_tags']['marginheight']='0';
$GLOBALS['phpgw_info']['flags']['body_tags']['topmargin']='0';
$GLOBALS['phpgw_info']['flags']['body_tags']['bottommargin']='0';
$GLOBALS['phpgw_info']['flags']['body_tags']['rightmargin']='0';
$GLOBALS['phpgw_info']['flags']['body_tags']['leftmargin']='0';
$GLOBALS['phpgw_info']['flags']['body_tags']['leftmargin']='0';
$GLOBALS['phpgw_info']['flags']['body_tags']['border']='0';
$GLOBALS['phpgw_info']['flags']['body_tags']['onLoad'] .= $this->load_preload_images_data();
if(@is_array($GLOBALS['phpgw_info']['flags']['body_tags']))
{
$body_tags_string = '';
reset($GLOBALS['phpgw_info']['flags']['body_tags']);
while(list($key,$value) = each($GLOBALS['phpgw_info']['flags']['body_tags']))
{
$body_tags_string .= " $key=\"$value\"";
}
$GLOBALS['phpgw']->template->set_var('phpgw_body_tags',$body_tags_string);
}
}
/*!
@function phpgw_header
@abstract load the phpgw header
@ -1358,7 +1390,8 @@
$GLOBALS['phpgw']->db->disconnect();
$this->msgbox('',False,'phpgw_msgbox');
$this->load_css_data();
$this->load_preload_images_data();
$this->load_phpgw_body_tags();
$GLOBALS['phpgw']->template->set_block('phpgw','phpgw_head_javascript');
$GLOBALS['phpgw']->template->pfp('out','phpgw_main');
/*

View File

@ -133,10 +133,6 @@
}
}
// if(@isset($GLOBALS['HTTP_GET_VARS']['framepart']))
// {
// $url .= '" target="_parent"';
// }
if ($iis)
{
echo "\n<HTML>\n<HEAD>\n<TITLE>Redirecting to $url</TITLE>";

View File

@ -27,6 +27,7 @@
var $lang; // Currently loaded translations
var $loaded = False;
var $all_loaded = False;
var $translator_helper = '*';
function translation()
{
@ -66,7 +67,7 @@
$this->load_langs(True);
}
$ret = @isset($this->lang[$_key]) ? $this->lang[$_key] : $key . '*';
$ret = @isset($this->lang[$_key]) ? $this->lang[$_key] : $key . $this->translator_helper;
$ndx = 1;
while(list($key,$val) = each($vars))

View File

@ -31,6 +31,7 @@
var $userlang = 'en';
var $currentapp = '';
var $loaded = False;
var $translator_helper = '*';
/*!
@function translation
@ -104,7 +105,7 @@
$this->load_langs();
}
$ret = @isset($this->lang[$_key]) ? $this->lang[$_key] : $key . '*';
$ret = @isset($this->lang[$_key]) ? $this->lang[$_key] : $key . $this->translator_helper;
$ndx = 1;
while(list($key,$val) = each($vars))

View File

@ -15,7 +15,6 @@
</TR>
<TR bgcolor="#e6e6e6">
<TD valign="BASELINE">
<FORM name="login" method="post" action="{login_url}">
<input type="hidden" name="passwd_type" value="text">
<TABLE border="0" align="CENTER" bgcolor="#486591" width="100%" cellpadding="0" cellspacing="0">

View File

@ -11,41 +11,11 @@
<LINK REL="ICON" href="{phpgw_head_browser_ico}" type="image/x-ico">
<LINK REL="SHORTCUT ICON" href="{phpgw_head_browser_ico}">
<TITLE>{phpgw_head_website_title}</TITLE>
<SCRIPT language="JavaScript" type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function multiLoad(top_doc,left_doc,body_doc,right_doc,bottom_doc) {
if(top_doc != null){ parent.top.location.href=top_doc; }
if(left_doc != null){ parent.left.location.href=left_doc; }
if(body_doc != null){ parent.body.location.href=body_doc; }
if(right_doc != null){ parent.right.location.href=right_doc; }
if(bottom_doc != null){ parent.bottom.location.href=bottom_doc; }
}
//-->
</SCRIPT>
{phpgw_head_javascript}
{phpgw_css}
{phpgw_head_tags}
</HEAD>
<BODY {phpgw_body_tags} onLoad="{phpgw_preload_images}{phpgw_body_onload}">
<BODY{phpgw_body_tags}>
<TABLE border="0" width="100%" height="%100" cellspacing="0" cellpadding="0">
<TR>
<TD width="100%" height="{phpgw_top_table_height}" align="left" valign="top" colspan="3">{phpgw_top}</TD>
@ -76,41 +46,11 @@
<LINK REL="ICON" href="{phpgw_head_browser_ico}" type="image/x-ico">
<LINK REL="SHORTCUT ICON" href="{phpgw_head_browser_ico}">
<TITLE>{phpgw_head_website_title}</TITLE>
<SCRIPT language="JavaScript" type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function multiLoad(top_doc,left_doc,body_doc,right_doc,bottom_doc) {
if(top_doc != null){ parent.top.location.href=top_doc; }
if(left_doc != null){ parent.left.location.href=left_doc; }
if(body_doc != null){ parent.body.location.href=body_doc; }
if(right_doc != null){ parent.right.location.href=right_doc; }
if(bottom_doc != null){ parent.bottom.location.href=bottom_doc; }
}
//-->
</SCRIPT>
{phpgw_head_javascript}
{phpgw_css}
{phpgw_head_tags}
</HEAD>
<BODY {phpgw_body_tags} onLoad="{phpgw_preload_images}{phpgw_body_onload}">
<BODY{phpgw_body_tags}>
{phpgw_msgbox}
{phpgw_body}
</BODY>
@ -146,3 +86,37 @@
</HEAD>
</HTML>
<!-- END phpgw_main_frames -->
<!-- BEGIN phpgw_head_javascript -->
<SCRIPT language="JavaScript" type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function multiLoad(top_doc,left_doc,body_doc,right_doc,bottom_doc) {
if(top_doc != null){ parent.top.location.href=top_doc; }
if(left_doc != null){ parent.left.location.href=left_doc; }
if(body_doc != null){ parent.body.location.href=body_doc; }
if(right_doc != null){ parent.right.location.href=right_doc; }
if(bottom_doc != null){ parent.bottom.location.href=bottom_doc; }
}
//-->
</SCRIPT>
<!-- END phpgw_head_javascript -->