1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
wizard.php
См. документацию.
1<?
2require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/tools.php");
3
5
6require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/classes/general/wizard_util.php");
7require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/classes/general/wizard_site.php");
8require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/classes/general/wizard_site_steps.php");
9
11{
14
17
18 //attribute 'name' for buttons
23
24 //attribute 'name' for hidden button vars
30
34
37
41
43
45 {
46 $this->wizardName = $wizardName;
47 $this->package = $package;
48
49 $this->wizardSteps = Array();
50
51 $this->currentStepID = null;
52 $this->firstStepID = null;
53
54 $this->nextButtonID = "StepNext";
55 $this->prevButtonID = "StepPrevious";
56 $this->finishButtonID = "StepFinish";
57 $this->cancelButtonID = "StepCancel";
58
59 $this->nextStepHiddenID = "NextStepID";
60 $this->prevStepHiddenID = "PreviousStepID";
61 $this->finishStepHiddenID = "FinishStepID";
62 $this->cancelStepHiddenID = "CancelStepID";
63 $this->currentStepHiddenID = "CurrentStepID";
64
65 $this->variablePrefix = "__wiz_";
66 $this->formName = "__wizard_form";
67 $this->formActionScript = "/".ltrim($_SERVER["REQUEST_URI"], "/");
68
69 $this->returnOutput = false;
70 $this->defaultVars = Array();
71
72 $this->arTemplates = Array();
73 $this->defaultTemplate = null;
74 $this->useAdminTemplate = true;
75 }
76
77 function AddStep($obStep, $stepID = null)
78 {
79 if (!is_subclass_of($obStep, "CWizardStep"))
80 {
81 $this->__ShowError("Your class ".get_class($obStep)." is not a subclass of CWizardStep<br />");
82 return;
83 }
84
85 $obStep->_SetWizard($this);
86 $obStep->InitStep();
87 $ownStepID = $obStep->GetStepID();
88
89 if ($ownStepID == null && $stepID == null)
90 {
91 $this->__ShowError("Your step (class ".get_class($obStep).") has no ID<br />");
92 return;
93 }
94
95 $stepID = ($stepID !== null ? $stepID : $ownStepID);
96 $obStep->SetStepID($stepID);
97 $this->wizardSteps[$stepID] = $obStep;
98
99 if ($this->firstStepID === null)
100 $this->SetFirstStep($stepID);
101 }
102
104 {
105 if (!is_array($arClasses))
106 return false;
107
108 foreach ($arClasses as $className)
109 {
110 if (!class_exists($className))
111 continue;
112
113 $this->AddStep(new $className);
114 }
115 }
116
117 function SetTemplate($obStepTemplate, $stepID = null)
118 {
119 if (!is_subclass_of($obStepTemplate, "CWizardTemplate"))
120 return;
121
122 $obStepTemplate->_SetWizard($this);
123
124 if ($stepID === null)
125 $this->defaultTemplate = $obStepTemplate;
126 else
127 $this->arTemplates[$stepID] = $obStepTemplate;
128 }
129
131 {
132 $this->useAdminTemplate = false;
133 }
134
135 function SetFirstStep($stepID)
136 {
137 $this->firstStepID = $stepID;
138 }
139
140 function SetCurrentStep($stepID)
141 {
142 if (array_key_exists($stepID, $this->wizardSteps))
143 $this->currentStepID = $stepID;
144 }
145
147 {
149 }
150
154 function GetCurrentStep()
155 {
156 if (array_key_exists($this->currentStepID, $this->wizardSteps))
157 return $this->wizardSteps[$this->currentStepID];
158
159 return null;
160 }
161
162 function GetWizardSteps()
163 {
164 return $this->wizardSteps;
165 }
166
167 function GetVars($useDefault = false)
168 {
169 $arVars = Array();
170 $prefix = $this->GetVarPrefix();
171 $prefixLength = mb_strlen($prefix);
172 foreach ($_REQUEST as $varName => $varValue)
173 {
174 if (strncmp($prefix, $varName, $prefixLength) == 0)
175 $arVars[mb_substr($varName, $prefixLength)] = $varValue;
176 }
177
178 if ($useDefault)
179 {
180 $arDefault = $this->GetDefaultVars();
181 $arVars = array_merge($arDefault, $arVars);
182 }
183
184 return $arVars;
185 }
186
187 function GetVar($varName, $useDefault = false)
188 {
189 $varName = str_replace("[]", "", $varName);
190 $trueName = $this->GetRealName($varName);
191
192 if (array_key_exists($trueName, $_REQUEST))
193 return $_REQUEST[$trueName];
194 elseif(mb_strpos($trueName, '['))
195 {
196 $varValue = $this->__GetComplexVar($trueName, $_REQUEST);
197 if($varValue !== null)
198 {
199 return $varValue;
200 }
201 elseif($useDefault)
202 {
203 return $this->GetDefaultVar($varName);
204 }
205 }
206 elseif ($useDefault)
207 return $this->GetDefaultVar($varName);
208
209 return null;
210 }
211
212 function SetVar($varName, $varValue)
213 {
214 $trueName = $this->GetRealName($varName);
215
216 if (!mb_strpos($varName, '['))
217 $_REQUEST[$trueName] = $varValue;
218 else
219 $this->__SetComplexVar($trueName, $varValue, $_REQUEST);
220 }
221
222 function UnSetVar($varName)
223 {
224 $trueName = $this->GetRealName($varName);
225
226 if (!mb_strpos($varName, '['))
227 unset($_REQUEST[$trueName]);
228 else
229 $this->__UnSetComplexVar($trueName, $_REQUEST);
230 }
231
232 function __GetComplexVar($varName, &$arVars)
233 {
234 $tokens = explode("[", str_replace("]", "", $varName));
235 $arValues =& $arVars;
236 do
237 {
238 $token = array_shift($tokens);
239 if (!isset($arValues[$token]))
240 return null;
241 $arValues =& $arValues[$token];
242 } while (!empty($tokens));
243
244 return $arValues;
245 }
246
247 function __SetComplexVar($varName, $value, &$arVars)
248 {
249 $tokens = explode("[", str_replace("]", "", $varName));
250 $arValues =& $arVars;
251 do
252 {
253 $token = array_shift($tokens);
254 if (!isset($arValues[$token]))
255 $arValues[$token] = Array();
256 $arValues =& $arValues[$token];
257 } while (count($tokens) > 1);
258 $arValues[$tokens[0]] = $value;
259 }
260
261 function __UnSetComplexVar($varName, &$arVars)
262 {
263 $tokens = explode("[", str_replace("]", "", $varName));
264 $arValues =& $arVars;
265 do
266 {
267 $token = array_shift($tokens);
268 if (!isset($arValues[$token]))
269 return null;
270 $arValues =& $arValues[$token];
271 } while (count($tokens) > 1);
272 unset($arValues[array_pop($tokens)]);
273 }
274
275 function GetRealName($varName)
276 {
277 return $this->GetVarPrefix().$varName;
278 }
279
280 function GetVarPrefix()
281 {
283 }
284
285 function SetVarPrefix($varPrefix)
286 {
287 $this->variablePrefix = $varPrefix;
288 }
289
290 function SetDefaultVar($varName, $varValue)
291 {
292 $varName = str_replace("[]", "", $varName);
293
294 if (!mb_strpos($varName, '['))
295 $this->defaultVars[$varName] = $varValue;
296 else
297 $this->__SetComplexVar($varName, $varValue, $this->defaultVars);
298 }
299
300 function SetDefaultVars($arVars)
301 {
302 if (!is_array($arVars))
303 return;
304
305 foreach ($arVars as $varName => $varValue)
306 $this->SetDefaultVar($varName, $varValue);
307 }
308
309 function GetDefaultVar($varName)
310 {
311 $varName = str_replace("[]", "", $varName);
312
313 if (array_key_exists($varName, $this->defaultVars))
314 return $this->defaultVars[$varName];
315 elseif(mb_strpos($varName, '['))
316 {
317 return $this->__GetComplexVar($varName, $this->defaultVars);
318 }
319
320 return null;
321 }
322
323 function GetDefaultVars()
324 {
325 return $this->defaultVars;
326 }
327
328 function GetWizardName()
329 {
330 return $this->wizardName;
331 }
332
334 {
335 $this->formName = $formName;
336 }
337
338 function GetFormName()
339 {
340 return $this->formName;
341 }
342
343 function SetFormActionScript($actionScript)
344 {
345 $this->formActionScript = $actionScript;
346 }
347
349 {
351 }
352
354 {
355 return ( isset($_REQUEST[$this->nextButtonID]) && isset($_REQUEST[$this->nextStepHiddenID]) );
356 }
357
359 {
360 return ( isset($_REQUEST[$this->prevButtonID]) && isset($_REQUEST[$this->prevStepHiddenID]) );
361 }
362
364 {
365 return ( isset($_REQUEST[$this->finishButtonID]) && isset($_REQUEST[$this->finishStepHiddenID]) );
366 }
367
369 {
370 return ( isset($_REQUEST[$this->cancelButtonID]) && isset($_REQUEST[$this->cancelStepHiddenID]) );
371 }
372
373 function SetNextButtonID($buttonID)
374 {
375 $this->nextButtonID = $buttonID;
376 }
377
379 {
380 return $this->nextButtonID;
381 }
382
383 function GetNextStepID()
384 {
385 if (isset($_REQUEST[$this->nextStepHiddenID]))
387
388 return null;
389 }
390
391 function SetPrevButtonID($buttonID)
392 {
393 $this->prevButtonID = $buttonID;
394 }
395
397 {
398 return $this->prevButtonID;
399 }
400
401 function GetPrevStepID()
402 {
403 if (isset($_REQUEST[$this->prevStepHiddenID]))
405
406 return null;
407 }
408
409 function SetFinishButtonID($buttonID)
410 {
411 $this->finishButtonID = $buttonID;
412 }
413
415 {
417 }
418
420 {
421 if (isset($_REQUEST[$this->finishStepHiddenID]))
423
424 return null;
425 }
426
427 function SetCancelButtonID($buttonID)
428 {
429 $this->cancelButtonID = $buttonID;
430 }
431
433 {
435 }
436
438 {
439 if (isset($_REQUEST[$this->cancelStepHiddenID]))
441
442 return null;
443 }
444
445 function SetReturnOutput($mode = true)
446 {
447 $this->returnOutput = (bool)$mode;
448 }
449
450 function GetPackage()
451 {
452 return $this->package;
453 }
454
455 function Display()
456 {
457 $currentStep = &$this->currentStepID;
458
459 //What button has just been pressed
460 if ($this->IsPrevButtonClick())
461 $currentStep = $this->GetPrevStepID();
462 elseif ($this->IsNextButtonClick())
463 $currentStep = $this->GetNextStepID();
464 elseif ($this->IsCancelButtonClick())
465 $currentStep = $this->GetCancelStepID();
466 elseif ($this->IsFinishButtonClick())
467 $currentStep = $this->GetFinishStepID();
468
469 //Execute current step action
470 if ( isset($_REQUEST[$this->currentStepHiddenID]) && isset($this->wizardSteps[$_REQUEST[$this->currentStepHiddenID]]) )
471 {
472 $oCurrentStep = $this->wizardSteps[$_REQUEST[$this->currentStepHiddenID]];
473 if (method_exists($oCurrentStep, "OnPostForm"))
474 {
475 $oCurrentStep->OnPostForm();
476 if (!empty($oCurrentStep->stepErrors))
478 }
479 }
480
481 //If step is not found, show a first step
482 if (!isset($this->wizardSteps[$currentStep]))
483 {
484 if (isset($this->wizardSteps[$this->firstStepID]))
485 $currentStep = $this->firstStepID;
486 else
487 {
488 $this->__ShowError("Wizard has no any step");
489 return;
490 }
491 }
492
493 return $this->_DisplayStep();
494 }
495
496 function _DisplayStep()
497 {
498 $oStep = $this->GetCurrentStep();
499 $oStep->ShowStep();
500
501 $formStart = '<form action="'.htmlspecialcharsbx($this->formActionScript).'" enctype="multipart/form-data" method="post" name="'.htmlspecialcharsbx($this->formName).'" id="'.htmlspecialcharsbx($this->formName).'">';
502 $formStart .= '<input type="hidden" name="'.htmlspecialcharsbx($this->currentStepHiddenID).'" value="'.htmlspecialcharsbx($this->currentStepID).'">';
503 $formStart .= $this->__DisplayHiddenVars($this->GetVars(), $oStep);
504
505 /*
506 if ($oStep->prevStepID !== null)
507 $strResult .= '<input type="submit" name="'.$this->prevButtonID.'" value="'.$oStep->prevCaption.'">
508 <input type="hidden" name="'.$this->prevStepHiddenID.'" value="'.$oStep->prevStepID.'">';
509
510 if ($oStep->nextStepID !== null)
511 $strResult .= '<input type="submit" name="'.$this->nextButtonID.'" value="'.$oStep->nextCaption.'">
512 <input type="hidden" name="'.$this->nextStepHiddenID.'" value="'.$oStep->nextStepID.'">';
513
514 if ($oStep->finishStepID !== null)
515 $strResult .= '<input type="submit" name="'.$this->finishButtonID.'" value="'.$oStep->finishCaption.'">
516 <input type="hidden" name="'.$this->finishStepHiddenID.'" value="'.$oStep->finishStepID.'">';
517
518 if ($oStep->cancelStepID !== null)
519 $strResult .= '&nbsp;&nbsp;<input type="submit" name="'.$this->cancelButtonID.'" value="'.$oStep->cancelCaption.'">
520 <input type="hidden" name="'.$this->cancelStepHiddenID.'" value="'.$oStep->cancelStepID.'">';
521 */
522
523 $formEnd = "</form>";
524
525 $stepLayout = $this->__GetStepLayout();
526 $stepLayout = $stepLayout->GetLayout();
527
528 $buttonsHtml = "";
529 $prevButtonHtml = "";
530 if ($oStep->prevStepID !== null)
531 {
532 $formStart .= '<input type="hidden" name="'.$this->prevStepHiddenID.'" value="'.$oStep->prevStepID.'">';
533 $prevButtonHtml = '<input type="submit" class="wizard-prev-button" name="'.$this->prevButtonID.'" value="'.$oStep->prevCaption.'">';
534 $buttonsHtml .= $prevButtonHtml;
535 }
536
537 $nextButtonHtml = "";
538 if ($oStep->nextStepID !== null)
539 {
540 $formStart .= '<input type="hidden" name="'.$this->nextStepHiddenID.'" value="'.$oStep->nextStepID.'">';
541 $nextButtonHtml = '<input type="submit" class="wizard-next-button" name="'.$this->nextButtonID.'" value="'.$oStep->nextCaption.'">';
542 $buttonsHtml .= ($buttonsHtml <> '' ? "&nbsp;" : "").$nextButtonHtml;
543 }
544
545 $finishButtonHtml = "";
546 if ($oStep->finishStepID !== null)
547 {
548 $formStart .= '<input type="hidden" name="'.$this->finishStepHiddenID.'" value="'.$oStep->finishStepID.'">';
549 $finishButtonHtml = '<input type="submit" class="wizard-finish-button" name="'.$this->finishButtonID.'" value="'.$oStep->finishCaption.'">';
550 $buttonsHtml .= ($buttonsHtml <> '' ? "&nbsp;" : "").$finishButtonHtml;
551 }
552
553 $cancelButtonHtml = "";
554 if ($oStep->cancelStepID !== null)
555 {
556 $formStart .= '<input type="hidden" name="'.$this->cancelStepHiddenID.'" value="'.$oStep->cancelStepID.'">';
557 $cancelButtonHtml = '<input type="submit" class="wizard-cancel-button" name="'.$this->cancelButtonID.'" value="'.$oStep->cancelCaption.'">';
558 $buttonsHtml .= ($buttonsHtml <> '' ? "&nbsp;&nbsp;&nbsp;" : "").$cancelButtonHtml;
559 }
560
561 $output = str_replace("{#FORM_START#}", $formStart, $stepLayout);
562 $output = str_replace("{#FORM_END#}", $formEnd, $output);
563 $output = str_replace("{#CONTENT#}", $oStep->content, $output);
564
565 //$output = str_replace("{#BUTTONS#}", $this->__DisplayButtons(), $output);
566 $output = str_replace("{#BUTTONS#}", $buttonsHtml, $output);
567 $output = str_replace("{#BUTTON_PREVIOUS#}", $prevButtonHtml, $output);
568 $output = str_replace("{#BUTTON_NEXT#}", $nextButtonHtml, $output);
569 $output = str_replace("{#BUTTON_CANCEL#}", $finishButtonHtml, $output);
570 $output = str_replace("{#BUTTON_FINISH#}", $cancelButtonHtml, $output);
571
572 if ($this->returnOutput)
573 return $output;
574 else
575 echo $output;
576 }
577
579 {
580 if (defined("ADMIN_SECTION") && ADMIN_SECTION === true && $this->useAdminTemplate === true)
581 {
583 $template->_SetWizard($this);
584 return $template;
585 }
586 elseif (isset($this->arTemplates[$this->currentStepID]))
587 {
588 return $this->arTemplates[$this->currentStepID];
589 }
590 elseif (is_object($this->defaultTemplate))
591 {
593 }
594 else
595 {
597 $template->_SetWizard($this);
598 return $template;
599 }
600 }
601
602 function __DisplayHiddenVars($arVars, $oStep, $concatString = null)
603 {
604 $strReturn = "";
605
606 foreach ($arVars as $varName => $varValue)
607 {
608 if ($concatString !== null)
609 $varName = $concatString."[".$varName."]";
610
611 if ($oStep->DisplayVarExists($varName))
612 continue;
613
614 if (is_array($varValue))
615 $strReturn .= $this->__DisplayHiddenVars($varValue, $oStep, $varName);
616 else
617 $strReturn .= '<input type="hidden" name="'.htmlspecialcharsbx($this->GetVarPrefix().$varName).'" value="'.htmlspecialcharsEx($varValue).'">
618 ';
619 }
620
621 return $strReturn;
622 }
623
625 {
626 if ($errorMessage <> '')
627 echo '<span style="color:#FF0000">'.$errorMessage.'</span>';
628 }
629
630 /* Old compatible Methods*/
631 function GetID()
632 {
633 if ($this->package === null)
634 return "";
635 return $this->package->GetID();
636 }
637
638 function GetPath()
639 {
640 if ($this->package === null)
641 return "";
642 return $this->package->GetPath();
643 }
644
646 {
647 if ($this->package === null)
648 return null;
649
650 return $this->package->GetSiteTemplateID();
651 }
652
653 function GetSiteGroupID()
654 {
655 if ($this->package === null)
656 return null;
657
658 return $this->package->GetSiteGroupID();
659 }
660
661 function GetSiteID()
662 {
663 if ($this->package === null)
664 return null;
665
666 return $this->package->GetSiteID();
667 }
668
670 {
671 if ($this->package === null)
672 return null;
673
674 return $this->package->GetSiteServiceID();
675 }
676 /* Old compatible methods */
677
678}
679
681{
685
690
695
698
699 var $wizard; // reference to wizard object
701
703
704 public function __construct()
705 {
706 $this->stepTitle = "";
707 $this->stepSubTitle = "";
708 $this->stepID = null;
709
710 $this->prevCaption = GetMessage("MAIN_WIZARD_PREV_CAPTION");
711 $this->nextCaption = GetMessage("MAIN_WIZARD_NEXT_CAPTION");
712 $this->finishCaption = GetMessage("MAIN_WIZARD_FINISH_CAPTION");
713 $this->cancelCaption = GetMessage("MAIN_WIZARD_CANCEL_CAPTION");
714
715 $this->nextStepID = null;
716 $this->prevStepID = null;
717 $this->finishStepID = null;
718 $this->cancelStepID = null;
719
720 $this->wizard = null;
721 $this->displayVars = Array();
722 $this->stepErrors = Array();
723
724 $this->content = "";
725
726 $this->autoSubmit = false;
727 }
728
729 //Step initialization
730 function InitStep()
731 {
732 //should be overloaded
733 }
734
735 //Step action
736 function OnPostForm()
737 {
738 //should be overloaded
739 }
740
741 //Step output
742 function ShowStep()
743 {
744 //should be overloaded
745 }
746
747 function SetTitle($title)
748 {
749 $this->stepTitle = $title;
750 }
751
752 function GetTitle()
753 {
754 return $this->stepTitle;
755 }
756
758 {
759 $this->stepSubTitle = $stepSubTitle;
760 }
761
762 function GetSubTitle()
763 {
764 return $this->stepSubTitle;
765 }
766
768 {
769 $this->stepID = $stepID;
770 }
771
772 function GetStepID()
773 {
774 return $this->stepID;
775 }
776
778 {
779 $this->nextStepID = $stepID;
780 }
781
782 function GetNextStepID()
783 {
784 return $this->nextStepID;
785 }
786
787 function SetNextCaption($caption)
788 {
789 $this->nextCaption = $caption;
790 }
791
792 function GetNextCaption()
793 {
794 return $this->nextCaption;
795 }
796
798 {
799 $this->prevStepID = $stepID;
800 }
801
802 function GetPrevStepID()
803 {
804 return $this->prevStepID;
805 }
806
807 function SetPrevCaption($caption)
808 {
809 $this->prevCaption = $caption;
810 }
811
812 function GetPrevCaption()
813 {
814 return $this->prevCaption;
815 }
816
818 {
819 $this->finishStepID = $stepID;
820 }
821
823 {
824 return $this->finishStepID;
825 }
826
827 function SetFinishCaption($caption)
828 {
829 $this->finishCaption = $caption;
830 }
831
833 {
834 return $this->finishCaption;
835 }
836
838 {
839 $this->cancelStepID = $stepID;
840 }
841
843 {
844 return $this->cancelStepID;
845 }
846
847 function SetCancelCaption($caption)
848 {
849 $this->cancelCaption = $caption;
850 }
851
853 {
854 return $this->cancelCaption;
855 }
856
857 function SetDisplayVars($arVars)
858 {
859 if (!is_array($arVars))
860 return;
861
862 $wizard = $this->GetWizard();
863 foreach ($arVars as $varName)
864 {
865 $varName = str_replace("[]", "", $varName);
866 if (!in_array($varName, $this->displayVars))
867 $this->displayVars[] = $varName;
868 }
869 }
870
871 function DisplayVarExists($varName)
872 {
873 $varName = str_replace("[]", "", $varName);
874
875 if (in_array($varName, $this->displayVars, true))
876 return true;
877 return null;
878 }
879
880 function GetDisplayVars()
881 {
882 return $this->displayVars;
883 }
884
885 function SetError($strError, $id = false)
886 {
887 $this->stepErrors[] = Array($strError, $id);
888 }
889
890 function GetErrors()
891 {
892 return $this->stepErrors;
893 }
894
895 //Text and textarea controls
896 function ShowInputField($type, $name, $arAttributes = Array())
897 {
898 $strReturn = "";
899 $wizard = $this->GetWizard();
900 $prefixName = $wizard->GetRealName($name);
901 $value = (($v = $wizard->GetVar($name)) <> '' ? $v : $wizard->GetDefaultVar($name));
902
903 $this->SetDisplayVars(Array($name));
904
905 switch ($type)
906 {
907 case "text":
908 if (!isset($arAttributes["size"]))
909 $arAttributes["size"] = 10;
910 $strReturn .= '<input type="text" name="'.htmlspecialcharsbx($prefixName).'" value="'.htmlspecialcharsEx($value).'"'.$this->_ShowAttributes($arAttributes).' />';
911 break;
912
913 case "password":
914 if (!isset($arAttributes["size"]))
915 $arAttributes["size"] = 10;
916 $strReturn .= '<input type="password" name="'.htmlspecialcharsbx($prefixName).'" value="'.htmlspecialcharsEx($value).'"'.$this->_ShowAttributes($arAttributes).' />';
917 break;
918
919 case "textarea":
920 $strReturn .= '<textarea name="'.htmlspecialcharsbx($prefixName).'"'.$this->_ShowAttributes($arAttributes).'>'.htmlspecialcharsEx($value).'</textarea>';
921 break;
922 }
923
924 return $strReturn;
925 }
926
927 //Checkbox control
928 function ShowCheckboxField($name, $value, $arAttributes = Array())
929 {
930 $this->SetDisplayVars(Array($name));
931 $wizard = $this->GetWizard();
932
933 $valueFromPost = $wizard->GetVar($name);
934 if ($valueFromPost !== null && !is_array($valueFromPost))
935 $valueFromPost = Array($valueFromPost);
936
937 $valueFromDefault = $wizard->GetDefaultVar($name);
938 if ($valueFromDefault !== null && !is_array($valueFromDefault))
939 $valueFromDefault = Array($valueFromDefault);
940
941 $checked = (
942 (($valueFromPost !== null && in_array($value, $valueFromPost)) ||
943 ($valueFromDefault !== null && $valueFromPost == "" && in_array($value, $valueFromDefault)))
944 &&
945 ($arAttributes["checked"] !== false)
946 );
947
948 static $arViewedField = Array();
949 $viewName = str_replace("[]", "", $name);
950 $strReturn = "";
951
952 if (!in_array($viewName, $arViewedField) /*&& !$valueWasViewed*/)
953 {
954 $arViewedField[] = $viewName;
955 $strReturn .= '<input name="'.htmlspecialcharsbx($wizard->GetRealName($viewName)).'" value="" type="hidden" />';
956 }
957
958 $prefixName = $wizard->GetRealName($name);
959 $strReturn .= '<input name="'.htmlspecialcharsbx($prefixName).'" '.($checked ?"checked=\"checked\" ":"").'type="checkbox" value="'.htmlspecialcharsEx($value).'"'.$this->_ShowAttributes($arAttributes).' />';
960
961 return $strReturn;
962
963 }
964
965 //Radio button control
966 function ShowRadioField($name, $value, $arAttributes = Array())
967 {
968 $this->SetDisplayVars(Array($name));
969 $wizard = $this->GetWizard();
970
971 $valueFromPost = $wizard->GetVar($name);
972 if ($valueFromPost !== null && !is_array($valueFromPost))
973 $valueFromPost = Array($valueFromPost);
974
975 $valueFromDefault = $wizard->GetDefaultVar($name);
976 if ($valueFromDefault !== null && !is_array($valueFromDefault))
977 $valueFromDefault = Array($valueFromDefault);
978
979 static $arCheckedField = Array();
980 $checked = false;
981 $checkName = str_replace("[]", "", $name);
982
983 if (!in_array($checkName, $arCheckedField))
984 {
985 $checked = (
986 ($valueFromPost !== null && in_array($value, $valueFromPost)) ||
987 ($valueFromDefault !== null && $valueFromPost === null && in_array($value, $valueFromDefault))
988 );
989
990 if ($checked)
991 $arCheckedField[] = $checkName;
992 }
993
994 $prefixName = $wizard->GetRealName($name);
995 return '<input name="'.htmlspecialcharsbx($prefixName).'" type="radio" '.($checked ?"checked=\"checked\" ":"").'value="'.htmlspecialcharsEx($value).'"'.$this->_ShowAttributes($arAttributes).' />';
996 }
997
998 //Dropdown and multiple controls
999 function ShowSelectField($name, $arValues = Array(), $arAttributes = Array())
1000 {
1001 $wizard = $this->GetWizard();
1002 $this->SetDisplayVars(Array($name));
1003
1004 $varValue = $wizard->GetVar($name);
1005 $selectedValues = (
1006 $varValue !== null && $varValue != "" ?
1007 $varValue :
1008 (
1009 $varValue === "" ?
1010 Array() :
1011 $wizard->GetDefaultVar($name)
1012 )
1013 );
1014
1015 if (!is_array($selectedValues))
1016 $selectedValues = Array($selectedValues);
1017
1018 $viewName = $wizard->GetRealName(str_replace("[]", "", $name));
1019 $strReturn = '<input name="'.htmlspecialcharsbx($viewName).'" value="" type="hidden" />';
1020
1021 $prefixName = $wizard->GetRealName($name);
1022 $strReturn .= '<select name="'.htmlspecialcharsbx($prefixName).'"'.$this->_ShowAttributes($arAttributes).'>';
1023
1024 foreach ($arValues as $optionValue => $optionName)
1025 $strReturn .= '<option value="'.htmlspecialcharsEx($optionValue).'"'.(in_array($optionValue, $selectedValues) ? " selected=\"selected\"" :"").'>'.htmlspecialcharsEx($optionName).'</option>
1026 ';
1027
1028 $strReturn .= '</select>';
1029
1030 return $strReturn;
1031 }
1032
1033 //Hidden control
1034 function ShowHiddenField($name, $value, $arAttributes = Array())
1035 {
1036 $wizard = $this->GetWizard();
1037
1038 $this->SetDisplayVars(Array($name));
1039 $trueName = $wizard->GetRealName($name);
1040
1041 $strReturn = '<input type="hidden" name="'.htmlspecialcharsbx($trueName).'" value="'.htmlspecialcharsEx($value).'"'.$this->_ShowAttributes($arAttributes).' />';
1042
1043 return $strReturn;
1044 }
1045
1046 //File control
1047 function ShowFileField($name, $arAttributes = Array())
1048 {
1049 $wizard = $this->GetWizard();
1050 $strReturn = "";
1051
1052 if (array_key_exists("max_file_size", $arAttributes))
1053 {
1054 $strReturn .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.intval($arAttributes["max_file_size"]).'" />';
1055 unset($arAttributes["max_file_size"]);
1056 }
1057
1058 $strReturn .= '<input type="file" name="'.htmlspecialcharsbx($wizard->GetRealName($name."_new")).'"'.$this->_ShowAttributes($arAttributes).' />';
1059
1060 $fileID = intval($wizard->GetVar($name));
1061 if ($fileID > 0)
1062 {
1063 $obFile = CFile::GetByID($fileID);
1064 if ($arFile = $obFile->Fetch())
1065 {
1066 $deleteName = $wizard->GetRealName($name."_del");
1067 $oldName = $wizard->GetRealName($name."_old");
1068
1069 $show_file_info = (isset($arAttributes["show_file_info"]) && $arAttributes["show_file_info"] == "N" ? false : true);
1070
1071 if ($show_file_info)
1072 {
1073 $strReturn .= "<br />&nbsp;".GetMessage("MAIN_WIZARD_FILE_NAME").": ".htmlspecialcharsEx($arFile["ORIGINAL_NAME"]);
1074
1075 if ($arFile["HEIGHT"] > 0 && $arFile["WIDTH"])
1076 {
1077 $strReturn .= "<br />&nbsp;".GetMessage("MAIN_WIZARD_FILE_WIDTH").": ".intval($arFile["WIDTH"]);
1078 $strReturn .= "<br />&nbsp;".GetMessage("MAIN_WIZARD_FILE_HEIGHT").": ".intval($arFile["HEIGHT"]);
1079 }
1080
1081 $sizes = array("b", "Kb", "Mb", "Gb");
1082 $pos = 0;
1083 $size = $arFile["FILE_SIZE"];
1084 while($size >= 1024)
1085 {
1086 $size /= 1024;
1087 $pos++;
1088 }
1089 $strReturn .= "<br />&nbsp;".GetMessage("MAIN_WIZARD_FILE_SIZE").": ".round($size, 2)." ".$sizes[$pos];
1090 }
1091
1092 $strReturn .= '<br />';
1093 $strReturn .= '<input type="checkbox" name="'.$deleteName.'" value="Y" id="'.$deleteName.'" />';
1094 $strReturn .= '<label for="'.$deleteName.'">'.GetMessage("MAIN_WIZARD_FILE_DELETE").'</label>';
1095 }
1096 }
1097
1098 return $strReturn;
1099
1100 }
1101
1102 function SaveFile($name, $arRestriction = Array())
1103 {
1104 $wizard = $this->GetWizard();
1105 $deleteFile = $wizard->GetVar($name."_del");
1106 $wizard->UnSetVar($name."_del");
1107 $oldFileID = $wizard->GetVar($name);
1108 $fileNew = $wizard->GetRealName($name."_new");
1109
1110 if (!array_key_exists($fileNew, $_FILES) || ($_FILES[$fileNew]["name"] == '' && $deleteFile === null))
1111 return;
1112
1113 if ($_FILES[$fileNew]["tmp_name"] == '' && $deleteFile === null)
1114 {
1115 $this->SetError(GetMessage("MAIN_WIZARD_FILE_UPLOAD_ERROR"), $name."_new");
1116 return;
1117 }
1118
1119 $arFile = $_FILES[$fileNew] + Array(
1120 "del" => ($deleteFile == "Y" ? "Y" : ""),
1121 "old_file" => (intval($oldFileID) > 0 ? intval($oldFileID): 0 ),
1122 "MODULE_ID" => "tmp_wizard"
1123 );
1124
1125 $max_file_size = (array_key_exists("max_file_size", $arRestriction) ? intval($arRestriction["max_file_size"]) : 0);
1126 $max_width = (array_key_exists("max_width", $arRestriction) ? intval($arRestriction["max_width"]) : 0);
1127 $max_height = (array_key_exists("max_height", $arRestriction) ? intval($arRestriction["max_height"]) : 0);
1128 $extensions = (array_key_exists("extensions", $arRestriction) && $arRestriction["extensions"] <> '' ? trim($arRestriction["extensions"]) : false);
1129 $make_preview = (array_key_exists("make_preview", $arRestriction) && $arRestriction["make_preview"] == "Y" ? true : false);
1130
1131 $error = CFile::CheckFile($arFile, $max_file_size, false, $extensions);
1132 if ($error <> '')
1133 {
1134 $this->SetError($error, $name."_new");
1135 return;
1136 }
1137
1138 if ($make_preview && $max_width > 0 && $max_height > 0)
1139 {
1140 $info = (new \Bitrix\Main\File\Image($arFile["tmp_name"]))->getInfo();
1141 if($info)
1142 {
1143 if ($info->getWidth() > $max_width || $info->getHeight() > $max_height)
1144 {
1145 $success = CWizardUtil::CreateThumbnail($arFile["tmp_name"], $arFile["tmp_name"], $max_width, $max_height);
1146 if ($success)
1147 $arFile["size"] = @filesize($arFile["tmp_name"]);
1148 }
1149 }
1150 }
1151 elseif ($max_width > 0 || $max_height > 0)
1152 {
1153 $error = CFile::CheckImageFile($arFile, $max_file_size, $max_width, $max_height);
1154 if ($error <> '')
1155 {
1156 $this->SetError($error, $name."_new");
1157 return;
1158 }
1159 }
1160
1161 $fileID = (int)CFile::SaveFile($arFile, "tmp");
1162 if ($fileID > 0)
1163 $wizard->SetVar($name, $fileID);
1164 else
1165 $wizard->UnSetVar($name);
1166
1167 return $fileID;
1168 }
1169
1170 function _ShowAttributes($arAttributes)
1171 {
1172 if (!is_array($arAttributes))
1173 return "";
1174
1175 $strReturn = "";
1176 foreach ($arAttributes as $name => $value)
1177 $strReturn .= ' '.htmlspecialcharsbx($name).'="'.htmlspecialcharsEx($value).'"';
1178
1179 return $strReturn;
1180 }
1181
1187 function GetWizard()
1188 {
1189 return $this->wizard;
1190 }
1191
1193 {
1194 $this->wizard = $wizard;
1195 }
1196
1197 function SetAutoSubmit($bool = true)
1198 {
1199 $this->autoSubmit = (bool)$bool;
1200 }
1201
1202 function IsAutoSubmit()
1203 {
1204 return (bool)$this->autoSubmit;
1205 }
1206
1207}
1208
1210{
1212
1213 function GetLayout()
1214 {
1215 $wizard = $this->GetWizard();
1216 $obStep = $wizard->GetCurrentStep();
1217
1218 $wizardName = htmlspecialcharsEx($wizard->GetWizardName());
1219 $formName = htmlspecialcharsbx($wizard->GetFormName());
1220
1221 $nextButtonID = htmlspecialcharsbx($wizard->GetNextButtonID());
1222 $prevButtonID = htmlspecialcharsbx($wizard->GetPrevButtonID());
1223 $cancelButtonID = htmlspecialcharsbx($wizard->GetCancelButtonID());
1224 $finishButtonID = htmlspecialcharsbx($wizard->GetFinishButtonID());
1225
1226 if (isset($GLOBALS["APPLICATION"]) && is_object($GLOBALS["APPLICATION"]))
1227 {
1228 $GLOBALS["APPLICATION"]->AddHeadString($styles);
1229 IncludeAJAX();
1230 }
1231 //IncludeAJAX();
1232
1233 $styles = <<<STYLES
1234<style type="text/css">
1235 /*Data table*/
1236 table.wizard-data-table
1237 {
1238 border:1px solid #7d7d7d;
1239 border-collapse:collapse;
1240 }
1241
1242 /*Any cell*/
1243 table.wizard-data-table td
1244 {
1245 border:1px solid #7d7d7d;
1246 background-color:#FFFFFF;
1247 padding:3px 5px;
1248 }
1249
1250 /*Head cell*/
1251 table.wizard-data-table thead td, table.wizard-data-table th
1252 {
1253 background-color:#F2F2EA;
1254 font-weight:normal;
1255 background-image:none;
1256 border:1px solid #7d7d7d;
1257 padding:4px;
1258 }
1259
1260 /*Body cell*/
1261 table.wizard-data-table tbody td
1262 {
1263 background-color:#FFF;
1264 background-image:none;
1265 }
1266
1267 /*Foot cell*/
1268 table.wizard-data-table tfoot td
1269 {
1270 background-color:#fff;
1271 padding:4px;
1272 }
1273
1274 .wizard-note-box
1275 {
1276 background:#EAE9E4;
1277 padding:7px;
1278 border:1px solid #797672;
1279 }
1280
1281 .wizard-required
1282 {
1283 color:red;
1284 }
1285</style>
1286STYLES;
1287 //$GLOBALS["APPLICATION"]->AddHeadString($styles);
1288
1289 $arErrors = $obStep->GetErrors();
1290 $strError = "";
1291 if (!empty($arErrors))
1292 {
1293 foreach ($arErrors as $arError)
1294 $strError .= $arError[0]."<br />";
1295
1296 $strError = '<tr><td style="padding-top: 10px; padding-left: 20px; color:red;">'.$strError.'</td></tr>';
1297 }
1298
1299 $stepTitle = $obStep->GetTitle();
1300 $stepSubTitle = $obStep->GetSubTitle();
1301
1302 $autoSubmit = "";
1303 if ($obStep->IsAutoSubmit())
1304 $autoSubmit = 'setTimeout("WizardAutoSubmit();", 500);';
1305
1306 $BX_ROOT = BX_ROOT;
1307
1308 $alertText = GetMessageJS("MAIN_WIZARD_WANT_TO_CANCEL");
1309 $loadingText = GetMessageJS("MAIN_WIZARD_WAIT_WINDOW_TEXT");
1310
1311 return <<<HTML
1312
1313{#FORM_START#}
1314<table style="border:2px outset #D4D0C8; background-color: #D4D0C8;" border="0" cellpadding="0" cellspacing="0" height="370" width="100%">
1315 <tr>
1316 <td style="background-color: #142F73" height="1"><span style="color:white; font-weight:bold; text-align:left; padding-left: 2px;">{$wizardName}</span></td>
1317 </tr>
1318
1319 <tr>
1320 <td style="height: 60px; border-bottom:2px groove #aca899; background-color: #ffffff; padding: 8px;" valign="top">
1321 <div style="padding-top: 5px; padding-left: 20px;"><b>{$stepTitle}</b></div>
1322 <div style="padding-left: 40px;">{$stepSubTitle}</div>
1323 </td>
1324 </tr>
1325
1326 {$strError}
1327
1328 <tr>
1329 <td style="padding: 20px; padding-left: 28px;padding-right: 28px;" valign="top" id="wizard-content-area" height="100%">{#CONTENT#}</td>
1330 </tr>
1331
1332 <tr>
1333 <td style="height: 40px; border-top:2px groove #ffffff; padding-right: 15px;" align="right">{#BUTTONS#}</td>
1334 </tr>
1335</table>
1336{#FORM_END#}
1337
1338<script>
1339
1340function WizardAutoSubmit()
1341{
1342 var nextButton = document.forms["{$formName}"].elements["{$nextButtonID}"];
1343 if (nextButton)
1344 {
1345 WaitWindow.Show();
1346
1347 nextButton.click();
1348 nextButton.disabled=true;
1349 }
1350}
1351
1352function WizardOnLoad()
1353{
1354 {$autoSubmit}
1355
1356 var cancelButton = document.forms["{$formName}"].elements["{$cancelButtonID}"];
1357 var nextButton = document.forms["{$formName}"].elements["{$nextButtonID}"];
1358 var prevButton = document.forms["{$formName}"].elements["{$prevButtonID}"];
1359 var finishButton = document.forms["{$formName}"].elements["{$finishButtonID}"];
1360
1361 if (cancelButton && !nextButton && !prevButton && !finishButton)
1362 cancelButton.onclick = CloseWindow;
1363 else if(cancelButton)
1364 cancelButton.onclick = ConfirmCancel;
1365}
1366
1367function CloseWindow()
1368{
1369 window.location = '/';
1370 return false;
1371}
1372
1373function ConfirmCancel()
1374{
1375 return (confirm("{$alertText}"));
1376}
1377
1378function CWaitWindow()
1379{
1380 this.Show = function()
1381 {
1382 try
1383 {
1384 var oDiv = document.createElement("DIV");
1385 oDiv.id = "__bx_wait_window";
1386 oDiv.style.width = "170px";
1387 oDiv.style.border = "1px solid #EACB6B";
1388 oDiv.style.textAlign = "center";
1389 oDiv.style.backgroundColor = "#FCF7D1";
1390 oDiv.style.position = "relative";
1391 oDiv.style.padding = "10px";
1392 oDiv.style.backgroundImage = "url({$BX_ROOT}/themes/.default/images/wait.gif)";
1393 oDiv.style.backgroundPosition = "10px center";
1394 oDiv.style.backgroundRepeat = "no-repeat";
1395 oDiv.style.left = "35%";
1396 oDiv.style.top = "50%";
1397 oDiv.style.zIndex = "3000";
1398 oDiv.innerHTML = "{$loadingText}";
1399 document.getElementById("wizard-content-area").appendChild(oDiv);
1400 }
1401 catch(e){}
1402 }
1403
1404 this.Hide = function()
1405 {
1406 try
1407 {
1408 var oDiv = document.getElementById("__bx_wait_window");
1409 oDiv.parentNode.removeChild(oDiv);
1410 oDiv = null;
1411 }catch(e){}
1412 }
1413}
1414
1415var WaitWindow = new CWaitWindow();
1416WizardOnLoad();
1417
1418</script>
1419
1420HTML;
1421 }
1422
1428 function GetWizard()
1429 {
1430 return $this->wizard;
1431 }
1432
1434 {
1435 $this->wizard = $wizard;
1436 }
1437
1438}
1439
1440
1442{
1443
1444 function GetLayout()
1445 {
1446 $wizard = $this->GetWizard();
1447
1448 $formName = htmlspecialcharsbx($wizard->GetFormName());
1449
1450 CUtil::InitJSCore(array("ajax"));
1451
1452 $adminPage = new CAdminPage();
1453 $adminScript = $adminPage->ShowScript();
1454
1455 $charset = LANG_CHARSET;
1456 $wizardName = htmlspecialcharsEx($wizard->GetWizardName());
1457
1458 $nextButtonID = htmlspecialcharsbx($wizard->GetNextButtonID());
1459 $prevButtonID = htmlspecialcharsbx($wizard->GetPrevButtonID());
1460 $cancelButtonID = htmlspecialcharsbx($wizard->GetCancelButtonID());
1461 $finishButtonID = htmlspecialcharsbx($wizard->GetFinishButtonID());
1462
1463 IncludeAJAX();
1464 $ajaxScripts = $GLOBALS["APPLICATION"]->GetHeadStrings();
1465 $ajaxScripts .= $GLOBALS["APPLICATION"]->GetHeadScripts();
1466
1467 $obStep = $wizard->GetCurrentStep();
1468 $arErrors = $obStep->GetErrors();
1469 $strError = $strJsError = "";
1470 if (!empty($arErrors))
1471 {
1472 foreach ($arErrors as $arError)
1473 {
1474 $strError .= $arError[0]."<br />";
1475
1476 if ($arError[1] !== false)
1477 $strJsError .= ($strJsError <> ""? ", ":"")."{'name':'".CUtil::addslashes($wizard->GetRealName($arError[1]))."', 'title':'".CUtil::addslashes(htmlspecialcharsback($arError[0]))."'}";
1478 }
1479
1480 if ($strError <> '')
1481 $strError = '<div id="step_error">'.$strError."</div>";
1482
1483 $strJsError = '
1484 <script>
1485 ShowWarnings(['.$strJsError.']);
1486 </script>';
1487 }
1488
1489 $stepTitle = $obStep->GetTitle();
1490 $stepSubTitle = $obStep->GetSubTitle();
1491
1492 $autoSubmit = "";
1493 if ($obStep->IsAutoSubmit())
1494 $autoSubmit = 'setTimeout("AutoSubmit();", 500);';
1495
1496 $alertText = GetMessageJS("MAIN_WIZARD_WANT_TO_CANCEL");
1497 $loadingText = GetMessageJS("MAIN_WIZARD_WAIT_WINDOW_TEXT");
1498
1499 $package = $wizard->GetPackage();
1500
1501 return <<<HTML
1502<!DOCTYPE html>
1503<html id="bx-admin-prefix">
1504<head>
1505 <head>
1506 <title>{$wizardName}</title>
1507 <meta http-equiv="X-UA-Compatible" content="IE=edge">
1508 <meta http-equiv="Content-Type" content="text/html; charset={$charset}">
1509 {$ajaxScripts}
1510 <style type="text/css">
1511 body
1512 {
1513 margin:0;
1514 padding:0;
1515 font-size: 13px;
1516 font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
1517 }
1518 table {font-size:100%;}
1519 form {margin:0; padding:0; }
1520
1521 a {
1522 color: #2675D7;
1523 text-decoration: underline;
1524 }
1525
1526
1527 .step-content {
1528 border: solid 1px #DCE7ED;
1529 background-color: #F5F9F9;
1530 height: 347px;
1531 overflow: auto;
1532 }
1533
1534 .step-header {
1535 border-bottom: 1px solid #DCE7ED;
1536 font-size: 12px;
1537 padding: 6px 30px 9px 9px;
1538 margin-bottom: 12px;
1539 }
1540
1541 .step-title { font-size: 16px; }
1542 .step-subtitle { font-size: 13px; }
1543
1544 .step-body {
1545 padding: 0 10px;
1546 }
1547
1548 .step-buttons
1549 {
1550 padding-top: 12px;
1551 padding-left: 2px;
1552 }
1553
1554 .step-buttons input:enabled {
1555 color:#3f4b54;
1556 }
1557
1558 .step-buttons input {
1559 -webkit-border-radius: 4px;
1560 border-radius: 4px;
1561 border:none;
1562 border-top:1px solid #fff;
1563 -webkit-box-shadow: 0 0 1px rgba(0,0,0,.11), 0 1px 1px rgba(0,0,0,.3), inset 0 1px #fff, inset 0 0 1px rgba(255,255,255,.5);
1564 box-shadow: 0 0 1px rgba(0,0,0,.3), 0 1px 1px rgba(0,0,0,.3), inset 0 1px #fff, inset 0 0 1px rgba(255,255,255,.5);
1565 background-image: -webkit-linear-gradient(bottom, #d7e3e7, #fff)!important;
1566 background-image: -moz-linear-gradient(bottom, #d7e3e7, #fff)!important;
1567 background-image: -ms-linear-gradient(bottom, #d7e3e7, #fff)!important;
1568 background-image: -o-linear-gradient(bottom, #d7e3e7, #fff)!important;
1569 background-image: linear-gradient(bottom, #d7e3e7, #fff)!important;
1570 cursor:pointer;
1571 display:inline-block;
1572 font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;
1573 font-weight:bold;
1574 font-size:13px;
1575 height: 29px;
1576 text-shadow:0 1px rgba(255,255,255,0.7);
1577 text-decoration:none;
1578 position:relative;
1579 vertical-align:middle;
1580 -webkit-font-smoothing: antialiased;
1581 padding: 0 13px 2px;
1582 margin-right: 3px;
1583 }
1584
1585 .step-buttons input:hover {
1586 text-decoration: none;
1587 background:#f3f6f7!important;
1588 background-image: -webkit-linear-gradient(top, #f8f8f9, #f2f6f8)!important;
1589 background-image: -moz-linear-gradient(top, #f8f8f9, #f2f6f8)!important;
1590 background-image: -ms-linear-gradient(top, #f8f8f9, #f2f6f8)!important;
1591 background-image: -o-linear-gradient(top, #f8f8f9, #f2f6f8)!important;
1592 background-image: linear-gradient(top, #f8f8f9, #f2f6f8)!important;
1593 }
1594
1595 .step-buttons input:active {
1596 -webkit-border-radius: 4px;
1597 border-radius: 4px;
1598 background-color: #b7c4c9!important;
1599 -webkit-box-shadow: inset 0 1px 1px 1px rgba(103,109,123,.78);
1600 box-shadow: inset 0 1px 1px 1px rgba(103,109,123,.78);
1601 background-image: -webkit-linear-gradient(top, rgba(179,194,200,.96), rgba(202,215,219,.96))!important;
1602 background-image: -moz-linear-gradient(top, rgba(179,194,200,.96), rgba(202,215,219,.96))!important;
1603 background-image: -ms-linear-gradient(top, rgba(179,194,200,.96), rgba(202,215,219,.96))!important;
1604 background-image: -o-linear-gradient(top, rgba(179,194,200,.96), rgba(202,215,219,.96))!important;
1605 background-image: linear-gradient(top, rgba(179,194,200,.96), rgba(202,215,219,.96))!important;
1606 border-top:transparent;
1607 height: 29px;
1608 outline:none;
1609 padding:2px 13px 1px;
1610 }
1611
1612 #step_error
1613 {
1614 color:red;
1615 padding:0 0 12px 0;
1616 }
1617
1618 #hidden-layer
1619 {
1620 background:#F8F9FC none repeat scroll 0%;
1621 height:100%;
1622 left:0pt;
1623 opacity:0.01;
1624 filter:alpha(opacity=1);
1625 -moz-opacity:0.01;
1626 position:absolute;
1627 top:0pt;
1628 width:100%;
1629 z-index:10001;
1630 }
1631
1632 /*Data table*/
1633 table.wizard-data-table { border:1px solid #B2C4DD; border-collapse:collapse;}
1634 table.wizard-data-table td { border:1px solid #B2C4DD; background-color:#FFFFFF; padding:3px 5px; }
1635 table.wizard-data-table thead td, table.wizard-data-table th {
1636 background-color:#E4EDF5;
1637 font-weight:normal;
1638 background-image:none;
1639 border:1px solid #B2C4DD;
1640 padding:4px;
1641 }
1642 table.wizard-data-table tbody td { background-color:#FFF; background-image:none; }
1643 table.wizard-data-table tfoot td { background-color:#F2F5F9; padding:4px; }
1644
1645 .wizard-note-box { background:#FEFDEA; padding:7px; border:1px solid #D7D6BA; }
1646 .wizard-required { color:red; }
1647
1648 .bx-session-message { display: none !important;}
1649
1650 </style>
1651
1652 {$adminScript}
1653
1654 <script>
1655
1656 top.BX.message({"ADMIN_WIZARD_EXIT_ALERT" : "{$alertText}"});
1657
1658 function OnLoad()
1659 {
1660 var dialog = top.BX.WindowManager.Get();
1661 if (dialog)
1662 dialog.SetTitle('{$wizardName}');
1663
1664 var form = document.forms["{$formName}"];
1665
1666 if (form)
1667 form.onsubmit = OnFormSubmit;
1668
1669 var cancelButton = document.forms["{$formName}"].elements["{$cancelButtonID}"];
1670 var nextButton = document.forms["{$formName}"].elements["{$nextButtonID}"];
1671 var prevButton = document.forms["{$formName}"].elements["{$prevButtonID}"];
1672 var finishButton = document.forms["{$formName}"].elements["{$finishButtonID}"];
1673
1674 if (cancelButton && !nextButton && !prevButton && !finishButton)
1675 {
1676 top.WizardWindow.isClosed = true;
1677 cancelButton.onclick = CloseWindow;
1678 }
1679 else if(cancelButton)
1680 {
1681 cancelButton.onclick = ConfirmCancel;
1682 }
1683
1684 {$autoSubmit}
1685 }
1686
1687 function OnFormSubmit()
1688 {
1689 var div = document.body.appendChild(document.createElement("DIV"));
1690 div.id = "hidden-layer";
1691 }
1692
1693 function AutoSubmit()
1694 {
1695 var nextButton = document.forms["{$formName}"].elements["{$nextButtonID}"];
1696 if (nextButton)
1697 {
1698 var wizard = top.WizardWindow;
1699 if (wizard)
1700 {
1701 wizard.messLoading = "{$loadingText}";
1702 wizard.ShowWaitWindow();
1703 }
1704
1705 nextButton.click();
1706 nextButton.disabled=true;
1707 }
1708 }
1709
1710 function ConfirmCancel()
1711 {
1712 return (confirm("{$alertText}"));
1713 }
1714
1715 function ShowWarnings(warnings)
1716 {
1717 var form = document.forms["{$formName}"];
1718 if(!form)
1719 return;
1720
1721 for(var i in warnings)
1722 {
1723 var e = form.elements[warnings[i]["name"]];
1724 if(!e)
1725 continue;
1726
1727 var type = (e.type? e.type.toLowerCase():"");
1728 var bBefore = false;
1729 if(e.length > 1 && type != "select-one" && type != "select-multiple")
1730 {
1731 e = e[0];
1732 bBefore = true;
1733 }
1734 if(type == "textarea" || type == "select-multiple")
1735 bBefore = true;
1736
1737 var td = e.parentNode;
1738 var img;
1739 if(bBefore)
1740 {
1741 img = td.insertBefore(new Image(), e);
1742 td.insertBefore(document.createElement("BR"), e);
1743 }
1744 else
1745 {
1746 img = td.insertBefore(new Image(), e.nextSibling);
1747 img.hspace = 2;
1748 img.vspace = 2;
1749 img.style.verticalAlign = "bottom";
1750 }
1751 img.src = "/bitrix/themes/"+phpVars.ADMIN_THEME_ID+"/images/icon_warn.gif";
1752 img.title = warnings[i]["title"];
1753 }
1754 }
1755
1756 document.onkeydown = EnterKeyPress;
1757
1758 function EnterKeyPress(event)
1759 {
1760
1761 event = event || window.event;
1762
1763 if (!event.ctrlKey)
1764 return;
1765
1766 var key = (event.keyCode ? event.keyCode : (event.which ? event.which : null) );
1767
1768 if (!key)
1769 return;
1770
1771 if (key == 13 || key == 39)
1772 {
1773 var nextButton = document.forms["{$formName}"].elements["{$nextButtonID}"];
1774 if (nextButton)
1775 nextButton.click();
1776 }
1777 else if (key == 37)
1778 {
1779 var prevButton = document.forms["{$formName}"].elements["{$prevButtonID}"];
1780 if (prevButton)
1781 prevButton.click();
1782 }
1783 }
1784
1785 function CloseWindow()
1786 {
1787 if (self.parent.window.WizardWindow)
1788 self.parent.window.WizardWindow.Close();
1789 }
1790
1791 </script>
1792
1793 </head>
1794
1795 <body onload="OnLoad();">
1796
1797 {#FORM_START#}
1798 <div class="step-content">
1799 <div class="step-header">
1800 <div class="step-title">{$stepTitle}</div>
1801 <div class="step-subtitle">{$stepSubTitle}</div>
1802 </div>
1803 <div class="step-body">
1804 {$strError}
1805 {#CONTENT#}
1806 </div>
1807
1808 </div>
1809 <div class="step-buttons">{#BUTTONS#}</div>
1810 {#FORM_END#}
1811 {$strJsError}
1812
1813 </body>
1814</html>
1815HTML;
1816
1817 }
1818
1819}
1820
1821?>
$type
Определения options.php:106
const BX_ROOT
Определения bx_root.php:3
Определения admin_lib.php:22
GetLayout()
Определения wizard.php:1444
Определения wizard.php:11
GetFormActionScript()
Определения wizard.php:348
GetFinishButtonID()
Определения wizard.php:414
__ShowError($errorMessage)
Определения wizard.php:624
GetPackage()
Определения wizard.php:450
SetFormName($formName)
Определения wizard.php:333
GetSiteGroupID()
Определения wizard.php:653
$variablePrefix
Определения wizard.php:31
$firstStepID
Определения wizard.php:16
$formName
Определения wizard.php:32
GetPath()
Определения wizard.php:638
SetVar($varName, $varValue)
Определения wizard.php:212
GetSiteTemplateID()
Определения wizard.php:645
GetCurrentStep()
Определения wizard.php:154
SetDefaultVars($arVars)
Определения wizard.php:300
$prevButtonID
Определения wizard.php:20
GetCancelButtonID()
Определения wizard.php:432
Display()
Определения wizard.php:455
SetCurrentStep($stepID)
Определения wizard.php:140
$package
Определения wizard.php:42
SetReturnOutput($mode=true)
Определения wizard.php:445
$currentStepHiddenID
Определения wizard.php:29
SetTemplate($obStepTemplate, $stepID=null)
Определения wizard.php:117
__SetComplexVar($varName, $value, &$arVars)
Определения wizard.php:247
$wizardSteps
Определения wizard.php:13
$nextButtonID
Определения wizard.php:19
SetPrevButtonID($buttonID)
Определения wizard.php:391
GetRealName($varName)
Определения wizard.php:275
$finishButtonID
Определения wizard.php:21
GetWizardName()
Определения wizard.php:328
SetFinishButtonID($buttonID)
Определения wizard.php:409
$returnOutput
Определения wizard.php:35
$prevStepHiddenID
Определения wizard.php:26
_DisplayStep()
Определения wizard.php:496
__DisplayHiddenVars($arVars, $oStep, $concatString=null)
Определения wizard.php:602
SetFirstStep($stepID)
Определения wizard.php:135
GetDefaultVars()
Определения wizard.php:323
IsFinishButtonClick()
Определения wizard.php:363
$wizardName
Определения wizard.php:12
AddStep($obStep, $stepID=null)
Определения wizard.php:77
__UnSetComplexVar($varName, &$arVars)
Определения wizard.php:261
GetNextButtonID()
Определения wizard.php:378
SetNextButtonID($buttonID)
Определения wizard.php:373
GetVar($varName, $useDefault=false)
Определения wizard.php:187
$formActionScript
Определения wizard.php:33
GetPrevButtonID()
Определения wizard.php:396
$cancelButtonID
Определения wizard.php:22
GetVarPrefix()
Определения wizard.php:280
GetSiteID()
Определения wizard.php:661
SetFormActionScript($actionScript)
Определения wizard.php:343
$currentStepID
Определения wizard.php:15
GetWizardSteps()
Определения wizard.php:162
SetDefaultVar($varName, $varValue)
Определения wizard.php:290
GetSiteServiceID()
Определения wizard.php:669
$useAdminTemplate
Определения wizard.php:40
IsCancelButtonClick()
Определения wizard.php:368
$defaultTemplate
Определения wizard.php:38
IsPrevButtonClick()
Определения wizard.php:358
$nextStepHiddenID
Определения wizard.php:25
UnSetVar($varName)
Определения wizard.php:222
AddSteps($arClasses)
Определения wizard.php:103
GetCancelStepID()
Определения wizard.php:437
GetPrevStepID()
Определения wizard.php:401
GetFormName()
Определения wizard.php:338
__GetComplexVar($varName, &$arVars)
Определения wizard.php:232
__GetStepLayout()
Определения wizard.php:578
DisableAdminTemplate()
Определения wizard.php:130
GetNextStepID()
Определения wizard.php:383
$defaultVars
Определения wizard.php:36
$cancelStepHiddenID
Определения wizard.php:28
SetVarPrefix($varPrefix)
Определения wizard.php:285
IsNextButtonClick()
Определения wizard.php:353
$finishStepHiddenID
Определения wizard.php:27
GetVars($useDefault=false)
Определения wizard.php:167
GetDefaultVar($varName)
Определения wizard.php:309
SetCancelButtonID($buttonID)
Определения wizard.php:427
GetID()
Определения wizard.php:631
$arTemplates
Определения wizard.php:39
GetCurrentStepID()
Определения wizard.php:146
__construct($wizardName, $package)
Определения wizard.php:44
GetFinishStepID()
Определения wizard.php:419
Определения wizard.php:681
SetCancelStep($stepID)
Определения wizard.php:837
SetFinishStep($stepID)
Определения wizard.php:817
__construct()
Определения wizard.php:704
SetPrevStep($stepID)
Определения wizard.php:797
$wizard
Определения wizard.php:699
$nextCaption
Определения wizard.php:691
$prevStepID
Определения wizard.php:687
InitStep()
Определения wizard.php:730
DisplayVarExists($varName)
Определения wizard.php:871
$finishCaption
Определения wizard.php:693
GetWizard()
Определения wizard.php:1187
GetDisplayVars()
Определения wizard.php:880
GetCancelCaption()
Определения wizard.php:852
GetPrevCaption()
Определения wizard.php:812
GetNextCaption()
Определения wizard.php:792
$content
Определения wizard.php:700
ShowCheckboxField($name, $value, $arAttributes=Array())
Определения wizard.php:928
SetStepID($stepID)
Определения wizard.php:767
$stepErrors
Определения wizard.php:697
$stepSubTitle
Определения wizard.php:683
SetError($strError, $id=false)
Определения wizard.php:885
GetErrors()
Определения wizard.php:890
OnPostForm()
Определения wizard.php:736
SetFinishCaption($caption)
Определения wizard.php:827
ShowSelectField($name, $arValues=Array(), $arAttributes=Array())
Определения wizard.php:999
$cancelStepID
Определения wizard.php:689
ShowFileField($name, $arAttributes=Array())
Определения wizard.php:1047
GetFinishCaption()
Определения wizard.php:832
GetTitle()
Определения wizard.php:752
$finishStepID
Определения wizard.php:688
_SetWizard($wizard)
Определения wizard.php:1192
SetNextCaption($caption)
Определения wizard.php:787
SetNextStep($stepID)
Определения wizard.php:777
$prevCaption
Определения wizard.php:692
SetTitle($title)
Определения wizard.php:747
SetAutoSubmit($bool=true)
Определения wizard.php:1197
$stepTitle
Определения wizard.php:682
ShowRadioField($name, $value, $arAttributes=Array())
Определения wizard.php:966
GetCancelStepID()
Определения wizard.php:842
GetPrevStepID()
Определения wizard.php:802
$displayVars
Определения wizard.php:696
$stepID
Определения wizard.php:684
SaveFile($name, $arRestriction=Array())
Определения wizard.php:1102
GetNextStepID()
Определения wizard.php:782
$autoSubmit
Определения wizard.php:702
ShowStep()
Определения wizard.php:742
ShowInputField($type, $name, $arAttributes=Array())
Определения wizard.php:896
GetStepID()
Определения wizard.php:772
SetPrevCaption($caption)
Определения wizard.php:807
SetCancelCaption($caption)
Определения wizard.php:847
$nextStepID
Определения wizard.php:686
_ShowAttributes($arAttributes)
Определения wizard.php:1170
$cancelCaption
Определения wizard.php:694
SetSubTitle($stepSubTitle)
Определения wizard.php:757
ShowHiddenField($name, $value, $arAttributes=Array())
Определения wizard.php:1034
IsAutoSubmit()
Определения wizard.php:1202
GetFinishStepID()
Определения wizard.php:822
GetSubTitle()
Определения wizard.php:762
SetDisplayVars($arVars)
Определения wizard.php:857
Определения wizard.php:1210
$wizard
Определения wizard.php:1211
GetLayout()
Определения wizard.php:1213
GetWizard()
Определения wizard.php:1428
_SetWizard($wizard)
Определения wizard.php:1433
static CreateThumbnail($sourcePath, $previewPath, $maxWidth, $maxHeight)
Определения wizard_util.php:384
$arValues
Определения component_props.php:25
collapse(node)
Определения ebay_mip_setup.php:316
$template
Определения file_edit.php:49
hidden PROPERTY[<?=$propertyIndex?>][CODE]<?=htmlspecialcharsEx( $propertyCode)?> height
Определения file_new.php:759
bx popup label bx width30 PAGE_NEW_MENU_NAME text width
Определения file_new.php:677
bx popup label bx hidden PROPERTY[<?=$propertyIndex?>][CODE]<?=htmlspecialcharsEx( $propertyCode)?> bx_view_property_<?=$propertyIndex?> overflow
Определения file_new.php:745
background position
Определения file_new.php:745
background repeat
Определения file_new.php:745
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
background color
Определения file_new.php:745
bx_acc_lim_group_list limitGroupList[] multiple<?=$group[ 'ID']?> ID selected margin top
Определения file_new.php:657
<? if( $useEditor3):?>< tr class="heading">< td colspan="2"><? echo GetMessage("FILEMAN_OPTION_SPELL_SET");?></td ></tr ><? if(function_exists( 'pspell_config_create')):$use_pspell_checked=(COption::GetOptionString( $module_id, "use_pspell", "Y")=="Y") ? "checked" :"";?>< tr >< td valign="top">< label for="use_pspell"><?echo GetMessage("FILEMAN_OPTION_USE_PSPELL");?></label >< br >< a title="<?echo GetMessage("FILEMAN_OPTION_ADDISH_DICS_TITLE");?> http
Определения options.php:1473
hidden mSiteList<?=htmlspecialcharsbx(serialize( $siteList))?><?=htmlspecialcharsbx( $siteList[ $j]["ID"])?> _Propery<? if(((COption::GetOptionString( $module_id, "different_set", "N")=="Y") &&( $j !=0))||(COption::GetOptionString( $module_id, "different_set", "N")=="N")) echo "display: none;"?> top adm detail content cell l top adm detail content cell r heading center center ID left
Определения options.php:768
$_REQUEST["admin_mnu_menu_id"]
Определения get_menu.php:8
$arClasses
Определения autoload.php:8
while($arParentIBlockProperty=$dbParentIBlockProperty->Fetch()) $errorMessage
global $adminPage
Определения init_admin.php:7
$output
Определения options.php:436
$strError
Определения options_user_settings.php:4
$_SERVER["DOCUMENT_ROOT"]
Определения cron_frame.php:9
$success
Определения mail_entry.php:69
const LANG_CHARSET
Определения include.php:65
if($NS['step']==6) if( $NS[ 'step']==7) if(COption::GetOptionInt('main', 'disk_space', 0) > 0) $info
Определения backup.php:924
htmlspecialcharsback($str)
Определения tools.php:2693
htmlspecialcharsEx($str)
Определения tools.php:2685
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
Определения tools.php:2701
IncludeAJAX()
Определения tools.php:4719
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
Определения tools.php:3778
GetMessage($name, $aReplace=null)
Определения tools.php:3397
GetMessageJS($name, $aReplace=false)
Определения tools.php:3392
$name
Определения menu_edit.php:35
return false
Определения prolog_main_admin.php:185
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
<? endif;?> window document title
Определения prolog_main_admin.php:76
const ADMIN_SECTION
Определения rss.php:2
font style
Определения invoice.php:442
font size
Определения invoice.php:442
</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
text align
Определения template.php:556
$title
Определения pdf.php:123
$optionName
Определения options.php:1735
$optionValue
Определения options.php:3512
border radius
Определения options_user_settings.php:273
margin right
Определения options_user_settings.php:273
$error
Определения subscription_card_product.php:20
$GLOBALS['_____370096793']
Определения update_client.php:1
adm detail iblock types adm detail iblock list tr_SITE_ID display
Определения yandex_setup.php:388