1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
admin_tabcontrol_drag.php
См. документацию.
1<?php
8
10
12{
13 protected $moduleId;
14
15 public function __construct($name, $tabs, $moduleId="", $bCanExpand = true, $bDenyAutosave = false)
16 {
17 parent::__construct($name, $tabs, $bCanExpand, $bDenyAutosave);
18 $this->moduleId = $moduleId;
19 \Bitrix\Main\Page\Asset::getInstance()->addJs("/bitrix/js/main/admin_dd.js");
20 }
21
23 {
24 if ($this->AUTOSAVE)
25 $this->AUTOSAVE->Init();
26
27 //end previous tab
28 $this->EndTab();
29
30 if($this->tabIndex >= count($this->tabs))
31 return;
32
33 $css = '';
34 if ($this->tabs[$this->tabIndex]["DIV"] <> $this->selectedTab)
35 $css .= 'display:none; ';
36
37 echo '
38<div class="adm-detail-content" id="'.$this->tabs[$this->tabIndex]["DIV"].'"'.($css != '' ? ' style="'.$css.'"' : '').'>';
39
40 if (!empty($this->tabs[$this->tabIndex]["TITLE"]))
41 echo '
42 <div class="adm-detail-title">'.$this->tabs[$this->tabIndex]["TITLE"].'</div>';
43
44 if ($this->tabs[$this->tabIndex]["IS_DRAGGABLE"] == "Y")
45 {
46 $arJsParams = array(
47 "moduleId" => $this->moduleId,
48 "optionName" => $this->getCurrentTabOptionName($this->tabIndex),
49 "tabId" => $this->tabs[$this->tabIndex]["DIV"],
50 "hidden" => $this->getTabHiddenBlocks($this->tabIndex)
51 );
52 echo '
53 <script>
54 BX.ready(function(){
55 var orderObj = new BX.Admin.DraggableTab(' . Json::encode($arJsParams) . ');
56 });
57 </script>';
58 }
59
60 $showWrap = $this->tabs[$this->tabIndex]["SHOW_WRAP"] == "N" ? false : true;
61 echo '
62 <div '.($showWrap ? 'class="adm-detail-content-item-block"' : '').'>
63 <table class="adm-detail-content-table edit-table" id="'.$this->tabs[$this->tabIndex]["DIV"].'_edit_table">
64 <tbody>
65';
66 if(array_key_exists("CUSTOM", $this->tabs[$this->tabIndex]) && $this->tabs[$this->tabIndex]["CUSTOM"] == "Y")
67 {
68 $this->customTabber->ShowTab($this->tabs[$this->tabIndex]["DIV"]);
69 $this->tabIndex++;
70 $this->BeginNextTab();
71 }
72 elseif(array_key_exists("CONTENT", $this->tabs[$this->tabIndex]))
73 {
74 echo $this->tabs[$this->tabIndex]["CONTENT"];
75 $this->tabIndex++;
76 $this->BeginNextTab();
77 }
78 else
79 {
80 $this->tabIndex++;
81 }
82 }
83
84 function ShowTabButtons()
85 {
86 $s = '';
87 if (!$this->bPublicMode)
88 {
89 if(count($this->tabs) > 1 && $this->bCanExpand/* || $this->AUTOSAVE*/)
90 {
91 $s .= '<div class="adm-detail-title-setting" onclick="'.$this->name.'.ToggleTabs();" title="'.GetMessage("admin_lib_expand_tabs").'" id="'.$this->name.'_expand_link"><span class="adm-detail-title-setting-btn adm-detail-title-expand"></span></div>';
92 }
93 }
94 return $s;
95 }
96
97 function getCurrentTabOptionName($tabIdx)
98 {
99 return $this->name."_".$this->tabs[$tabIdx]["DIV"];
100 }
101
102 function getTabSettings($tabIdx)
103 {
104 if (isset($this->tabs[$tabIdx]["SETTINGS"]))
105 {
106 return $this->tabs[$tabIdx]["SETTINGS"];
107 }
108
109 $tabSettings = CUserOptions::getOption($this->moduleId, $this->getCurrentTabOptionName($tabIdx));
110
111 if (!empty($tabSettings["order"]))
112 {
113 $tabSettings["order"] = explode(",", $tabSettings["order"]);
114 }
115 else
116 {
117 $tabSettings["order"] = [];
118 }
119
120 if (!empty($tabSettings["hidden"]))
121 {
122 $tabSettings["hidden"] = explode(",", $tabSettings["hidden"]);
123 }
124 else
125 {
126 $tabSettings["hidden"] = [];
127 }
128
129 $this->tabs[$tabIdx]["SETTINGS"] = $tabSettings;
130
131 return $tabSettings;
132 }
133
134 function getCurrentTabBlocksOrder($defaultBlocksOrder = array())
135 {
136 $tabSettings = $this->getTabSettings($this->tabIndex-1);
137 $blocksOrder = $tabSettings["order"];
138
139 if (is_array($defaultBlocksOrder) && !empty($defaultBlocksOrder))
140 {
141 if (empty($blocksOrder))
142 {
143 $blocksOrder = $defaultBlocksOrder;
144 }
145 else
146 {
147 foreach($blocksOrder as $key => $blockCode)
148 {
149 if (!in_array($blockCode, $defaultBlocksOrder))
150 unset($blocksOrder[$key]);
151 }
152 $blocksOrder = array_unique(array_merge($blocksOrder, $defaultBlocksOrder));
153 }
154 }
155
156 return $blocksOrder;
157 }
158
159 function getTabHiddenBlocks($tabIdx)
160 {
161 $tabSettings = $this->getTabSettings($tabIdx);
162 $hiddenBlocks = $tabSettings["hidden"];
163 return is_array($hiddenBlocks) ? $hiddenBlocks : array();
164 }
165
167 {
168 echo '<div data-role="dragObj" data-onlydest="Y" style="height:5px;width:100%"></div>';
169 }
170
171 function DraggableBlockBegin($title, $dataId = "")
172 {
173 echo '
174 <div class="adm-container-draggable'.(in_array($dataId, $this->getTabHiddenBlocks($this->tabIndex-1)) ? ' hidden' : '').'" data-role="dragObj" data-id="'.$dataId.'">
175 <div class="adm-bus-statusorder">
176 <div class="adm-bus-component-container">
177 <div class="adm-bus-component-title-container draggable">
178 <div class="adm-bus-component-title-icon"></div>
179 <div class="adm-bus-component-title">'.$title.'</div>
180 <div class="adm-bus-component-title-icon-turn" data-role="toggleObj"></div>'.
181 //'<div class="adm-bus-component-title-icon-close"></div>'
182 '</div>
183 <div class="adm-bus-component-content-container">
184 <div class="adm-bus-table-container">';
185 }
186
188 {
189 echo ' </div>
190 </div>
191 </div>
192 </div>
193 </div>';
194 }
195}
196
197
203{
204 protected $id;
205 protected $engines = array();
206 protected $args = array();
207
213 public function __construct($id, $args = array())
214 {
215 $this->id = $id;
216 $this->args = $args;
217
218 foreach (GetModuleEvents("main", $this->id, true) as $arEvent)
219 {
220 $res = ExecuteModuleEventEx($arEvent, array($args));
221
222 if (is_array($res))
223 $this->engines[$res["BLOCKSET"]] = $res;
224 }
225 }
226
230 public function setArgs($args = array())
231 {
232 $this->args = $args;
233 }
234
238 public function check()
239 {
240 $result = true;
241
242 foreach ($this->engines as $value)
243 {
244 if (array_key_exists("check", $value))
245 {
246 $resultTmp = call_user_func_array($value["check"], array($this->args));
247
248 if ($result && !$resultTmp)
249 $result = false;
250 }
251 }
252
253 return $result;
254 }
255
259 public function action()
260 {
261 $result = true;
262
263 foreach ($this->engines as $value)
264 {
265 if (array_key_exists("action", $value))
266 {
267 $resultTmp = call_user_func_array($value["action"], array($this->args));
268
269 if ($result && !$resultTmp)
270 $result = false;
271 }
272 }
273
274 return $result;
275 }
276
280 public function getBlocksBrief()
281 {
282 $blocks = array();
283
284 foreach ($this->engines as $key => $value)
285 {
286 if (array_key_exists("getBlocksBrief", $value))
287 {
288 $tmp = call_user_func_array($value["getBlocksBrief"], array($this->args));
289
290 if (is_array($tmp))
291 $blocks = $blocks + $tmp;
292 }
293 }
294
295 return $blocks;
296 }
297
303 public function getBlockContent($blockCode, $selectedTab)
304 {
305 $result = '';
306
307 foreach ($this->engines as $key => $value)
308 if (array_key_exists("getBlockContent", $value))
309 $result .= call_user_func_array($value["getBlockContent"], array($blockCode, $selectedTab, $this->args));
310
311 return $result;
312 }
313
317 public function getScripts()
318 {
319 $result = '';
320
321 foreach ($this->engines as $key => $value)
322 {
323 if (array_key_exists("getScripts", $value))
324 $result .= call_user_func_array($value["getScripts"], array($this->args));
325 }
326
327 return $result;
328 }
329}
Определения json.php:9
getBlockContent($blockCode, $selectedTab)
Определения admin_tabcontrol_drag.php:303
setArgs($args=array())
Определения admin_tabcontrol_drag.php:230
__construct($id, $args=array())
Определения admin_tabcontrol_drag.php:213
BeginNextTab($options=array())
Определения admin_tabcontrol_drag.php:22
getCurrentTabBlocksOrder($defaultBlocksOrder=array())
Определения admin_tabcontrol_drag.php:134
getTabSettings($tabIdx)
Определения admin_tabcontrol_drag.php:102
getTabHiddenBlocks($tabIdx)
Определения admin_tabcontrol_drag.php:159
DraggableBlockBegin($title, $dataId="")
Определения admin_tabcontrol_drag.php:171
__construct($name, $tabs, $moduleId="", $bCanExpand=true, $bDenyAutosave=false)
Определения admin_tabcontrol_drag.php:15
getCurrentTabOptionName($tabIdx)
Определения admin_tabcontrol_drag.php:97
$bCanExpand
Определения admin_tabcontrol.php:21
$options
Определения commerceml2.php:49
if(!is_array($prop["VALUES"])) $tmp
Определения component_props.php:203
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$res
Определения filter_act.php:7
$result
Определения get_property_values.php:14
ExecuteModuleEventEx($arEvent, $arParams=[])
Определения tools.php:5214
GetModuleEvents($MODULE_ID, $MESSAGE_ID, $bReturnArray=false)
Определения tools.php:5177
GetMessage($name, $aReplace=null)
Определения tools.php:3397
return false
Определения prolog_main_admin.php:185
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
if(empty($signedUserToken)) $key
Определения quickway.php:257
</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
$title
Определения pdf.php:123