diff --git a/phpgwapi/templates/idots/ajaxStorePrefs.php b/phpgwapi/templates/idots/ajaxStorePrefs.php new file mode 100644 index 0000000000..bf27b20ebd --- /dev/null +++ b/phpgwapi/templates/idots/ajaxStorePrefs.php @@ -0,0 +1,55 @@ + author of the idots template set + * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License + * @package api + * @subpackage framework + * @access public + * @abstract script which is called by idots template set to store prefs using AJAX + * @version $Id$ + */ + + if(!$_GET['currentapp']) + { + $_GET['currentapp']='preferences'; + } + + $egw_flags = Array( + 'currentapp' => $_GET['currentapp'], + 'noheader' => True, + 'nonavbar' => True, + 'noappheader' => True, + 'noappfooter' => True, + 'nofooter' => True + ); + + $GLOBALS['egw_info']['flags'] = $egw_flags; + + require('../../../header.inc.php'); + require_once(EGW_API_INC.'/xajax.inc.php'); + $xajax = new xajax($GLOBALS['egw_info']['server']['webserver_url']."/phpgwapi/templates/idots/ajaxStorePrefs.php"); + $xajax->registerFunction("storeEGWPref"); + + /** + * storeEGWPref + * + * @param mixed $repository egroupware preferences repository + * @param mixed $key key to preference + * @param mixed $value new value + * @access public + * @return mixed returns null when no erro, else return error message. + */ + function storeEGWPref($repository,$key,$value) + { + $objResponse = new xajaxResponse(); + $GLOBALS['egw']->preferences->read_repository(); + $GLOBALS['egw']->preferences->change($repository,$key,$value); + $GLOBALS['egw']->preferences->save_repository(True); + return $objResponse; + } + + $xajax->processRequests(); +?> diff --git a/phpgwapi/templates/idots/class.idots_framework.inc.php b/phpgwapi/templates/idots/class.idots_framework.inc.php index 330273cb76..1bcceb275d 100644 --- a/phpgwapi/templates/idots/class.idots_framework.inc.php +++ b/phpgwapi/templates/idots/class.idots_framework.inc.php @@ -14,6 +14,7 @@ require_once(EGW_API_INC.'/class.egw_framework.inc.php'); require_once(EGW_API_INC.'/class.Template.inc.php'); +require_once(EGW_API_INC.'/class.dragdrop.inc.php'); /** * eGW idots template @@ -90,6 +91,9 @@ class idots_framework extends egw_framework */ function navbar() { + $this->tplsav2 = CreateObject('phpgwapi.tplsavant2'); + $this->tplsav2->set_tpl_path(EGW_SERVER_ROOT.SEP.'phpgwapi'.SEP.'templates'.SEP.'idots'); + $this->navbar_done = true; // the navbar @@ -158,15 +162,52 @@ class idots_framework extends egw_framework } else { - $var['menu_link'] = ''; - $var['sideboxcolstart'] = ''; - $var['remove_padding'] = ''; - $this->tpl->set_var($var); - $content .= $this->tpl->parse('out','appbox'); + $GLOBALS['phpgw']->preferences->read_repository(); - $content .= $this->sidebox_content; - - $var['sideboxcolend'] = ''; + $prefs = array(); + + if ($GLOBALS['egw_info']['user']['preferences']['common']) + { + $sideboxwidth = $GLOBALS['egw_info']['user']['preferences']['common']['idotssideboxwidth']; + } + if(intval($sideboxwidth)<1) + { + $sideboxwidth = 203; + } + + $var['menu_link'] = ''; + + $var['sideboxcolstart'] = '
'; + $var['sideboxcolstart'] .= '
+ resize + +
'; + $var['remove_padding'] = ''; + $this->tpl->set_var($var); + $content .= $this->tpl->parse('out','appbox'); + + $content .= $this->sidebox_content; + + $var['sideboxcolend'] = '
'; + + // Add DHTML for resizing sidebox menu + // include wz_dragdrop once + if(!$GLOBALS['egw_info']['flags']['wz_dragdrop_included']) + { + $GLOBALS['egw_info']['flags']['need_footer'] .= "\n"; + $GLOBALS['egw_info']['flags']['need_footer'] .= ''."\n"; + $GLOBALS['egw_info']['flags']['wz_dragdrop_included'] = True; + } + + require_once(EGW_API_INC.'/xajax.inc.php'); + $xajax = new xajax($GLOBALS['egw_info']['server']['webserver_url']."/phpgwapi/templates/idots/ajaxStorePrefs.php"); + $xajax->registerFunction("storeEGWPref"); + + $this->tplsav2->assign('sideboxwidth', $sideboxwidth); + $this->tplsav2->assign('xajaxobj',&$xajax); + $this->tplsav2->assign('xajaxincdir',$GLOBALS['egw_info']['server']['webserver_url'].'/phpgwapi/js'); + + $GLOBALS['egw_info']['flags']['need_footer'] .= $this->tplsav2->fetch('sidebox_dhtml.tpl.php'); } $this->tpl->set_var($var); @@ -559,17 +600,18 @@ class idots_framework extends egw_framework */ function sidebox($appname,$menu_title,$file) { - if(!$appname || ($appname==$GLOBALS['egw_info']['flags']['currentapp'] && $file)) - { - $this->tpl->set_var('lang_title',$menu_title); - $this->sidebox_content .= $this->tpl->fp('out','extra_blocks_header'); - foreach($file as $text => $url) - { - $this->sidebox_content .= $this->_sidebox_menu_item($url,$text); - } - $this->sidebox_content .= $this->tpl->parse('out','extra_blocks_footer'); - } + if(!$appname || ($appname==$GLOBALS['egw_info']['flags']['currentapp'] && $file)) + { + $this->tpl->set_var('lang_title',$menu_title); + $this->sidebox_content .= $this->tpl->fp('out','extra_blocks_header'); + + foreach($file as $text => $url) + { + $this->sidebox_content .= $this->_sidebox_menu_item($url,$text); + } + $this->sidebox_content .= $this->tpl->parse('out','extra_blocks_footer'); + } } /** diff --git a/phpgwapi/templates/idots/css/idots.css b/phpgwapi/templates/idots/css/idots.css index f85d4ac1c6..4f02675374 100755 --- a/phpgwapi/templates/idots/css/idots.css +++ b/phpgwapi/templates/idots/css/idots.css @@ -153,8 +153,13 @@ input[type=image] border: 0; } -.divLoginbox,.divSidebox +#thesideboxcolumn +{ + width: 177px; + position:relative; +} +.divLoginbox { position:relative; width: 370px; @@ -163,7 +168,8 @@ input[type=image] .divSidebox { - width: 177px; + position:relative; + border: #9c9c9c 1px solid; } .divSideboxHeader,.divLoginboxHeader diff --git a/phpgwapi/templates/idots/sidebox_dhtml.tpl.php b/phpgwapi/templates/idots/sidebox_dhtml.tpl.php new file mode 100644 index 0000000000..857e9fc5b5 --- /dev/null +++ b/phpgwapi/templates/idots/sidebox_dhtml.tpl.php @@ -0,0 +1,22 @@ + +xajaxobj->printJavascript($this->xajaxincdir); ?> + + +