1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
processparams.php
См. документацию.
1<?php
2namespace Bitrix\Translate\Controller;
3
4use Bitrix\Translate;
5
12{
14 protected array $fieldToStoreInProcess = [];
15
21 public function getProgressParameterOptionName(): string
22 {
23 $settingId = 'translate';
24 if ($this instanceof Translate\Controller\Action)
25 {
26 $controller = $this->getController();
27 $settingId = $controller::SETTING_ID;
28 }
29 elseif ($this instanceof Translate\Controller\Controller)
30 {
31 $settingId = static::SETTING_ID;
32 }
33
34 $classId = \str_replace(['_', '\\'], '', static::class);
35
36 $id = "{$settingId}/{$classId}";
37
38 if (!empty($this->tabId))
39 {
40 $id .= '/'. $this->tabId;
41 }
42
43 return $id;
44 }
45
53 public function keepField($fieldName): self
54 {
55 if (\is_array($fieldName))
56 {
57 $this->fieldToStoreInProcess = \array_merge($this->fieldToStoreInProcess, $fieldName);
58 }
59 else
60 {
61 $this->fieldToStoreInProcess[] = $fieldName;
62 }
63
64 return $this;
65 }
66
72 public function restoreProgressParameters(): self
73 {
74 if (\count($this->fieldToStoreInProcess) > 0)
75 {
76 $progressData = $this->getProgressParameters();
77 if (\count($progressData) > 0)
78 {
79 foreach ($this->fieldToStoreInProcess as $fieldName)
80 {
81 if (isset($progressData[$fieldName]))
82 {
83 $this->{$fieldName} = $progressData[$fieldName];
84 }
85 }
86 }
87 }
88
89 return $this;
90 }
91
97 public function saveProgressParameters(): self
98 {
99 // store state
100 $progressData = [];
101 foreach ($this->fieldToStoreInProcess as $fieldName)
102 {
103 $progressData[$fieldName] = $this->{$fieldName};
104 }
105
106 $optName = \explode('/', $this->getProgressParameterOptionName());
107 $storage =& $_SESSION;
108 for ($d = 0, $depth = \count($optName); $d < $depth; $d++)
109 {
110 if (!isset($storage[$optName[$d]]))
111 {
112 $storage[$optName[$d]] = [];
113 }
114 $storage =& $storage[$optName[$d]];
115 }
116
117 $storage = $progressData;
118
119 return $this;
120 }
121
127 public function getProgressParameters(): array
128 {
129 $optName = \explode('/', $this->getProgressParameterOptionName());
130 $storage =& $_SESSION;
131 for ($d = 0, $depth = \count($optName); $d < $depth; $d++)
132 {
133 if (!isset($storage[$optName[$d]]))
134 {
135 return [];
136 }
137 $storage =& $storage[$optName[$d]];
138 }
139
140 return $storage;
141 }
142
148 public function clearProgressParameters(): self
149 {
150 $optName = \explode('/', $this->getProgressParameterOptionName());
151 $storage =& $_SESSION;
152 for ($d = 0, $depth = \count($optName); $d < $depth; $d++)
153 {
154 if (!isset($storage[$optName[$d]]))
155 {
156 return $this;
157 }
158 $storage =& $storage[$optName[$d]];
159 }
160
161 unset($storage);
162
163 return $this;
164 }
165}
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
trait ProcessParams
Определения processparams.php:12
restoreProgressParameters()
Определения processparams.php:72
getProgressParameterOptionName()
Определения processparams.php:21
saveProgressParameters()
Определения processparams.php:97
keepField($fieldName)
Определения processparams.php:53
clearProgressParameters()
Определения processparams.php:148
Определения autoload.php:3
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
if(empty($decryptedData)) $storage
Определения quickway.php:270
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
Определения waybill.php:936