make dynamic resizable sidebox width app specific

This commit is contained in:
Ralf Becker 2009-11-18 20:00:26 +00:00
parent d18f839cbf
commit 221473ce0f
6 changed files with 50 additions and 42 deletions

View File

@ -285,7 +285,8 @@ abstract class egw_framework
else
{
$var['current_app_title']=$apps[$GLOBALS['egw_info']['flags']['currentapp']]['title'];
}
}
$var['currentapp'] = $GLOBALS['egw_info']['flags']['currentapp'];
// current users for admins
$var['current_users'] = $this->_current_users();

View File

@ -8,5 +8,5 @@ function dragSidebar()
function dropSidebar()
{
var mainbox = dd.elements.thesideboxcolumn;
xajax_doXMLHTTP("preferences.ajaxpreferences.storeEGWPref","common","idotssideboxwidth",mainbox.w);
xajax_doXMLHTTP("preferences.ajaxpreferences.storeEGWPref",currentapp,"idotssideboxwidth",mainbox.w);
}

View File

@ -1,5 +1,8 @@
<!-- BEGIN navbar_header -->
<div style="position:relative"><div id="divLogo"><a href="{logo_url}" target="_blank"><img src="{logo_file}" border="0" title="{logo_title}" alt="eGroupWare"/></a></div></div>
<div style="position:relative"><div id="divLogo"><a href="{logo_url}" target="_blank"><img src="{logo_file}" border="0" title="{logo_title}" alt="EGroupware"/></a></div></div>
<script language="javascript">
var currentapp = '{currentapp}';
</script>
<!-- BEGIN app_extra_icons_div -->
<script language="javascript">

View File

@ -216,9 +216,9 @@ class idots_framework extends egw_framework
{
$prefs = array();
if ($GLOBALS['egw_info']['user']['preferences']['common'])
if (isset($GLOBALS['egw_info']['user']['preferences'][$GLOBALS['egw_info']['flags']['currentapp']]['idotssideboxwidth']))
{
$sideboxwidth = $GLOBALS['egw_info']['user']['preferences']['common']['idotssideboxwidth'];
$sideboxwidth = $GLOBALS['egw_info']['user']['preferences'][$GLOBALS['egw_info']['flags']['currentapp']]['idotssideboxwidth'];
}
if((int)$sideboxwidth < 1)
{
@ -370,7 +370,7 @@ class idots_framework extends egw_framework
}
else
{
$var['logo_file'] = $GLOBALS['egw']->common->image('phpgwapi',$GLOBALS['egw_info']['server']['login_logo_file']?$GLOBALS['egw_info']['server']['login_logo_file']:'logo');
$var['logo_file'] = common::image('phpgwapi',$GLOBALS['egw_info']['server']['login_logo_file']?$GLOBALS['egw_info']['server']['login_logo_file']:'logo');
}
$var['logo_url'] = $GLOBALS['egw_info']['server']['login_logo_url']?$GLOBALS['egw_info']['server']['login_logo_url']:'http://www.eGroupWare.org';
if (substr($var['logo_url'],0,4) != 'http')
@ -386,7 +386,7 @@ class idots_framework extends egw_framework
$tmpl->set_var(array(
'lang_language' => lang('Language'),
'select_language' => html::select('lang',$GLOBALS['egw_info']['user']['preferences']['common']['lang'],
$GLOBALS['egw']->translation->get_installed_langs(),true),
translation::get_installed_langs(),true),
));
}
else
@ -750,7 +750,7 @@ class idots_framework extends egw_framework
if(isset($item_link['icon']))
{
$app = isset($item_link['app']) ? $item_link['app'] : $GLOBALS['egw_info']['flags']['currentapp'];
$var['icon_or_star'] = $item_link['icon'] ? '<img style="margin:0px 2px 0px 2px; height: 16px;" src="'.$GLOBALS['egw']->common->image($app,$item_link['icon']).'"/>' : False;
$var['icon_or_star'] = $item_link['icon'] ? '<img style="margin:0px 2px 0px 2px; height: 16px;" src="'.common::image($app,$item_link['icon']).'"/>' : False;
}
$var['lang_item'] = isset($item_link['no_lang']) && $item_link['no_lang'] ? $item_link['text'] : lang($item_link['text']);
$var['item_link'] = $item_link['link'];

View File

@ -1,5 +1,8 @@
<!-- BEGIN navbar_header -->
<div style="position:relative"><div id="divLogo"><a href="{logo_url}" target="_blank"><img src="{logo_file}" border="0" title="{logo_title}" alt="eGroupWare"/></a></div></div>
<div style="position:relative"><div id="divLogo"><a href="{logo_url}" target="_blank"><img src="{logo_file}" border="0" title="{logo_title}" alt="EGroupware"/></a></div></div>
<script language="javascript">
var currentapp = '{currentapp}';
</script>
<!-- BEGIN app_extra_icons_div -->
<script language="javascript">

View File

@ -1,35 +1,36 @@
<?php
/**
* ajaxpreferences
*
* @package preferences
* @abstract script which is called to store prefs using AJAX
* @copyright Lingewoud B.V.
* @link http://www.egroupware.org
* @author Pim Snel <pim-AT-lingewoud-DOT-nl>
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
class ajaxpreferences
{
function ajaxpreferences(){}
/**
* ajaxpreferences
*
* @package preferences
* @copyright Lingewoud B.V.
* @link http://www.egroupware.org
* @author Pim Snel <pim-AT-lingewoud-DOT-nl>
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
/**
* 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)
{
$response = new xajaxResponse();
$GLOBALS['egw']->preferences->read_repository();
$GLOBALS['egw']->preferences->change($repository,$key,$value);
$GLOBALS['egw']->preferences->save_repository(True);
return $response->getXML();
}
}
?>
/**
* Script which is called to store prefs using AJAX
*/
class ajaxpreferences
{
/**
* 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)
{
$response = new xajaxResponse();
$GLOBALS['egw']->preferences->read_repository();
$GLOBALS['egw']->preferences->change($repository,$key,$value);
$GLOBALS['egw']->preferences->save_repository(True);
//$response->addAlert(__METHOD__."('$repository','$key','$value')");
return $response->getXML();
}
}