- fixed the application manual call from text menu

- sidebox is working again and can be opened and closed from the textmenu (its open by default)
- sidebox saves its state to the preferences
- some html and css cleanups
- IE support still broken
This commit is contained in:
Pim Snel 2005-07-06 23:12:42 +00:00
parent d2444ac288
commit 6d387b8aa2
9 changed files with 175 additions and 34 deletions

View File

@ -155,6 +155,9 @@ a.appTitles,.appTitles
z-index:40;
}
#divAppboxHeader
{
/*width:100%;*/

View File

@ -198,17 +198,39 @@ td
border-top:outset 1px #9c9c9c;
border-bottom:outset 1px #9c9c9c;
border-right:outset 1px #9c9c9c;
/* padding-top:50px;
padding-bottom:60px;
*/
left:0px;
width:170px;
/** height:100%;*/
background-color:#cccccc;
background-color:white;
display:none;
overflow:visible;
position:fixed;
z-index:899;
padding:0;
}
.sidebox
{
}
.sidebox li
{
display:block;
margin:2px;
}
.sidebox ul
{
_list-style:none;
list-style-position:inside;
padding-left:10px;
}
.sidebox_title
{
background-color:#dedede;
padding:5px;
font-weight:bold;
}
.divLoginbox

View File

@ -83,7 +83,8 @@
$app = "";
}
$var = Array(
$var = Array(
'img_icon' => PHPGW_IMAGES_DIR . '/favicon.ico',
'img_shortcut' => PHPGW_IMAGES_DIR . '/favicon.ico',
'slider_effects'=> $slider_effects,

View File

@ -175,6 +175,33 @@ function saveSize(idotsName) {
}
function saveSideboxState(idotsName,sideboxstate) {
title = xDT.prop(idotsName, 'wTitle');
//w = xDT.prop(idotsName, 'wWidth');
//h = xDT.prop(idotsName, 'wHeight');
url = strXmlUrl + "/write_settings.php?action=save_sidebox_state&title=" + idotsName + "&sidebox_state="+sideboxstate;
/*var found = false;
for(i = 0; i < aTitle.length; i++)
{
if(aTitle[i] != "" && aTitle[i] == title) {
aWidth[i] = w;
aHeight[i] = h;
found = true;
}
}
if(!found)
{
aTitle[aTitle.length] = title;
aWidth[aWidth.length] = w;
aHeight[aHeight.length] = h;
}
*/
loadXMLDoc(url);
return true;
}
function findPosX(obj)
{
var curleft = 0;

View File

@ -41,21 +41,25 @@
$GLOBALS['idots2_tpl']->set_block('navbar','show_clock','show_clock');
$GLOBALS['idots2_tpl']->set_block('navbar','no_clock','no_clock');
$GLOBALS['idots2_tpl']->set_block('navbar','sidebox_container','sidebox_container');
$GLOBALS['idots2_tpl']->set_block('navbar','sidebox_container_footer','sidebox_container_footer');
$GLOBALS['idots2_tpl']->set_block('navbar','sidebox_set_open','sidebox_set_open');
$GLOBALS['idots2_tpl']->set_block('navbar','sidebox','sidebox');
$GLOBALS['idots2_tpl']->set_block('navbar','sidebox_spacer','sidebox_spacer');
$GLOBALS['idots2_tpl']->set_block('navbar','sidebox_footer','sidebox_footer');
$GLOBALS['idots2_tpl']->set_block('navbar','extra_sidebox_block_row','extra_sidebox_block_row');
$GLOBALS['idots2_tpl']->set_block('navbar','extra_sidebox_block_row_raw','extra_sidebox_block_row_raw');
$GLOBALS['idots2_tpl']->set_block('navbar','extra_sidebox_block_row_no_link','extra_sidebox_block_row_no_link');
$GLOBALS['idots2_tpl']->set_block('navbar','extra_blocks_header','extra_block_header');
$GLOBALS['idots2_tpl']->set_block('navbar','menu_header','menu_header');
$GLOBALS['idots2_tpl']->set_block('navbar','extra_block_row','extra_block_row');
$GLOBALS['idots2_tpl']->set_block('navbar','extra_block_row_raw','extra_block_row_raw');
$GLOBALS['idots2_tpl']->set_block('navbar','extra_block_row_no_link','extra_block_row_no_link');
$GLOBALS['idots2_tpl']->set_block('navbar','extra_block_spacer','extra_block_spacer');
$GLOBALS['idots2_tpl']->set_block('navbar','extra_blocks_footer','extra_blocks_footer');
$GLOBALS['idots2_tpl']->set_block('navbar','txt_menu_spacer','txt_menu_spacer');
$GLOBALS['idots2_tpl']->set_block('navbar','menu_footer','menu_footer');
$GLOBALS['idots2_tpl']->set_block('navbar','begin_toolbar','begin_toolbar');
$GLOBALS['idots2_tpl']->set_block('navbar','end_toolbar','end_toolbar');
@ -319,6 +323,19 @@
}
else
{
$GLOBALS['phpgw']->preferences->read_repository();
/* foreach($GLOBALS['phpgw_info']['user']['apps'] as $name => $data)
{
if($data['title'] == $title) {
$state['name'] = $name;
$GLOBALS['phpgw']->preferences->change('phpgwapi','sidebox_state'.$name,$state);
$GLOBALS['phpgw']->preferences->save_repository(True);
break;
}
}
*/
// build the menu
$menu=array();
$menu['Window'] = array(
@ -348,7 +365,7 @@
array(
'text' => lang('%1 manual',$GLOBALS['phpgw_info']['apps'][$GLOBALS['phpgw_info']['flags']['currentapp']]['title']),
'no_lang' => True,
'link' => 'javascript:parent.openX(\''.lang('%1 manual',$GLOBALS['phpgw_info']['apps'][$GLOBALS['phpgw_info']['flags']['currentapp']]['title']).'\',\''.$GLOBALS['phpgw_info']['navbar']['manual']['url'].'\')'
'link' => 'javascript:parent.openX(\''.lang('%1 manual',$GLOBALS['phpgw_info']['apps'][$GLOBALS['phpgw_info']['flags']['currentapp']]['title']).'\',\''.$GLOBALS['phpgw_info']['navbar']['manual']['url'].'?app_manual='.$GLOBALS['phpgw_info']['flags']['currentapp'].'\')'
),
array(
'text' => '<hr style="border:0;border-bottom:dashed 1px #444444;height:1px;color:#444444;">',
@ -434,20 +451,24 @@
'Logout'=>$GLOBALS['egw_info']['navbar']['logout']['url']
);
$var['menu_link'] = '';
//$var['sideboxcolstart'] = '<t'.'d id="tdSidebox" valign="top">';
$var['remove_padding'] = '';
$var['current_app'] = $GLOBALS['egw_info']['flags']['currentapp'];
$GLOBALS['idots2_tpl']->set_var($var);
$GLOBALS['idots2_tpl']->pparse('out','sidebox_container');
//display_sidebox('',$menu_title,$file);
$GLOBALS['egw']->hooks->single('sidebox_menu',$GLOBALS['egw_info']['flags']['currentapp']);
//$var['sideboxcolend'] = '</'.'td>';
$GLOBALS['idots2_tpl']->pparse('out','sidebox_container_footer');
$GLOBALS['idots2_tpl']->pparse('out','navbar_footer');
// get sidebox state and set it with js
if($GLOBALS['phpgw_info']['user']['preferences']['phpgwapi']['sidebox_'.$GLOBALS['phpgw_info']['flags']['currentapp']]!='close')
{
$GLOBALS['idots2_tpl']->pparse('out','sidebox_set_open');
}
// If the application has a header include, we now include it
if(!@$GLOBALS['phpgw_info']['flags']['noappheader'] && @isset($_GET['menuaction']))
@ -491,14 +512,14 @@
{
$var['lang_title']=$menu_title;//$appname.' '.lang('Menu');
$GLOBALS['idots2_tpl']->set_var($var);
$GLOBALS['idots2_tpl']->pfp('out','extra_blocks_header');
$GLOBALS['idots2_tpl']->pfp('out','menu_header');
foreach($file as $text => $url)
{
sidebox_menu_item($url,$text);
textmenu_item($url,$text);
}
$GLOBALS['idots2_tpl']->pparse('out','extra_blocks_footer');
$GLOBALS['idots2_tpl']->pparse('out','menu_footer');
}
}
@ -506,7 +527,7 @@
{
if($item_text === '_NewLine_' || $item_link === '_NewLine_')
{
$GLOBALS['idots2_tpl']->pparse('out','extra_block_spacer');
$GLOBALS['idots2_tpl']->pparse('out','txt_menu_spacer');
}
else
{
@ -563,7 +584,7 @@
{
if($item_text === '_NewLine_' || $item_link === '_NewLine_')
{
$GLOBALS['idots2_tpl']->pparse('out','extra_block_spacer');
$GLOBALS['idots2_tpl']->pparse('out','sidebox_spacer');
}
else
{

View File

@ -155,17 +155,18 @@ function sidebox_close()
{
document.getElementById('sidebox_container').style.display="none";
document.getElementById('divAppbox').style.marginLeft="0px;";
parent.saveSideboxState('{current_app}','close');
}
function sidebox_open()
{
document.getElementById('sidebox_container').style.display="block";
document.getElementById('divAppbox').style.marginLeft="180px;";
document.getElementById('divAppbox').style.marginLeft="170px;";
parent.saveSideboxState('{current_app}','open');
}
</script>
<div id="sidebox_container">
<br/>
<!-- END sidebox_container -->
<!-- BEGIN sidebox_container_footer -->
@ -174,16 +175,23 @@ function sidebox_open()
<!-- END sidebox_container_footer -->
<!-- BEGIN sidebox_set_open -->
<script>
sidebox_open();
</script>
<!-- END sidebox_set_open -->
<!-- BEGIN sidebox -->
<div class="sidebox">
<ul>
<div class="sidebox_title">{lang_title}</div>
<table style="width:100%">
<!-- END sidebox -->
<!-- BEGIN sidebox_footer -->
</ul>
</table>
</div>
<!-- END sidebox_footer -->
@ -191,11 +199,18 @@ function sidebox_open()
<!-- BEGIN extra_sidebox_block_row -->
<li><a class="rowSidebox" href="{item_link}"{target}>{lang_item}</a></li>
<tr class="divSideboxEntry">
<td width="20" align="center" valign="middle" class="textSidebox">{icon_or_star}</td><td class="textSidebox"><a class="textSidebox" href="{item_link}"{target}>{lang_item}</a></td>
</tr>
<!-- END extra_sidebox_block_row -->
<!-- BEGIN sidebox_spacer -->
<!-- END sidebox_spacer -->
<!-- BEGIN extra_sidebox_block_row_raw -->
<li><div><a href="#">{lang_item}</a></div></li>
@ -220,19 +235,19 @@ function sidebox_open()
<!-- END navbar_footer -->
<!-- BEGIN extra_blocks_header -->
<!-- BEGIN menu_header -->
<li onclick="itemClick(event);" onmouseover="itemHover(event);"> <a href="javascript:void(0);">{lang_title}</a>
<ul>
<!-- END extra_blocks_header -->
<!-- END menu_header -->
<!-- BEGIN extra_blocks_footer -->
<!-- BEGIN menu_footer -->
</ul></li>
<!-- END extra_blocks_footer -->
<!-- END menu_footer -->
<!-- BEGIN extra_block_row -->
@ -256,9 +271,10 @@ function sidebox_open()
<!-- END extra_block_row_no_link -->
<!-- BEGIN extra_block_spacer -->
<!-- BEGIN txt_menu_spacer -->
&nbsp;
<!-- END extra_block_spacer -->
<!-- END txt_menu_spacer -->
<!-- BEGIN launch_app -->

View File

@ -0,0 +1,53 @@
<?php
/**************************************************************************\
* eGroupWare *
* http://www.egroupware.org *
* This file is written by Rob van Kraanen <rvkraanen@gmail.com> *
* This file is written by Pim Snel <pim@lingewoud.com> *
* Copyright 2005 Lingewoud BV - www.lingewoud.com *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
//todo move shortcutsetting and size also to this file
$phpgw_info = array();
$GLOBALS['phpgw_info']['flags'] = array(
'noheader' => True,
'nonavbar' => True,
'disable_Template_class' => True,
'currentapp' => 'notifywindow'
);
include('../../../header.inc.php');
header("Content-type: text/xml");
header( "Expires: Mon, 26 Jul 1997 05:00:00 GMT" );
header( "Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . "GMT" );
header( "Cache-Control: no-cache, must-revalidate" );
header( "Pragma: no-cache" );
echo '<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>';
echo "\r\n<response>\r\n";
if($_GET[action]=='save_sidebox_state')
{
$title = $_GET["title"];
$sidebox_state = $_GET["sidebox_state"];
echo $title." ".$sidebox_state;
$GLOBALS['phpgw']->preferences->read_repository();
foreach($GLOBALS['phpgw_info']['user']['apps'] as $name => $data)
{
if($name == $title)
{
$GLOBALS['phpgw']->preferences->change('phpgwapi','sidebox_'.$name,$_GET["sidebox_state"]);
$GLOBALS['phpgw']->preferences->save_repository(True);
break;
}
}
}
echo "</response>";
?>

View File

@ -3,6 +3,7 @@
* eGroupWare *
* http://www.egroupware.org *
* This file is written by Rob van Kraanen <rvkraanen@gmail.com> *
* Copyright 2005 Lingewoud BV - www.lingewoud.com *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *

View File

@ -29,7 +29,6 @@
standalone="yes"?>';
echo "\r\n<response>\r\n";
$title = $_GET["title"];
$width = $_GET["w"];
$height= $_GET["h"];
@ -44,8 +43,6 @@
$size['height'] = $height;
$GLOBALS['phpgw']->preferences->change('phpgwapi','size_'.$name,$size);
$GLOBALS['phpgw']->preferences->save_repository(True);
}
}
echo "</response>";