diff options
author | Mario Vavti <mario@mariovavti.com> | 2018-10-06 20:29:32 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-10-06 20:29:32 +0200 |
commit | 66cf0852728d2f95ed3a5b7a304dbc7b79111831 (patch) | |
tree | df5e73fe65ee7f25247eef73d1b3145d18e7e1ab /Zotlabs/Module/Settings/Channel_home.php | |
parent | d1745319318b47932cf5d4acf400bfbf62f94ddc (diff) | |
download | volse-hubzilla-66cf0852728d2f95ed3a5b7a304dbc7b79111831.tar.gz volse-hubzilla-66cf0852728d2f95ed3a5b7a304dbc7b79111831.tar.bz2 volse-hubzilla-66cf0852728d2f95ed3a5b7a304dbc7b79111831.zip |
move profile assign selector to profile settings and personal menu selector to channel_home settings and get rid of misc channel settings section.
Diffstat (limited to 'Zotlabs/Module/Settings/Channel_home.php')
-rw-r--r-- | Zotlabs/Module/Settings/Channel_home.php | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/Zotlabs/Module/Settings/Channel_home.php b/Zotlabs/Module/Settings/Channel_home.php index 0e916d530..b6ecf4ff1 100644 --- a/Zotlabs/Module/Settings/Channel_home.php +++ b/Zotlabs/Module/Settings/Channel_home.php @@ -2,6 +2,7 @@ namespace Zotlabs\Module\Settings; +require_once('include/menu.php'); class Channel_home { @@ -18,8 +19,10 @@ class Channel_home { $channel_divmore_height = ((x($_POST,'channel_divmore_height')) ? intval($_POST['channel_divmore_height']) : 400); if($channel_divmore_height < 50) $channel_divmore_height = 50; - set_pconfig(local_channel(),'system','channel_divmore_height', $channel_divmore_height); + + $channel_menu = ((x($_POST['channel_menu'])) ? htmlspecialchars_decode(trim($_POST['channel_menu']),ENT_QUOTES) : ''); + set_pconfig(local_channel(),'system','channel_menu',$channel_menu); build_sync_packet(); @@ -43,12 +46,37 @@ class Channel_home { t('Click to expand content exceeding this height') ]; + $menus = menu_list(local_channel()); + if($menus) { + $current = get_pconfig(local_channel(),'system','channel_menu'); + $menu[] = ''; + foreach($menus as $m) { + $menu[$m['menu_name']] = htmlspecialchars($m['menu_name'],ENT_COMPAT,'UTF-8'); + } + + $menu_select = [ + 'channel_menu', + t('Personal menu to display in your channel pages'), + $current, + '', + $menu + ]; + } + $extra_settings_html = replace_macros(get_markup_template('field_input.tpl'), [ '$field' => $channel_divmore_height ] ); + if($menu) { + $extra_settings_html .= replace_macros(get_markup_template('field_select.tpl'), + [ + '$field' => $menu_select + ] + ); + } + $tpl = get_markup_template("settings_module.tpl"); $o .= replace_macros($tpl, array( |