Last active
June 29, 2017 14:30
-
-
Save 4yvi/8dbdfc79a9ea4d16da81b29faef0c486 to your computer and use it in GitHub Desktop.
Создание попапа в админке
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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