Skip to content

Instantly share code, notes, and snippets.

@4yvi
Last active June 29, 2017 14:30
Show Gist options
  • Save 4yvi/8dbdfc79a9ea4d16da81b29faef0c486 to your computer and use it in GitHub Desktop.
Save 4yvi/8dbdfc79a9ea4d16da81b29faef0c486 to your computer and use it in GitHub Desktop.
Создание попапа в админке
CJSCore::Init(array('window'));
/**
* Формирует ссылку на попап
* @param array $arInput
*
* @return string;
* */
function createLinkPopup($arInput){
$arDefault = [
'width' => 500,
'height' => 200,
'buttons' => [
'[code]BX.CDialog.prototype.btnClose[code]',
],
];
$ar = array_merge($arInput, $arDefault);
return 'javascript:(new BX.CDialog('.str_replace(
'[code]\'',
'',
str_replace(
'\'[code]',
'',
CUtil::PhpToJsObject($ar)
)
).')).Show()';
}
// Создаем ссылки на информацию о социальных сетях
$arResult['INFO_URL']['VK'] = createLinkPopup(
[
'title' => Loc::getMessage('OPTONS_VK_INFO_TITLE'),
'content' => Loc::getMessage('PTONS_VK_INFO_CONTENT')
]
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment