'Popup window title', 'ARGS' => 'param1=values1¶m2=value2', // additional GET arguments for POST query ) */ public function __construct($title = '', $arConfig = array()) { if ($title != '') $this->SetTitle($title); if (is_set($arConfig, 'TITLE')) $this->SetTitle($arConfig['TITLE']); if (is_set($arConfig, 'ARGS')) $this->SetAdditionalArgs($arConfig['ARGS']); if (is_set($arConfig, 'SUFFIX') && $arConfig['SUFFIX'] <> '') $this->SetSuffix($arConfig['SUFFIX']); } function InitSystem() { /** @global CMain $APPLICATION */ global $APPLICATION; if (!$this->bInited && (!isset($_REQUEST['bxsender']) || $_REQUEST['bxsender'] != 'core_window_cauthdialog')) { $this->InitScripts(); $APPLICATION->AddBufferContent(array($this, "_InitSystem")); $APPLICATION->ShowHeadStrings(); $APPLICATION->ShowHeadScripts(); $this->bInited = true; } } function _InitSystem() { $adminPage = new CAdminPage(); return $adminPage->ShowPopupCSS(). $adminPage->ShowScript(); } function InitScripts() { CJSCore::Init(array('admin_interface')); } function SetAdditionalArgs($additional_args = '') { $this->post_args = $additional_args; } function SetTitle($title = '') { $this->title = trim($title); } function GetFormName() { return $this->__form_name; } function SetSuffix($suffix) { $this->suffix = '_'.trim($suffix); $this->__form_name .= $this->suffix; } function ShowTitlebar($title = '') { $this->InitSystem(); if ($title == '') $title = $this->title; ?> InitSystem(); $this->bDescriptionStarted = true; ?> '; $this->bDescriptionStarted = false; } } function StartContent($arAdditional = array()) { $this->InitSystem(); $this->EndDescription(); $this->bContentStarted = true; if (isset($arAdditional['buffer']) && $arAdditional['buffer']) { $this->bContentBuffered = true; //ob_start(); $this->cont_id = RandString(10); echo 'bContentStarted = false; } } function StartButtons() { $this->InitSystem(); $this->EndDescription(); $this->EndContent(); $this->bButtonsStarted = true; ob_start(); } function EndButtons() { if ($this->bButtonsStarted) { $buttons = ob_get_contents(); ob_end_clean(); ?> bButtonsStarted = false; } } function ShowStandardButtons($arButtons = array('save', 'cancel')) { $this->InitSystem(); if (!is_array($arButtons)) return; if ($this->bButtonsStarted) { $this->EndButtons(); } $arSB = array('save' => $this->jsPopup.'.btnSave', 'cancel' => $this->jsPopup.'.btnCancel', 'close' => $this->jsPopup.'.btnClose'); foreach ($arButtons as $key => $value) if (!$arSB[$value]) unset($arButtons[$key]); $arButtons = array_values($arButtons); ?> EndDescription(); echo ''; } function ShowError($errortext, $title = '') { $this->ShowTitlebar($title != "" ? $title : $this->title); if (!$this->bDescriptionStarted) $this->StartDescription(); ShowError($errortext); $this->ShowStandardButtons(array("close")); echo ''; require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog_admin_js.php"); exit(); } function Close($bReload = true, $back_url = false) { if (!$back_url && is_set($_REQUEST, 'back_url')) $back_url = $_REQUEST['back_url']; if(!str_starts_with($back_url, "/") || substr($back_url,1,1) == "/") { //only local /url is allowed $back_url = ''; } echo ''; die(); } } class CJSPopupOnPage extends CJSPopup { function InitSystem() {} // this SHOULD be empty! }