From 9638bf2b1eeb805b27eaf2f2e1e8a09bfd5c5514 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 21 Sep 2018 20:23:31 +0200 Subject: provide a return path from settings pages --- Zotlabs/Lib/Apps.php | 3 ++- Zotlabs/Module/Settings/Connections.php | 2 ++ Zotlabs/Module/Settings/Network.php | 2 ++ include/features.php | 2 ++ view/tpl/app.tpl | 2 +- view/tpl/navbar_default.tpl | 2 +- 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}}{{/if}} {{if $feature}}{{/if}} {{if $pin}}{{/if}} - {{if $settings_url}}{{/if}} + {{if $settings_url}}{{/if}} {{/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 @@ {{if $settings_url}} 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 @@
+ {{if $rpath}} + + {{/if}} {{foreach $features as $feature}} {{include file="field_checkbox.tpl" field=$feature}} {{/foreach}} -- cgit v1.2.3