aboutsummaryrefslogtreecommitdiffstats
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
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
-rwxr-xr-xjs/main.js19
-rw-r--r--mod/settings.php91
-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
-rw-r--r--view/theme/quattro/dark/style.css23
-rw-r--r--view/theme/quattro/generic_links_widget.tpl11
-rw-r--r--view/theme/quattro/green/style.css23
-rw-r--r--view/theme/quattro/icons.less1
-rw-r--r--view/theme/quattro/nav.tpl40
-rw-r--r--view/theme/quattro/quattro.less6
-rw-r--r--view/theme/quattro/style.php16
-rw-r--r--view/theme/quattro/theme.php20
17 files changed, 143 insertions, 130 deletions
diff --git a/js/main.js b/js/main.js
index 7f0428b5b..7a90fa910 100755
--- a/js/main.js
+++ b/js/main.js
@@ -137,13 +137,12 @@
$('#mail-update-li').html(mail);
var eNotif = $(data).find('notif')
- notif = eNotif.attr('count');
- if (notif>=0){
- $("#nav-notifications-linkmenu").addClass("on");
+
+ if (eNotif.children("note").length==0){
+ $("#nav-notifications-menu").html(notifications_empty);
+ } else {
nnm = $("#nav-notifications-menu");
-
nnm.html(notifications_all + notifications_mark);
-
//nnm.attr('popup','true');
eNotif.children("note").each(function(){
e = $(this);
@@ -151,10 +150,12 @@
html = notifications_tpl.format(e.attr('href'),e.attr('photo'), text, e.attr('date'), e.attr('seen'));
nnm.append(html);
});
-
+ }
+ notif = eNotif.attr('count');
+ if (notif>0){
+ $("#nav-notifications-linkmenu").addClass("on");
} else {
- // $("#nav-notifications-linkmenu").removeClass("on");
- // $("#nav-notifications-menu").html(notifications_empty);
+ $("#nav-notifications-linkmenu").removeClass("on");
}
if(notif == 0) { notif = ''; $('#notify-update').removeClass('show') } else { $('#notify-update').addClass('show') }
$('#notify-update').html(notif);
@@ -609,4 +610,4 @@ function previewTheme(elm) {
$('#theme-preview').html('<div id="theme-desc">' + data.desc + '</div><a href="' + data.img + '"><img src="' + data.img + '" width="320" height="240" alt="' + theme + '" /></a>');
});
-} \ No newline at end of file
+}
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'),
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">
diff --git a/view/theme/quattro/dark/style.css b/view/theme/quattro/dark/style.css
index 1d951aba8..16c786d20 100644
--- a/view/theme/quattro/dark/style.css
+++ b/view/theme/quattro/dark/style.css
@@ -48,6 +48,9 @@
.icon.s10.unlock {
background-image: url("../../../images/icons/10/unlock.png");
}
+.icon.s10.plugin {
+ background-image: url("../../../images/icons/10/plugin.png");
+}
.icon.s10.type-unkn {
background-image: url("../../../images/icons/10/zip.png");
}
@@ -100,6 +103,9 @@
.icon.s16.unlock {
background-image: url("../../../images/icons/16/unlock.png");
}
+.icon.s16.plugin {
+ background-image: url("../../../images/icons/16/plugin.png");
+}
.icon.s16.type-unkn {
background-image: url("../../../images/icons/16/zip.png");
}
@@ -152,6 +158,9 @@
.icon.s22.unlock {
background-image: url("../../../images/icons/22/unlock.png");
}
+.icon.s22.plugin {
+ background-image: url("../../../images/icons/22/plugin.png");
+}
.icon.s22.type-unkn {
background-image: url("../../../images/icons/22/zip.png");
}
@@ -204,6 +213,9 @@
.icon.s48.unlock {
background-image: url("../../../images/icons/48/unlock.png");
}
+.icon.s48.plugin {
+ background-image: url("../../../images/icons/48/plugin.png");
+}
.icon.s48.type-unkn {
background-image: url("../../../images/icons/48/zip.png");
}
@@ -501,6 +513,17 @@ ul.menu-popup .empty {
text-align: center;
color: #9eabb0;
}
+ul.menu-popup .toolbar {
+ background-color: #9eabb0;
+ height: auto;
+ overflow: auto;
+}
+ul.menu-popup .toolbar a {
+ float: right;
+}
+ul.menu-popup .toolbar a:hover {
+ background-color: #ffffff;
+}
/* autocomplete popup */
.acpopup {
max-height: 150px;
diff --git a/view/theme/quattro/generic_links_widget.tpl b/view/theme/quattro/generic_links_widget.tpl
new file mode 100644
index 000000000..29580bbc7
--- /dev/null
+++ b/view/theme/quattro/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 {{ if $item.selected }}selected{{ endif }}"><a href="$item.url" class="link">$item.label</a></li>
+ {{ endfor }}
+ </ul>
+
+</div>
diff --git a/view/theme/quattro/green/style.css b/view/theme/quattro/green/style.css
index e7cc549d0..df43aa152 100644
--- a/view/theme/quattro/green/style.css
+++ b/view/theme/quattro/green/style.css
@@ -48,6 +48,9 @@
.icon.s10.unlock {
background-image: url("../../../images/icons/10/unlock.png");
}
+.icon.s10.plugin {
+ background-image: url("../../../images/icons/10/plugin.png");
+}
.icon.s10.type-unkn {
background-image: url("../../../images/icons/10/zip.png");
}
@@ -100,6 +103,9 @@
.icon.s16.unlock {
background-image: url("../../../images/icons/16/unlock.png");
}
+.icon.s16.plugin {
+ background-image: url("../../../images/icons/16/plugin.png");
+}
.icon.s16.type-unkn {
background-image: url("../../../images/icons/16/zip.png");
}
@@ -152,6 +158,9 @@
.icon.s22.unlock {
background-image: url("../../../images/icons/22/unlock.png");
}
+.icon.s22.plugin {
+ background-image: url("../../../images/icons/22/plugin.png");
+}
.icon.s22.type-unkn {
background-image: url("../../../images/icons/22/zip.png");
}
@@ -204,6 +213,9 @@
.icon.s48.unlock {
background-image: url("../../../images/icons/48/unlock.png");
}
+.icon.s48.plugin {
+ background-image: url("../../../images/icons/48/plugin.png");
+}
.icon.s48.type-unkn {
background-image: url("../../../images/icons/48/zip.png");
}
@@ -501,6 +513,17 @@ ul.menu-popup .empty {
text-align: center;
color: #9eabb0;
}
+ul.menu-popup .toolbar {
+ background-color: #9eabb0;
+ height: auto;
+ overflow: auto;
+}
+ul.menu-popup .toolbar a {
+ float: right;
+}
+ul.menu-popup .toolbar a:hover {
+ background-color: #ffffff;
+}
/* autocomplete popup */
.acpopup {
max-height: 150px;
diff --git a/view/theme/quattro/icons.less b/view/theme/quattro/icons.less
index e314fba1f..3688ae021 100644
--- a/view/theme/quattro/icons.less
+++ b/view/theme/quattro/icons.less
@@ -13,6 +13,7 @@
&.link { background-image: url("../../../images/icons/@{size}/link.png"); }
&.lock { background-image: url("../../../images/icons/@{size}/lock.png"); }
&.unlock { background-image: url("../../../images/icons/@{size}/unlock.png"); }
+ &.plugin { background-image: url("../../../images/icons/@{size}/plugin.png"); }
&.type-unkn { background-image: url("../../../images/icons/@{size}/zip.png"); }
&.type-audio{ background-image: url("../../../images/icons/@{size}/audio.png"); }
&.type-video{ background-image: url("../../../images/icons/@{size}/video.png"); }
diff --git a/view/theme/quattro/nav.tpl b/view/theme/quattro/nav.tpl
index 8c872864c..26f04f134 100644
--- a/view/theme/quattro/nav.tpl
+++ b/view/theme/quattro/nav.tpl
@@ -43,8 +43,7 @@
<li id="nav-notifications-linkmenu" class="nav-menu-icon"><a href="$nav.notifications.0" rel="#nav-notifications-menu" title="$nav.notifications.1"><span class="icon s22 notify">$nav.notifications.1</span></a>
<span id="notify-update" class="nav-notify"></span>
<ul id="nav-notifications-menu" class="menu-popup">
- <li id="nav-notifications-mark-all"><a href="#" onclick="notifyMarkAll(); return false;">$nav.notifications.mark.1</a></li>
- <li id="nav-notifications-see-all"><a href="$nav.notifications.all.0">$nav.notifications.all.1</a></li>
+ <li id="nav-notifications-mark-all" class="toolbar"><a href="#" onclick="notifyMarkAll(); return false;" title="$nav.notifications.mark.1"><span class="icon s10 edit"></span></a></a><a href="$nav.notifications.all.0" title="$nav.notifications.all.1"><span class="icon s10 plugin"></span></a></li>
<li class="empty">$emptynotifications</li>
</ul>
</li>
@@ -92,40 +91,3 @@
<li><a href="{0}"><img src="{1}">{2} <span class="notif-when">{3}</span></a></li>
</ul>
-{#
-
-{{ if $nav.logout }}<a id="nav-logout-link" class="nav-link $nav.logout.2" href="$nav.logout.0" title="$nav.logout.3" >$nav.logout.1</a> {{ endif }}
-{{ if $nav.login }}<a id="nav-login-link" class="nav-login-link $nav.login.2" href="$nav.login.0" title="$nav.login.3" >$nav.login.1</a> {{ endif }}
-
-<span id="nav-link-wrapper" >
-
-{{ if $nav.register }}<a id="nav-register-link" class="nav-commlink $nav.register.2" href="$nav.register.0" title="$nav.register.3" >$nav.register.1</a>{{ endif }}
-
-<a id="nav-help-link" class="nav-link $nav.help.2" target="friendika-help" href="$nav.help.0" title="$nav.help.3" >$nav.help.1</a>
-
-{{ if $nav.apps }}<a id="nav-apps-link" class="nav-link $nav.apps.2" href="$nav.apps.0" title="$nav.apps.3" >$nav.apps.1</a>{{ endif }}
-
-<a id="nav-search-link" class="nav-link $nav.search.2" href="$nav.search.0" title="$nav.search.3" >$nav.search.1</a>
-<a id="nav-directory-link" class="nav-link $nav.directory.2" href="$nav.directory.0" title="$nav.directory.3" >$nav.directory.1</a>
-
-{{ if $nav.admin }}<a id="nav-admin-link" class="nav-link $nav.admin.2" href="$nav.admin.0" title="$nav.admin.3" >$nav.admin.1</a>{{ endif }}
-
-{{ if $nav.notifications }}
-<a id="nav-notify-link" class="nav-commlink $nav.notifications.2" href="$nav.notifications.0" title="$nav.notifications.3" >$nav.notifications.1</a>
-<span id="notify-update" class="nav-ajax-left"></span>
-{{ endif }}
-{{ if $nav.messages }}
-<a id="nav-messages-link" class="nav-commlink $nav.messages.2" href="$nav.messages.0" title="$nav.messages.3" >$nav.messages.1</a>
-<span id="mail-update" class="nav-ajax-left"></span>
-{{ endif }}
-
-{{ if $nav.manage }}<a id="nav-manage-link" class="nav-commlink $nav.manage.2" href="$nav.manage.0" title="$nav.manage.3">$nav.manage.1</a>{{ endif }}
-
-{{ if $nav.settings }}<a id="nav-settings-link" class="nav-link $nav.settings.2" href="$nav.settings.0" title="$nav.settings.3">$nav.settings.1</a>{{ endif }}
-{{ if $nav.profiles }}<a id="nav-profiles-link" class="nav-link $nav.profiles.2" href="$nav.profiles.0" title="$nav.profiles.3" >$nav.profiles.1</a>{{ endif }}
-
-
-</span>
-<span id="nav-end"></span>
-<span id="banner">$banner</span>
-#}
diff --git a/view/theme/quattro/quattro.less b/view/theme/quattro/quattro.less
index c6352cfe9..0660a3ad7 100644
--- a/view/theme/quattro/quattro.less
+++ b/view/theme/quattro/quattro.less
@@ -227,6 +227,12 @@ ul.menu-popup {
text-align: center;
color: @MenuEmpty;
}
+ .toolbar {
+ background-color: @MenuEmpty;
+ height: auto; overflow: auto;
+ a { float: right; }
+ a:hover { background-color: @MenuBg; }
+ }
}
diff --git a/view/theme/quattro/style.php b/view/theme/quattro/style.php
index 889ec1530..b6104a170 100644
--- a/view/theme/quattro/style.php
+++ b/view/theme/quattro/style.php
@@ -1,5 +1,9 @@
<?php
- $color = get_pconfig(local_user(), "quattro","color");
+ $color = false;
+ if (local_user()) {
+ $color = get_pconfig(local_user(), "quattro","color");
+ $quattro_align = get_pconfig(local_user(), 'quattro', 'align' );
+ }
if ($color===false) $color="dark";
@@ -7,3 +11,13 @@
echo file_get_contents("$THEMEPATH/$color/style.css");
}
+
+ if($quattro_align=="center"){
+ echo "
+ html { width: 100%; margin:0px; padding:0px; }
+ body {
+ margin: 50px auto;
+ width: 900px;
+ }
+ ";
+ }
diff --git a/view/theme/quattro/theme.php b/view/theme/quattro/theme.php
deleted file mode 100644
index be47a401c..000000000
--- a/view/theme/quattro/theme.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-
-
-
-
-$quattro_align = get_pconfig(local_user(), 'quattro', 'align' );
-
-if(local_user() && $quattro_align=="center"){
-
- $a->page['htmlhead'].="
- <style>
- html { width: 100%; margin:0px; padding:0px; }
- body {
- margin: 50px auto;
- width: 900px;
- }
- </style>
- ";
-
-}