1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
moneyconfig.php
См. документацию.
1<?php
2
3namespace Bitrix\Main\Grid\Column\Editable;
4
5use Bitrix\Currency\CurrencyManager;
6use Bitrix\Main\Grid\Editor\Types;
7use Bitrix\Main\Loader;
8
12class MoneyConfig extends Config
13{
18 private array $currencyList;
19 private ?bool $isHtml;
20
24 public function __construct(string $name, ?array $currencyList = null)
25 {
26 parent::__construct($name, Types::MONEY);
27
28 if (isset($currencyList))
29 {
30 $this->currencyList = $currencyList;
31 }
32 elseif (Loader::includeModule('currency'))
33 {
34 $this->currencyList = CurrencyManager::getSymbolList();
35 $this->setHtml(true);
36 }
37 else
38 {
39 $this->currencyList = [];
40 }
41 }
42
50 public function setHtml(bool $value): self
51 {
52 $this->isHtml = $value;
53
54 return $this;
55 }
56
62 private function getCurrenyListAsDropdown(): array
63 {
64 $result = [];
65
66 foreach ($this->currencyList as $value => $name)
67 {
68 $result[] = [
69 'VALUE' => $value,
70 'NAME' => $name,
71 ];
72 }
73
74 return $result;
75 }
76
80 public function toArray(): array
81 {
82 $result = parent::toArray();
83
84 $result['CURRENCY_LIST'] = $this->getCurrenyListAsDropdown();
85
86 if (isset($this->isHtml))
87 {
88 $result['HTML_ENTITY'] = $this->isHtml;
89 }
90
91 return $result;
92 }
93}
__construct(string $name, ?array $currencyList=null)
Определения moneyconfig.php:24
static includeModule($moduleName)
Определения loader.php:67
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
$name
Определения menu_edit.php:35
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393