本文整理汇总了PHP中CUtil::jSEscape方法的典型用法代码示例。如果您正苦于以下问题:PHP CUtil::jSEscape方法的具体用法?PHP CUtil::jSEscape怎么用?PHP CUtil::jSEscape使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUtil
的用法示例。
在下文中一共展示了CUtil::jSEscape方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: processActionOpenDialog
protected function processActionOpenDialog()
{
$selectedService = '';
$fakeMove = $this->request->getQuery('wish') === 'fakemove';
$enabledMultiSelect = $this->request->getQuery('multiselect') !== 'N';
if ($this->request->getQuery('cloudImport')) {
$list = $this->listCloudStorages();
$types = array('cloud' => array('id' => 'cloud', 'order' => 4));
$selectedService = $this->request->getQuery('service');
} else {
$list = $this->listStorages();
if (!$list) {
$this->sendJsonErrorResponse();
}
$types = array('recently_used' => array('id' => 'recently_used', 'order' => 1, 'searchable' => false), 'user' => array('id' => 'user', 'order' => 2, 'searchable' => false), 'common' => array('id' => 'common', 'name' => Loc::getMessage('DISK_UF_CONTROLLER_SHARED_DOCUMENTS'), 'order' => 3, 'searchable' => false), 'group' => array('id' => 'group', 'name' => Loc::getMessage('DISK_UF_CONTROLLER_MY_GROUPS'), 'order' => 4, 'searchable' => false));
if ($fakeMove) {
unset($types['recently_used']);
}
}
$dialogName = $this->request->getQuery('dialogName');
if (strlen($dialogName) <= 0) {
$dialogName = 'DiskFileDialog';
}
$dialogTitle = Loc::getMessage($fakeMove ? 'DISK_UF_CONTROLLER_SAVE_DOCUMENT_TITLE' : 'DISK_UF_CONTROLLER_SELECT_DOCUMENT_TITLE');
if (!$fakeMove && !$enabledMultiSelect) {
$dialogTitle = Loc::getMessage('DISK_UF_CONTROLLER_SELECT_ONE_DOCUMENT_TITLE');
}
$js = "\n\t\t\t<script>\n\t\t\t\tBX.DiskFileDialog.init({\n\t\t\t\t\t'currentTabId': '" . \CUtil::jSEscape($selectedService) . "',\n\t\t\t\t\t'name' : '" . \CUtil::jSEscape($dialogName) . "',\n\n\t\t\t\t\t'bindPopup' : { 'node' : null, 'offsetTop' : 0, 'offsetLeft': 0},\n\n\t\t\t\t\t'localize' : {\n\t\t\t\t\t\t'title' : '" . \CUtil::jSEscape($dialogTitle) . "',\n\t\t\t\t\t\t'saveButton' : '" . \CUtil::jSEscape(Loc::getMessage($fakeMove ? 'DISK_UF_CONTROLLER_SELECT_FOLDER' : 'DISK_UF_CONTROLLER_SELECT_DOCUMENT')) . "',\n\t\t\t\t\t\t'cancelButton' : '" . \CUtil::jSEscape(Loc::getMessage('DISK_UF_CONTROLLER_CANCEL')) . "'\n\t\t\t\t\t},\n\n\t\t\t\t\t'callback' : {\n\t\t\t\t\t\t'saveButton' : function(tab, path, selected) {},\n\t\t\t\t\t\t'cancelButton' : function(tab, path, selected) {}\n\t\t\t\t\t},\n\n\t\t\t\t\t'type' : " . \CUtil::phpToJSObject($types) . ",\n\t\t\t\t\t'typeItems' : " . \CUtil::phpToJSObject($list) . ",\n\t\t\t\t\t'items' : {},\n\n\t\t\t\t\t'itemsDisabled' : {},\n\t\t\t\t\t'itemsSelected' : {},\n\t\t\t\t\t'itemsSelectEnabled' : " . ($fakeMove ? '{folder: true}' : "{'onlyFiles' : true}") . ", // all, onlyFiles, folder, archive, image, file, video, txt, word, excel, ppt\n\t\t\t\t\t'itemsSelectMulti' : " . ($fakeMove || !$enabledMultiSelect ? 'false' : 'true') . ",\n\n\t\t\t\t\t'gridColumn' : {\n\t\t\t\t\t\t'name' : {'id' : 'name', 'name' : '" . \CUtil::jSEscape(Loc::getMessage('DISK_UF_CONTROLLER_TITLE_NAME')) . "', 'sort' : 'name', 'style': 'width: 310px', 'order': 1},\n\t\t\t\t\t\t'size' : {'id' : 'size', 'name' : '" . \CUtil::jSEscape(Loc::getMessage('DISK_UF_CONTROLLER_FILE_SIZE')) . "', 'sort' : 'sizeInt', 'style': 'width: 79px', 'order': 2},\n\t\t\t\t\t\t'modifyBy' : {'id' : 'modifyBy', 'name' : '" . \CUtil::jSEscape(Loc::getMessage('DISK_UF_CONTROLLER_TITLE_MODIFIED_BY')) . "', 'sort' : 'modifyBy', 'style': 'width: 122px', 'order': 3},\n\t\t\t\t\t\t'modifyDate' : {'id' : 'modifyDate', 'name' : '" . \CUtil::jSEscape(Loc::getMessage('DISK_UF_CONTROLLER_TITLE_TIMESTAMP')) . "', 'sort' : 'modifyDateInt', 'style': 'width: 90px', 'order': 4}\n\t\t\t\t\t},\n\t\t\t\t\t'gridOrder' : {'column': 'modifyDateInt', 'order':'desc'}\n\t\t\t\t});\n\t\t\t</script>\n\t\t\t\t";
$this->sendResponse($js);
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:30,代码来源:controller.php本文标签属性:
示例:示例是什么意思
代码:代码大全可复制
PHP:PHP
CUtil:CUtil
jSEscape:jSEscape