]> git.mxchange.org Git - friendica.git/commitdiff
settings: move tabs to aside. add a new template "generic_links_widget.tpl"
authorFabio Comuni <fabrix.xm@gmail.com>
Thu, 12 Apr 2012 06:38:55 +0000 (08:38 +0200)
committerFabio Comuni <fabrix.xm@gmail.com>
Thu, 12 Apr 2012 06:38:55 +0000 (08:38 +0200)
mod/settings.php
view/generic_links_widget.tpl [new file with mode: 0644]
view/settings.tpl
view/settings_addons.tpl
view/settings_connectors.tpl
view/settings_display.tpl
view/settings_oauth.tpl
view/settings_oauth_edit.tpl

index 6879da285f3430160affc06e9bbbdf61ef79e00e..94851c20bbbc346a170ba3fef220f11a900519db 100644 (file)
@@ -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 (file)
index 0000000..45813b8
--- /dev/null
@@ -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>
index 8753474afa00174bb27ad3809c9f9635947ad5b9..ebca4875f054d800fdf4c74cff4fba64d65b6545 100644 (file)
@@ -1,5 +1,3 @@
-$tabs
-
 <h1>$ptitle</h1>
 
 $nickname_block
index 28fca53620a0e9e254cdc4778a953c7b38b044a9..84171dc8db2925cfb439c440477355a627e23bb0 100644 (file)
@@ -1,5 +1,3 @@
-$tabs
-
 <h1>$title</h1>
 
 
index 43c0346bba7dc5e726c36ceaca4dd327a10594ab..bd3d60f0f4bc5273f14536fcd20f9a89015cb9eb 100644 (file)
@@ -1,5 +1,3 @@
-$tabs
-
 <h1>$title</h1>
 
 <div class="connector_statusmsg">$diasp_enabled</div>
index fc7a56c8ac94a030761057d966d112b3b3b32918..70895a1f89e0067c417d13f29bef438fc62f1f7b 100644 (file)
@@ -1,5 +1,3 @@
-$tabs
-
 <h1>$ptitle</h1>
 
 <form action="settings/display" id="settings-form" method="post" autocomplete="off" >
index da1398ab9656eb694b3f352ec8b37b6a58a03560..890c4ee6c85ce6e6b7d3cb273fcc26e6d1368359 100644 (file)
@@ -1,5 +1,3 @@
-$tabs
-
 <h1>$title</h1>
 
 
index d293413867700aff64d9537c5cf9872f387e7ed4..e6f2abdc24b48c7e197fde4652c7f7661cb42002 100644 (file)
@@ -1,5 +1,3 @@
-$tabs
-
 <h1>$title</h1>
 
 <form method="POST">