move *_divmore_height setting to the module extra_settings, and fix issue where feature settings were not synced if rpath was provided
This commit is contained in:
parent
6e03104e3e
commit
d4af745fc8
@ -16,6 +16,10 @@ class Calendar {
|
|||||||
process_module_features_post(local_channel(), $features, $_POST);
|
process_module_features_post(local_channel(), $features, $_POST);
|
||||||
|
|
||||||
build_sync_packet();
|
build_sync_packet();
|
||||||
|
|
||||||
|
if($_POST['rpath'])
|
||||||
|
goaway($_POST['rpath']);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,8 +14,18 @@ class Channel_home {
|
|||||||
$features = get_module_features($module);
|
$features = get_module_features($module);
|
||||||
|
|
||||||
process_module_features_post(local_channel(), $features, $_POST);
|
process_module_features_post(local_channel(), $features, $_POST);
|
||||||
|
|
||||||
|
$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);
|
||||||
|
|
||||||
build_sync_packet();
|
build_sync_packet();
|
||||||
|
|
||||||
|
if($_POST['rpath'])
|
||||||
|
goaway($_POST['rpath']);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26,6 +36,20 @@ class Channel_home {
|
|||||||
$features = get_module_features($module);
|
$features = get_module_features($module);
|
||||||
$rpath = (($_GET['rpath']) ? $_GET['rpath'] : '');
|
$rpath = (($_GET['rpath']) ? $_GET['rpath'] : '');
|
||||||
|
|
||||||
|
$channel_divmore_height = [
|
||||||
|
'channel_divmore_height',
|
||||||
|
t('Max height of content (in pixels)'),
|
||||||
|
((get_pconfig(local_channel(),'system','channel_divmore_height')) ? get_pconfig(local_channel(),'system','channel_divmore_height') : 400),
|
||||||
|
t('Click to expand content exceeding this height')
|
||||||
|
];
|
||||||
|
|
||||||
|
$extra_settings_html = replace_macros(get_markup_template('field_input.tpl'),
|
||||||
|
[
|
||||||
|
'$field' => $channel_divmore_height
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
$tpl = get_markup_template("settings_module.tpl");
|
$tpl = get_markup_template("settings_module.tpl");
|
||||||
|
|
||||||
$o .= replace_macros($tpl, array(
|
$o .= replace_macros($tpl, array(
|
||||||
@ -34,6 +58,7 @@ class Channel_home {
|
|||||||
'$form_security_token' => get_form_security_token('settings_' . $module),
|
'$form_security_token' => get_form_security_token('settings_' . $module),
|
||||||
'$title' => t('Channel Home Settings'),
|
'$title' => t('Channel Home Settings'),
|
||||||
'$features' => process_module_features_get(local_channel(), $features),
|
'$features' => process_module_features_get(local_channel(), $features),
|
||||||
|
'$extra_settings_html' => $extra_settings_html,
|
||||||
'$submit' => t('Submit')
|
'$submit' => t('Submit')
|
||||||
));
|
));
|
||||||
|
|
||||||
|
@ -16,6 +16,10 @@ class Connections {
|
|||||||
process_module_features_post(local_channel(), $features, $_POST);
|
process_module_features_post(local_channel(), $features, $_POST);
|
||||||
|
|
||||||
build_sync_packet();
|
build_sync_packet();
|
||||||
|
|
||||||
|
if($_POST['rpath'])
|
||||||
|
goaway($_POST['rpath']);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,6 +16,10 @@ class Directory {
|
|||||||
process_module_features_post(local_channel(), $features, $_POST);
|
process_module_features_post(local_channel(), $features, $_POST);
|
||||||
|
|
||||||
build_sync_packet();
|
build_sync_packet();
|
||||||
|
|
||||||
|
if($_POST['rpath'])
|
||||||
|
goaway($_POST['rpath']);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,13 +30,6 @@ class Display {
|
|||||||
$manual_update = ((array_key_exists('manual_update',$_POST)) ? intval($_POST['manual_update']) : 0);
|
$manual_update = ((array_key_exists('manual_update',$_POST)) ? intval($_POST['manual_update']) : 0);
|
||||||
$start_menu = ((x($_POST,'start_menu')) ? intval($_POST['start_menu']) : 0);
|
$start_menu = ((x($_POST,'start_menu')) ? intval($_POST['start_menu']) : 0);
|
||||||
|
|
||||||
$channel_divmore_height = ((x($_POST,'channel_divmore_height')) ? intval($_POST['channel_divmore_height']) : 400);
|
|
||||||
if($channel_divmore_height < 50)
|
|
||||||
$channel_divmore_height = 50;
|
|
||||||
$network_divmore_height = ((x($_POST,'network_divmore_height')) ? intval($_POST['network_divmore_height']) : 400);
|
|
||||||
if($network_divmore_height < 50)
|
|
||||||
$network_divmore_height = 50;
|
|
||||||
|
|
||||||
$browser_update = ((x($_POST,'browser_update')) ? intval($_POST['browser_update']) : 0);
|
$browser_update = ((x($_POST,'browser_update')) ? intval($_POST['browser_update']) : 0);
|
||||||
$browser_update = $browser_update * 1000;
|
$browser_update = $browser_update * 1000;
|
||||||
if($browser_update < 10000)
|
if($browser_update < 10000)
|
||||||
@ -53,8 +46,6 @@ class Display {
|
|||||||
set_pconfig(local_channel(),'system','itemspage', $itemspage);
|
set_pconfig(local_channel(),'system','itemspage', $itemspage);
|
||||||
set_pconfig(local_channel(),'system','no_smilies',1-intval($nosmile));
|
set_pconfig(local_channel(),'system','no_smilies',1-intval($nosmile));
|
||||||
set_pconfig(local_channel(),'system','title_tosource',$title_tosource);
|
set_pconfig(local_channel(),'system','title_tosource',$title_tosource);
|
||||||
set_pconfig(local_channel(),'system','channel_divmore_height', $channel_divmore_height);
|
|
||||||
set_pconfig(local_channel(),'system','network_divmore_height', $network_divmore_height);
|
|
||||||
set_pconfig(local_channel(),'system','manual_conversation_update', $manual_update);
|
set_pconfig(local_channel(),'system','manual_conversation_update', $manual_update);
|
||||||
set_pconfig(local_channel(),'system','channel_menu', $channel_menu);
|
set_pconfig(local_channel(),'system','channel_menu', $channel_menu);
|
||||||
set_pconfig(local_channel(),'system','start_menu', $start_menu);
|
set_pconfig(local_channel(),'system','start_menu', $start_menu);
|
||||||
@ -211,8 +202,6 @@ class Display {
|
|||||||
'$manual_update' => array('manual_update', t('Manual conversation updates'), channel_manual_conv_update(local_channel()), t('Default is on, turning this off may increase screen jumping'), $yes_no),
|
'$manual_update' => array('manual_update', t('Manual conversation updates'), channel_manual_conv_update(local_channel()), t('Default is on, turning this off may increase screen jumping'), $yes_no),
|
||||||
'$title_tosource' => array('title_tosource', t("Link post titles to source"), $title_tosource, '', $yes_no),
|
'$title_tosource' => array('title_tosource', t("Link post titles to source"), $title_tosource, '', $yes_no),
|
||||||
'$theme_config' => $theme_config,
|
'$theme_config' => $theme_config,
|
||||||
'$channel_divmore_height' => array('channel_divmore_height', t('Channel page max height of content (in pixels)'), ((get_pconfig(local_channel(),'system','channel_divmore_height')) ? get_pconfig(local_channel(),'system','channel_divmore_height') : 400), t('click to expand content exceeding this height')),
|
|
||||||
'$network_divmore_height' => array('network_divmore_height', t('Grid page max height of content (in pixels)'), ((get_pconfig(local_channel(),'system','network_divmore_height')) ? get_pconfig(local_channel(),'system','network_divmore_height') : 400) , t('click to expand content exceeding this height')),
|
|
||||||
'$start_menu' => ['start_menu', t('New Member Links'), $start_menu, t('Display new member quick links menu'), $yes_no]
|
'$start_menu' => ['start_menu', t('New Member Links'), $start_menu, t('Display new member quick links menu'), $yes_no]
|
||||||
));
|
));
|
||||||
|
|
||||||
|
@ -16,6 +16,10 @@ class Editor {
|
|||||||
process_module_features_post(local_channel(), $features, $_POST);
|
process_module_features_post(local_channel(), $features, $_POST);
|
||||||
|
|
||||||
build_sync_packet();
|
build_sync_packet();
|
||||||
|
|
||||||
|
if($_POST['rpath'])
|
||||||
|
goaway($_POST['rpath']);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,6 +16,10 @@ class Events {
|
|||||||
process_module_features_post(local_channel(), $features, $_POST);
|
process_module_features_post(local_channel(), $features, $_POST);
|
||||||
|
|
||||||
build_sync_packet();
|
build_sync_packet();
|
||||||
|
|
||||||
|
if($_POST['rpath'])
|
||||||
|
goaway($_POST['rpath']);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,6 +16,10 @@ class Manage {
|
|||||||
process_module_features_post(local_channel(), $features, $_POST);
|
process_module_features_post(local_channel(), $features, $_POST);
|
||||||
|
|
||||||
build_sync_packet();
|
build_sync_packet();
|
||||||
|
|
||||||
|
if($_POST['rpath'])
|
||||||
|
goaway($_POST['rpath']);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,8 +14,18 @@ class Network {
|
|||||||
$features = get_module_features($module);
|
$features = get_module_features($module);
|
||||||
|
|
||||||
process_module_features_post(local_channel(), $features, $_POST);
|
process_module_features_post(local_channel(), $features, $_POST);
|
||||||
|
|
||||||
|
$network_divmore_height = ((x($_POST,'network_divmore_height')) ? intval($_POST['network_divmore_height']) : 400);
|
||||||
|
if($network_divmore_height < 50)
|
||||||
|
$network_divmore_height = 50;
|
||||||
|
|
||||||
|
set_pconfig(local_channel(),'system','network_divmore_height', $network_divmore_height);
|
||||||
|
|
||||||
build_sync_packet();
|
build_sync_packet();
|
||||||
|
|
||||||
|
if($_POST['rpath'])
|
||||||
|
goaway($_POST['rpath']);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26,6 +36,19 @@ class Network {
|
|||||||
$features = get_module_features($module);
|
$features = get_module_features($module);
|
||||||
$rpath = (($_GET['rpath']) ? $_GET['rpath'] : '');
|
$rpath = (($_GET['rpath']) ? $_GET['rpath'] : '');
|
||||||
|
|
||||||
|
$network_divmore_height = [
|
||||||
|
'network_divmore_height',
|
||||||
|
t('Max height of content (in pixels)'),
|
||||||
|
((get_pconfig(local_channel(),'system','network_divmore_height')) ? get_pconfig(local_channel(),'system','network_divmore_height') : 400),
|
||||||
|
t('Click to expand content exceeding this height')
|
||||||
|
];
|
||||||
|
|
||||||
|
$extra_settings_html = replace_macros(get_markup_template('field_input.tpl'),
|
||||||
|
[
|
||||||
|
'$field' => $network_divmore_height
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
$tpl = get_markup_template("settings_module.tpl");
|
$tpl = get_markup_template("settings_module.tpl");
|
||||||
|
|
||||||
$o .= replace_macros($tpl, array(
|
$o .= replace_macros($tpl, array(
|
||||||
@ -33,8 +56,9 @@ class Network {
|
|||||||
'$action_url' => 'settings/' . $module,
|
'$action_url' => 'settings/' . $module,
|
||||||
'$form_security_token' => get_form_security_token('settings_' . $module),
|
'$form_security_token' => get_form_security_token('settings_' . $module),
|
||||||
'$title' => t('Activity Settings'),
|
'$title' => t('Activity Settings'),
|
||||||
'$features' => process_module_features_get(local_channel(), $features),
|
'$features' => process_module_features_get(local_channel(), $features),
|
||||||
'$submit' => t('Submit')
|
'$extra_settings_html' => $extra_settings_html,
|
||||||
|
'$submit' => t('Submit')
|
||||||
));
|
));
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
|
@ -16,6 +16,10 @@ class Photos {
|
|||||||
process_module_features_post(local_channel(), $features, $_POST);
|
process_module_features_post(local_channel(), $features, $_POST);
|
||||||
|
|
||||||
build_sync_packet();
|
build_sync_packet();
|
||||||
|
|
||||||
|
if($_POST['rpath'])
|
||||||
|
goaway($_POST['rpath']);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,6 +16,10 @@ class Profiles {
|
|||||||
process_module_features_post(local_channel(), $features, $_POST);
|
process_module_features_post(local_channel(), $features, $_POST);
|
||||||
|
|
||||||
build_sync_packet();
|
build_sync_packet();
|
||||||
|
|
||||||
|
if($_POST['rpath'])
|
||||||
|
goaway($_POST['rpath']);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,15 @@ function feature_level($feature,$def) {
|
|||||||
function process_module_features_get($uid, $features) {
|
function process_module_features_get($uid, $features) {
|
||||||
unset($features[0]);
|
unset($features[0]);
|
||||||
foreach($features as $f) {
|
foreach($features as $f) {
|
||||||
$arr[] = array('feature_' . $f[0],$f[1],((intval(feature_enabled($uid, $f[0]))) ? "1" : ''),$f[2], array(t('Off'),t('On')), (($f[4] === false) ? '' : 'disabled'));
|
$arr[] = [
|
||||||
|
'feature_' . $f[0],
|
||||||
|
$f[1],
|
||||||
|
((intval(feature_enabled($uid, $f[0]))) ? "1" : ''),
|
||||||
|
$f[2],
|
||||||
|
[t('Off'),t('On')],
|
||||||
|
(($f[4] === false) ? '' : 'disabled'),
|
||||||
|
$f[5]
|
||||||
|
];
|
||||||
}
|
}
|
||||||
return $arr;
|
return $arr;
|
||||||
}
|
}
|
||||||
@ -61,8 +69,6 @@ function process_module_features_post($uid, $features, $post_arr) {
|
|||||||
else
|
else
|
||||||
set_pconfig($uid,'feature', $k, '');
|
set_pconfig($uid,'feature', $k, '');
|
||||||
}
|
}
|
||||||
if($post_arr['rpath'])
|
|
||||||
goaway($post_arr['rpath']);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_features($filtered = true, $level = (-1)) {
|
function get_features($filtered = true, $level = (-1)) {
|
||||||
|
@ -58,8 +58,6 @@
|
|||||||
<div class="section-content-wrapper">
|
<div class="section-content-wrapper">
|
||||||
{{include file="field_input.tpl" field=$ajaxint}}
|
{{include file="field_input.tpl" field=$ajaxint}}
|
||||||
{{include file="field_input.tpl" field=$itemspage}}
|
{{include file="field_input.tpl" field=$itemspage}}
|
||||||
{{include file="field_input.tpl" field=$channel_divmore_height}}
|
|
||||||
{{include file="field_input.tpl" field=$network_divmore_height}}
|
|
||||||
{{include file="field_checkbox.tpl" field=$nosmile}}
|
{{include file="field_checkbox.tpl" field=$nosmile}}
|
||||||
{{include file="field_checkbox.tpl" field=$channel_menu}}
|
{{include file="field_checkbox.tpl" field=$channel_menu}}
|
||||||
{{include file="field_checkbox.tpl" field=$title_tosource}}
|
{{include file="field_checkbox.tpl" field=$title_tosource}}
|
||||||
|
@ -11,6 +11,9 @@
|
|||||||
{{foreach $features as $feature}}
|
{{foreach $features as $feature}}
|
||||||
{{include file="field_checkbox.tpl" field=$feature}}
|
{{include file="field_checkbox.tpl" field=$feature}}
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
|
{{if $extra_settings_html}}
|
||||||
|
{{$extra_settings_html}}
|
||||||
|
{{/if}}
|
||||||
<div class="settings-submit-wrapper" >
|
<div class="settings-submit-wrapper" >
|
||||||
<button type="submit" name="submit" class="btn btn-primary">{{$submit}}</button>
|
<button type="submit" name="submit" class="btn btn-primary">{{$submit}}</button>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user