diff --git a/phpgwapi/templates/idots2/head.inc.php b/phpgwapi/templates/idots2/head.inc.php index a37b83bf22..42b17bad74 100755 --- a/phpgwapi/templates/idots2/head.inc.php +++ b/phpgwapi/templates/idots2/head.inc.php @@ -1,105 +1,105 @@ '; - $theme_css .= ''; - - $cbe_core = ''; - $cbe_event = ''; - $cbe_slide = ''; - $skin_idots2 = ''; - $x_core = ''; - $x_events = ''; - $x_shortcuts = ''; - $xdesktop .= $theme_css . $cbe_core . $cbe_event . $cbe_slide . $skin_idots2 . $x_core . $x_events . $x_shortcuts; - - - } - else - { - //Just a normal page - $bodyheader = ' id="xpage"'; - $menu_js = ''; - $theme_css = ''; + // get used language code - $xdesktop = $theme_css . $menu_js; - } - - /* - ** Create/use the template - */ - $tpl = CreateObject('phpgwapi.Template',PHPGW_TEMPLATE_DIR); - $tpl->set_unknowns('remove'); - $tpl->set_file(array('_head' => 'head.tpl')); - $tpl->set_block('_head','head'); + $lang_code = $GLOBALS['phpgw_info']['user']['preferences']['common']['lang']; - if ($GLOBALS['phpgw_info']['flags']['app_header']) - { - $app = $GLOBALS['phpgw_info']['flags']['app_header']; - } - else - { - $app = $GLOBALS['phpgw_info']['flags']['currentapp']; - $app = isset($GLOBALS['phpgw_info']['apps'][$app]) ? $GLOBALS['phpgw_info']['apps'][$app]['title'] : lang($app); - } - if($GLOBALS['phpgw_info']['flags']['currentapp']=='eGroupWare') - { - $app = ""; - - } - -$var = Array( - 'img_icon' => PHPGW_IMAGES_DIR . '/favicon.ico', - 'img_shortcut' => PHPGW_IMAGES_DIR . '/favicon.ico', - 'slider_effects'=> $slider_effects, - 'simple_show_hide'=> $simple_show_hide, - 'lang_code' => $lang_code, - 'charset' => $GLOBALS['phpgw']->translation->charset(), - 'font_family' => $GLOBALS['phpgw_info']['theme']['font'], - 'website_title' => $GLOBALS['phpgw_info']['server']['site_title']. ($app ? " [$app]" : ''), - 'body_tags' => $bodyheader .' '. $GLOBALS['phpgw']->common->get_body_attribs(), - 'xdesktop' => $xdesktop, - 'css' => $GLOBALS['phpgw']->common->get_css(), - 'bckGrnd' => $bckGrnd, - 'java_script' => $GLOBALS['phpgw']->common->get_java_script(), - ); - $tpl->set_var($var); - $tpl->pfp('out','head'); - unset($tpl); + /* + ** Getting the correct directories for finding the resources + */ + $template_dir = $GLOBALS['phpgw_info']['server']['webserver_url'] . "/phpgwapi/templates/" . $GLOBALS['phpgw_info']['server']['template_set']; + + $js_url = $template_dir.'/js/'; + $css_url = $template_dir.'/css/'; + + + if($GLOBALS['phpgw_info']['flags']['currentapp']=='eGroupWare') + { + //Initializing x-desktop + $bodyheader = ' id="xdesktop"'; + $theme_css = ''; + $theme_css .= ''; + + $cbe_core = ''; + $cbe_event = ''; + $cbe_slide = ''; + $skin_idots2 = ''; + $x_core = ''; + $x_events = ''; + $x_shortcuts = ''; + $xdesktop .= $theme_css . $cbe_core . $cbe_event . $cbe_slide . $skin_idots2 . $x_core . $x_events . $x_shortcuts; + + + } + else + { + //Just a normal page + $bodyheader = ' id="xpage"'; + $menu_js = ''; + $theme_css = ''; + + $xdesktop = $theme_css . $menu_js; + } + + + /* + ** Create/use the template + */ + $tpl = CreateObject('phpgwapi.Template',PHPGW_TEMPLATE_DIR); + $tpl->set_unknowns('remove'); + $tpl->set_file(array('_head' => 'head.tpl')); + $tpl->set_block('_head','head'); + + if ($GLOBALS['phpgw_info']['flags']['app_header']) + { + $app = $GLOBALS['phpgw_info']['flags']['app_header']; + } + else + { + $app = $GLOBALS['phpgw_info']['flags']['currentapp']; + $app = isset($GLOBALS['phpgw_info']['apps'][$app]) ? $GLOBALS['phpgw_info']['apps'][$app]['title'] : lang($app); + } + if($GLOBALS['phpgw_info']['flags']['currentapp']=='eGroupWare') + { + $app = ""; + + } + + $var = Array( + 'img_icon' => PHPGW_IMAGES_DIR . '/favicon.ico', + 'img_shortcut' => PHPGW_IMAGES_DIR . '/favicon.ico', + 'slider_effects'=> $slider_effects, + 'simple_show_hide'=> $simple_show_hide, + 'lang_code' => $lang_code, + 'charset' => $GLOBALS['phpgw']->translation->charset(), + 'font_family' => $GLOBALS['phpgw_info']['theme']['font'], + 'website_title' => $GLOBALS['phpgw_info']['server']['site_title']. ($app ? " [$app]" : ''), + 'body_tags' => $bodyheader .' '. $GLOBALS['phpgw']->common->get_body_attribs(), + 'xdesktop' => $xdesktop, + 'css' => $GLOBALS['phpgw']->common->get_css(), + 'bckGrnd' => $bckGrnd, + 'java_script' => $GLOBALS['phpgw']->common->get_java_script(), + ); + $tpl->set_var($var); + $tpl->pfp('out','head'); + unset($tpl); ?> diff --git a/phpgwapi/templates/idots2/images/close_sidebox.png b/phpgwapi/templates/idots2/images/close_sidebox.png new file mode 100644 index 0000000000..b4eb6c7c96 Binary files /dev/null and b/phpgwapi/templates/idots2/images/close_sidebox.png differ diff --git a/phpgwapi/templates/idots2/images/open_sidebox.png b/phpgwapi/templates/idots2/images/open_sidebox.png new file mode 100644 index 0000000000..0add0cac44 Binary files /dev/null and b/phpgwapi/templates/idots2/images/open_sidebox.png differ diff --git a/phpgwapi/templates/idots2/navbar.inc.php b/phpgwapi/templates/idots2/navbar.inc.php index 3c11b1d7ea..780b2f3ee0 100755 --- a/phpgwapi/templates/idots2/navbar.inc.php +++ b/phpgwapi/templates/idots2/navbar.inc.php @@ -3,13 +3,12 @@ * eGroupWare * * http://www.egroupware.org * * -------------------------------------------- * - * 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. * + * 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. * \**************************************************************************/ - /* * 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( @@ -41,7 +42,7 @@ $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'); @@ -53,7 +54,7 @@ $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','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'); @@ -317,25 +318,26 @@ $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(); $menu['Window'] = array( @@ -343,23 +345,27 @@ 'text' => lang('%1 start',$GLOBALS['phpgw_info']['apps'][$GLOBALS['phpgw_info']['flags']['currentapp']]['title']), 'no_lang' => True, 'link' => $GLOBALS['phpgw_info']['server']['webserver_url'] . '/'.$GLOBALS['phpgw_info']['flags']['currentapp'].'/index.php' - ), - array( + ), + array( 'text' => lang('Refresh'), '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,28 +400,19 @@ $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); + $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) { - display_textmenu('',$menu_title,$menu); + display_textmenu('',$menu_title,$menu); } $GLOBALS['idots2_tpl']->pparse('out','end_appbox'); //build the toolbar - $toolbar = Array(); $toolbar['refresh'] = Array( 'title' => "Refresh", @@ -424,48 +420,63 @@ '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 - $menu_title = lang('General Menu'); - - $file['Home'] = $GLOBALS['egw_info']['navbar']['home']['url']; - if($GLOBALS['egw_info']['user']['apps']['preferences']) + if($sidebox_enabled) { - $file['Preferences'] = $GLOBALS['egw_info']['navbar']['preferences']['url']; + $menu_title = lang('General Menu'); + + $file['Home'] = $GLOBALS['egw_info']['navbar']['home']['url']; + if($GLOBALS['egw_info']['user']['apps']['preferences']) + { + $file['Preferences'] = $GLOBALS['egw_info']['navbar']['preferences']['url']; + } + $file += array( + array( + 'text' => lang('About %1',$GLOBALS['egw_info']['apps'][$GLOBALS['egw_info']['flags']['currentapp']]['title']), + 'no_lang' => True, + 'link' => $GLOBALS['egw_info']['navbar']['about']['url'] + ), + 'Logout'=>$GLOBALS['egw_info']['navbar']['logout']['url'] + ); + $var['menu_link'] = ''; + $var['remove_padding'] = ''; + $var['current_app'] = $GLOBALS['egw_info']['flags']['currentapp']; + $GLOBALS['idots2_tpl']->set_var($var); + + $GLOBALS['idots2_tpl']->pparse('out','sidebox_container'); + + $GLOBALS['egw']->hooks->single('sidebox_menu',$GLOBALS['egw_info']['flags']['currentapp']); + + $GLOBALS['idots2_tpl']->pparse('out','sidebox_container_footer'); } - $file += array( - array( - 'text' => lang('About %1',$GLOBALS['egw_info']['apps'][$GLOBALS['egw_info']['flags']['currentapp']]['title']), - 'no_lang' => True, - 'link' => $GLOBALS['egw_info']['navbar']['about']['url'] - ), - 'Logout'=>$GLOBALS['egw_info']['navbar']['logout']['url'] - ); - $var['menu_link'] = ''; - $var['remove_padding'] = ''; - $var['current_app'] = $GLOBALS['egw_info']['flags']['currentapp']; - $GLOBALS['idots2_tpl']->set_var($var); - - $GLOBALS['idots2_tpl']->pparse('out','sidebox_container'); - - $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'); } } diff --git a/phpgwapi/templates/idots2/navbar.tpl b/phpgwapi/templates/idots2/navbar.tpl index a52996cc98..0e93b814d7 100755 --- a/phpgwapi/templates/idots2/navbar.tpl +++ b/phpgwapi/templates/idots2/navbar.tpl @@ -1,6 +1,6 @@ @@ -132,13 +130,13 @@ function start() { - + - +
@@ -236,6 +234,12 @@ sidebox_open(); +
  • {lang_title}