now admin can enable/disable the preferences as any other app, fix for bug#2967

This commit is contained in:
Ralf Becker 2003-03-28 16:19:46 +00:00
parent 2ffaa5997d
commit 32f1ed2b83
7 changed files with 30 additions and 20 deletions

View File

@ -1346,13 +1346,11 @@ if (!@is_file(PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info'
$GLOBALS['phpgw_info']['navbar']['home']['icon'] = $this->image('phpgwapi',Array('home','nonav'));
$GLOBALS['phpgw_info']['navbar']['home']['icon_hover'] = $this->image_on('phpgwapi',Array('home','nonav'),'-over');
reset($GLOBALS['phpgw_info']['user']['apps']);
/* ksort($GLOBALS['phpgw_info']['user']['apps']); */
if(is_array($GLOBALS['phpgw_info']['user']['apps']['admin']))
list($first) = each($GLOBALS['phpgw_info']['user']['apps']);
if(is_array($GLOBALS['phpgw_info']['user']['apps']['admin']) && $first != 'admin')
{
$newarray['admin'] = $GLOBALS['phpgw_info']['user']['apps']['admin'];
while(list($index,$value) = each($GLOBALS['phpgw_info']['user']['apps']))
foreach($GLOBALS['phpgw_info']['user']['apps'] as $index => $value)
{
if($index != 'admin')
{
@ -1375,14 +1373,14 @@ if (!@is_file(PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info'
$navbar = False;
}
while (list($app,$data) = each($GLOBALS['phpgw_info']['user']['apps']))
foreach($GLOBALS['phpgw_info']['user']['apps'] as $app => $data)
{
if (is_long($app))
{
continue;
}
if ($GLOBALS['phpgw_info']['apps'][$app]['status'] != 2 && $GLOBALS['phpgw_info']['apps'][$app]['status'] != 3)
if ($app == 'preferences' || $GLOBALS['phpgw_info']['apps'][$app]['status'] != 2 && $GLOBALS['phpgw_info']['apps'][$app]['status'] != 3)
{
$GLOBALS['phpgw_info']['navbar'][$app]['title'] = $data['title'];
$GLOBALS['phpgw_info']['navbar'][$app]['url'] = $GLOBALS['phpgw']->link('/' . $app . '/index.php');
@ -1402,23 +1400,26 @@ if (!@is_file(PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info'
}
/* apps for the top menu */
$GLOBALS['phpgw_info']['navbar']['preferences']['title'] = lang('preferences');
$GLOBALS['phpgw_info']['navbar']['preferences']['url'] = $GLOBALS['phpgw']->link('/preferences/index.php');
$GLOBALS['phpgw_info']['navbar']['preferences']['icon'] = $this->image('preferences',Array('navbar','nonav'));
$GLOBALS['phpgw_info']['navbar']['preferences']['icon_hover'] = $this->image_on('preferences',Array('navbar','nonav'),'-over');
$GLOBALS['phpgw_info']['navbar']['help']['title'] = lang('manual');
$GLOBALS['phpgw_info']['navbar']['help']['url'] = $GLOBALS['phpgw']->link('/help.php');
$GLOBALS['phpgw_info']['navbar']['help']['icon'] = $this->image('phpgwapi',Array('help','nonav'));
$GLOBALS['phpgw_info']['navbar']['help']['icon_hover'] = $this->image_on('phpgwapi',Array('help','nonav'),'-over');
if ($GLOBALS['phpgw_info']['flags']['currentapp'] == 'home') //|| $GLOBALS['phpgw_info']['flags']['currentapp'] == 'preferences')
if ($GLOBALS['phpgw_info']['flags']['currentapp'] == 'home')
{
$app = 'phpGroupWare';
$app = $app_title = 'phpGroupWare';
}
else
{
$app = $GLOBALS['phpgw_info']['flags']['currentapp'];
$app_title = $GLOBALS['phpgw_info']['apps'][$app]['title'];
}
if ($GLOBALS['phpgw_info']['user']['apps']['preferences']) // preferences last
{
$prefs = $GLOBALS['phpgw_info']['navbar']['preferences'];
unset($GLOBALS['phpgw_info']['navbar']['preferences']);
$GLOBALS['phpgw_info']['navbar']['preferences'] = $prefs;
}
/* We handle this here becuase its special */

View File

@ -370,7 +370,6 @@
$continue_app_data = True;
if ($GLOBALS['phpgw_info']['flags']['currentapp'] != 'home' &&
$GLOBALS['phpgw_info']['flags']['currentapp'] != 'preferences' &&
$GLOBALS['phpgw_info']['flags']['currentapp'] != 'about' &&
$GLOBALS['phpgw_info']['flags']['currentapp'] != 'help')
{

View File

@ -82,7 +82,9 @@
<table cellspacing="0" cellpadding="0" align="right">
<tr>
<td><a href="{$home_link}" onMouseOver="" onMouseOut=""><img src="{$home_img}" border="0" name="nine" alt="{$home_title}" title="{$home_title}"/></a></td>
<td><a href="{$prefs_link}" onMouseOver="" onMouseOut=""><img src="{$prefs_img}" border="0" name="ten" alt="{$prefs_title}" title="{$prefs_title}"/></a></td>
<xsl:if test="$prefs_link != ''">
<td><a href="{$prefs_link}" onMouseOver="" onMouseOut=""><img src="{$prefs_img}" border="0" name="ten" alt="{$prefs_title}" title="{$prefs_title}"/></a></td>
</xsl:if>
<td><a href="{$logout_link}" onMouseOver="" onMouseOut=""><img src="{$logout_img}" border="0" name="eleven" alt="{$logout_title}" title="{$logout_title}"/></a></td>
<td><a href="{$about_link}" onMouseOver="" onMouseOut=""><img src="{$about_img}" border="0" name="about" alt="{$about_title}" title="{$about_title}"/></a></td>
<td><a href="{$help_link}" onMouseOver="" onMouseOut="" target="_blank"><img src="{$help_img}" border="0" name="help" alt="{$help_title}" title="{$help_title}"/></a></td>

View File

@ -60,7 +60,9 @@
<table cellpadding="2" cellspacing="2">
<tr class="top_bottom">
<td class="top_menu"><a href="{$home_link}" onMouseOver="window.status='{$home_statustext}'; return true;" onMouseOut="window.status='';return true;" class="{$top_css_home}">[<xsl:value-of select="home_title"/>]</a></td>
<td class="top_menu"><a href="{$prefs_link}" onMouseOver="window.status='{$prefs_statustext}'; return true;" onMouseOut="window.status='';return true;" class="{$top_css_prefs}">[<xsl:value-of select="prefs_title"/>]</a></td>
<xsl:if test="$prefs_link != ''">
<td class="top_menu"><a href="{$prefs_link}" onMouseOver="window.status='{$prefs_statustext}'; return true;" onMouseOut="window.status='';return true;" class="{$top_css_prefs}">[<xsl:value-of select="prefs_title"/>]</a></td>
</xsl:if>
<td class="top_menu"><a href="{$logout_link}" onMouseOver="window.status='{$logout_statustext}'; return true;" onMouseOut="window.status='';return true;" class="{$top_css}">[<xsl:value-of select="logout_title"/>]</a></td>
<td class="top_menu"><a href="{$about_link}" onMouseOver="window.status='{$about_statustext}'; return true;" onMouseOut="window.status='';return true;" class="{$top_css_about}">[<xsl:value-of select="about_img"/>]</a></td>
<td class="top_menu"><a href="{$help_link}" onMouseOver="window.status='{$help_statustext}'; return true;" onMouseOut="window.status='';return true;" class="{$top_css_help}" target="_blank">[<xsl:value-of select="help_img"/>]</a></td>

View File

@ -80,7 +80,9 @@
<table cellpadding="0" cellspacing="0">
<tr class="top_bottom">
<td><a href="{$home_link}" onMouseOver="nine.src='{$home_img_hover}'" onMouseOut="nine.src='{$home_img}'"><img src="{$home_img}" border="0" name="nine" alt="{$home_title}" title="{$home_title}"/></a></td>
<td><a href="{$prefs_link}" onMouseOver="ten.src='{$prefs_img_hover}'" onMouseOut="ten.src='{$prefs_img}'"><img src="{$prefs_img}" border="0" name="ten" alt="{$prefs_title}" title="{$prefs_title}"/></a></td>
<xsl:if test="$prefs_link != ''">
<td><a href="{$prefs_link}" onMouseOver="ten.src='{$prefs_img_hover}'" onMouseOut="ten.src='{$prefs_img}'"><img src="{$prefs_img}" border="0" name="ten" alt="{$prefs_title}" title="{$prefs_title}"/></a></td>
</xsl:if>
<td><a href="{$logout_link}" onMouseOver="eleven.src='{$logout_img_hover}'" onMouseOut="eleven.src='{$logout_img}'"><img src="{$logout_img}" border="0" name="eleven" alt="{$logout_title}" title="{$logout_title}"/></a></td>
<td><a href="{$about_link}" onMouseOver="about.src='{$about_img_hover}'" onMouseOut="about.src='{$about_img}'"><img src="{$about_img}" border="0" name="about" alt="{$about_title}" title="{$about_title}"/></a></td>
<td><a href="{$help_link}" onMouseOver="help.src='{$help_img_hover}'" onMouseOut="help.src='{$help_img}'" target="_blank"><img src="{$help_img}" border="0" name="help" alt="{$help_title}" title="{$help_title}"/></a></td>

View File

@ -50,7 +50,9 @@
<td width="218" height="33" class="top_top"><img src="{$logo_img}" alt="phpGroupWare" title="phpGroupWare"/></td>
<td width="100%" valign="bottom" class="top_top"> </td>
<td valign="bottom" width="56" class="top"><a href="{$home_link}"><img src="{$home_img" width="56" height="23" border="0" alt="{$home_title}" title="{$home_title}"/></a></td>
<td valign="bottom" width="85" class="top"><a href="{$prefs_link}"><img src="{$prefs_img}" width="85" height="23" border="0" alt="{$prefs_title}" title="{$prefs_title}"/></a></td>
<xsl:if test="$prefs_link != ''">
<td valign="bottom" width="85" class="top"><a href="{$prefs_link}"><img src="{$prefs_img}" width="85" height="23" border="0" alt="{$prefs_title}" title="{$prefs_title}"/></a></td>
</xsl:if>
<td valign="bottom" width="56" class="top"><a href="{$logout_link}"><img src="{$logout_img}" width="56" height="23" border="0" alt="{$logout_title}" title="{$logout_title}"/></a></td>
<td valign="bottom" width="39" class="top"><a href="{$about_link}"><img src="{$about_img}" width="39" height="23" border="0" alt="{$about_title}" title="{$about_title}"/></a></td>
<td valign="bottom" width="39" class="top"><a href="{$help_link}" target="_blank"><img src="{$help_img}" width="39" height="23" border="0" alt="{$help_title}" title="{$help_title}"/></a></td>

View File

@ -56,7 +56,9 @@
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td><a href="{$home_link}"><img src="{$home_img}" border="0" alt="{$home_title}" title="{$home_title}"/></a></td>
<td><a href="{$prefs_link}"><img src="{$prefs_img}" border="0" alt="{$prefs_title}" title="{$prefs_title}"/></a></td>
<xsl:if test="$prefs_link != ''">
<td><a href="{$prefs_link}"><img src="{$prefs_img}" border="0" alt="{$prefs_title}" title="{$prefs_title}"/></a></td>
</xsl:if>
<td><a href="{$logout_link}"><img src="{$logout_img}" border="0" alt="{$logout_title}" title="{$logout_title}"/></a></td>
<td><a href="{$about_link}"><img src="{$about_img}" border="0" alt="{$about_title}" title="{$about_title}"/></a></td>
<td><a href="{$help_link}" target="_blank"><img src="{$help_img}" border="0" alt="{$help_title}" title="{$help_title}"/></a></td>