Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
taskinfo.php
1<?php
3
5
6final class TaskInfo extends Base
7{
8 const TYPE = 'TASKINFO';
9
10 public function getType()
11 {
12 return static::TYPE;
13 }
14
15 public function getText(string $text = '', array $params = [])
16 {
17 $result = '';
18
19 try
20 {
21 $data = Json::decode($text);
22 }
23 catch(\Bitrix\Main\ArgumentException $e)
24 {
25 $data = [];
26 }
27
28 if (
29 !is_array($data)
30 || empty($data)
31 || !\Bitrix\Main\Loader::includeModule("tasks")
32 )
33 {
34 return $result;
35 }
36
37 $result = htmlspecialcharsEx(
38 \Bitrix\Tasks\Comments\Task\CommentPoster::getCommentText(
39 $data,
40 array_merge($params, ['mobile' => (isset($params['mobile']) && $params['mobile'] === true)])
41 )
42 );
43
44 return $result;
45 }
46
47 public function canDelete()
48 {
49 return false;
50 }
51}
getText(string $text='', array $params=[])
Definition taskinfo.php:15