Skip to content

Commit

Permalink
Add my account to Top Menu, only show when user is allowed to maintai…
Browse files Browse the repository at this point in the history
…n his own data (fixed indention and warning)
  • Loading branch information
asig2016 authored and ralfbecker committed Jan 29, 2024
1 parent e5b7896 commit ebfefbf
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions api/src/Framework.php
Original file line number Diff line number Diff line change
Expand Up @@ -1307,10 +1307,10 @@ protected function add_preferences_topmenu($type='prefs')
'title' => 'Access',
'hook' => 'acl_rights',
),
'useraccount' => array(
'title' => 'My Account',
'hook' => 'user_account',
),
'useraccount' => array(
'title' => 'My Account',
'hook' => 'user_account',
),
'cats' => array(
'title' => 'Categories',
'hook' => 'categories',
Expand Down Expand Up @@ -1367,18 +1367,18 @@ protected function add_preferences_topmenu($type='prefs')
));
}
break;
case 'useraccount':
$config = Config::read('phpgwapi');
if ($config['own_account_acl'] && is_array($config['own_account_acl']) && count($config['own_account_acl'])>0){
$this->_add_topmenu_item(array(
'id' => $type,
'name' => 'useraccount',
'title' => lang($types[$type]['title']),
'url' => "javascript:egw.open_link('".
self::link('/index.php?menuaction=addressbook.addressbook_ui.edit&account_id='.$GLOBALS['egw_info']['user']['account_id'])."','_blank','850x580')",
));
}
break;
case 'useraccount':
$config = Config::read('phpgwapi');
if (!empty($config['own_account_acl']) && is_array($config['own_account_acl']) && count($config['own_account_acl'])>0)
{
$this->_add_topmenu_item(array(
'id' => $type,
'name' => 'useraccount',
'title' => lang($types[$type]['title']),
'url' => "javascript:egw.open_link('".self::link('/index.php?menuaction=addressbook.addressbook_ui.edit&account_id='.$GLOBALS['egw_info']['user']['account_id'])."','_blank','850x580')",
));
}
break;
default:
$this->_add_topmenu_item(array(
'id' => $type,
Expand Down

0 comments on commit ebfefbf

Please sign in to comment.