provide a return path from settings pages
This commit is contained in:
parent
6f43468724
commit
9638bf2b1e
@ -524,7 +524,8 @@ class Apps {
|
||||
'$add' => t('Add to app-tray'),
|
||||
'$remove' => t('Remove from app-tray'),
|
||||
'$add_nav' => t('Pin to navbar'),
|
||||
'$remove_nav' => t('Unpin from navbar')
|
||||
'$remove_nav' => t('Unpin from navbar'),
|
||||
'$rpath' => z_root() . '/apps'
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -19,10 +19,12 @@ class Connections {
|
||||
function get() {
|
||||
|
||||
$features = self::get_features();
|
||||
$rpath = (($_GET['rpath']) ? $_GET['rpath'] : '');
|
||||
|
||||
$tpl = get_markup_template("settings_module.tpl");
|
||||
|
||||
$o .= replace_macros($tpl, array(
|
||||
'$rpath' => $rpath,
|
||||
'$action_url' => 'settings/connections',
|
||||
'$form_security_token' => get_form_security_token("settings_connections"),
|
||||
'$title' => t('Connections Settings'),
|
||||
|
@ -19,10 +19,12 @@ class Network {
|
||||
function get() {
|
||||
|
||||
$features = self::get_features();
|
||||
$rpath = (($_GET['rpath']) ? $_GET['rpath'] : '');
|
||||
|
||||
$tpl = get_markup_template("settings_module.tpl");
|
||||
|
||||
$o .= replace_macros($tpl, array(
|
||||
'$rpath' => $rpath,
|
||||
'$action_url' => 'settings/network',
|
||||
'$form_security_token' => get_form_security_token("settings_network"),
|
||||
'$title' => t('Activity Settings'),
|
||||
|
@ -59,6 +59,8 @@ function process_features_post($uid, $features, $post_arr) {
|
||||
else
|
||||
set_pconfig($uid,'feature', $k, '');
|
||||
}
|
||||
if($post_arr['rpath'])
|
||||
goaway($post_arr['rpath']);
|
||||
}
|
||||
|
||||
function get_features($filtered = true, $level = (-1)) {
|
||||
|
@ -20,7 +20,7 @@
|
||||
{{if $delete}}<button type="submit" name="delete" value="{{if $deleted}}{{$undelete}}{{else}}{{$delete}}{{/if}}" class="btn btn-outline-secondary btn-sm" title="{{if $deleted}}{{$undelete}}{{else}}{{$delete}}{{/if}}" ><i class="fa fa-fw fa-trash-o drop-icons"></i></button>{{/if}}
|
||||
{{if $feature}}<button type="submit" name="feature" value="nav_featured_app" class="btn btn-outline-secondary btn-sm" title="{{if $featured}}{{$remove}}{{else}}{{$add}}{{/if}}"><i class="fa fa-fw fa-star{{if $featured}} text-warning{{/if}}"></i></button>{{/if}}
|
||||
{{if $pin}}<button type="submit" name="pin" value="nav_pinned_app" class="btn btn-outline-secondary btn-sm" title="{{if $pinned}}{{$remove_nav}}{{else}}{{$add_nav}}{{/if}}"><i class="fa fa-fw fa-thumb-tack{{if $pinned}} text-success{{/if}}"></i></button>{{/if}}
|
||||
{{if $settings_url}}<a href="{{$settings_url}}" class="btn btn-outline-secondary btn-sm"><i class="fa fa-fw fa-cog"></i></a>{{/if}}
|
||||
{{if $settings_url}}<a href="{{$settings_url}}/?f=&rpath={{$rpath}}" class="btn btn-outline-secondary btn-sm"><i class="fa fa-fw fa-cog"></i></a>{{/if}}
|
||||
</form>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -74,7 +74,7 @@
|
||||
</div>
|
||||
{{if $settings_url}}
|
||||
<div id="nav-app-settings-link-wrapper" class="navbar-nav mr-auto">
|
||||
<a id="nav-app-settings-link" href="{{$settings_url}}" class="nav-link">
|
||||
<a id="nav-app-settings-link" href="{{$settings_url}}/?f=&rpath={{$url}}" class="nav-link">
|
||||
<i class="fa fa-fw fa-cog"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
@ -5,6 +5,9 @@
|
||||
<div class="section-content-wrapper">
|
||||
<form action="{{$action_url}}" method="post" autocomplete="off">
|
||||
<input type='hidden' name='form_security_token' value='{{$form_security_token}}'>
|
||||
{{if $rpath}}
|
||||
<input type='hidden' name='rpath' value='{{$rpath}}'>
|
||||
{{/if}}
|
||||
{{foreach $features as $feature}}
|
||||
{{include file="field_checkbox.tpl" field=$feature}}
|
||||
{{/foreach}}
|
||||
|
Reference in New Issue
Block a user