diff options
author | Mario Vavti <mario@mariovavti.com> | 2018-09-21 20:23:31 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-09-21 20:23:31 +0200 |
commit | 9638bf2b1eeb805b27eaf2f2e1e8a09bfd5c5514 (patch) | |
tree | eb2c72120cd2b2e0625b3d02ede424b80c1ebe27 | |
parent | 6f43468724fccec3b37b7411a5ecb45a3ebe2e0b (diff) | |
download | volse-hubzilla-9638bf2b1eeb805b27eaf2f2e1e8a09bfd5c5514.tar.gz volse-hubzilla-9638bf2b1eeb805b27eaf2f2e1e8a09bfd5c5514.tar.bz2 volse-hubzilla-9638bf2b1eeb805b27eaf2f2e1e8a09bfd5c5514.zip |
provide a return path from settings pages
-rw-r--r-- | Zotlabs/Lib/Apps.php | 3 | ||||
-rw-r--r-- | Zotlabs/Module/Settings/Connections.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Settings/Network.php | 2 | ||||
-rw-r--r-- | include/features.php | 2 | ||||
-rw-r--r-- | view/tpl/app.tpl | 2 | ||||
-rwxr-xr-x | view/tpl/navbar_default.tpl | 2 | ||||
-rwxr-xr-x | view/tpl/settings_module.tpl | 3 |
7 files changed, 13 insertions, 3 deletions
diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php index b35eb9844..010947467 100644 --- a/Zotlabs/Lib/Apps.php +++ b/Zotlabs/Lib/Apps.php @@ -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' )); } diff --git a/Zotlabs/Module/Settings/Connections.php b/Zotlabs/Module/Settings/Connections.php index 361d86ccb..425409502 100644 --- a/Zotlabs/Module/Settings/Connections.php +++ b/Zotlabs/Module/Settings/Connections.php @@ -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'), diff --git a/Zotlabs/Module/Settings/Network.php b/Zotlabs/Module/Settings/Network.php index 1e39121c8..a2e606565 100644 --- a/Zotlabs/Module/Settings/Network.php +++ b/Zotlabs/Module/Settings/Network.php @@ -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'), diff --git a/include/features.php b/include/features.php index c3ef54945..460d2cb38 100644 --- a/include/features.php +++ b/include/features.php @@ -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)) { diff --git a/view/tpl/app.tpl b/view/tpl/app.tpl index 042f48704..6013f9548 100644 --- a/view/tpl/app.tpl +++ b/view/tpl/app.tpl @@ -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}} diff --git a/view/tpl/navbar_default.tpl b/view/tpl/navbar_default.tpl index 73b5ccf59..0c8be512d 100755 --- a/view/tpl/navbar_default.tpl +++ b/view/tpl/navbar_default.tpl @@ -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> diff --git a/view/tpl/settings_module.tpl b/view/tpl/settings_module.tpl index b2ac5462f..cabefc3e5 100755 --- a/view/tpl/settings_module.tpl +++ b/view/tpl/settings_module.tpl @@ -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}} |