1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
DocumentLib.php
См. документацию.
1<?php
2
3namespace Bitrix\Bizproc\Calc\Libs;
4
5use Bitrix\Main;
6use Bitrix\Bizproc\Calc\Arguments;
7use Bitrix\Main\Localization\Loc;
8
9class DocumentLib extends BaseLib
10{
11 public function getFunctions(): array
12 {
13 return [
14 'getdocumenturl' => [
15 'args' => true,
16 'func' => 'callGetDocumentUrl',
17 'description' => Loc::getMessage('BIZPROC_CALC_FUNCTION_GETDOCUMENTURL_DESCRIPTION_MSGVER_1'),
18 ],
19 ];
20 }
21
22 public function callGetDocumentUrl(Arguments $args)
23 {
24 $format = $args->getFirst();
25 $external = $args->getSecond();
26 $activity = $args->getParser()->getActivity();
27
28 $url = $activity->workflow->getRuntime()->getDocumentService()->getDocumentAdminPage(
29 $activity->getDocumentId()
30 );
31 $name = null;
32
33 if ($external)
34 {
36 }
37
38 if ($format === 'bb' || $format === 'html')
39 {
40 $name = $activity->workflow->getService('DocumentService')->getDocumentName(
41 $activity->getDocumentId()
42 );
43 }
44
45 if ($format === 'bb')
46 {
47 return sprintf(
48 '[url=%s]%s[/url]',
49 $url,
50 $name
51 );
52 }
53
54 if ($format === 'html')
55 {
56 return sprintf(
57 '<a href="%s" target="_blank">%s</a>',
58 $url,
60 );
61 }
62
63 return $url;
64 }
65}
callGetDocumentUrl(Arguments $args)
Определения DocumentLib.php:22
static getInstance()
Определения urlmanager.php:28
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$activity
Определения options.php:214
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
Определения tools.php:2701
$name
Определения menu_edit.php:35
$url
Определения iframe.php:7