aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r--Zotlabs/Module/Achievements.php44
-rw-r--r--Zotlabs/Module/Admin/Features.php5
-rw-r--r--Zotlabs/Module/Admin/Site.php3
-rw-r--r--Zotlabs/Module/Authorize.php9
-rw-r--r--Zotlabs/Module/Authtest.php4
-rw-r--r--Zotlabs/Module/Changeaddr.php40
-rw-r--r--Zotlabs/Module/Channel_calendar.php30
-rw-r--r--Zotlabs/Module/Conversation.php4
-rw-r--r--Zotlabs/Module/Cover_photo.php9
-rw-r--r--Zotlabs/Module/Dav.php1
-rw-r--r--Zotlabs/Module/Display.php7
-rw-r--r--Zotlabs/Module/Fbrowser.php2
-rw-r--r--Zotlabs/Module/Go.php4
-rw-r--r--Zotlabs/Module/Impel.php4
-rw-r--r--Zotlabs/Module/Import.php3
-rw-r--r--Zotlabs/Module/Import_progress.php20
-rw-r--r--Zotlabs/Module/Item.php58
-rw-r--r--Zotlabs/Module/Like.php18
-rw-r--r--Zotlabs/Module/Mitem.php30
-rw-r--r--Zotlabs/Module/Moderate.php2
-rw-r--r--Zotlabs/Module/OAuth2TestVehicle.php8
-rw-r--r--Zotlabs/Module/Oauth.php12
-rw-r--r--Zotlabs/Module/Oauth2.php12
-rw-r--r--Zotlabs/Module/Page.php4
-rw-r--r--Zotlabs/Module/Pdledit.php2
-rw-r--r--Zotlabs/Module/Profperm.php2
-rw-r--r--Zotlabs/Module/React.php3
-rw-r--r--Zotlabs/Module/Removeaccount.php20
-rw-r--r--Zotlabs/Module/Removeme.php6
-rw-r--r--Zotlabs/Module/Search_ac.php7
-rw-r--r--Zotlabs/Module/Settings/Account.php4
-rw-r--r--Zotlabs/Module/Settings/Calendar.php5
-rw-r--r--Zotlabs/Module/Settings/Channel_home.php5
-rw-r--r--Zotlabs/Module/Settings/Connections.php5
-rw-r--r--Zotlabs/Module/Settings/Conversation.php2
-rw-r--r--Zotlabs/Module/Settings/Directory.php5
-rw-r--r--Zotlabs/Module/Settings/Editor.php5
-rw-r--r--Zotlabs/Module/Settings/Events.php5
-rw-r--r--Zotlabs/Module/Settings/Features.php7
-rw-r--r--Zotlabs/Module/Settings/Manage.php5
-rw-r--r--Zotlabs/Module/Settings/Network.php5
-rw-r--r--Zotlabs/Module/Settings/Photos.php5
-rw-r--r--Zotlabs/Module/Settings/Profiles.php5
-rw-r--r--Zotlabs/Module/Share.php6
-rw-r--r--Zotlabs/Module/Subthread.php2
-rw-r--r--Zotlabs/Module/Tagrm.php98
-rw-r--r--Zotlabs/Module/Thing.php11
-rw-r--r--Zotlabs/Module/Vote.php9
-rw-r--r--Zotlabs/Module/Webfinger.php14
-rw-r--r--Zotlabs/Module/Webpages.php5
50 files changed, 290 insertions, 291 deletions
diff --git a/Zotlabs/Module/Achievements.php b/Zotlabs/Module/Achievements.php
index 1529448d3..a16294039 100644
--- a/Zotlabs/Module/Achievements.php
+++ b/Zotlabs/Module/Achievements.php
@@ -8,25 +8,25 @@ class Achievements extends \Zotlabs\Web\Controller {
// This doesn't work, so
if (! is_developer())
return;
-
+
if(argc() > 1)
$which = argv(1);
else {
notice( t('Requested profile is not available.') . EOL );
return;
}
-
+
$profile = 0;
- $profile = argv(1);
+ $profile = argv(1);
profile_load($which,$profile);
-
+
$r = q("select channel_id from channel where channel_address = '%s'",
dbesc($which)
);
if($r) {
$owner = intval($r[0]['channel_id']);
}
-
+
$observer = \App::get_observer();
$ob_hash = (($observer) ? $observer['xchan_hash'] : '');
$perms = get_all_perms($owner,$ob_hash);
@@ -34,60 +34,60 @@ class Achievements extends \Zotlabs\Web\Controller {
notice( t('Permission denied.') . EOL);
return;
}
-
+
$newmembertext = t('Some blurb about what to do when you\'re new here');
-
-
+
+
// By default, all badges are false
$contactbadge = false;
$profilebadge = false;
$keywordsbadge = false;
-
+
// Check number of contacts. Award a badge if over 10
- // We'll figure these out on each page load instead of
+ // We'll figure these out on each page load instead of
// writing them to the DB because that will mean one needs
// to retain their achievements - eg, you can't add
// a bunch of channels just to get your badge, and then
// delete them all again. If these become popular or
// used in profiles or something, we may need to reconsider
// and add a table for this - because this won't scale.
-
+
$r = q("select * from abook where abook_channel = %d",
intval($owner)
);
-
+
if (count($r))
$contacts = count($r);
// We're checking for 11 to adjust for the abook record for self
if ($contacts >= 11)
$contactbadge = true;
-
+
// Check if an about field in the profile has been created.
-
+
$r = q("select * from profile where uid = %d and about <> ''",
intval($owner)
);
-
+
if ($r)
$profilebadge = 1;
-
+
// Check if keywords have been set
-
+
$r = q("select * from profile where uid = %d and keywords <> ''",
intval($owner)
);
-
+
if($r)
$keywordsbadge = 1;
-
+
return replace_macros(get_markup_template("achievements.tpl"), array(
'$newmembertext' => $newmembertext,
'$profilebadge' => $profilebadge,
'$contactbadge' => $contactbadge,
'$keywordsbadge' => $keywordsbadge,
- '$channelsbadge' => $channelsbadge
+ '$channelsbadge' => null,
));
-
+
}
-
+
}
diff --git a/Zotlabs/Module/Admin/Features.php b/Zotlabs/Module/Admin/Features.php
index e0b3a3fd4..eb82ae1ff 100644
--- a/Zotlabs/Module/Admin/Features.php
+++ b/Zotlabs/Module/Admin/Features.php
@@ -59,14 +59,13 @@ class Features {
}
$tpl = get_markup_template("admin_settings_features.tpl");
- $o .= replace_macros($tpl, array(
+
+ return replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("admin_manage_features"),
'$title' => t('Manage Additional Features'),
'$features' => $arr,
'$submit' => t('Submit'),
));
-
- return $o;
}
}
diff --git a/Zotlabs/Module/Admin/Site.php b/Zotlabs/Module/Admin/Site.php
index abc56d298..9ef5dc20f 100644
--- a/Zotlabs/Module/Admin/Site.php
+++ b/Zotlabs/Module/Admin/Site.php
@@ -6,6 +6,8 @@ use Zotlabs\Lib\Config;
class Site {
+ private string $eol;
+ private string $joo;
/**
* @brief POST handler for Admin Site Page.
@@ -208,7 +210,6 @@ class Site {
//Config::Set('system','force_queue_threshold', $force_queue);
Config::Set('system','no_community_page', $no_community_page);
- Config::Set('system','no_utf', $no_utf);
Config::Set('system','sse_enabled', $sse_enabled);
diff --git a/Zotlabs/Module/Authorize.php b/Zotlabs/Module/Authorize.php
index c6709f602..b015c3284 100644
--- a/Zotlabs/Module/Authorize.php
+++ b/Zotlabs/Module/Authorize.php
@@ -9,7 +9,7 @@ class Authorize extends \Zotlabs\Web\Controller {
function get() {
if (! local_channel()) {
return login();
- }
+ }
else {
$name = $_REQUEST['client_name'];
@@ -25,7 +25,7 @@ class Authorize extends \Zotlabs\Web\Controller {
$link = (($app['url']) ? '<a style="float: none;" href="' . $app['url'] . '">' . $app['name'] . '</a> ' : $app['name']);
- $o .= replace_macros(get_markup_template('oauth_authorize.tpl'), [
+ return replace_macros(get_markup_template('oauth_authorize.tpl'), [
'$title' => t('Authorize'),
'$authorize' => sprintf( t('Do you authorize the app %s to access your channel data?'), $link ),
'$app' => $app,
@@ -35,7 +35,6 @@ class Authorize extends \Zotlabs\Web\Controller {
'$redirect_uri' => (x($_REQUEST, 'redirect_uri') ? $_REQUEST['redirect_uri'] : ''),
'$state' => (x($_REQUEST, 'state') ? $_REQUEST['state'] : ''),
]);
- return $o;
}
}
@@ -50,7 +49,7 @@ class Authorize extends \Zotlabs\Web\Controller {
// TODO: The automatic client registration protocol below should adhere more
// closely to "OAuth 2.0 Dynamic Client Registration Protocol" defined
// at https://tools.ietf.org/html/rfc7591
-
+
// If no client_id was provided, generate a new one.
if (x($_POST, 'client_id')) {
$client_id = $_POST['client_id'];
@@ -67,7 +66,7 @@ class Authorize extends \Zotlabs\Web\Controller {
$request = \OAuth2\Request::createFromGlobals();
$response = new \OAuth2\Response();
- // Note, "sub" field must match type and content. $user_id is used to populate - make sure it's a string.
+ // Note, "sub" field must match type and content. $user_id is used to populate - make sure it's a string.
$channel = channelx_by_n(local_channel());
$user_id = $channel['channel_id'];
diff --git a/Zotlabs/Module/Authtest.php b/Zotlabs/Module/Authtest.php
index d85af09dc..bf199ccf6 100644
--- a/Zotlabs/Module/Authtest.php
+++ b/Zotlabs/Module/Authtest.php
@@ -7,7 +7,7 @@ class Authtest extends \Zotlabs\Web\Controller {
$auth_success = false;
- $o .= '<h3>Magic-Auth Diagnostic</h3>';
+ $o = '<h3>Magic-Auth Diagnostic</h3>';
if(! local_channel()) {
notice( t('Permission denied.') . EOL);
@@ -27,7 +27,7 @@ class Authtest extends \Zotlabs\Web\Controller {
$_REQUEST['test'] = 1;
$mod = new Magic();
- $x = $mod->init($a);
+ $x = $mod->init();
$o .= 'Local Setup returns: ' . print_r($x,true);
diff --git a/Zotlabs/Module/Changeaddr.php b/Zotlabs/Module/Changeaddr.php
index ed139c9f9..f8a045727 100644
--- a/Zotlabs/Module/Changeaddr.php
+++ b/Zotlabs/Module/Changeaddr.php
@@ -5,30 +5,30 @@ namespace Zotlabs\Module;
class Changeaddr extends \Zotlabs\Web\Controller {
function post() {
-
+
if(! local_channel())
return;
-
+
if($_SESSION['delegate'])
return;
-
+
if((! x($_POST,'qxz_password')) || (! strlen(trim($_POST['qxz_password']))))
return;
-
+
if((! x($_POST,'verify')) || (! strlen(trim($_POST['verify']))))
return;
-
+
if($_POST['verify'] !== $_SESSION['remove_account_verify'])
return;
-
-
+
+
$account = \App::get_account();
$channel = \App::get_channel();
-
+
$x = account_verify_password($account['account_email'],$_POST['qxz_password']);
if(! ($x && $x['account']))
return;
-
+
if($account['account_password_changed'] > NULL_DATE) {
$d1 = datetime_convert('UTC','UTC','now - 48 hours');
if($account['account_password_changed'] > $d1) {
@@ -36,7 +36,7 @@ class Changeaddr extends \Zotlabs\Web\Controller {
return;
}
}
-
+
$new_address = trim($_POST['newname']);
if($new_address === $channel['channel_address'])
@@ -55,23 +55,23 @@ class Changeaddr extends \Zotlabs\Web\Controller {
channel_change_address($channel,$new_address);
goaway(z_root() . '/changeaddr');
-
+
}
-
-
+
+
function get() {
-
+
if(! local_channel())
goaway(z_root());
-
+
$channel = \App::get_channel();
$hash = random_string();
-
+
$_SESSION['remove_account_verify'] = $hash;
-
+
$tpl = get_markup_template('channel_rename.tpl');
- $o .= replace_macros($tpl, array(
+ return replace_macros($tpl, array(
'$basedir' => z_root(),
'$hash' => $hash,
'$title' => t('Change channel nickname/address'),
@@ -80,9 +80,5 @@ class Changeaddr extends \Zotlabs\Web\Controller {
'$newname' => array('newname', t('New channel address'),$channel['channel_address'], ''),
'$submit' => t('Rename Channel')
));
-
- return $o;
-
}
-
}
diff --git a/Zotlabs/Module/Channel_calendar.php b/Zotlabs/Module/Channel_calendar.php
index 289e3a734..30683404b 100644
--- a/Zotlabs/Module/Channel_calendar.php
+++ b/Zotlabs/Module/Channel_calendar.php
@@ -179,26 +179,14 @@ class Channel_calendar extends Controller {
if ($post_tags)
$datarray['term'] = $post_tags;
- $item_id = event_store_item($datarray, $event);
+ $post = event_store_item($datarray, $event);
- if ($item_id) {
- $r = q("select * from item where id = %d",
- intval($item_id)
- );
- if ($r) {
- xchan_query($r);
- $sync_item = fetch_post_tags($r);
- $z = q("select * from event where event_hash = '%s' and uid = %d limit 1",
- dbesc($r[0]['resource_id']),
- intval($channel['channel_id'])
- );
- if ($z) {
- Libsync::build_sync_packet($channel['channel_id'], array('event_item' => array(encode_item($sync_item[0], true)), 'event' => $z));
- }
- }
+ if (!empty($post['item_id'])) {
+ Master::Summon(['Notifier', 'event', $post['item_id']]);
+ }
+ if (!empty($post['approval_id'])) {
+ Master::Summon(['Notifier', 'event', $post['approval_id']]);
}
-
- Master::Summon(array('Notifier', 'event', $item_id));
killme();
@@ -470,13 +458,14 @@ class Channel_calendar extends Controller {
}
else {
// complex deletion that needs to propagate and be performed in phases
- drop_item($i[0]['id'], true, DROPITEM_PHASE1);
+ drop_item($i[0]['id'], DROPITEM_PHASE1);
$complex = true;
}
$ii = q("select * from item where id = %d",
intval($i[0]['id'])
);
+
if ($ii) {
xchan_query($ii);
$sync_item = fetch_post_tags($ii);
@@ -485,6 +474,9 @@ class Channel_calendar extends Controller {
if ($complex) {
tag_deliver($i[0]['uid'], $i[0]['id']);
+ if (intval($i[0]['item_wall'])) {
+ Master::Summon(['Notifier', 'drop', $i[0]['id']]);
+ }
}
}
}
diff --git a/Zotlabs/Module/Conversation.php b/Zotlabs/Module/Conversation.php
index aa8349f55..c3e6ae5ec 100644
--- a/Zotlabs/Module/Conversation.php
+++ b/Zotlabs/Module/Conversation.php
@@ -16,7 +16,7 @@ class Conversation extends Controller {
public function init() {
- if (ActivityStreams::is_as_request()) {
+ if (ActivityStreams::is_as_request() || Libzot::is_zot_request()) {
$item_id = argv(1);
if (!$item_id) {
@@ -77,7 +77,7 @@ class Conversation extends Controller {
}
}
}
- elseif (Config::get('system', 'require_authenticated_fetch', false)) {
+ elseif (Config::Get('system', 'require_authenticated_fetch', false)) {
http_status_exit(403, 'Permission denied');
}
diff --git a/Zotlabs/Module/Cover_photo.php b/Zotlabs/Module/Cover_photo.php
index aa2464ac2..2d2ffd52d 100644
--- a/Zotlabs/Module/Cover_photo.php
+++ b/Zotlabs/Module/Cover_photo.php
@@ -371,7 +371,7 @@ class Cover_photo extends \Zotlabs\Web\Controller {
$tpl = get_markup_template('cover_photo.tpl');
- $o .= replace_macros($tpl,array(
+ $output = replace_macros($tpl,array(
'$user' => \App::$channel['channel_address'],
'$info' => t('Your cover photo may be visible to anybody on the internet'),
'$existing' => get_cover_photo(local_channel(),'array',PHOTO_RES_COVER_850),
@@ -397,15 +397,15 @@ class Cover_photo extends \Zotlabs\Web\Controller {
));
- call_hooks('cover_photo_content_end', $o);
+ call_hooks('cover_photo_content_end', $output);
- return $o;
+ return $output;
}
else {
$filename = \App::$data['imagecrop'] . '-3';
$resolution = 3;
$tpl = get_markup_template("cropcover.tpl");
- $o .= replace_macros($tpl,array(
+ return replace_macros($tpl,array(
'$filename' => $filename,
'$profile' => intval($_REQUEST['profile']),
'$resource' => \App::$data['imagecrop'] . '-3',
@@ -415,7 +415,6 @@ class Cover_photo extends \Zotlabs\Web\Controller {
'$form_security_token' => get_form_security_token("cover_photo"),
'$done' => t('Done Editing')
));
- return $o;
}
}
diff --git a/Zotlabs/Module/Dav.php b/Zotlabs/Module/Dav.php
index 96fe2c898..5254d436d 100644
--- a/Zotlabs/Module/Dav.php
+++ b/Zotlabs/Module/Dav.php
@@ -9,6 +9,7 @@
namespace Zotlabs\Module;
use Sabre\DAV as SDAV;
+use Zotlabs\Lib\Libzot;
use Zotlabs\Storage;
use Zotlabs\Web\HTTPSig;
diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php
index 451ddeb1f..090e0c92e 100644
--- a/Zotlabs/Module/Display.php
+++ b/Zotlabs/Module/Display.php
@@ -344,7 +344,12 @@ class Display extends Controller {
'$profile_page' => xmlify(z_root() . '/display/' . gen_link_id($target_item['mid'])),
));
- $x = [ 'xml' => $atom, 'channel' => $channel, 'observer_hash' => $observer_hash, 'params' => $params ];
+ $x = [
+ 'xml' => $atom,
+ 'channel' => $channel,
+ 'observer_hash' => $observer_hash,
+ 'params' => [],
+ ];
call_hooks('atom_feed_top',$x);
$atom = $x['xml'];
diff --git a/Zotlabs/Module/Fbrowser.php b/Zotlabs/Module/Fbrowser.php
index 3bac81c5a..e8517e095 100644
--- a/Zotlabs/Module/Fbrowser.php
+++ b/Zotlabs/Module/Fbrowser.php
@@ -6,6 +6,8 @@ namespace Zotlabs\Module;
* @author Fabio Comuni <fabrixxm@kirgroup.com>
*/
+use function Zotlabs\Render\template_escape;
+
require_once('include/photo/photo_driver.php');
/**
diff --git a/Zotlabs/Module/Go.php b/Zotlabs/Module/Go.php
index ec528fb1a..77a3ffac6 100644
--- a/Zotlabs/Module/Go.php
+++ b/Zotlabs/Module/Go.php
@@ -2,7 +2,7 @@
namespace Zotlabs\Module;
-use Zorlabs\Lib\Config;
+use Zotlabs\Lib\Config;
class Go extends \Zotlabs\Web\Controller {
@@ -19,7 +19,7 @@ class Go extends \Zotlabs\Web\Controller {
function get() {
if(! local_channel()) {
- notify( t('This page is available only to site members') . EOL);
+ notice( t('This page is available only to site members') . EOL);
}
$channel = \App::get_channel();
diff --git a/Zotlabs/Module/Impel.php b/Zotlabs/Module/Impel.php
index 869de2669..0e07ab71c 100644
--- a/Zotlabs/Module/Impel.php
+++ b/Zotlabs/Module/Impel.php
@@ -164,7 +164,7 @@ class Impel extends \Zotlabs\Web\Controller {
$arr['id'] = $i[0]['id'];
// don't update if it has the same timestamp as the original
if($arr['edited'] > $i[0]['edited'])
- $x = item_store_update($arr,$execflag);
+ $x = item_store_update($arr, $execflag , deliver: false, addAndSync: false);
}
else {
if(($i) && (intval($i[0]['item_deleted']))) {
@@ -175,7 +175,7 @@ class Impel extends \Zotlabs\Web\Controller {
);
}
else
- $x = item_store($arr,$execflag);
+ $x = item_store($arr, $execflag, deliver: false, addAndSync: false);
}
if($x && $x['success']) {
diff --git a/Zotlabs/Module/Import.php b/Zotlabs/Module/Import.php
index 5ace4e72d..7aed6469e 100644
--- a/Zotlabs/Module/Import.php
+++ b/Zotlabs/Module/Import.php
@@ -534,6 +534,7 @@ class Import extends Controller {
if ($api_path) {
$parsed = parse_url($api_path);
unset($parsed['path']);
+ unset($parsed['query']);
// store the import host so we can manually kick off item/file sync later in case anything did not work out
set_pconfig($channel['channel_id'], 'import', 'host', $parsed['host']);
@@ -551,7 +552,7 @@ class Import extends Controller {
$until = datetime_convert(date_default_timezone_get(), date_default_timezone_get(), 'now + 1 day');
//$poll_interval = Config::Get('system', 'poll_interval', 3);
- $page = 0;
+ $page = 0;
Master::Summon(['Content_importer', sprintf('%d', $page), $since, $until, $channel['channel_address'], urlencode($hz_server)]);
Master::Summon(['File_importer', sprintf('%d', $page), $channel['channel_address'], urlencode($hz_server)]);
diff --git a/Zotlabs/Module/Import_progress.php b/Zotlabs/Module/Import_progress.php
index d9b13e8a8..0afb6faed 100644
--- a/Zotlabs/Module/Import_progress.php
+++ b/Zotlabs/Module/Import_progress.php
@@ -29,14 +29,14 @@ class Import_progress extends \Zotlabs\Web\Controller {
$c = PConfig::Get(local_channel(), 'import', 'content_progress');
if ($c) {
- $total_cpages = floor(intval($c['items_total']) / intval($c['items_page']));
+ $total_cpages = round(intval($c['items_total']) / intval($c['items_page']));
if(!$total_cpages) {
- $total_cpages = 1; // because of floor
+ $total_cpages = 1; // because of round
}
$cpage = $c['last_page'] + 1; // because page count start at 0
- $cprogress = intval(floor((intval($cpage) * 100) / $total_cpages));
+ $cprogress = intval(round((intval($cpage) * 100) / $total_cpages));
$ccompleted_str = t('Item sync completed!');
if(argv(1) === 'resume_itemsync' && $cprogress < 100) {
@@ -50,6 +50,7 @@ class Import_progress extends \Zotlabs\Web\Controller {
if ($alive) {
$parsed = parse_url($alive);
unset($parsed['path']);
+ unset($parsed['query']);
$hz_server = unparse_url($parsed);
$since = datetime_convert(date_default_timezone_get(), date_default_timezone_get(), '0001-01-01 00:00');
@@ -79,14 +80,14 @@ class Import_progress extends \Zotlabs\Web\Controller {
$f = PConfig::Get(local_channel(), 'import', 'files_progress');
if ($f) {
- $total_fpages = floor(intval($f['files_total']) / intval($f['files_page']));
+ $total_fpages = round(intval($f['files_total']) / intval($f['files_page']));
if(!$total_fpages) {
$total_fpages = 1;
}
$fpage = $f['last_page'] + 1;
- $fprogress = intval(floor((intval($fpage) * 100) / $total_fpages));
+ $fprogress = intval(round((intval($fpage) * 100) / $total_fpages));
$fcompleted_str = t('File sync completed!');
if(argv(1) === 'resume_filesync' && $fprogress < 100) {
@@ -120,6 +121,7 @@ class Import_progress extends \Zotlabs\Web\Controller {
}
$fcompleted_str = t('File sync completed but no files were found!');
+
}
$fprogress_str = ((intval($fprogress)) ? $fprogress . '%' : $fprogress);
@@ -127,13 +129,15 @@ class Import_progress extends \Zotlabs\Web\Controller {
if(is_ajax()) {
$ret = [
'cprogress' => $cprogress,
- 'fprogress' => $fprogress
+ 'ccompleted_str' => $ccompleted_str,
+ 'fprogress' => $fprogress,
+ 'fcompleted_str' => $fcompleted_str
];
json_return_and_die($ret);
}
- $o = replace_macros(get_markup_template("import_progress.tpl"), [
+ return replace_macros(get_markup_template('import_progress.tpl'), [
'$chtitle_str' => t('Channel clone status'),
'$ctitle_str' => t('Item sync status'),
'$ftitle_str' => t('File sync status'),
@@ -147,8 +151,6 @@ class Import_progress extends \Zotlabs\Web\Controller {
'$resume_str' => t('Resume'),
'$resume_helper_str' => t('Only resume if sync stalled!')
]);
-
- return $o;
}
}
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php
index fba16fbe1..8ded7c1d7 100644
--- a/Zotlabs/Module/Item.php
+++ b/Zotlabs/Module/Item.php
@@ -807,18 +807,44 @@ class Item extends Controller {
}
- if ($moderated)
+ if ($moderated) {
$item_blocked = ITEM_MODERATED;
+ }
- if (!strlen($verb))
+ if (!strlen($verb)) {
$verb = 'Create';
+ }
$notify_type = (($parent) ? 'comment-new' : 'wall-new');
$uuid = $uuid ?? $message_id ?? item_message_id();
$mid = $mid ?? z_root() . '/item/' . $uuid;
+
+ // Set the conversation target.
+ if (empty($owner_hash)) {
+ $owner_hash = $owner_xchan['xchan_hash'];
+ }
+
+ if ($owner_hash === $channel['channel_hash']) {
+ $attributedTo = z_root() . '/channel/' . $channel['channel_address'];
+
+ $conversation = isset($parent_item) ? $parent_item['mid'] : $mid;
+ $datarray['target'] = [
+ 'id' => str_replace('/item/', '/conversation/', $conversation),
+ 'type' => 'Collection',
+ 'attributedTo' => $attributedTo,
+ ];
+ $datarray['tgt_type'] = 'Collection';
+ }
+ elseif (!empty($parent_item['target'])) {
+ $datarray['target'] = $parent_item['target'];
+ $datarray['tgt_type'] = $parent_item['tgt_type'];
+ }
+
+
+
if ($is_poll) {
$poll = [
'question' => $body,
@@ -1023,6 +1049,7 @@ class Item extends Controller {
$this->add_listeners($datarray);
}
+ /* sync this is done in item_store_update()
if (!$parent) {
$r = q("select * from item where id = %d",
intval($post_id)
@@ -1033,9 +1060,14 @@ class Item extends Controller {
Libsync::build_sync_packet($profile_uid, ['item' => [encode_item($sync_item[0], true)]]);
}
}
- if (!$nopush)
- Master::Summon(['Notifier', 'edit_post', $post_id]);
+ */
+ if (!$nopush) {
+ Master::Summon(['Notifier', 'edit_post', $post_id]);
+ if (intval($x['approval_id'])) {
+ Master::Summon(['Notifier', 'edit_post', $x['approval_id']]);
+ }
+ }
if ($api_source)
return ($x);
@@ -1059,6 +1091,7 @@ class Item extends Controller {
}
$post_id = $post['item_id'];
+ $approval_id = $post['approval_id'] ?? 0;
$datarray = $post['item'];
@@ -1133,6 +1166,7 @@ class Item extends Controller {
killme();
}
+ /* sync this is done in item_store_update()
if ($parent || $datarray['item_private'] == 1) {
$r = q("select * from item where id = %d",
intval($post_id)
@@ -1143,6 +1177,7 @@ class Item extends Controller {
Libsync::build_sync_packet($profile_uid, ['item' => [encode_item($sync_item[0], true)]]);
}
}
+ */
$datarray['id'] = $post_id;
$datarray['llink'] = z_root() . '/display/' . $datarray['uuid'];
@@ -1153,8 +1188,12 @@ class Item extends Controller {
$nopush = false;
}
- if (!$nopush)
+ if (!$nopush) {
Master::Summon(['Notifier', $notify_type, $post_id]);
+ if ($approval_id) {
+ Master::Summon(['Notifier', $notify_type, $approval_id]);
+ }
+ }
logger('post_complete');
@@ -1209,7 +1248,7 @@ class Item extends Controller {
require_once('include/items.php');
- $i = q("select id, uid, item_origin, author_xchan, owner_xchan, source_xchan, item_type from item where id = %d limit 1",
+ $i = q("select * from item where id = %d limit 1",
intval(argv(2))
);
@@ -1236,7 +1275,6 @@ class Item extends Controller {
$can_delete = true;
}
-
if (!($can_delete || $local_delete)) {
notice(t('Permission denied.') . EOL);
return;
@@ -1252,13 +1290,14 @@ class Item extends Controller {
}
else {
// complex deletion that needs to propagate and be performed in phases
- drop_item($i[0]['id'], true, DROPITEM_PHASE1);
+ drop_item($i[0]['id'], DROPITEM_PHASE1);
$complex = true;
}
$r = q("select * from item where id = %d",
intval($i[0]['id'])
);
+
if ($r) {
xchan_query($r);
$sync_item = fetch_post_tags($r);
@@ -1267,6 +1306,9 @@ class Item extends Controller {
if ($complex) {
tag_deliver($i[0]['uid'], $i[0]['id']);
+ if (intval($i[0]['item_wall']) || $i[0]['mid'] !== $i[0]['parent_mid']) {
+ Master::Summon(['Notifier', 'drop', $i[0]['id']]);
+ }
}
}
diff --git a/Zotlabs/Module/Like.php b/Zotlabs/Module/Like.php
index d493742e7..2fb3fab83 100644
--- a/Zotlabs/Module/Like.php
+++ b/Zotlabs/Module/Like.php
@@ -284,7 +284,7 @@ class Like extends Controller {
intval($ch[0]['channel_id'])
);
if ($r)
- drop_item($r[0]['id'], false);
+ drop_item($r[0]['id']);
if ($interactive) {
notice(t('Previous action reversed.') . EOL);
return $o;
@@ -387,17 +387,20 @@ class Like extends Controller {
// already liked it. Drop that item.
require_once('include/items.php');
foreach ($r as $rr) {
- drop_item($rr['id'], false, DROPITEM_PHASE1);
+ drop_item($rr['id'], DROPITEM_PHASE1);
+
// set the changed timestamp on the parent so we'll see the update without a page reload
q("update item set changed = '%s' where id = %d and uid = %d",
dbesc(datetime_convert()),
intval($rr['parent']),
intval($rr['uid'])
);
+
// Prior activity was a duplicate of the one we're submitting, just undo it;
// don't fall through and create another
- if (activity_match($rr['verb'], $activity))
+ if (activity_match($rr['verb'], $activity)) {
$multi_undo = false;
+ }
$d = q("select * from item where id = %d",
intval($rr['id'])
@@ -559,6 +562,7 @@ class Like extends Controller {
$post = item_store($arr);
$post_id = $post['item_id'];
+ $approval_id = $post['approval_id'] ?? 0;
// save the conversation from expiration
@@ -574,6 +578,7 @@ class Like extends Controller {
}
+/* Item sync is now done in item_store()
$r = q("select * from item where id = %d",
intval($post_id)
);
@@ -582,7 +587,7 @@ class Like extends Controller {
$sync_item = fetch_post_tags($r);
Libsync::build_sync_packet($profile_uid, ['item' => [encode_item($sync_item[0], true)]]);
}
-
+*/
if ($extended_like) {
$r = q("insert into likes (channel_id,liker,likee,iid,i_mid,verb,target_type,target_id,target) values (%d,'%s','%s',%d,'%s','%s','%s','%s','%s')",
@@ -609,7 +614,10 @@ class Like extends Controller {
}
- Master::Summon(array('Notifier', 'like', $post_id));
+ Master::Summon(['Notifier', 'like', $post_id]);
+ if ($approval_id) {
+ Master::Summon(['Notifier', 'like', $approval_id]);
+ }
if ($interactive) {
notice(t('Action completed.') . EOL);
diff --git a/Zotlabs/Module/Mitem.php b/Zotlabs/Module/Mitem.php
index ac7470e13..81787f8c4 100644
--- a/Zotlabs/Module/Mitem.php
+++ b/Zotlabs/Module/Mitem.php
@@ -184,8 +184,8 @@ class Mitem extends \Zotlabs\Web\Controller {
'$nick' => $which,
'$sys' => \App::$is_sys
));
-
- $o .= replace_macros(get_markup_template('mitemlist.tpl'),array(
+
+ return replace_macros(get_markup_template('mitemlist.tpl'),array(
'$title' => t('Menu:'),
'$create' => $create,
'$nametitle' => t('Link Name'),
@@ -204,29 +204,27 @@ class Mitem extends \Zotlabs\Web\Controller {
'$hintedit' => t('Edit this menu item'),
'$nick' => $which,
));
-
- return $o;
}
-
-
+
+
if(argc() > 3) {
if(intval(argv(3))) {
-
+
$m = q("select * from menu_item where mitem_id = %d and mitem_channel_id = %d limit 1",
intval(argv(3)),
intval($owner)
);
-
+
if(! $m) {
notice( t('Menu item not found.') . EOL);
goaway(z_root() . '/menu/'. $which . ((\App::$is_sys) ? '?f=&sys=1' : ''));
}
-
+
$mitem = $m[0];
-
+
$lockstate = (($mitem['allow_cid'] || $mitem['allow_gid'] || $mitem['deny_cid'] || $mitem['deny_gid']) ? 'lock' : 'unlock');
-
+
if(argc() == 5 && argv(4) == 'drop') {
menu_sync_packet($owner,get_observer_hash(),$mitem['mitem_menu_id']);
$r = menu_del_item($mitem['mitem_menu_id'], $owner, intval(argv(3)));
@@ -235,12 +233,12 @@ class Mitem extends \Zotlabs\Web\Controller {
info( t('Menu item deleted.') . EOL);
else
notice( t('Menu item could not be deleted.'). EOL);
-
+
goaway(z_root() . '/mitem/' . $which . '/' . $mitem['mitem_menu_id'] . ((\App::$is_sys) ? '?f=&sys=1' : ''));
}
-
+
// edit menu item
- $o = replace_macros(get_markup_template('mitemedit.tpl'), array(
+ return replace_macros(get_markup_template('mitemedit.tpl'), array(
'$header' => t('Edit Menu Element'),
'$menu_id' => \App::$data['menu']['menu_id'],
'$permissions' => t('Menu Item Permissions'),
@@ -261,10 +259,8 @@ class Mitem extends \Zotlabs\Web\Controller {
'$menu_names' => $menu_names,
'$nick' => $which
));
-
- return $o;
}
}
}
-
+
}
diff --git a/Zotlabs/Module/Moderate.php b/Zotlabs/Module/Moderate.php
index ed2a1e4f9..2103684ab 100644
--- a/Zotlabs/Module/Moderate.php
+++ b/Zotlabs/Module/Moderate.php
@@ -74,7 +74,7 @@ class Moderate extends \Zotlabs\Web\Controller {
// let the sender know we received their comment but we don't permit spam here.
// Activity::send_rejection_activity(App::get_channel(), $item['author_xchan'], $item);
- drop_item($post_id,false);
+ drop_item($post_id);
notice( t('Item deleted') . EOL);
}
diff --git a/Zotlabs/Module/OAuth2TestVehicle.php b/Zotlabs/Module/OAuth2TestVehicle.php
index 5ae278e8c..57cda3c28 100644
--- a/Zotlabs/Module/OAuth2TestVehicle.php
+++ b/Zotlabs/Module/OAuth2TestVehicle.php
@@ -31,8 +31,8 @@ class OAuth2TestVehicle extends \Zotlabs\Web\Controller {
$_SESSION['api_response'] = (x($_SESSION, 'api_response') ? $_SESSION['api_response'] : '');
}
function get() {
-
- $o .= replace_macros(get_markup_template('oauth2testvehicle.tpl'), array(
+
+ $output = replace_macros(get_markup_template('oauth2testvehicle.tpl'), array(
'$baseurl' => z_root(),
'$api_response' => $_SESSION['api_response'],
/*
@@ -97,8 +97,10 @@ class OAuth2TestVehicle extends \Zotlabs\Web\Controller {
)
)
));
+
$_SESSION['success'] = '';
- return $o;
+
+ return $output;
}
function post() {
diff --git a/Zotlabs/Module/Oauth.php b/Zotlabs/Module/Oauth.php
index 061296257..6063c7738 100644
--- a/Zotlabs/Module/Oauth.php
+++ b/Zotlabs/Module/Oauth.php
@@ -103,7 +103,8 @@ class Oauth extends Controller {
if((argc() > 1) && (argv(1) === 'add')) {
$tpl = get_markup_template("oauth_edit.tpl");
- $o .= replace_macros($tpl, array(
+
+ return replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("oauth"),
'$title' => t('Add application'),
'$submit' => t('Submit'),
@@ -114,7 +115,6 @@ class Oauth extends Controller {
'$redirect' => array('redirect', t('Redirect'), '', t('Redirect URI - leave blank unless your application specifically requires this')),
'$icon' => array('icon', t('Icon url'), '', t('Optional')),
));
- return $o;
}
if((argc() > 2) && (argv(1) === 'edit')) {
@@ -129,7 +129,7 @@ class Oauth extends Controller {
$app = $r[0];
$tpl = get_markup_template("oauth_edit.tpl");
- $o .= replace_macros($tpl, array(
+ return replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("oauth"),
'$title' => t('Add application'),
'$submit' => t('Update'),
@@ -140,7 +140,6 @@ class Oauth extends Controller {
'$redirect' => array('redirect', t('Redirect'), $app['redirect_uri'], ''),
'$icon' => array('icon', t('Icon url'), $app['icon'], ''),
));
- return $o;
}
if((argc() > 2) && (argv(1) === 'delete')) {
@@ -163,7 +162,8 @@ class Oauth extends Controller {
$tpl = get_markup_template("oauth.tpl");
- $o .= replace_macros($tpl, array(
+
+ return replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("oauth"),
'$baseurl' => z_root(),
'$title' => t('Connected OAuth Apps'),
@@ -175,8 +175,6 @@ class Oauth extends Controller {
'$remove' => t('Remove authorization'),
'$apps' => $r,
));
- return $o;
-
}
}
diff --git a/Zotlabs/Module/Oauth2.php b/Zotlabs/Module/Oauth2.php
index 4b0b1991e..7aadd91bc 100644
--- a/Zotlabs/Module/Oauth2.php
+++ b/Zotlabs/Module/Oauth2.php
@@ -108,7 +108,8 @@ class Oauth2 extends Controller {
if((argc() > 1) && (argv(1) === 'add')) {
$tpl = get_markup_template("oauth2_edit.tpl");
- $o .= replace_macros($tpl, array(
+
+ return replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("oauth2"),
'$title' => t('Add OAuth2 application'),
'$submit' => t('Submit'),
@@ -119,7 +120,6 @@ class Oauth2 extends Controller {
'$grant' => array('grant', t('Grant Types'), '', t('leave blank unless your application sepcifically requires this')),
'$scope' => array('scope', t('Authorization scope'), '', t('leave blank unless your application sepcifically requires this')),
));
- return $o;
}
if((argc() > 2) && (argv(1) === 'edit')) {
@@ -136,7 +136,7 @@ class Oauth2 extends Controller {
$app = $r[0];
$tpl = get_markup_template("oauth2_edit.tpl");
- $o .= replace_macros($tpl, array(
+ return replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("oauth2"),
'$title' => t('Add application'),
'$submit' => t('Update'),
@@ -147,7 +147,6 @@ class Oauth2 extends Controller {
'$grant' => array('grant', t('Grant Types'), $app['grant_types'], t('leave blank unless your application specifically requires this')),
'$scope' => array('scope', t('Authorization scope'), $app['scope'], t('leave blank unless your application specifically requires this')),
));
- return $o;
}
if((argc() > 2) && (argv(1) === 'delete')) {
@@ -184,7 +183,8 @@ class Oauth2 extends Controller {
);
$tpl = get_markup_template("oauth2.tpl");
- $o .= replace_macros($tpl, array(
+
+ return replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("oauth2"),
'$baseurl' => z_root(),
'$title' => t('Connected OAuth2 Apps'),
@@ -196,8 +196,6 @@ class Oauth2 extends Controller {
'$remove' => t('Remove authorization'),
'$apps' => $r,
));
- return $o;
-
}
}
diff --git a/Zotlabs/Module/Page.php b/Zotlabs/Module/Page.php
index 8a698005a..a4ee5eaa2 100644
--- a/Zotlabs/Module/Page.php
+++ b/Zotlabs/Module/Page.php
@@ -183,9 +183,7 @@ class Page extends \Zotlabs\Web\Controller {
if($r[0]['mimetype'] === 'application/x-pdl')
\App::$page['pdl_content'] = true;
- $o .= prepare_page($r[0]);
- return $o;
-
+ return prepare_page($r[0]);
}
}
diff --git a/Zotlabs/Module/Pdledit.php b/Zotlabs/Module/Pdledit.php
index e0bbc31d0..aa512e6da 100644
--- a/Zotlabs/Module/Pdledit.php
+++ b/Zotlabs/Module/Pdledit.php
@@ -51,7 +51,7 @@ class Pdledit extends Controller {
if(argc() > 1)
$module = 'mod_' . argv(1) . '.pdl';
else {
- $o .= '<div class="generic-content-wrapper-styled">';
+ $o = '<div class="generic-content-wrapper-styled">';
$o .= '<h1>' . t('Edit System Page Description') . '</h1>';
$edited = [];
diff --git a/Zotlabs/Module/Profperm.php b/Zotlabs/Module/Profperm.php
index 842197415..4594728b1 100644
--- a/Zotlabs/Module/Profperm.php
+++ b/Zotlabs/Module/Profperm.php
@@ -55,6 +55,8 @@ class Profperm extends \Zotlabs\Web\Controller {
}
+ $o = '';
+
if((argc() > 1) && (intval(argv(1)))) {
$r = q("SELECT * FROM profile WHERE id = %d AND uid = %d AND is_default = 0 LIMIT 1",
intval(argv(1)),
diff --git a/Zotlabs/Module/React.php b/Zotlabs/Module/React.php
index e04b9b257..e1abd242e 100644
--- a/Zotlabs/Module/React.php
+++ b/Zotlabs/Module/React.php
@@ -91,6 +91,9 @@ class React extends Controller {
if ($x['success']) {
$nid = $x['item_id'];
Master::Summon(['Notifier', 'like', $nid]);
+ if (!empty($x['approval_id'])) {
+ Master::Summon(['Notifier', 'like', $x['approval_id']]);
+ }
}
}
diff --git a/Zotlabs/Module/Removeaccount.php b/Zotlabs/Module/Removeaccount.php
index cd18b79c0..b41acb8b0 100644
--- a/Zotlabs/Module/Removeaccount.php
+++ b/Zotlabs/Module/Removeaccount.php
@@ -36,22 +36,22 @@ class Removeaccount extends \Zotlabs\Web\Controller {
return;
}
}
-
+
$global_remove = 0; //intval($_POST['global']);
-
- account_remove($account_id, 1 - $global_remove);
+
+ account_remove($account_id, 1 - $global_remove);
}
-
+
function get() {
-
+
if(! local_channel())
goaway(z_root());
-
+
$hash = random_string();
-
+
$_SESSION['remove_account_verify'] = $hash;
$tpl = get_markup_template('removeaccount.tpl');
- $o .= replace_macros($tpl, array(
+ return replace_macros($tpl, array(
'$basedir' => z_root(),
'$hash' => $hash,
'$title' => t('Remove This Account'),
@@ -60,9 +60,5 @@ class Removeaccount extends \Zotlabs\Web\Controller {
// '$global' => array('global', t('Remove this account, all its channels and all its channel clones from the network'), false, t('By default only the instances of the channels located on this hub will be removed from the network')),
'$submit' => t('Remove Account')
));
-
- return $o;
-
}
-
}
diff --git a/Zotlabs/Module/Removeme.php b/Zotlabs/Module/Removeme.php
index 4d475ead6..d71f8d4ab 100644
--- a/Zotlabs/Module/Removeme.php
+++ b/Zotlabs/Module/Removeme.php
@@ -54,7 +54,7 @@ class Removeme extends \Zotlabs\Web\Controller {
$_SESSION['remove_account_verify'] = $hash;
$tpl = get_markup_template('removeme.tpl');
- $o .= replace_macros($tpl, array(
+ return replace_macros($tpl, array(
'$basedir' => z_root(),
'$hash' => $hash,
'$title' => t('Remove Channel'),
@@ -63,9 +63,5 @@ class Removeme extends \Zotlabs\Web\Controller {
// '$global' => [ 'global', t('Remove this channel and all its clones from the network'), false, t('By default only the instance of the channel located on this hub will be removed from the network'), [ t('No'),t('Yes') ] ],
'$submit' => t('Remove Channel')
));
-
- return $o;
-
}
-
}
diff --git a/Zotlabs/Module/Search_ac.php b/Zotlabs/Module/Search_ac.php
index 24b724c5d..cd0960859 100644
--- a/Zotlabs/Module/Search_ac.php
+++ b/Zotlabs/Module/Search_ac.php
@@ -90,12 +90,7 @@ class Search_ac extends \Zotlabs\Web\Controller {
'items' => $results,
);
echo json_encode($o);
-
- logger('search_ac: ' . print_r($x,true),LOGGER_DATA,LOG_INFO);
-
+
killme();
}
-
-
-
}
diff --git a/Zotlabs/Module/Settings/Account.php b/Zotlabs/Module/Settings/Account.php
index 0266cee12..7f0d11069 100644
--- a/Zotlabs/Module/Settings/Account.php
+++ b/Zotlabs/Module/Settings/Account.php
@@ -100,7 +100,7 @@ class Account {
$attremail = ((!strpos($email, '@')) ? 'disabled="disabled"' : '');
$tpl = get_markup_template("settings_account.tpl");
- $o .= replace_macros($tpl, array(
+ return replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("settings_account"),
'$title' => t('Account Settings'),
'$origpass' => array('origpass', t('Current Password'), ' ',''),
@@ -114,7 +114,5 @@ class Account {
'$removeaccount' => t('Remove this account including all its channels'),
'$account_settings' => $account_settings
));
- return $o;
}
-
}
diff --git a/Zotlabs/Module/Settings/Calendar.php b/Zotlabs/Module/Settings/Calendar.php
index 65240c635..3b15f4aa6 100644
--- a/Zotlabs/Module/Settings/Calendar.php
+++ b/Zotlabs/Module/Settings/Calendar.php
@@ -33,7 +33,7 @@ class Calendar {
$tpl = get_markup_template("settings_module.tpl");
- $o .= replace_macros($tpl, array(
+ return replace_macros($tpl, array(
'$rpath' => escape_url($rpath),
'$action_url' => 'settings/' . $module,
'$form_security_token' => get_form_security_token('settings_' . $module),
@@ -41,8 +41,5 @@ class Calendar {
'$features' => process_module_features_get(local_channel(), $features),
'$submit' => t('Submit')
));
-
- return $o;
}
-
}
diff --git a/Zotlabs/Module/Settings/Channel_home.php b/Zotlabs/Module/Settings/Channel_home.php
index 470dbe4c3..388b70942 100644
--- a/Zotlabs/Module/Settings/Channel_home.php
+++ b/Zotlabs/Module/Settings/Channel_home.php
@@ -81,7 +81,7 @@ class Channel_home {
$tpl = get_markup_template("settings_module.tpl");
- $o .= replace_macros($tpl, array(
+ return replace_macros($tpl, array(
'$rpath' => escape_url($rpath),
'$action_url' => 'settings/' . $module,
'$form_security_token' => get_form_security_token('settings_' . $module),
@@ -90,8 +90,5 @@ class Channel_home {
'$extra_settings_html' => $extra_settings_html,
'$submit' => t('Submit')
));
-
- return $o;
}
-
}
diff --git a/Zotlabs/Module/Settings/Connections.php b/Zotlabs/Module/Settings/Connections.php
index 52a95a3d1..9d1069cf3 100644
--- a/Zotlabs/Module/Settings/Connections.php
+++ b/Zotlabs/Module/Settings/Connections.php
@@ -33,7 +33,7 @@ class Connections {
$tpl = get_markup_template("settings_module.tpl");
- $o .= replace_macros($tpl, array(
+ return replace_macros($tpl, array(
'$rpath' => escape_url($rpath),
'$action_url' => 'settings/' . $module,
'$form_security_token' => get_form_security_token('settings_' . $module),
@@ -41,8 +41,5 @@ class Connections {
'$features' => process_module_features_get(local_channel(), $features),
'$submit' => t('Submit')
));
-
- return $o;
}
-
}
diff --git a/Zotlabs/Module/Settings/Conversation.php b/Zotlabs/Module/Settings/Conversation.php
index 5f3d903a8..51ee2c83a 100644
--- a/Zotlabs/Module/Settings/Conversation.php
+++ b/Zotlabs/Module/Settings/Conversation.php
@@ -36,7 +36,7 @@ class Conversation {
$tpl = (($aj) ? get_markup_template("settings_module_ajax.tpl") : get_markup_template("settings_module.tpl"));
- $o .= replace_macros($tpl, array(
+ $o = replace_macros($tpl, array(
'$action_url' => 'settings/' . $module,
'$form_security_token' => get_form_security_token('settings_' . $module),
'$title' => t('Conversation Settings'),
diff --git a/Zotlabs/Module/Settings/Directory.php b/Zotlabs/Module/Settings/Directory.php
index 09ea61f60..e1957d2fa 100644
--- a/Zotlabs/Module/Settings/Directory.php
+++ b/Zotlabs/Module/Settings/Directory.php
@@ -33,7 +33,7 @@ class Directory {
$tpl = get_markup_template("settings_module.tpl");
- $o .= replace_macros($tpl, array(
+ return replace_macros($tpl, array(
'$rpath' => escape_url($rpath),
'$action_url' => 'settings/' . $module,
'$form_security_token' => get_form_security_token('settings_' . $module),
@@ -41,8 +41,5 @@ class Directory {
'$features' => process_module_features_get(local_channel(), $features),
'$submit' => t('Submit')
));
-
- return $o;
}
-
}
diff --git a/Zotlabs/Module/Settings/Editor.php b/Zotlabs/Module/Settings/Editor.php
index 85c3e69ae..50bd2b2ad 100644
--- a/Zotlabs/Module/Settings/Editor.php
+++ b/Zotlabs/Module/Settings/Editor.php
@@ -33,7 +33,7 @@ class Editor {
$tpl = get_markup_template("settings_module.tpl");
- $o .= replace_macros($tpl, array(
+ return replace_macros($tpl, array(
'$rpath' => escape_url($rpath),
'$action_url' => 'settings/' . $module,
'$form_security_token' => get_form_security_token('settings_' . $module),
@@ -41,8 +41,5 @@ class Editor {
'$features' => process_module_features_get(local_channel(), $features),
'$submit' => t('Submit')
));
-
- return $o;
}
-
}
diff --git a/Zotlabs/Module/Settings/Events.php b/Zotlabs/Module/Settings/Events.php
index 0a0e3516c..3a7faa8b4 100644
--- a/Zotlabs/Module/Settings/Events.php
+++ b/Zotlabs/Module/Settings/Events.php
@@ -33,7 +33,7 @@ class Events {
$tpl = get_markup_template("settings_module.tpl");
- $o .= replace_macros($tpl, array(
+ return replace_macros($tpl, array(
'$rpath' => escape_url($rpath),
'$action_url' => 'settings/' . $module,
'$form_security_token' => get_form_security_token('settings_' . $module),
@@ -41,8 +41,5 @@ class Events {
'$features' => process_module_features_get(local_channel(), $features),
'$submit' => t('Submit')
));
-
- return $o;
}
-
}
diff --git a/Zotlabs/Module/Settings/Features.php b/Zotlabs/Module/Settings/Features.php
index 553ff0836..84c868e48 100644
--- a/Zotlabs/Module/Settings/Features.php
+++ b/Zotlabs/Module/Settings/Features.php
@@ -38,17 +38,14 @@ class Features {
$arr[$fname][1][] = array('feature_' . $f[0],$f[1],((intval(feature_enabled(local_channel(),$f[0]))) ? "1" : ''),$f[2],array(t('Off'),t('On')));
}
}
-
+
$tpl = get_markup_template("settings_features.tpl");
- $o .= replace_macros($tpl, array(
+ return replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("settings_features"),
'$title' => t('Additional Features'),
'$features' => $arr,
'$baseurl' => z_root(),
'$submit' => t('Submit'),
));
-
- return $o;
}
-
}
diff --git a/Zotlabs/Module/Settings/Manage.php b/Zotlabs/Module/Settings/Manage.php
index 6fb57eafb..6e47cfcc7 100644
--- a/Zotlabs/Module/Settings/Manage.php
+++ b/Zotlabs/Module/Settings/Manage.php
@@ -34,7 +34,7 @@ class Manage {
$tpl = get_markup_template("settings_module.tpl");
- $o .= replace_macros($tpl, array(
+ return replace_macros($tpl, array(
'$rpath' => escape_url($rpath),
'$action_url' => 'settings/' . $module,
'$form_security_token' => get_form_security_token('settings_' . $module),
@@ -42,8 +42,5 @@ class Manage {
'$features' => process_module_features_get(local_channel(), $features),
'$submit' => t('Submit')
));
-
- return $o;
}
-
}
diff --git a/Zotlabs/Module/Settings/Network.php b/Zotlabs/Module/Settings/Network.php
index eae963a25..39c66622e 100644
--- a/Zotlabs/Module/Settings/Network.php
+++ b/Zotlabs/Module/Settings/Network.php
@@ -52,7 +52,7 @@ class Network {
$tpl = get_markup_template("settings_module.tpl");
- $o .= replace_macros($tpl, array(
+ return replace_macros($tpl, array(
'$rpath' => escape_url($rpath),
'$action_url' => 'settings/' . $module,
'$form_security_token' => get_form_security_token('settings_' . $module),
@@ -61,8 +61,5 @@ class Network {
'$extra_settings_html' => $extra_settings_html,
'$submit' => t('Submit')
));
-
- return $o;
}
-
}
diff --git a/Zotlabs/Module/Settings/Photos.php b/Zotlabs/Module/Settings/Photos.php
index f68c8847b..05c380850 100644
--- a/Zotlabs/Module/Settings/Photos.php
+++ b/Zotlabs/Module/Settings/Photos.php
@@ -33,7 +33,7 @@ class Photos {
$tpl = get_markup_template("settings_module.tpl");
- $o .= replace_macros($tpl, array(
+ return replace_macros($tpl, array(
'$rpath' => escape_url($rpath),
'$action_url' => 'settings/' . $module,
'$form_security_token' => get_form_security_token('settings_' . $module),
@@ -41,8 +41,5 @@ class Photos {
'$features' => process_module_features_get(local_channel(), $features),
'$submit' => t('Submit')
));
-
- return $o;
}
-
}
diff --git a/Zotlabs/Module/Settings/Profiles.php b/Zotlabs/Module/Settings/Profiles.php
index 0ff2dfb6d..5052385a8 100644
--- a/Zotlabs/Module/Settings/Profiles.php
+++ b/Zotlabs/Module/Settings/Profiles.php
@@ -42,7 +42,7 @@ class Profiles {
$tpl = get_markup_template("settings_module.tpl");
- $o .= replace_macros($tpl, array(
+ return replace_macros($tpl, array(
'$rpath' => escape_url($rpath),
'$action_url' => 'settings/' . $module,
'$form_security_token' => get_form_security_token('settings_' . $module),
@@ -51,8 +51,5 @@ class Profiles {
'$extra_settings_html' => $extra_settings_html,
'$submit' => t('Submit')
));
-
- return $o;
}
-
}
diff --git a/Zotlabs/Module/Share.php b/Zotlabs/Module/Share.php
index db0acb6f5..4fefdb4ef 100644
--- a/Zotlabs/Module/Share.php
+++ b/Zotlabs/Module/Share.php
@@ -136,6 +136,7 @@ class Share extends \Zotlabs\Web\Controller {
$post = item_store($arr);
$post_id = $post['item_id'];
+ $approval_id = $post['approval_id'] ?? 0;
$arr['id'] = $post_id;
@@ -143,6 +144,7 @@ class Share extends \Zotlabs\Web\Controller {
// info( t('Post repeated') . EOL);
+/*
$r = q("select * from item where id = %d",
intval($post_id)
);
@@ -151,8 +153,12 @@ class Share extends \Zotlabs\Web\Controller {
$sync_item = fetch_post_tags($r);
Libsync::build_sync_packet($channel['channel_id'], [ 'item' => [ encode_item($sync_item[0],true) ] ]);
}
+*/
Master::Summon([ 'Notifier', 'like', $post_id ]);
+ if ($approval_id) {
+ Master::Summon(['Notifier', 'like', $approval_id]);
+ }
killme();
diff --git a/Zotlabs/Module/Subthread.php b/Zotlabs/Module/Subthread.php
index b927ee480..baabee78f 100644
--- a/Zotlabs/Module/Subthread.php
+++ b/Zotlabs/Module/Subthread.php
@@ -159,7 +159,7 @@ class Subthread extends \Zotlabs\Web\Controller {
$arr['deny_cid'] = $item['deny_cid'];
$arr['deny_gid'] = $item['deny_gid'];
- $post = item_store($arr);
+ $post = item_store($arr, deliver: false, addAndSync: false);
$post_id = $post['item_id'];
$arr['id'] = $post_id;
diff --git a/Zotlabs/Module/Tagrm.php b/Zotlabs/Module/Tagrm.php
index a6dc21798..34eaf85b2 100644
--- a/Zotlabs/Module/Tagrm.php
+++ b/Zotlabs/Module/Tagrm.php
@@ -7,141 +7,141 @@ require_once('include/bbcode.php');
class Tagrm extends \Zotlabs\Web\Controller {
function post() {
-
+
if(! local_channel())
goaway(z_root() . '/' . $_SESSION['photo_return']);
-
-
+
+
if((x($_POST,'submit')) && ($_POST['submit'] === t('Cancel')))
goaway(z_root() . '/' . $_SESSION['photo_return']);
-
+
$tag = ((x($_POST,'tag')) ? trim($_POST['tag']) : '');
$item = ((x($_POST,'item')) ? intval($_POST['item']) : 0 );
-
+
$r = q("SELECT * FROM item WHERE id = %d AND uid = %d LIMIT 1",
intval($item),
intval(local_channel())
);
-
+
if(! $r)
goaway(z_root() . '/' . $_SESSION['photo_return']);
-
+
$r = fetch_post_tags($r,true);
-
+
$item = $r[0];
$new_tags = array();
-
+
if($item['term']) {
for($x = 0; $x < count($item['term']); $x ++) {
if($item['term'][$x]['term'] !== hex2bin($tag))
$new_tags[] = $item['term'][$x];
}
}
-
+
if($new_tags)
$item['term'] = $new_tags;
else
unset($item['term']);
-
- item_store_update($item);
-
+
+ item_store_update($item, deliver: false, addAndSync: false);
+
info( t('Tag removed') . EOL );
goaway(z_root() . '/' . $_SESSION['photo_return']);
-
+
// NOTREACHED
-
+
}
-
-
-
+
+
+
function get() {
-
+
if(! local_channel()) {
goaway(z_root() . '/' . $_SESSION['photo_return']);
// NOTREACHED
}
-
+
// remove tag on the fly if item and tag are provided
if((argc() == 4) && (argv(1) === 'drop') && intval(argv(2))) {
-
+
$item = intval(argv(2));
$tag = argv(3);
-
+
$r = q("SELECT * FROM item WHERE id = %d AND uid = %d LIMIT 1",
intval($item),
intval(local_channel())
);
-
+
if(! $r)
goaway(z_root() . '/' . $_SESSION['photo_return']);
-
+
$r = fetch_post_tags($r,true);
-
+
$item = $r[0];
-
+
$new_tags = array();
-
+
if($item['term']) {
for($x = 0; $x < count($item['term']); $x ++) {
if($item['term'][$x]['term'] !== hex2bin($tag))
$new_tags[] = $item['term'][$x];
}
}
-
+
if($new_tags)
$item['term'] = $new_tags;
else
unset($item['term']);
-
- item_store_update($item);
-
+
+ item_store_update($item, deliver: false, addAndSync: false);
+
info( t('Tag removed') . EOL );
goaway(z_root() . '/' . $_SESSION['photo_return']);
-
+
}
-
+
//if we got only the item print a list of tags to select
if((argc() == 3) && (argv(1) === 'drop') && intval(argv(2))) {
-
+
$o = '';
-
+
$item = intval(argv(2));
-
+
$r = q("SELECT * FROM item WHERE id = %d AND uid = %d LIMIT 1",
intval($item),
intval(local_channel())
);
-
+
if(! $r)
goaway(z_root() . '/' . $_SESSION['photo_return']);
-
+
$r = fetch_post_tags($r,true);
-
+
if(! count($r[0]['term']))
goaway(z_root() . '/' . $_SESSION['photo_return']);
-
+
$o .= '<h3>' . t('Remove Item Tag') . '</h3>';
-
+
$o .= '<p id="tag-remove-desc">' . t('Select a tag to remove: ') . '</p>';
-
+
$o .= '<form id="tagrm" action="tagrm" method="post" >';
$o .= '<input type="hidden" name="item" value="' . $item . '" />';
$o .= '<ul>';
-
-
+
+
foreach($r[0]['term'] as $x) {
$o .= '<li><input type="checkbox" name="tag" value="' . bin2hex($x['term']) . '" >' . bbcode($x['term']) . '</input></li>';
}
-
+
$o .= '</ul>';
$o .= '<input id="tagrm-submit" type="submit" name="submit" value="' . t('Remove') .'" />';
$o .= '<input id="tagrm-cancel" type="submit" name="submit" value="' . t('Cancel') .'" />';
$o .= '</form>';
-
+
return $o;
-
+
}
-
+
}
-
+
}
diff --git a/Zotlabs/Module/Thing.php b/Zotlabs/Module/Thing.php
index a77081741..aef494e13 100644
--- a/Zotlabs/Module/Thing.php
+++ b/Zotlabs/Module/Thing.php
@@ -339,7 +339,7 @@ class Thing extends \Zotlabs\Web\Controller {
return '';
}
- $o .= replace_macros(get_markup_template('thing_edit.tpl'),array(
+ return replace_macros(get_markup_template('thing_edit.tpl'),array(
'$thing_hdr' => t('Edit Thing'),
'$multiprof' => feature_enabled(local_channel(),'multi_profiles'),
'$profile_lbl' => t('Select a profile'),
@@ -363,8 +363,6 @@ class Thing extends \Zotlabs\Web\Controller {
'$lockstate' => $lockstate,
'$submit' => t('Submit')
));
-
- return $o;
}
if(argc() == 3 && argv(1) === 'drop') {
@@ -392,10 +390,10 @@ class Thing extends \Zotlabs\Web\Controller {
Libsync::build_sync_packet(0,array('obj' => $r));
- return $o;
+ return '';
}
- $o .= replace_macros(get_markup_template('thing_input.tpl'),array(
+ return replace_macros(get_markup_template('thing_input.tpl'),array(
'$thing_hdr' => t('Add Thing to your Profile'),
'$multiprof' => feature_enabled(local_channel(),'multi_profiles'),
'$profile_lbl' => t('Select a profile'),
@@ -415,8 +413,5 @@ class Thing extends \Zotlabs\Web\Controller {
'$lockstate' => $lockstate,
'$submit' => t('Submit')
));
-
- return $o;
}
-
}
diff --git a/Zotlabs/Module/Vote.php b/Zotlabs/Module/Vote.php
index 06c47f91f..5192e3043 100644
--- a/Zotlabs/Module/Vote.php
+++ b/Zotlabs/Module/Vote.php
@@ -107,10 +107,12 @@ class Vote extends Controller {
retain_item($fetch[0]['id']);
if($x['success']) {
- $itemid = $x['item_id'];
- Master::Summon( [ 'Notifier', 'like', $itemid ] );
+ Master::Summon(['Notifier', 'like', $x['item_id']]);
+ if (!empty($x['approval_id'])) {
+ Master::Summon(['Notifier', 'like', $x['approval_id']]);
+ }
}
-
+/*
$r = q("select * from item where id = %d",
intval($itemid)
);
@@ -119,6 +121,7 @@ class Vote extends Controller {
$sync_item = fetch_post_tags($r);
Libsync::build_sync_packet($channel['channel_id'], [ 'item' => [ encode_item($sync_item[0],true) ] ]);
}
+*/
}
$ret['success'] = true;
diff --git a/Zotlabs/Module/Webfinger.php b/Zotlabs/Module/Webfinger.php
index 0dafae23c..ba0dca9e7 100644
--- a/Zotlabs/Module/Webfinger.php
+++ b/Zotlabs/Module/Webfinger.php
@@ -7,16 +7,16 @@ namespace Zotlabs\Module;
class Webfinger extends \Zotlabs\Web\Controller {
function get() {
-
-
- $o .= '<h3>Webfinger Diagnostic</h3>';
-
+
+
+ $o = '<h3>Webfinger Diagnostic</h3>';
+
$o .= '<form action="webfinger" method="get">';
$o .= 'Lookup address: <input type="text" style="width: 250px;" name="addr" value="' . $_GET['addr'] .'" />';
- $o .= '<input type="submit" name="submit" value="Submit" /></form>';
-
+ $o .= '<input type="submit" name="submit" value="Submit" /></form>';
+
$o .= '<br /><br />';
-
+
if(x($_GET,'addr')) {
$addr = trim($_GET['addr']);
diff --git a/Zotlabs/Module/Webpages.php b/Zotlabs/Module/Webpages.php
index ffb0d94ea..ca15c0b3a 100644
--- a/Zotlabs/Module/Webpages.php
+++ b/Zotlabs/Module/Webpages.php
@@ -63,7 +63,7 @@ class Webpages extends Controller {
switch ($_SESSION['action']) {
case 'import':
$_SESSION['action'] = null;
- $o .= replace_macros(get_markup_template('webpage_import.tpl'), array(
+ return replace_macros(get_markup_template('webpage_import.tpl'), array(
'$title' => t('Import Webpage Elements'),
'$importbtn' => t('Import selected'),
'$action' => 'import',
@@ -71,7 +71,6 @@ class Webpages extends Controller {
'$layouts' => $_SESSION['layouts'],
'$blocks' => $_SESSION['blocks'],
));
- return $o;
case 'importselected':
$_SESSION['action'] = null;
@@ -87,7 +86,7 @@ class Webpages extends Controller {
$pages = get_webpage_elements($channel, 'pages');
$layouts = get_webpage_elements($channel, 'layouts');
$blocks = get_webpage_elements($channel, 'blocks');
- $o .= replace_macros(get_markup_template('webpage_export_list.tpl'), array(
+ $o = replace_macros(get_markup_template('webpage_export_list.tpl'), array(
'$title' => t('Export Webpage Elements'),
'$exportbtn' => t('Export selected'),
'$action' => $_SESSION['export'], // value should be 'zipfile' or 'cloud'