aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mod/settings.php87
-rw-r--r--view/generic_links_widget.tpl11
-rw-r--r--view/settings.tpl2
-rw-r--r--view/settings_addons.tpl2
-rw-r--r--view/settings_connectors.tpl2
-rw-r--r--view/settings_display.tpl2
-rw-r--r--view/settings_oauth.tpl2
-rw-r--r--view/settings_oauth_edit.tpl2
8 files changed, 53 insertions, 57 deletions
diff --git a/mod/settings.php b/mod/settings.php
index 6879da285..94851c20b 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -47,6 +47,47 @@ function settings_init(&$a) {
EOT;
+
+ $tabs = array(
+ array(
+ 'label' => t('Account settings'),
+ 'url' => $a->get_baseurl(true).'/settings',
+ 'selected' => (($a->argc == 1)?'active':''),
+ ),
+ array(
+ 'label' => t('Display settings'),
+ 'url' => $a->get_baseurl(true).'/settings/display',
+ 'selected' => (($a->argc > 1) && ($a->argv[1] === 'display')?'active':''),
+ ),
+
+ array(
+ 'label' => t('Connector settings'),
+ 'url' => $a->get_baseurl(true).'/settings/connectors',
+ 'selected' => (($a->argc > 1) && ($a->argv[1] === 'connectors')?'active':''),
+ ),
+ array(
+ 'label' => t('Plugin settings'),
+ 'url' => $a->get_baseurl(true).'/settings/addon',
+ 'selected' => (($a->argc > 1) && ($a->argv[1] === 'addon')?'active':''),
+ ),
+ array(
+ 'label' => t('Connected apps'),
+ 'url' => $a->get_baseurl(true) . '/settings/oauth',
+ 'selected' => (($a->argc > 1) && ($a->argv[1] === 'oauth')?'active':''),
+ ),
+ array(
+ 'label' => t('Export personal data'),
+ 'url' => $a->get_baseurl(true) . '/uexport',
+ 'selected' => ''
+ )
+ );
+
+ $tabtpl = get_markup_template("generic_links_widget.tpl");
+ $a->page['aside'] = replace_macros($tabtpl, array(
+ '$title' => t('Settings'),
+ '$items' => $tabs,
+ ));
+
}
@@ -479,44 +520,7 @@ function settings_content(&$a) {
return;
}
- $tabs = array(
- array(
- 'label' => t('Account settings'),
- 'url' => $a->get_baseurl(true).'/settings',
- 'sel' => (($a->argc == 1)?'active':''),
- ),
- array(
- 'label' => t('Display settings'),
- 'url' => $a->get_baseurl(true).'/settings/display',
- 'sel' => (($a->argc > 1) && ($a->argv[1] === 'display')?'active':''),
- ),
-
- array(
- 'label' => t('Connector settings'),
- 'url' => $a->get_baseurl(true).'/settings/connectors',
- 'sel' => (($a->argc > 1) && ($a->argv[1] === 'connectors')?'active':''),
- ),
- array(
- 'label' => t('Plugin settings'),
- 'url' => $a->get_baseurl(true).'/settings/addon',
- 'sel' => (($a->argc > 1) && ($a->argv[1] === 'addon')?'active':''),
- ),
- array(
- 'label' => t('Connections'),
- 'url' => $a->get_baseurl(true) . '/settings/oauth',
- 'sel' => (($a->argc > 1) && ($a->argv[1] === 'oauth')?'active':''),
- ),
- array(
- 'label' => t('Export personal data'),
- 'url' => $a->get_baseurl(true) . '/uexport',
- 'sel' => ''
- )
- );
-
- $tabtpl = get_markup_template("common_tabs.tpl");
- $tabs = replace_macros($tabtpl, array(
- '$tabs' => $tabs,
- ));
+
if(($a->argc > 1) && ($a->argv[1] === 'oauth')) {
@@ -524,7 +528,6 @@ function settings_content(&$a) {
$tpl = get_markup_template("settings_oauth_edit.tpl");
$o .= replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("settings_oauth"),
- '$tabs' => $tabs,
'$title' => t('Add application'),
'$submit' => t('Submit'),
'$cancel' => t('Cancel'),
@@ -551,7 +554,6 @@ function settings_content(&$a) {
$tpl = get_markup_template("settings_oauth_edit.tpl");
$o .= replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("settings_oauth"),
- '$tabs' => $tabs,
'$title' => t('Add application'),
'$submit' => t('Update'),
'$cancel' => t('Cancel'),
@@ -594,7 +596,6 @@ function settings_content(&$a) {
'$consumerkey' => t('Client key starts with'),
'$noname' => t('No name'),
'$remove' => t('Remove authorization'),
- '$tabs' => $tabs,
'$apps' => $r,
));
return $o;
@@ -614,7 +615,6 @@ function settings_content(&$a) {
$o .= replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("settings_addon"),
'$title' => t('Plugin Settings'),
- '$tabs' => $tabs,
'$settings_addons' => $settings_addons
));
return $o;
@@ -658,7 +658,6 @@ function settings_content(&$a) {
'$form_security_token' => get_form_security_token("settings_connectors"),
'$title' => t('Connector Settings'),
- '$tabs' => $tabs,
'$diasp_enabled' => $diasp_enabled,
'$ostat_enabled' => $ostat_enabled,
@@ -735,7 +734,6 @@ function settings_content(&$a) {
$tpl = get_markup_template("settings_display.tpl");
$o = replace_macros($tpl, array(
- '$tabs' => $tabs,
'$ptitle' => t('Display Settings'),
'$form_security_token' => get_form_security_token("settings_display"),
'$submit' => t('Submit'),
@@ -920,7 +918,6 @@ function settings_content(&$a) {
);
$o .= replace_macros($stpl,array(
- '$tabs' => $tabs,
'$ptitle' => t('Account Settings'),
'$submit' => t('Submit'),
diff --git a/view/generic_links_widget.tpl b/view/generic_links_widget.tpl
new file mode 100644
index 000000000..45813b876
--- /dev/null
+++ b/view/generic_links_widget.tpl
@@ -0,0 +1,11 @@
+<div class="widget">
+ {{if $title}}<h3>$title</h3>{{endif}}
+ {{if $desc}}<div class="desc">$desc</div>{{endif}}
+
+ <ul>
+ {{ for $items as $item }}
+ <li class="tool"><a href="$item.url" class="{{ if $item.selected }}selected{{ endif }}">$item.label</a></li>
+ {{ endfor }}
+ </ul>
+
+</div>
diff --git a/view/settings.tpl b/view/settings.tpl
index 8753474af..ebca4875f 100644
--- a/view/settings.tpl
+++ b/view/settings.tpl
@@ -1,5 +1,3 @@
-$tabs
-
<h1>$ptitle</h1>
$nickname_block
diff --git a/view/settings_addons.tpl b/view/settings_addons.tpl
index 28fca5362..84171dc8d 100644
--- a/view/settings_addons.tpl
+++ b/view/settings_addons.tpl
@@ -1,5 +1,3 @@
-$tabs
-
<h1>$title</h1>
diff --git a/view/settings_connectors.tpl b/view/settings_connectors.tpl
index 43c0346bb..bd3d60f0f 100644
--- a/view/settings_connectors.tpl
+++ b/view/settings_connectors.tpl
@@ -1,5 +1,3 @@
-$tabs
-
<h1>$title</h1>
<div class="connector_statusmsg">$diasp_enabled</div>
diff --git a/view/settings_display.tpl b/view/settings_display.tpl
index fc7a56c8a..70895a1f8 100644
--- a/view/settings_display.tpl
+++ b/view/settings_display.tpl
@@ -1,5 +1,3 @@
-$tabs
-
<h1>$ptitle</h1>
<form action="settings/display" id="settings-form" method="post" autocomplete="off" >
diff --git a/view/settings_oauth.tpl b/view/settings_oauth.tpl
index da1398ab9..890c4ee6c 100644
--- a/view/settings_oauth.tpl
+++ b/view/settings_oauth.tpl
@@ -1,5 +1,3 @@
-$tabs
-
<h1>$title</h1>
diff --git a/view/settings_oauth_edit.tpl b/view/settings_oauth_edit.tpl
index d29341386..e6f2abdc2 100644
--- a/view/settings_oauth_edit.tpl
+++ b/view/settings_oauth_edit.tpl
@@ -1,5 +1,3 @@
-$tabs
-
<h1>$title</h1>
<form method="POST">