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

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

View File

@ -8,5 +8,5 @@ function dragSidebar()
function dropSidebar() function dropSidebar()
{ {
var mainbox = dd.elements.thesideboxcolumn; 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 --> <!-- 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 --> <!-- BEGIN app_extra_icons_div -->
<script language="javascript"> <script language="javascript">

View File

@ -216,9 +216,9 @@ class idots_framework extends egw_framework
{ {
$prefs = array(); $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) if((int)$sideboxwidth < 1)
{ {
@ -370,7 +370,7 @@ class idots_framework extends egw_framework
} }
else 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'; $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') if (substr($var['logo_url'],0,4) != 'http')
@ -386,7 +386,7 @@ class idots_framework extends egw_framework
$tmpl->set_var(array( $tmpl->set_var(array(
'lang_language' => lang('Language'), 'lang_language' => lang('Language'),
'select_language' => html::select('lang',$GLOBALS['egw_info']['user']['preferences']['common']['lang'], '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 else
@ -750,7 +750,7 @@ class idots_framework extends egw_framework
if(isset($item_link['icon'])) if(isset($item_link['icon']))
{ {
$app = isset($item_link['app']) ? $item_link['app'] : $GLOBALS['egw_info']['flags']['currentapp']; $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['lang_item'] = isset($item_link['no_lang']) && $item_link['no_lang'] ? $item_link['text'] : lang($item_link['text']);
$var['item_link'] = $item_link['link']; $var['item_link'] = $item_link['link'];

View File

@ -1,5 +1,8 @@
<!-- BEGIN navbar_header --> <!-- 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 --> <!-- BEGIN app_extra_icons_div -->
<script language="javascript"> <script language="javascript">

View File

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