diff options
-rw-r--r-- | Zotlabs/Daemon/Notifier.php | 23 | ||||
-rw-r--r-- | Zotlabs/Module/Apporder.php | 43 | ||||
-rw-r--r-- | Zotlabs/Module/Apps.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Pdledit.php | 26 | ||||
-rw-r--r-- | Zotlabs/Widget/Notifications.php | 32 | ||||
-rwxr-xr-x | boot.php | 8 | ||||
-rw-r--r-- | doc/member/member_guide.bb | 2 | ||||
-rw-r--r-- | include/auth.php | 7 | ||||
-rw-r--r-- | include/import.php | 9 | ||||
-rw-r--r-- | include/nav.php | 44 | ||||
-rw-r--r-- | include/zot.php | 16 | ||||
-rw-r--r-- | view/css/widgets.css | 8 | ||||
-rw-r--r-- | view/pdl/mod_network.pdl | 2 | ||||
-rw-r--r-- | view/theme/redbasic/css/style.css | 2 | ||||
-rw-r--r-- | view/theme/redbasic/js/redbasic.js | 2 | ||||
-rw-r--r-- | view/tpl/app_nav.tpl | 2 | ||||
-rwxr-xr-x | view/tpl/main_slider.tpl | 8 | ||||
-rwxr-xr-x | view/tpl/navbar_default.tpl (renamed from view/tpl/nav.tpl) | 9 | ||||
-rw-r--r-- | view/tpl/notifications_widget.tpl | 12 | ||||
-rw-r--r-- | view/tpl/pdledit.tpl | 3 |
20 files changed, 200 insertions, 60 deletions
diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php index 5f8490b06..84212270f 100644 --- a/Zotlabs/Daemon/Notifier.php +++ b/Zotlabs/Daemon/Notifier.php @@ -66,6 +66,8 @@ require_once('include/bbcode.php'); * purge_all channel_id * expire channel_id * relay item_id (item was relayed to owner, we will deliver it as owner) + * single_activity item_id (deliver to a singleton network from the appropriate clone) + * single_mail mail_id (deliver to a singleton network from the appropriate clone) * location channel_id * request channel_id xchan_hash message_id * rating xlink_id @@ -106,7 +108,7 @@ class Notifier { $normal_mode = true; $packet_type = 'undefined'; - if($cmd === 'mail') { + if($cmd === 'mail' || $cmd === 'single_mail') { $normal_mode = false; $mail = true; $private = true; @@ -466,7 +468,7 @@ class Notifier { 'uplink' => $uplink, 'cmd' => $cmd, 'mail' => $mail, - 'single' => false, + 'single' => (($cmd === 'single_mail' || $cmd === 'single_activity') ? true : false), 'location' => $location, 'request' => $request, 'normal_mode' => $normal_mode, @@ -574,7 +576,7 @@ class Notifier { 'uplink' => $uplink, 'cmd' => $cmd, 'mail' => $mail, - 'single' => false, + 'single' => (($cmd === 'single_mail' || $cmd === 'single_activity') ? true : false), 'location' => $location, 'request' => $request, 'normal_mode' => $normal_mode, @@ -593,6 +595,21 @@ class Notifier { } + // singleton deliveries by definition 'not got zot'. + // Single deliveries are other federated networks (plugins) and we're essentially + // delivering only to those that have this site url in their abook_instance + // and only from within a sync operation. This means if you post from a clone, + // and a connection is connected to one of your other clones; assuming that hub + // is running it will receive a sync packet. On receipt of this sync packet it + // will invoke a delivery to those connections which are connected to just that + // hub instance. + + if($cmd === 'single_mail' || $cmd === 'single_activity') { + continue; + } + + // default: zot protocol + $hash = random_string(); $packet = null; $pmsg = ''; diff --git a/Zotlabs/Module/Apporder.php b/Zotlabs/Module/Apporder.php index 1097a01eb..956548d1f 100644 --- a/Zotlabs/Module/Apporder.php +++ b/Zotlabs/Module/Apporder.php @@ -11,30 +11,35 @@ class Apporder extends \Zotlabs\Web\Controller { } function get() { - $syslist = array(); - $list = Zlib\Apps::app_list(local_channel(), false, 'nav_featured_app'); - if($list) { - foreach($list as $li) { - $syslist[] = Zlib\Apps::app_encode($li); - } - } - Zlib\Apps::translate_system_apps($syslist); - usort($syslist,'Zotlabs\\Lib\\Apps::app_name_compare'); + if(! local_channel()) + return; - $syslist = Zlib\Apps::app_order(local_channel(),$syslist); + nav_set_selected('Order Apps'); - foreach($syslist as $app) { - $nav_apps[] = Zlib\Apps::app_render($app,'nav-order'); + $syslist = array(); + $list = Zlib\Apps::app_list(local_channel(), false, 'nav_featured_app'); + if($list) { + foreach($list as $li) { + $syslist[] = Zlib\Apps::app_encode($li); + } + } + Zlib\Apps::translate_system_apps($syslist); + + usort($syslist,'Zotlabs\\Lib\\Apps::app_name_compare'); + + $syslist = Zlib\Apps::app_order(local_channel(),$syslist); + foreach($syslist as $app) { + $nav_apps[] = Zlib\Apps::app_render($app,'nav-order'); } - return replace_macros(get_markup_template('apporder.tpl'), - [ - '$header' => t('Change Order of Navigation Apps'), - '$desc' => t('Use arrows to move the corresponding app up or down in the display list'), - '$nav_apps' => $nav_apps - ] - ); + return replace_macros(get_markup_template('apporder.tpl'), + [ + '$header' => t('Change Order of Navigation Apps'), + '$desc' => t('Use arrows to move the corresponding app up or down in the display list'), + '$nav_apps' => $nav_apps + ] + ); } } diff --git a/Zotlabs/Module/Apps.php b/Zotlabs/Module/Apps.php index 261615997..2f61f2932 100644 --- a/Zotlabs/Module/Apps.php +++ b/Zotlabs/Module/Apps.php @@ -7,6 +7,8 @@ use \Zotlabs\Lib as Zlib; class Apps extends \Zotlabs\Web\Controller { function get() { + + nav_set_selected('Apps'); if(argc() == 2 && argv(1) == 'edit') $mode = 'edit'; diff --git a/Zotlabs/Module/Pdledit.php b/Zotlabs/Module/Pdledit.php index 618444480..f8af470ac 100644 --- a/Zotlabs/Module/Pdledit.php +++ b/Zotlabs/Module/Pdledit.php @@ -14,7 +14,7 @@ class Pdledit extends \Zotlabs\Web\Controller { if(! trim($_REQUEST['content'])) { del_pconfig(local_channel(),'system','mod_' . $_REQUEST['module'] . '.pdl'); - goaway(z_root() . '/pdledit/' . $_REQUEST['module']); + goaway(z_root() . '/pdledit'); } set_pconfig(local_channel(),'system','mod_' . $_REQUEST['module'] . '.pdl',escape_tags($_REQUEST['content'])); build_sync_packet(); @@ -34,19 +34,38 @@ class Pdledit extends \Zotlabs\Web\Controller { notice( t('Feature disabled.') . EOL); return; } - + + if(argc() > 2 && argv(2) === 'reset') { + del_pconfig(local_channel(),'system','mod_' . argv(1) . '.pdl'); + goaway(z_root() . '/pdledit'); + } + if(argc() > 1) $module = 'mod_' . argv(1) . '.pdl'; else { $o .= '<div class="generic-content-wrapper-styled">'; $o .= '<h1>' . t('Edit System Page Description') . '</h1>'; + + $edited = []; + + $r = q("select k from pconfig where uid = %d and cat = 'system' and k like '%s' ", + intval(local_channel()), + dbesc('mod_%.pdl') + ); + + if($r) { + foreach($r as $rv) { + $edited[] = substr(str_replace('.pdl','',$rv['k']),4); + } + } + $files = glob('Zotlabs/Module/*.php'); if($files) { foreach($files as $f) { $name = lcfirst(basename($f,'.php')); $x = theme_include('mod_' . $name . '.pdl'); if($x) { - $o .= '<a href="pdledit/' . $name . '" >' . $name . '</a><br />'; + $o .= '<a href="pdledit/' . $name . '" >' . $name . '</a>' . ((in_array($name,$edited)) ? ' ' . t('(modified)') . ' <a href="pdledit/' . $name . '/reset" >' . t('Reset') . '</a>': '' ) . '<br />'; } } } @@ -69,6 +88,7 @@ class Pdledit extends \Zotlabs\Web\Controller { '$header' => t('Edit System Page Description'), '$mname' => t('Module Name:'), '$help' => t('Layout Help'), + '$another' => t('Edit another layout'), '$module' => argv(1), '$content' => htmlspecialchars($t,ENT_COMPAT,'UTF-8'), '$submit' => t('Submit') diff --git a/Zotlabs/Widget/Notifications.php b/Zotlabs/Widget/Notifications.php index 0f82d102e..a857f1ad9 100644 --- a/Zotlabs/Widget/Notifications.php +++ b/Zotlabs/Widget/Notifications.php @@ -120,21 +120,23 @@ class Notifications { ]; } - $notifications[] = [ - 'type' => 'pubs', - 'icon' => 'globe', - 'severity' => 'secondary', - 'label' => t('Public Stream'), - 'title' => t('Public Stream Notifications'), - 'viewall' => [ - 'url' => 'pubstream', - 'label' => t('View the public stream') - ], - 'markall' => [ - 'url' => '#', - 'label' => t('Mark all notifications seen') - ] - ]; + if(get_config('system', 'disable_discover_tab') != 1) { + $notifications[] = [ + 'type' => 'pubs', + 'icon' => 'globe', + 'severity' => 'secondary', + 'label' => t('Public Stream'), + 'title' => t('Public Stream Notifications'), + 'viewall' => [ + 'url' => 'pubstream', + 'label' => t('View the public stream') + ], + 'markall' => [ + 'url' => '#', + 'label' => t('Mark all notifications seen') + ] + ]; + } $o = replace_macros(get_markup_template('notifications_widget.tpl'), array( '$notifications' => $notifications, @@ -2090,9 +2090,11 @@ function construct_page() { $installing = false; - $navbar = get_config('system','navbar','nav'); - if(App::$profile_uid) { - $navbar = get_pconfig(App::$profile_uid,'system','navbar',$navbar); + $uid = ((App::$profile_uid) ? App::$profile_uid : local_channel()); + + $navbar = get_config('system','navbar','default'); + if($uid) { + $navbar = get_pconfig($uid,'system','navbar',$navbar); } if($comanche && App::$layout['navbar']) { diff --git a/doc/member/member_guide.bb b/doc/member/member_guide.bb index 0794f24d3..4a9262741 100644 --- a/doc/member/member_guide.bb +++ b/doc/member/member_guide.bb @@ -640,7 +640,7 @@ The condensed notation isn't part of Comanche itself but is recognised by $Proje [navbar]tucson[/navbar] [/code] -Use the 'tucson' navbar template and CSS rules. By default the 'nav' navbar template will be used. +Use the 'tucson' navbar template and CSS rules. By default the 'default' navbar template will be used. [h4]Regions[/h4] diff --git a/include/auth.php b/include/auth.php index c7be69583..78be32bf4 100644 --- a/include/auth.php +++ b/include/auth.php @@ -83,7 +83,7 @@ function account_verify_password($login, $pass) { if(($email_verify) && ($register_policy == REGISTER_OPEN) && ($account['account_flags'] & ACCOUNT_UNVERIFIED)) { logger('email verification required for ' . $login); - return null; + return ( [ 'reason' => 'unvalidated' ] ); } if(($account['account_flags'] == ACCOUNT_OK) @@ -259,7 +259,10 @@ else { } else { $verify = account_verify_password($_POST['username'], $_POST['password']); - if($verify) { + if($verify && array_key_exists('reason',$verify) && $verify['reason'] === 'unvalidated') { + notice( t('Email validation is incomplete. Please check your email.')); + } + elseif($verify) { $atoken = $verify['xchan']; $channel = $verify['channel']; $account = App::$account = $verify['account']; diff --git a/include/import.php b/include/import.php index 4d38c8061..702fa7e54 100644 --- a/include/import.php +++ b/include/import.php @@ -644,6 +644,12 @@ function import_items($channel, $items, $sync = false, $relocate = null) { fix_attached_file_permissions($channel,$item['author_xchan'],$item['body'],$item['allow_cid'],$item['allow_gid'],$item['deny_cid'],$item['deny_gid']); + if($sync && $item['item_wall']) { + // deliver singletons if we have any + if($item_result && $item_result['success']) { + Zotlabs\Daemon\Master::Summon( [ 'Notifier','single_activity',$item_result['item_id'] ]); + } + } } } } @@ -1017,6 +1023,9 @@ function import_mail($channel, $mails, $sync = false) { $m['aid'] = $channel['channel_account_id']; $m['uid'] = $channel['channel_id']; $mail_id = mail_store($m); + if($sync && $mail_id) { + Zotlabs\Daemon\Master::Summon(array('Notifier','single_mail',$mail_id)); + } } } } diff --git a/include/nav.php b/include/nav.php index b5f713145..6fd7d527b 100644 --- a/include/nav.php +++ b/include/nav.php @@ -6,7 +6,7 @@ require_once('include/security.php'); require_once('include/menu.php'); -function nav($template = 'nav') { +function nav($template = 'default') { /** * @@ -92,6 +92,46 @@ EOT; } if(local_channel()) { + + + + $nav['network'] = array('network', t('Activity'), "", t('Network Activity'),'network_nav_btn'); + $nav['network']['all'] = [ 'network', t('View your network activity'), '','' ]; + $nav['network']['mark'] = array('', t('Mark all activity notifications seen'), '',''); + + $nav['home'] = array('channel/' . $channel['channel_address'], t('Channel Home'), "", t('Channel home'),'home_nav_btn'); + $nav['home']['all'] = [ 'channel/' . $channel['channel_address'], t('View your channel home'), '' , '' ]; + $nav['home']['mark'] = array('', t('Mark all channel notifications seen'), '',''); + + + $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'); + $nav['notifications']['all']=array('notifications/system', t('View all notifications'), "", ""); + $nav['notifications']['mark'] = array('', t('Mark all system notifications seen'), '',''); + + $nav['messages'] = array('mail/combined', t('Mail'), "", t('Private mail'),'mail_nav_btn'); + $nav['messages']['all']=array('mail/combined', t('View your private messages'), "", ""); + $nav['messages']['mark'] = array('', t('Mark all private messages seen'), '',''); + $nav['messages']['inbox'] = array('mail/inbox', t('Inbox'), "", t('Inbox')); + $nav['messages']['outbox']= array('mail/outbox', t('Outbox'), "", t('Outbox')); + $nav['messages']['new'] = array('mail/new', t('New Message'), "", t('New Message')); + + + $nav['all_events'] = array('events', t('Events'), "", t('Event Calendar'),'events_nav_btn'); + $nav['all_events']['all']=array('events', t('View events'), "", ""); + $nav['all_events']['mark'] = array('', t('Mark all events seen'), '',''); + + if(! $_SESSION['delegate']) { + $nav['manage'] = array('manage', t('Channel Manager'), "", t('Manage Your Channels'),'manage_nav_btn'); + } + + $nav['settings'] = array('settings', t('Settings'),"", t('Account/Channel Settings'),'settings_nav_btn'); + + if($chans && count($chans) > 1 && feature_enabled(local_channel(),'nav_channel_select')) $nav['channels'] = $chans; @@ -248,7 +288,7 @@ EOT; } if(! $tpl) { - $tpl = get_markup_template('nav.tpl'); + $tpl = get_markup_template('navbar_default.tpl'); } App::$page['nav'] .= replace_macros($tpl, array( diff --git a/include/zot.php b/include/zot.php index af7fbf8fd..b6df6bca8 100644 --- a/include/zot.php +++ b/include/zot.php @@ -718,6 +718,16 @@ function import_xchan($arr,$ud_flags = UPDATE_FLAGS_UPDATED, $ud_arr = null) { if(intval($r[0]['xchan_pubforum']) != intval($arr['public_forum'])) $pubforum_changed = 1; + if($arr['protocols']) { + $protocols = implode(',',$arr['protocols']); + if($protocols !== 'zot') { + set_xconfig($xchan_hash,'system','protocols',$protocols); + } + else { + del_xconfig($xchan_hash,'system','protocols'); + } + } + if(($r[0]['xchan_name_date'] != $arr['name_updated']) || ($r[0]['xchan_connurl'] != $arr['connections_url']) || ($r[0]['xchan_addr'] != $arr['address']) @@ -4035,6 +4045,11 @@ function zotinfo($arr) { $id = $e['channel_id']; + $x = [ 'channel_id' => $id, 'protocols' => 'zot' ]; + call_hooks('channel_protocols',$x); + $protocols = $x['protocols']; + + $sys_channel = (intval($e['channel_system']) ? true : false); $special_channel = (($e['channel_pageflags'] & PAGE_PREMIUM) ? true : false); $adult_channel = (($e['channel_pageflags'] & PAGE_ADULT) ? true : false); @@ -4135,6 +4150,7 @@ function zotinfo($arr) { $ret['target'] = $ztarget; $ret['target_sig'] = $zsig; $ret['searchable'] = $searchable; + $ret['protocols'] = $protocols; $ret['adult_content'] = $adult_channel; $ret['public_forum'] = $public_forum; if($deleted) diff --git a/view/css/widgets.css b/view/css/widgets.css index 6cd61ae6f..cea3a3820 100644 --- a/view/css/widgets.css +++ b/view/css/widgets.css @@ -57,7 +57,13 @@ li:hover .widget-nav-pills-icons { /* affinity slider */ #main-slider { - margin: 10px 7px 45px 7px; + margin: 10px 7px 4rem 7px; +} + +@media screen and (max-width: 767px) { + #main-slider { + margin: 4rem 7px 4rem 7px; + } } /* posted date */ diff --git a/view/pdl/mod_network.pdl b/view/pdl/mod_network.pdl index 24cf65b3c..44e29ffbd 100644 --- a/view/pdl/mod_network.pdl +++ b/view/pdl/mod_network.pdl @@ -1,5 +1,3 @@ -[region=nav]$nav[/region] - [region=aside] [widget=collections][/widget] [widget=forums][/widget] diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 8b4a6ac82..aea75df65 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -50,7 +50,7 @@ main { height: 100%; background: rgba(0, 0, 0, .5); cursor: pointer; - z-index: 1029; + z-index: 1028; } h1, .h1 { diff --git a/view/theme/redbasic/js/redbasic.js b/view/theme/redbasic/js/redbasic.js index 4f71c1e73..04199ea95 100644 --- a/view/theme/redbasic/js/redbasic.js +++ b/view/theme/redbasic/js/redbasic.js @@ -83,7 +83,7 @@ $(document).ready(function() { }); var notifications_parent = $('#notifications_wrapper')[0].parentElement.id; - $('#notifications-btn-1').click(function() { + $('#notifications-btn').click(function() { if($('#notifications_wrapper').hasClass('fs')) $('#notifications_wrapper').prependTo('#' + notifications_parent); else diff --git a/view/tpl/app_nav.tpl b/view/tpl/app_nav.tpl index 1ee5adb70..046cd7237 100644 --- a/view/tpl/app_nav.tpl +++ b/view/tpl/app_nav.tpl @@ -1 +1 @@ -<a class="navbar-app nav-link{{if $app.active}} active{{/if}}" href="{{$app.url}}" title="{{$app.name}}" >{{if $icon}}<i class="generic-icons-nav fa fa-fw fa-{{$icon}}"></i>{{else}}<img src="{{$app.photo}}" width="16" height="16" />{{/if}}</a> +<a class="navbar-app nav-link{{if $app.active}} active{{/if}}" href="{{$app.url}}" title="{{$app.name}}" >{{if $icon}}<i class="fa fa-fw fa-{{$icon}}"></i>{{else}}<img src="{{$app.photo}}" width="16" height="16" />{{/if}}</a> diff --git a/view/tpl/main_slider.tpl b/view/tpl/main_slider.tpl index 4cc265f59..f5c573970 100755 --- a/view/tpl/main_slider.tpl +++ b/view/tpl/main_slider.tpl @@ -1,5 +1,9 @@ -<div id="main-slider" class="slider" ><input id="main-range" type="text" name="cminmax" value="{{$val}}" /></div> -<div id="profile-jot-text-loading" class="spinner-wrapper"><div class="spinner m"></div></div> +<div id="main-slider" class="slider" > + <input id="main-range" type="text" name="cminmax" value="{{$val}}" /> + <div id="profile-jot-text-loading" class="spinner-wrapper"> + <div class="spinner m"></div> + </div> +</div> <script> $(document).ready(function() { var old_cmin = 0; diff --git a/view/tpl/nav.tpl b/view/tpl/navbar_default.tpl index b6faad0c2..cf7235b14 100755 --- a/view/tpl/nav.tpl +++ b/view/tpl/navbar_default.tpl @@ -67,7 +67,7 @@ <i class="fa fa-arrow-circle-right" id="expand-aside-icon"></i> </button> {{if $localuser || $nav.pubs}} - <button id="notifications-btn-1" type="button" class="navbar-toggler border-0 text-white"> + <button id="notifications-btn" type="button" class="navbar-toggler border-0 text-white"> <i class="fa fa-exclamation-circle"></i> </button> {{/if}} @@ -107,6 +107,13 @@ </div> </li> {{/if}} + {{if $navbar_apps}} + {{foreach $navbar_apps as $navbar_app}} + <li> + {{$navbar_app}} + </li> + {{/foreach}} + {{/if}} <li class="nav-item dropdown" id="app-menu"> <a class="nav-link" href="#" data-toggle="dropdown"><i class="fa fa-fw fa-bars"></i></a> <div id="dropdown-menu" class="dropdown-menu dropdown-menu-right"> diff --git a/view/tpl/notifications_widget.tpl b/view/tpl/notifications_widget.tpl index 73cf24071..6865879ad 100644 --- a/view/tpl/notifications_widget.tpl +++ b/view/tpl/notifications_widget.tpl @@ -17,7 +17,7 @@ width: 100%; max-width: 100%; height: 100%; - z-index: 1025; + z-index: 1029; overflow: auto; } @@ -26,6 +26,7 @@ } </style> +{{if $notifications}} <div id="notifications_wrapper"> <div id="notifications" class="navbar-nav" data-children=".nav-item"> <div id="nav-notifications-template" rel="template"> @@ -43,10 +44,14 @@ </a> <div id="nav-{{$notification.type}}-menu" class="collapse notification-content" rel="{{$notification.type}}"> {{if $notification.viewall}} - <a class="list-group-item" id="nav-{{$notification.type}}-see-all" href="{{$notification.viewall.url}}">{{$notification.viewall.label}}</a> + <a class="list-group-item text-dark" id="nav-{{$notification.type}}-see-all" href="{{$notification.viewall.url}}"> + <i class="fa fa-fw fa-external-link"></i> {{$notification.viewall.label}} + </a> {{/if}} {{if $notification.markall}} - <a class="list-group-item" id="nav-{{$notification.type}}-mark-all" href="{{$notification.markall.url}}" onclick="markRead('{{$notification.type}}'); return false;">{{$notification.markall.label}}</a> + <a class="list-group-item text-dark" id="nav-{{$notification.type}}-mark-all" href="{{$notification.markall.url}}" onclick="markRead('{{$notification.type}}'); return false;"> + <i class="fa fa-fw fa-check"></i> {{$notification.markall.label}} + </a> {{/if}} {{$loading}} </div> @@ -54,3 +59,4 @@ {{/foreach}} </div> </div> +{{/if}} diff --git a/view/tpl/pdledit.tpl b/view/tpl/pdledit.tpl index cef93d324..2ea89b6c1 100644 --- a/view/tpl/pdledit.tpl +++ b/view/tpl/pdledit.tpl @@ -5,6 +5,9 @@ <br /> <a href="help/comanche" target="hubzilla-help">{{$help}}</a> +<br> +<br> +<a href="pdledit">{{$another}}</a> <br /> <br /> |