Здесь код с минимальными комментариями[spoiler]
Метод генерирует JS, открывающий URL в popup-окне
Если хочется самому:
Все это счастье находится в JS библиотеке /bitrix/js/main/core/core_window.js
Вот описание параметров
Метод генерирует JS, открывающий URL в popup-окне
$APPLICATION->GetPopupLink( array( 'URL' => 'url_to_page', 'PARAMS' => array( 'width' => 780, 'height' => 570, 'resizable' => true, 'min_width' => 780, 'min_height' => 570 )) ); |
CUtil::InitJSCore(array('window', 'ajax'));
$arDialogParams = array(
//'content_url' => $arUrl['URL'],
'title' => $arUrl['PARAMS']['title'],
'head' => $arUrl['PARAMS']['head'],
'content' => $arUrl['PARAMS']['content'],
'icon' => $arUrl['PARAMS']['icon'],
'resize_id' => $arUrl['PARAMS']['resize_id'],
'width' => $arUrl['PARAMS']['width'],
'height' => $arUrl['PARAMS']['height'],
'min_width' => $arUrl['PARAMS']['min_width'],
'min_height' => $arUrl['PARAMS']['min_height'],
'resizable' => false,
'draggable' => false,
'content_post' => '',
);
$href = '(new BX .CDialog('.CUtil::PhpToJsObject($arDialogParams).')).Show()';
|
Все это счастье находится в JS библиотеке /bitrix/js/main/core/core_window.js
Вот описание параметров
/* standard bitrix dialog extends BX.CWindowDialog */ /* arParams = { ( title: 'dialog title', head: 'head block html', content: 'dialog content', icon: 'head icon classname or filename', resize_id: 'some id to save resize information'// useless if resizable = false ![]() or ( content_url: url to content load loaded content scripts can use BX.WindowManager.Get() to get access to the current window object ![]() height: window_height_in_pixels, width: window_width_in_pixels, draggable: true|false, resizable: true|false, min_height: min_window_height_in_pixels, // useless if resizable = false min_width: min_window_width_in_pixels, // useless if resizable = false buttons: [ 'html_code', BX.CDialog.btnSave, BX.CDialog.btnCancel, BX.CDialog.btnClose ] } */ |
