diff options
author | Mario Vavti <mario@mariovavti.com> | 2017-10-04 13:37:17 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2017-10-04 13:37:17 +0200 |
commit | 295ed07d40ea330ef438d9cad8fe3af8fd265507 (patch) | |
tree | 0eadabe5ed19e68e2c570cb0fbbb7ba9a20e9863 | |
parent | fa93114804801bceabea06570e8eee602167600a (diff) | |
download | volse-hubzilla-295ed07d40ea330ef438d9cad8fe3af8fd265507.tar.gz volse-hubzilla-295ed07d40ea330ef438d9cad8fe3af8fd265507.tar.bz2 volse-hubzilla-295ed07d40ea330ef438d9cad8fe3af8fd265507.zip |
bring back notifications for account approvals
-rw-r--r-- | Zotlabs/Module/Ping.php | 24 | ||||
-rw-r--r-- | include/nav.php | 2 | ||||
-rw-r--r-- | view/js/main.js | 4 | ||||
-rwxr-xr-x | view/tpl/nav.tpl | 15 |
4 files changed, 41 insertions, 4 deletions
diff --git a/Zotlabs/Module/Ping.php b/Zotlabs/Module/Ping.php index 1a76f4f7b..66ab1a386 100644 --- a/Zotlabs/Module/Ping.php +++ b/Zotlabs/Module/Ping.php @@ -340,6 +340,30 @@ class Ping extends \Zotlabs\Web\Controller { killme(); } + if((argc() > 1 && (argv(1) === 'register')) && is_site_admin()) { + $result = array(); + + $r = q("SELECT account_email, account_created from account where (account_flags & %d) > 0", + intval(ACCOUNT_PENDING) + ); + if($r) { + foreach($r as $rr) { + $result[] = array( + 'notify_link' => z_root() . '/admin/accounts', + 'name' => $rr['account_email'], + 'url' => '', + 'photo' => get_default_profile_photo(48), + 'when' => relative_date($rr['account_created']), + 'hclass' => ('notify-unseen'), + 'message' => t('requires approval') + ); + } + } + logger('ping (register): ' . print_r($result, true), LOGGER_DATA); + echo json_encode(array('notify' => $result)); + killme(); + } + if(argc() > 1 && (argv(1) === 'all_events')) { $bd_format = t('g A l F d') ; // 8 AM Friday January 18 diff --git a/include/nav.php b/include/nav.php index 01decb2bf..eccb89764 100644 --- a/include/nav.php +++ b/include/nav.php @@ -180,6 +180,8 @@ EOT; $nav['intros'] = array('connections/ifpending', t('Connections'), "", t('Connections'),'connections_nav_btn'); + if(is_site_admin()) + $nav['registrations'] = array('admin/accounts', t('Registrations'), "", t('Registrations'),'registrations_nav_btn'); $nav['notifications'] = array('notifications/system', t('Notices'), "", t('Notifications'),'notifications_nav_btn'); diff --git a/view/js/main.js b/view/js/main.js index 73b2f3616..dc40db360 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -444,7 +444,7 @@ function NavUpdate() { updateCountsOnly = false; - if(data.network || data.home || data.intros || data.mail || data.all_events || data.notify || data.files || data.pubs) { + if(data.network || data.home || data.intros || data.register || data.mail || data.all_events || data.notify || data.files || data.pubs) { $('#notifications-btn').css('opacity', 1); } else { @@ -490,7 +490,7 @@ function NavUpdate() { if(data.notify == 0) { data.notify = ''; $('.notify-update, .notify-button').hide(); } else { $('.notify-update, .notify-button').show(); } $('.notify-update').html(data.notify); - if(data.register == 0) { data.register = ''; $('.register-update').removeClass('show'); } else { $('.register-update').addClass('show'); } + if(data.register == 0) { data.register = ''; $('.register-update, .register-button').hide(); } else { $('.register-update, .register-button').show(); } $('.register-update').html(data.register); if(data.events == 0) { data.events = ''; $('.events-update, .events-button').hide(); } else { $('.events-update, .events-button').show(); } diff --git a/view/tpl/nav.tpl b/view/tpl/nav.tpl index 72860aebe..0d0b0b600 100755 --- a/view/tpl/nav.tpl +++ b/view/tpl/nav.tpl @@ -128,7 +128,7 @@ {{/if}} {{if $nav.intros}} <li class="nav-item dropdown intro-button" style="display: none;"> - <a class="nav-link" href="{{$nav.intros.0}}" title="{{$nav.intros.3}}" id="{{$nav.intros.4}}" data-toggle="dropdown" rel="#nav-intros-menu"> + <a class="nav-link" href="#" title="{{$nav.intros.3}}" id="{{$nav.intros.4}}" data-toggle="dropdown" rel="#nav-intros-menu"> <i class="fa fa-fw fa-users"></i> <span class="badge badge-pill badge-danger intro-update"></span> </a> @@ -138,9 +138,20 @@ </div> </li> {{/if}} + {{if $nav.registrations}} + <li class="nav-item dropdown register-button" style="display: none;"> + <a class="nav-link" href="#" title="{{$nav.registrations.3}}" id="{{$nav.registrations.4}}" data-toggle="dropdown" rel="#nav-register-menu"> + <i class="fa fa-fw fa-user-o"></i> + <span class="badge badge-pill badge-danger register-update"></span> + </a> + <div id="nav-register-menu" class="dropdown-menu" rel="register"> + {{$emptynotifications}} + </div> + </li> + {{/if}} {{if $nav.notifications}} <li class="nav-item dropdown notify-button" style="display: none;"> - <a class="nav-link" href="{{$nav.notifications.0}}" title="{{$nav.notifications.1}}" id="{{$nav.notifications.4}}" data-toggle="dropdown" rel="#nav-notify-menu"> + <a class="nav-link" href="#" title="{{$nav.notifications.1}}" id="{{$nav.notifications.4}}" data-toggle="dropdown" rel="#nav-notify-menu"> <i class="fa fa-fw fa-exclamation"></i> <span class="badge badge-pill badge-danger notify-update"></span> </a> |