move profile assign selector to profile settings and personal menu selector to channel_home settings and get rid of misc channel settings section.
This commit is contained in:
parent
d174531931
commit
66cf085272
@ -135,8 +135,6 @@ class Channel {
|
|||||||
$photo_path = ((x($_POST,'photo_path')) ? escape_tags(trim($_POST['photo_path'])) : '');
|
$photo_path = ((x($_POST,'photo_path')) ? escape_tags(trim($_POST['photo_path'])) : '');
|
||||||
$attach_path = ((x($_POST,'attach_path')) ? escape_tags(trim($_POST['attach_path'])) : '');
|
$attach_path = ((x($_POST,'attach_path')) ? escape_tags(trim($_POST['attach_path'])) : '');
|
||||||
|
|
||||||
$channel_menu = ((x($_POST['channel_menu'])) ? htmlspecialchars_decode(trim($_POST['channel_menu']),ENT_QUOTES) : '');
|
|
||||||
|
|
||||||
$expire_items = ((x($_POST,'expire_items')) ? intval($_POST['expire_items']) : 0);
|
$expire_items = ((x($_POST,'expire_items')) ? intval($_POST['expire_items']) : 0);
|
||||||
$expire_starred = ((x($_POST,'expire_starred')) ? intval($_POST['expire_starred']) : 0);
|
$expire_starred = ((x($_POST,'expire_starred')) ? intval($_POST['expire_starred']) : 0);
|
||||||
$expire_photos = ((x($_POST,'expire_photos'))? intval($_POST['expire_photos']) : 0);
|
$expire_photos = ((x($_POST,'expire_photos'))? intval($_POST['expire_photos']) : 0);
|
||||||
@ -157,8 +155,6 @@ class Channel {
|
|||||||
$defpermcat = ((x($_POST,'defpermcat')) ? notags(trim($_POST['defpermcat'])) : 'default');
|
$defpermcat = ((x($_POST,'defpermcat')) ? notags(trim($_POST['defpermcat'])) : 'default');
|
||||||
|
|
||||||
$mailhost = ((array_key_exists('mailhost',$_POST)) ? notags(trim($_POST['mailhost'])) : '');
|
$mailhost = ((array_key_exists('mailhost',$_POST)) ? notags(trim($_POST['mailhost'])) : '');
|
||||||
$profile_assign = ((x($_POST,'profile_assign')) ? notags(trim($_POST['profile_assign'])) : '');
|
|
||||||
|
|
||||||
|
|
||||||
$pageflags = $channel['channel_pageflags'];
|
$pageflags = $channel['channel_pageflags'];
|
||||||
$existing_adult = (($pageflags & PAGE_ADULT) ? 1 : 0);
|
$existing_adult = (($pageflags & PAGE_ADULT) ? 1 : 0);
|
||||||
@ -246,7 +242,6 @@ class Channel {
|
|||||||
set_pconfig(local_channel(),'system','post_joingroup', $post_joingroup);
|
set_pconfig(local_channel(),'system','post_joingroup', $post_joingroup);
|
||||||
set_pconfig(local_channel(),'system','post_profilechange', $post_profilechange);
|
set_pconfig(local_channel(),'system','post_profilechange', $post_profilechange);
|
||||||
set_pconfig(local_channel(),'system','blocktags',$blocktags);
|
set_pconfig(local_channel(),'system','blocktags',$blocktags);
|
||||||
set_pconfig(local_channel(),'system','channel_menu',$channel_menu);
|
|
||||||
set_pconfig(local_channel(),'system','vnotify',$vnotify);
|
set_pconfig(local_channel(),'system','vnotify',$vnotify);
|
||||||
set_pconfig(local_channel(),'system','always_show_in_notices',$always_show_in_notices);
|
set_pconfig(local_channel(),'system','always_show_in_notices',$always_show_in_notices);
|
||||||
set_pconfig(local_channel(),'system','evdays',$evdays);
|
set_pconfig(local_channel(),'system','evdays',$evdays);
|
||||||
@ -254,7 +249,6 @@ class Channel {
|
|||||||
set_pconfig(local_channel(),'system','attach_path',$attach_path);
|
set_pconfig(local_channel(),'system','attach_path',$attach_path);
|
||||||
set_pconfig(local_channel(),'system','default_permcat',$defpermcat);
|
set_pconfig(local_channel(),'system','default_permcat',$defpermcat);
|
||||||
set_pconfig(local_channel(),'system','email_notify_host',$mailhost);
|
set_pconfig(local_channel(),'system','email_notify_host',$mailhost);
|
||||||
set_pconfig(local_channel(),'system','profile_assign',$profile_assign);
|
|
||||||
set_pconfig(local_channel(),'system','autoperms',$autoperms);
|
set_pconfig(local_channel(),'system','autoperms',$autoperms);
|
||||||
|
|
||||||
$r = q("update channel set channel_name = '%s', channel_pageflags = %d, channel_timezone = '%s', channel_location = '%s', channel_notifyflags = %d, channel_max_anon_mail = %d, channel_max_friend_req = %d, channel_expire_days = %d $set_perms where channel_id = %d",
|
$r = q("update channel set channel_name = '%s', channel_pageflags = %d, channel_timezone = '%s', channel_location = '%s', channel_notifyflags = %d, channel_max_anon_mail = %d, channel_max_friend_req = %d, channel_expire_days = %d $set_perms where channel_id = %d",
|
||||||
@ -460,18 +454,6 @@ class Channel {
|
|||||||
require_once('include/group.php');
|
require_once('include/group.php');
|
||||||
$group_select = mini_group_select(local_channel(),$channel['channel_default_group']);
|
$group_select = mini_group_select(local_channel(),$channel['channel_default_group']);
|
||||||
|
|
||||||
require_once('include/menu.php');
|
|
||||||
$m1 = menu_list(local_channel());
|
|
||||||
$menu = false;
|
|
||||||
if($m1) {
|
|
||||||
$menu = array();
|
|
||||||
$current = get_pconfig(local_channel(),'system','channel_menu');
|
|
||||||
$menu[] = array('name' => '', 'selected' => ((! $current) ? true : false));
|
|
||||||
foreach($m1 as $m) {
|
|
||||||
$menu[] = array('name' => htmlspecialchars($m['menu_name'],ENT_COMPAT,'UTF-8'), 'selected' => (($m['menu_name'] === $current) ? ' selected="selected" ' : false));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$evdays = get_pconfig(local_channel(),'system','evdays');
|
$evdays = get_pconfig(local_channel(),'system','evdays');
|
||||||
if(! $evdays)
|
if(! $evdays)
|
||||||
$evdays = 3;
|
$evdays = 3;
|
||||||
@ -498,7 +480,7 @@ class Channel {
|
|||||||
if($vnotify === false)
|
if($vnotify === false)
|
||||||
$vnotify = (-1);
|
$vnotify = (-1);
|
||||||
|
|
||||||
$plugin = [ 'basic' => '', 'security' => '', 'notify' => '', 'misc' => '' ];
|
$plugin = [ 'basic' => '', 'security' => '', 'notify' => '' ];
|
||||||
call_hooks('channel_settings',$plugin);
|
call_hooks('channel_settings',$plugin);
|
||||||
|
|
||||||
$disable_discover_tab = intval(get_config('system','disable_discover_tab',1)) == 1;
|
$disable_discover_tab = intval(get_config('system','disable_discover_tab',1)) == 1;
|
||||||
@ -543,8 +525,6 @@ class Channel {
|
|||||||
'$permissions' => t('Default Privacy Group'),
|
'$permissions' => t('Default Privacy Group'),
|
||||||
'$permdesc' => t("\x28click to open/close\x29"),
|
'$permdesc' => t("\x28click to open/close\x29"),
|
||||||
'$aclselect' => populate_acl($perm_defaults, false, \Zotlabs\Lib\PermissionDescription::fromDescription(t('Use my default audience setting for the type of object published'))),
|
'$aclselect' => populate_acl($perm_defaults, false, \Zotlabs\Lib\PermissionDescription::fromDescription(t('Use my default audience setting for the type of object published'))),
|
||||||
'$profseltxt' => t('Profile to assign new connections'),
|
|
||||||
'$profselect' => ((feature_enabled(local_channel(),'multi_profiles')) ? contact_profile_assign(get_pconfig(local_channel(),'system','profile_assign','')) : ''),
|
|
||||||
|
|
||||||
'$allow_cid' => acl2json($perm_defaults['allow_cid']),
|
'$allow_cid' => acl2json($perm_defaults['allow_cid']),
|
||||||
'$allow_gid' => acl2json($perm_defaults['allow_gid']),
|
'$allow_gid' => acl2json($perm_defaults['allow_gid']),
|
||||||
@ -604,7 +584,6 @@ class Channel {
|
|||||||
'$basic_addon' => $plugin['basic'],
|
'$basic_addon' => $plugin['basic'],
|
||||||
'$sec_addon' => $plugin['security'],
|
'$sec_addon' => $plugin['security'],
|
||||||
'$notify_addon' => $plugin['notify'],
|
'$notify_addon' => $plugin['notify'],
|
||||||
'$misc_addon' => $plugin['misc'],
|
|
||||||
|
|
||||||
'$h_advn' => t('Advanced Account/Page Type Settings'),
|
'$h_advn' => t('Advanced Account/Page Type Settings'),
|
||||||
'$h_descadvn' => t('Change the behaviour of this account for special situations'),
|
'$h_descadvn' => t('Change the behaviour of this account for special situations'),
|
||||||
@ -612,12 +591,8 @@ class Channel {
|
|||||||
'$lbl_misc' => t('Miscellaneous Settings'),
|
'$lbl_misc' => t('Miscellaneous Settings'),
|
||||||
'$photo_path' => array('photo_path', t('Default photo upload folder'), get_pconfig(local_channel(),'system','photo_path'), t('%Y - current year, %m - current month')),
|
'$photo_path' => array('photo_path', t('Default photo upload folder'), get_pconfig(local_channel(),'system','photo_path'), t('%Y - current year, %m - current month')),
|
||||||
'$attach_path' => array('attach_path', t('Default file upload folder'), get_pconfig(local_channel(),'system','attach_path'), t('%Y - current year, %m - current month')),
|
'$attach_path' => array('attach_path', t('Default file upload folder'), get_pconfig(local_channel(),'system','attach_path'), t('%Y - current year, %m - current month')),
|
||||||
'$menus' => $menu,
|
|
||||||
'$menu_desc' => t('Personal menu to display in your channel pages'),
|
|
||||||
'$removeme' => t('Remove Channel'),
|
'$removeme' => t('Remove Channel'),
|
||||||
'$removechannel' => t('Remove this channel.'),
|
'$removechannel' => t('Remove this channel.'),
|
||||||
'$firefoxshare' => t('Firefox Share $Projectname provider'),
|
|
||||||
|
|
||||||
));
|
));
|
||||||
|
|
||||||
call_hooks('settings_form',$o);
|
call_hooks('settings_form',$o);
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Zotlabs\Module\Settings;
|
namespace Zotlabs\Module\Settings;
|
||||||
|
|
||||||
|
require_once('include/menu.php');
|
||||||
|
|
||||||
class Channel_home {
|
class Channel_home {
|
||||||
|
|
||||||
@ -18,9 +19,11 @@ class Channel_home {
|
|||||||
$channel_divmore_height = ((x($_POST,'channel_divmore_height')) ? intval($_POST['channel_divmore_height']) : 400);
|
$channel_divmore_height = ((x($_POST,'channel_divmore_height')) ? intval($_POST['channel_divmore_height']) : 400);
|
||||||
if($channel_divmore_height < 50)
|
if($channel_divmore_height < 50)
|
||||||
$channel_divmore_height = 50;
|
$channel_divmore_height = 50;
|
||||||
|
|
||||||
set_pconfig(local_channel(),'system','channel_divmore_height', $channel_divmore_height);
|
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();
|
build_sync_packet();
|
||||||
|
|
||||||
if($_POST['rpath'])
|
if($_POST['rpath'])
|
||||||
@ -43,12 +46,37 @@ class Channel_home {
|
|||||||
t('Click to expand content exceeding this height')
|
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'),
|
$extra_settings_html = replace_macros(get_markup_template('field_input.tpl'),
|
||||||
[
|
[
|
||||||
'$field' => $channel_divmore_height
|
'$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");
|
$tpl = get_markup_template("settings_module.tpl");
|
||||||
|
|
||||||
$o .= replace_macros($tpl, array(
|
$o .= replace_macros($tpl, array(
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Zotlabs\Module\Settings;
|
namespace Zotlabs\Module\Settings;
|
||||||
|
|
||||||
|
require_once('include/selectors.php');
|
||||||
|
|
||||||
class Profiles {
|
class Profiles {
|
||||||
|
|
||||||
@ -15,6 +16,9 @@ class Profiles {
|
|||||||
|
|
||||||
process_module_features_post(local_channel(), $features, $_POST);
|
process_module_features_post(local_channel(), $features, $_POST);
|
||||||
|
|
||||||
|
$profile_assign = ((x($_POST,'profile_assign')) ? notags(trim($_POST['profile_assign'])) : '');
|
||||||
|
set_pconfig(local_channel(),'system','profile_assign',$profile_assign);
|
||||||
|
|
||||||
build_sync_packet();
|
build_sync_packet();
|
||||||
|
|
||||||
if($_POST['rpath'])
|
if($_POST['rpath'])
|
||||||
@ -30,6 +34,10 @@ class Profiles {
|
|||||||
$features = get_module_features($module);
|
$features = get_module_features($module);
|
||||||
$rpath = (($_GET['rpath']) ? $_GET['rpath'] : '');
|
$rpath = (($_GET['rpath']) ? $_GET['rpath'] : '');
|
||||||
|
|
||||||
|
$extra_settings_html = '';
|
||||||
|
if(feature_enabled(local_channel(),'multi_profiles'))
|
||||||
|
$extra_settings_html = contact_profile_assign(get_pconfig(local_channel(),'system','profile_assign',''));
|
||||||
|
|
||||||
$tpl = get_markup_template("settings_module.tpl");
|
$tpl = get_markup_template("settings_module.tpl");
|
||||||
|
|
||||||
$o .= replace_macros($tpl, array(
|
$o .= replace_macros($tpl, array(
|
||||||
@ -38,6 +46,7 @@ class Profiles {
|
|||||||
'$form_security_token' => get_form_security_token('settings_' . $module),
|
'$form_security_token' => get_form_security_token('settings_' . $module),
|
||||||
'$title' => t('Profiles Settings'),
|
'$title' => t('Profiles 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')
|
||||||
));
|
));
|
||||||
|
|
||||||
|
@ -3,21 +3,32 @@
|
|||||||
|
|
||||||
function contact_profile_assign($current) {
|
function contact_profile_assign($current) {
|
||||||
|
|
||||||
$o = '';
|
|
||||||
|
|
||||||
$o .= "<select id=\"contact-profile-selector\" name=\"profile_assign\" class=\"form-control\"/>\r\n";
|
|
||||||
|
|
||||||
$r = q("SELECT profile_guid, profile_name FROM profile WHERE uid = %d",
|
$r = q("SELECT profile_guid, profile_name FROM profile WHERE uid = %d",
|
||||||
intval($_SESSION['uid']));
|
intval($_SESSION['uid'])
|
||||||
|
);
|
||||||
|
|
||||||
if($r) {
|
if($r) {
|
||||||
foreach($r as $rr) {
|
foreach($r as $rr) {
|
||||||
$selected = (($rr['profile_guid'] == $current) ? " selected=\"selected\" " : "");
|
$options[$rr['profile_guid']] = $rr['profile_name'];
|
||||||
$o .= "<option value=\"{$rr['profile_guid']}\" $selected >{$rr['profile_name']}</option>\r\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$o .= "</select>\r\n";
|
|
||||||
|
$select = [
|
||||||
|
'profile_assign',
|
||||||
|
t('Profile to assign new connections'),
|
||||||
|
$current,
|
||||||
|
'',
|
||||||
|
$options
|
||||||
|
];
|
||||||
|
|
||||||
|
$o = replace_macros(get_markup_template('field_select.tpl'),
|
||||||
|
[
|
||||||
|
'$field' => $select
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function contact_poll_interval($current, $disabled = false) {
|
function contact_poll_interval($current, $disabled = false) {
|
||||||
|
@ -3,5 +3,5 @@
|
|||||||
<select class="form-control" name="{{$field.0}}" id="id_{{$field.0}}">
|
<select class="form-control" name="{{$field.0}}" id="id_{{$field.0}}">
|
||||||
{{foreach $field.4 as $opt=>$val}}<option value="{{$opt}}" {{if $opt==$field.2}}selected="selected"{{/if}}>{{$val}}</option>{{/foreach}}
|
{{foreach $field.4 as $opt=>$val}}<option value="{{$opt}}" {{if $opt==$field.2}}selected="selected"{{/if}}>{{$val}}</option>{{/foreach}}
|
||||||
</select>
|
</select>
|
||||||
<small class="form-text text-muted">{{$field.3}}</small>
|
<small class="form-text text-muted">{{$field.3}}</small >
|
||||||
</div>
|
</div>
|
||||||
|
@ -161,42 +161,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="panel">
|
|
||||||
<div class="section-subtitle-wrapper" role="tab" id="miscellaneous-settings">
|
|
||||||
<h3>
|
|
||||||
<a data-toggle="collapse" data-target="#miscellaneous-settings-collapse" href="#" aria-expanded="true" aria-controls="miscellaneous-settings-collapse">
|
|
||||||
{{$lbl_misc}}
|
|
||||||
</a>
|
|
||||||
</h3>
|
|
||||||
</div>
|
|
||||||
<div id="miscellaneous-settings-collapse" class="collapse" role="tabpanel" aria-labelledby="miscellaneous-settings" data-parent="#settings" >
|
|
||||||
<div class="section-content-tools-wrapper">
|
|
||||||
<div class="form-group">
|
|
||||||
{{if $profselect}}
|
|
||||||
<label for="contact-profile-selector">{{$profseltxt}}</label>
|
|
||||||
{{$profselect}}
|
|
||||||
{{/if}}
|
|
||||||
{{if $menus}}
|
|
||||||
<div class="form-group channel-menu">
|
|
||||||
<label for="channel_menu">{{$menu_desc}}</label>
|
|
||||||
<select name="channel_menu" class="form-control">
|
|
||||||
{{foreach $menus as $menu }}
|
|
||||||
<option value="{{$menu.name}}" {{$menu.selected}}>{{$menu.name}}</option>
|
|
||||||
{{/foreach}}
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
||||||
{{if $misc_addon}}
|
|
||||||
{{$misc_addon}}
|
|
||||||
{{/if}}
|
|
||||||
</div>
|
|
||||||
<div class="settings-submit-wrapper" >
|
|
||||||
<button type="submit" name="submit" class="btn btn-primary">{{$submit}}</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{{$aclselect}}
|
{{$aclselect}}
|
||||||
|
Reference in New Issue
Block a user