Add my account to Top Menu, only show when user is allowed to maintain his own data (fixed indention and warning)

This commit is contained in:
Alexandros Sigalas 2024-01-29 11:15:58 +02:00 committed by Ralf Becker
parent e5b789693e
commit ebfefbf070

View File

@ -1307,10 +1307,10 @@ abstract class Framework extends Framework\Extra
'title' => 'Access', 'title' => 'Access',
'hook' => 'acl_rights', 'hook' => 'acl_rights',
), ),
'useraccount' => array( 'useraccount' => array(
'title' => 'My Account', 'title' => 'My Account',
'hook' => 'user_account', 'hook' => 'user_account',
), ),
'cats' => array( 'cats' => array(
'title' => 'Categories', 'title' => 'Categories',
'hook' => 'categories', 'hook' => 'categories',
@ -1367,18 +1367,18 @@ abstract class Framework extends Framework\Extra
)); ));
} }
break; break;
case 'useraccount': case 'useraccount':
$config = Config::read('phpgwapi'); $config = Config::read('phpgwapi');
if ($config['own_account_acl'] && is_array($config['own_account_acl']) && count($config['own_account_acl'])>0){ 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, $this->_add_topmenu_item(array(
'name' => 'useraccount', 'id' => $type,
'title' => lang($types[$type]['title']), 'name' => 'useraccount',
'url' => "javascript:egw.open_link('". 'title' => lang($types[$type]['title']),
self::link('/index.php?menuaction=addressbook.addressbook_ui.edit&account_id='.$GLOBALS['egw_info']['user']['account_id'])."','_blank','850x580')", '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; break;
default: default:
$this->_add_topmenu_item(array( $this->_add_topmenu_item(array(
'id' => $type, 'id' => $type,