diff options
author | Mario <mario@mariovavti.com> | 2018-09-22 19:48:17 +0200 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2018-09-22 19:48:17 +0200 |
commit | 45078dda825d6412f755e2727e25c027ca48c1e9 (patch) | |
tree | 4bc4134fc7539ec032d5ef8abc7f5a73044f6cef /include | |
parent | 822bbd9ad5e84f556ca6e6580d3a5326c301af8f (diff) | |
download | volse-hubzilla-45078dda825d6412f755e2727e25c027ca48c1e9.tar.gz volse-hubzilla-45078dda825d6412f755e2727e25c027ca48c1e9.tar.bz2 volse-hubzilla-45078dda825d6412f755e2727e25c027ca48c1e9.zip |
introduce profile settings and provide a way for modules without an app to still be able to link to its settings page from the navbar
Diffstat (limited to 'include')
-rw-r--r-- | include/nav.php | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/include/nav.php b/include/nav.php index 5a2096e02..1eef8dc07 100644 --- a/include/nav.php +++ b/include/nav.php @@ -221,6 +221,9 @@ function nav($template = 'default') { } } + if(! $settings_url && isset(App::$nav_sel['settings_url'])) + $settings_url = App::$nav_sel['settings_url']; + //app bin if($is_owner) { if(get_pconfig(local_channel(), 'system','import_system_apps') !== datetime_convert('UTC','UTC','now','Y-m-d')) { @@ -300,7 +303,7 @@ function nav($template = 'default') { '$addapps' => t('Add Apps'), '$orderapps' => t('Arrange Apps'), '$sysapps_toggle' => t('Toggle System Apps'), - '$url' => (($url) ? $url : App::$cmd), + '$url' => (($url) ? $url : z_root() . '/' . App::$cmd), '$settings_url' => $settings_url )); @@ -323,11 +326,16 @@ function nav($template = 'default') { * Set a menu item in navbar as selected * */ -function nav_set_selected($item){ - App::$nav_sel['raw_name'] = $item; - $item = ['name' => $item]; +function nav_set_selected($raw_name, $settings_url = ''){ + App::$nav_sel['raw_name'] = $raw_name; + + $item = ['name' => $raw_name]; Apps::translate_system_apps($item); + App::$nav_sel['name'] = $item['name']; + + if($settings_url) + App::$nav_sel['settings_url'] = z_root() . '/' . $settings_url; } function channel_apps($is_owner = false, $nickname = null) { |