aboutsummaryrefslogtreecommitdiffstats
path: root/mod/settings.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-04-12 05:47:57 -0700
committerfriendica <info@friendica.com>2012-04-12 05:47:57 -0700
commit23b08e3ea79936ecee0a061e38a08145f3fca1da (patch)
tree6f2fa30889c7935bb3f70da10ff5d33f4700fa09 /mod/settings.php
parent815a727076210e6fd7edd6815c33e4bc56e674c6 (diff)
parent309f2bfa5f85e80e94d6ee177496c5a095201943 (diff)
downloadvolse-hubzilla-23b08e3ea79936ecee0a061e38a08145f3fca1da.tar.gz
volse-hubzilla-23b08e3ea79936ecee0a061e38a08145f3fca1da.tar.bz2
volse-hubzilla-23b08e3ea79936ecee0a061e38a08145f3fca1da.zip
Merge pull request #228 from fabrixxm/master
settings tabs, notifications js and quattro
Diffstat (limited to 'mod/settings.php')
-rw-r--r--mod/settings.php91
1 files changed, 42 insertions, 49 deletions
diff --git a/mod/settings.php b/mod/settings.php
index 6879da285..2dd9fb9a6 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -15,10 +15,6 @@ function get_theme_config_file($theme){
}
function settings_init(&$a) {
- if(local_user()) {
- profile_load($a,$a->user['nickname']);
- }
-
// These lines provide the javascript needed by the acl selector
$a->page['htmlhead'] .= "<script> var ispublic = '" . t('everybody') . "';" ;
@@ -47,6 +43,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 +516,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 +524,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 +550,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 +592,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 +611,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 +654,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 +730,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 +914,6 @@ function settings_content(&$a) {
);
$o .= replace_macros($stpl,array(
- '$tabs' => $tabs,
'$ptitle' => t('Account Settings'),
'$submit' => t('Submit'),