diff options
Diffstat (limited to 'Zotlabs/Lib/ThreadItem.php')
-rw-r--r-- | Zotlabs/Lib/ThreadItem.php | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php index 8f364e945..1082bf642 100644 --- a/Zotlabs/Lib/ThreadItem.php +++ b/Zotlabs/Lib/ThreadItem.php @@ -3,8 +3,9 @@ namespace Zotlabs\Lib; use App; -use Zotlabs\Lib\Apps; use Zotlabs\Access\AccessList; +use Zotlabs\Lib\Apps; +use Zotlabs\Lib\Config; require_once('include/text.php'); @@ -41,9 +42,7 @@ class ThreadItem { $this->data = $data; $this->toplevel = ($this->get_id() == $this->get_data_value('parent')); - $this->threaded = get_config('system','thread_allow'); - - $observer = \App::get_observer(); + $this->threaded = Config::Get('system','thread_allow'); // Prepare the children if(isset($data['children'])) { @@ -70,7 +69,7 @@ class ThreadItem { // allow a site to configure the order and content of the reaction emoji list if($this->toplevel) { - $x = get_config('system','reactions'); + $x = Config::Get('system','reactions'); if($x && is_array($x) && count($x)) { $this->reactions = $x; } @@ -347,12 +346,12 @@ class ThreadItem { $dreport = ''; - $keep_reports = intval(get_config('system','expire_delivery_reports')); + $keep_reports = intval(Config::Get('system','expire_delivery_reports')); if($keep_reports === 0) $keep_reports = 10; $dreport_link = ''; - if((intval($item['item_type']) == ITEM_TYPE_POST) && (! get_config('system','disable_dreport')) && strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC',"now - $keep_reports days")) > 0) { + if((intval($item['item_type']) == ITEM_TYPE_POST) && (! Config::Get('system','disable_dreport')) && strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC',"now - $keep_reports days")) > 0) { $dreport = t('Delivery Report'); $dreport_link = '?mid=' . $item['mid']; } @@ -363,7 +362,8 @@ class ThreadItem { localize_item($item); - $body = prepare_body($item,true); + $opts = (($item['resource_type'] === 'event') ? ['is_event_item' => true] : []); + $body = prepare_body($item, true, $opts); // $viewthread (below) is only valid in list mode. If this is a channel page, build the thread viewing link // since we can't depend on llink or plink pointing to the right local location. @@ -397,7 +397,7 @@ class ThreadItem { $json_mids = json_encode($mids); // Pinned item processing - $allowed_type = (in_array($item['item_type'], get_config('system', 'pin_types', [ ITEM_TYPE_POST ])) ? true : false); + $allowed_type = (in_array($item['item_type'], Config::Get('system', 'pin_types', [ ITEM_TYPE_POST ])) ? true : false); $pinned_items = ($allowed_type ? get_pconfig($item['uid'], 'pinned', $item['item_type'], []) : []); $pinned = ((!empty($pinned_items) && in_array($midb64, $pinned_items)) ? true : false); @@ -549,7 +549,7 @@ class ThreadItem { $result['children'] = array(); $nb_children = count($children); - $visible_comments = get_config('system','expanded_comments'); + $visible_comments = Config::Get('system','expanded_comments'); if($visible_comments === false) $visible_comments = 3; @@ -826,7 +826,7 @@ class ThreadItem { */ private function get_comment_box() { - if(!$this->is_toplevel() && !get_config('system','thread_allow')) { + if(!$this->is_toplevel() && !Config::Get('system','thread_allow')) { return ''; } @@ -874,7 +874,7 @@ class ThreadItem { '$feature_encrypt' => ((feature_enabled($conv->get_profile_owner(),'content_encrypt')) ? true : false), '$encrypt' => t('Encrypt text'), '$cipher' => $conv->get_cipher(), - '$sourceapp' => \App::$sourcename, + '$sourceapp' => App::$sourcename, '$observer' => get_observer_hash(), '$anoncomments' => ((in_array($conv->get_mode(), ['channel', 'display', 'cards', 'articles']) && perm_is_allowed($conv->get_profile_owner(),'','post_comments')) ? true : false), '$anonname' => [ 'anonname', t('Your full name (required)') ], |