- fix bug with missing root desktop windows after template is set to idots2

- don't show sidebox when it is is not hooked for an application
- small improvements to idots2 toolbar
This commit is contained in:
Pim Snel 2005-07-12 20:57:00 +00:00
parent 73d74fa0f3
commit 14755ad517
6 changed files with 189 additions and 173 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 590 B

View File

@ -9,7 +9,6 @@
* option) any later version. *
\**************************************************************************/
/*
* parse_navbar
*
@ -20,6 +19,8 @@
function parse_navbar($force = False)
{
$GLOBALS['phpgw']->preferences->read_repository();
$GLOBALS['idots2_tpl'] = createobject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
$GLOBALS['idots2_tpl']->set_file(
array(
@ -317,24 +318,25 @@
$GLOBALS['idots2_tpl']->pfp('out','navbar_header_end');
/******************************************************\
* The menu's *
\******************************************************/
}
// its an application, create a window
else
{
$GLOBALS['phpgw']->preferences->read_repository();
/* foreach($GLOBALS['phpgw_info']['user']['apps'] as $name => $data)
//this checks if the rootwindow exist
$var['rooturl'] = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/index.php?cd=yes';
//set some shortcut vars
$current_app= $GLOBALS['phpgw_info']['flags']['currentapp'];
$current_app_title= $GLOBALS['phpgw_info']['apps'][$GLOBALS['phpgw_info']['flags']['currentapp']]['title'];
// _debug_array($GLOBALS['phpgw_info']['flags']['currentapp']);
// _debug_array($GLOBALS['egw']->hooks->found_hooks[$current_app]);
// die();
if($GLOBALS['egw']->hooks->found_hooks[$current_app]['sidebox_menu'])
{
if($data['title'] == $title) {
$state['name'] = $name;
$GLOBALS['phpgw']->preferences->change('phpgwapi','sidebox_state'.$name,$state);
$GLOBALS['phpgw']->preferences->save_repository(True);
break;
$sidebox_enabled=true;
}
}
*/
// build the menu
$menu=array();
@ -349,17 +351,21 @@
'no_lang' => True,
'link' => 'javascript:document.location=document.location'
),
array(
);
if($sidebox_enabled)
{
$menu['Window'][] = array(
'text' => lang('Open sidebox'),
'no_lang' => True,
'link' => 'javascript:sidebox_open()'
),
array(
);
$menu['Window'][] = array(
'text' => lang('Close sidebox'),
'no_lang' => True,
'link' => 'javascript:sidebox_close()'
),
);
}
$menu['Help'] = array(
array(
@ -374,7 +380,6 @@
array(
'text' => lang('About %1',$GLOBALS['phpgw_info']['apps'][$GLOBALS['phpgw_info']['flags']['currentapp']]['title']),
'no_lang' => True,
//'link' => 'javascript:parent.openX(\'about\',\''.$GLOBALS['phpgw_info']['navbar']['about']['url'].'\')'
'link' => $GLOBALS['phpgw_info']['navbar']['about']['url']
),
array(
@ -395,18 +400,10 @@
$GLOBALS['idots2_tpl']->set_var($var);
$menu_from_app = $GLOBALS['phpgw']->hooks->single('menu',$GLOBALS['phpgw_info']['flags']['currentapp']);
//_debug_array($menu_new);
//die();
if(is_array($menu_from_app))
{
$menu = array_merge($menu_from_app,$menu);
}
/* else
{
$GLOBALS['phpgw']->hooks->single('sidebox_menu',$GLOBALS['phpgw_info']['flags']['currentapp']);
display_sidebox('',$menu_title,$menu_help);
}
*/
foreach($menu as $menu_title =>$menu)
{
@ -416,7 +413,6 @@
$GLOBALS['idots2_tpl']->pparse('out','end_appbox');
//build the toolbar
$toolbar = Array();
$toolbar['refresh'] = Array(
'title' => "Refresh",
@ -424,17 +420,33 @@
'url'=>'javascript:document.location=document.location'
);
if($sidebox_enabled)
{
$toolbar['opensidebox'] = Array(
'title' => "Open sidebox",
'image' => 'open_sidebox.png',
'url'=>'javascript:sidebox_open()'
);
$toolbar['closesidebox'] = Array(
'title' => "Open sidebox",
'image' => 'close_sidebox.png',
'url'=>'javascript:sidebox_close()'
);
}
//Is there a toolbar hooked in this application
$toolbar_from_app = $GLOBALS['phpgw']->hooks->single('toolbar',$GLOBALS['phpgw_info']['flags']['currentapp']);
if(is_array($toolbar_from_app) && count($toolbar_from_app) > 0)
{
$toolbar = array_merge($toolbar_from_app,$toolbar);
$toolbar['sep'] = '';
$toolbar = array_merge($toolbar,$toolbar_from_app);
}
display_toolbar($toolbar);
//build the sidebox
if($sidebox_enabled)
{
$menu_title = lang('General Menu');
$file['Home'] = $GLOBALS['egw_info']['navbar']['home']['url'];
@ -460,12 +472,11 @@
$GLOBALS['egw']->hooks->single('sidebox_menu',$GLOBALS['egw_info']['flags']['currentapp']);
$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')
if($sidebox_enabled && $GLOBALS['phpgw_info']['user']['preferences']['phpgwapi']['sidebox_'.$GLOBALS['phpgw_info']['flags']['currentapp']]!='close')
{
$GLOBALS['idots2_tpl']->pparse('out','sidebox_set_open');
}
@ -483,12 +494,11 @@
return;
}
/*
* display_toolbar
*
* The toolbar
*
* @todo toggle buttons, better lay-out hover and active
*/
function display_toolbar($toolbar) {
$GLOBALS['idots2_tpl']->pparse('out','begin_toolbar');
@ -499,7 +509,8 @@
$GLOBALS['idots2_tpl']->set_var($item);
$GLOBALS['idots2_tpl']->pfp('out','toolbar_item');
}
else {
else
{
$GLOBALS['idots2_tpl']->pparse('out','toolbar_seperator');
}
}

View File

@ -1,6 +1,6 @@
<!-- BEGIN xdesktop_header -->
<script type='text/javascript'>
var rootwindow=true;
var xDT = new xDesktop();
var clock_set = '{clock}';
var clock_show = '{clock_show}';
@ -21,7 +21,6 @@ var color_text_sc = '{color_text_sc}';
showShortcuts('{appTitles}', '{appUrls}', '{appImgs}','{appTop}','{appLeft}','{appType}','{appName}','{strXmlUrl}');
initSizes('{sizeTitles}', '{sizeWidth}', '{sizeHeight}');
function start() {
xDT.resPath('{template_dir}/js/x-desktop/xDT/');
xDT.desktop.init();
@ -33,7 +32,6 @@ function start() {
openX(default_title, default_app);
}
}
</script>
@ -132,13 +130,13 @@ function start() {
<!-- BEGIN toolbar_item -->
<a href="{url}" onmouseout="this.style.border='1px solid #e5e5e5';" onmouseover="'this.style.border=1px outset #FFF';" onmousedown="this.style.border='1px inset #FFF';" style="background-image: url({image})"></a>
<a href="{url}" onmouseout="this.style.border='1px solid #e5e5e5';" onmouseover="'this.style.border=1px outset #aaa';" onmousedown="this.style.border='1px inset #fff';" style="width:18px;height:18px;background-image: url({image})"></a>
<!-- END toolbar_item -->
<!-- BEGIN toolbar_seperator -->
<div style="float:left;width:1px;height:19px;margin-top:3px;margin-left:2px;margin-right:3px;border-right:solid 1px #aaaaaa"></div>
<!-- END toolbar_seperator -->
@ -236,6 +234,12 @@ sidebox_open();
<!-- BEGIN menu_header -->
<script type=text/javascript>
if(!parent.rootwindow)
{
parent.location.href='{rooturl}';
}
</script>
<li onclick="itemClick(event);" onmouseover="itemHover(event);"> <a href="javascript:void(0);">{lang_title}</a>
<ul>

View File

@ -20,7 +20,8 @@
$GLOBALS['egw_info']['template']['idots2']['icon'] = "phpgwapi/templates/idots2/images/logo-idots.png";
$GLOBALS['egw_info']['template']['idots2']['maintainer'] = array(
array('name' => 'Edo van Bruggen', 'email' => 'edovanbruggen@raketnet.nl'),
array('name' => 'Rob van Kraanen', 'email' => 'rvkraanen@gmail.com')
array('name' => 'Rob van Kraanen', 'email' => 'rvkraanen@gmail.com'),
array('name' => 'Pim Snel', 'email' => 'pim@lingewoud.nl')
);
$GLOBALS['egw_info']['template']['idots2']['description'] = "