Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge

This commit is contained in:
zotlabs 2017-10-11 15:13:57 -07:00
commit 48d2b3afa8
20 changed files with 200 additions and 60 deletions

View File

@ -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 = '';

View File

@ -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
]
);
}
}

View File

@ -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';

View File

@ -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')

View File

@ -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,

View File

@ -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']) {

View File

@ -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]

View File

@ -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'];

View File

@ -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));
}
}
}
}

View File

@ -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(

View File

@ -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)

View File

@ -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 */

View File

@ -1,5 +1,3 @@
[region=nav]$nav[/region]
[region=aside]
[widget=collections][/widget]
[widget=forums][/widget]

View File

@ -50,7 +50,7 @@ main {
height: 100%;
background: rgba(0, 0, 0, .5);
cursor: pointer;
z-index: 1029;
z-index: 1028;
}
h1, .h1 {

View File

@ -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

View File

@ -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>

View File

@ -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;

View File

@ -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">

View File

@ -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}}

View File

@ -5,6 +5,9 @@
<br />
<a href="help/comanche" target="hubzilla-help">{{$help}}</a>
<br>
<br>
<a href="pdledit">{{$another}}</a>
<br />
<br />