本文整理汇总了PHP中sensitiveIO::jsonEncode方法的典型用法代码示例。如果您正苦于以下问题:PHP sensitiveIO::jsonEncode方法的具体用法?PHP sensitiveIO::jsonEncode怎么用?PHP sensitiveIO::jsonEncode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sensitiveIO
的用法示例。
在下文中一共展示了sensitiveIO::jsonEncode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isset
} else {
$version = isset($objectsInfo['version']) ? $objectsInfo['version'] : 4;
if (isset($objectsInfo['description'])) {
$description = ' ext:qtip="' . io::htmlspecialchars($objectsInfo['description']) . '"';
unset($objectsInfo['description']);
} else {
$description = '';
}
if (isset($objectsInfo['adminLabel'])) {
$label = io::htmlspecialchars($objectsInfo['adminLabel']);
unset($objectsInfo['adminLabel']);
} else {
$label = $cms_language->getMessage(MESSAGE_PAGE_MODULE_ADMIN, array(io::htmlspecialchars($module->getLabel($cms_language))));
}
$class = isset($objectsInfo['class']) ? $objectsInfo['class'] : 'atm-modules';
$contentEl .= '<li><div class="' . $class . ' atm-sidepic"></div><a atm:action="module"' . $description . ' atm:module="' . $module->getCodename() . '" atm:version="' . $version . '" atm:options="' . io::htmlspecialchars(sensitiveIO::jsonEncode($objectsInfo)) . '" href="#">' . $label . '</a></li>';
}
}
}
$contentEl .= '
</ul>
</div>';
//panel
$modulesPanels .= "{\n\t\t\t\tid:\t\t\t\t\t'module{$module->getCodename()}SidePanel',\n\t\t\t\tframe:\t\t\t\ttrue,\n\t\t\t\ttitle: \t\t\t\t'{$modLabel}',\n\t\t\t\tcollapsible:\t\ttrue,\n\t\t\t\ttitleCollapse: \t\ttrue,\n\t\t\t\tcollapsed:\t\t\ttrue,\n\t\t\t\thtml:\t\t\t\t'" . sensitiveIO::sanitizeJSString($contentEl) . "',\n\t\t\t\tlisteners:\t\t\t{'expand': scrollPanel}";
//add modules parameters
if ($cms_user->hasAdminClearance(CLEARANCE_ADMINISTRATION_EDITVALIDATEALL)) {
$modulesPanels .= ",\n\t\t\t\thideCollapseTool:\ttrue,\n\t\t\t\ttools: [{\n\t\t\t\t\tid:\t\t\t\t'gear',\n\t\t\t\t\thandler:\t\tfunction(e, toolEl, panel){\n\t\t\t\t\t\tvar window = new Automne.frameWindow({\n\t\t\t\t\t\t\tid:\t\t\t\t'modulesWindow',\n\t\t\t\t\t\t\tframeURL:\t\t'" . PATH_MAIN_WR . "/admin-v3/modules_admin.php?moduleCodename={$module->getCodename()}',\n\t\t\t\t\t\t\tallowFrameNav:\ttrue,\n\t\t\t\t\t\t\twidth:\t\t\t750,\n\t\t\t\t\t\t\theight:\t\t\t580,\n\t\t\t\t\t\t\tanimateTarget:\te\n\t\t\t\t\t\t});\n\t\t\t\t\t\twindow.show();\n\t\t\t\t\t},\n\t\t\t\t\tqtip:\t\t\t'" . $cms_language->getMessage(MESSAGE_PAGE_MODULE_PARAMETERS) . "'\n\t\t\t\t}, {\n\t\t\t\t\tid:\t\t\t\t'toggle',\n\t\t\t\t\thandler:\t\tfunction(e, toolEl, panel){\n\t\t\t\t\t\tpanel.toggleCollapse(true);\n\t\t\t\t\t}\n\t\t\t\t}]";
}
$modulesPanels .= "\n\t\t\t},";
}
}
示例2: array
if (!$module || !$module->isPolymod()) {
CMS_grandFather::raiseError('Unknown module or module is not polymod for codename : ' . $codename);
$view->show();
}
//CHECKS user has module clearance
if (!$cms_user->hasModuleClearance($codename, CLEARANCE_MODULE_EDIT)) {
CMS_grandFather::raiseError('User has no rights on module : ' . $codename);
$view->setActionMessage($cms_language->getmessage(MESSAGE_ERROR_MODULE_RIGHTS, array($module->getLabel($cms_language))));
$view->show();
}
//load current object definition
$object = CMS_poly_object_catalog::getObjectDefinition($objectId);
$winLabel = sensitiveIO::sanitizeJSString($cms_language->getMessage(MESSAGE_MULTI_OBJECT_CHOOSE_ELEMENT, array($object->getObjectLabel($cms_language)), MOD_POLYMOD_CODENAME));
$md5 = md5(mt_rand() . microtime());
$url = PATH_ADMIN_MODULES_WR . '/polymod/item-selector.php';
$params = sensitiveIO::jsonEncode(array('winId' => 'selector-' . $md5, 'objectId' => $object->getID(), 'module' => $codename, 'multiple' => $unique ? 0 : 1));
$unique = $unique ? '1' : '0';
//this is only an single item selection, so help selection a little
$jscontent = <<<END
\tvar window = Ext.getCmp('{$winId}');
\t//set window title
\twindow.setTitle('{$winLabel}');
\t//set help button on top of page
\twindow.tools['help'].show();
\t//add a tooltip on button
\tvar propertiesTip = new Ext.ToolTip({
\t\ttarget:\t\t window.tools['help'],
\t\ttitle:\t\t\t '{$cms_language->getJsMessage(MESSAGE_TOOLBAR_HELP)}',
\t\thtml:\t\t\t '{$cms_language->getJsMessage(MESSAGE_TOOLBAR_HELP_DESC, false, MOD_POLYMOD_CODENAME)}',
\t\tdismissDelay:\t0
\t});
示例3: CMS_file
$maxFileSize = CMS_file::getMaxUploadFileSize('K');
if ($rawDatas['file'] && file_exists(PATH_MODULES_FILES_STANDARD_FS . '/edition/' . $rawDatas['file'])) {
$file = new CMS_file(PATH_MODULES_FILES_STANDARD_FS . '/edition/' . $rawDatas['file']);
$fileDatas = array('filename' => $file->getName(false), 'filepath' => $file->getFilePath(CMS_file::WEBROOT), 'filesize' => $file->getFileSize(), 'fileicon' => $file->getFileIcon(CMS_file::WEBROOT), 'extension' => $file->getExtension());
} else {
$fileDatas = array('filename' => '', 'filepath' => '', 'filesize' => '', 'fileicon' => '', 'extension' => '');
}
$filePath = $fileDatas['filepath'];
$fileDatas = sensitiveIO::jsonEncode($fileDatas);
if ($rawDatas['enlargedFile'] && file_exists(PATH_MODULES_FILES_STANDARD_FS . '/edition/' . $rawDatas['enlargedFile'])) {
$file = new CMS_file(PATH_MODULES_FILES_STANDARD_FS . '/edition/' . $rawDatas['enlargedFile']);
$zoomDatas = array('filename' => $file->getName(false), 'filepath' => $file->getFilePath(CMS_file::WEBROOT), 'filesize' => $file->getFileSize(), 'fileicon' => $file->getFileIcon(CMS_file::WEBROOT), 'extension' => $file->getExtension());
} else {
$zoomDatas = array('filename' => '', 'filepath' => '', 'filesize' => '', 'fileicon' => '', 'extension' => '');
}
$zoomDatas = sensitiveIO::jsonEncode($zoomDatas);
$linkDatas = sensitiveIO::sanitizeJSString($rawDatas['externalLink']);
$imageLabel = sensitiveIO::sanitizeJSString($rawDatas["label"]);
$jscontent = <<<END
\tvar blockWindow = Ext.getCmp('{$winId}');
\t//set window title
\t
\tblockWindow.setTitle('{$cms_language->getJsMessage(MESSAGE_EDIT_IMG)}');
\t//set help button on top of page
\tblockWindow.tools['help'].show();
\t//add a tooltip on button
\tvar propertiesTip = new Ext.ToolTip({
\t\ttarget:\t\t blockWindow.tools['help'],
\t\ttitle:\t\t\t '{$cms_language->getJsMessage(MESSAGE_TOOLBAR_HELP)}',
\t\thtml:\t\t\t '{$cms_language->getJsMessage(MESSAGE_WINDOW_IMG_INFO)}',
\t\tdismissDelay:\t0
示例4: array
CMS_grandFather::raiseError('Error, user has no rights item ' . $itemId);
$jscontent = "\n\t\tvar window = Ext.getCmp('{$winId}');\n\t\tif (window) {\n\t\t\twindow.close();\n\t\t}\n\t\tAutomne.message.popup({\n\t\t\tmsg: \t\t\t\t'{$cms_language->getJSMessage(MESSAGE_PAGE_ELEMENT_EDIT_RIGHTS_ERROR, array($itemLabel), MOD_POLYMOD_CODENAME)}',\n\t\t\tbuttons: \t\t\tExt.MessageBox.OK,\n\t\t\tclosable: \t\t\tfalse,\n\t\t\ticon: \t\t\t\tExt.MessageBox.ERROR\n\t\t});";
$view->addJavascript($jscontent);
$view->show();
}
} else {
//instanciate clean object (creation)
$item = new CMS_poly_object($object->getID(), '');
}
$winLabel = sensitiveIO::sanitizeJSString($cms_language->getMessage(MESSAGE_PAGE_TITLE_MODULE, array($cms_module->getLabel($cms_language))) . " :: " . $cms_language->getMessage(MESSAGE_PAGE_TITLE, array($object->getLabel($cms_language)), MOD_POLYMOD_CODENAME));
$fieldsObjects = $item->getFieldsObjects();
$itemFields = '';
foreach ($fieldsObjects as $fieldID => $aFieldObject) {
$fieldAdmin = $item->getHTMLAdmin($fieldID, $cms_language, '');
if (is_array($fieldAdmin)) {
$itemFields .= sensitiveIO::jsonEncode($fieldAdmin) . ',';
}
}
//do some search and replace to allow use of js functions in returned code
$itemFields = str_replace('"scope":"this"', '"scope":this', $itemFields);
function replaceCallBack($parts)
{
return 'function(' . str_replace(array('\\"', '\\/'), array('"', '/'), $parts[1]) . '}';
}
$itemFields = preg_replace_callback('#"function\\((.*)}"#U', 'replaceCallBack', $itemFields);
//Append pub dates if object is a primary resource
$saveAndValidate = '';
$saveIconCls = $saveTooltip = '';
if ($object->isPrimaryResource()) {
if (!$item->getID()) {
$dt = new CMS_date();
示例5: foreach
foreach ($allGroups as $aGroup) {
$searchPanel .= "{boxLabel: '{$aGroup}', inputValue:'{$aGroup}', name: 'groups[]', listeners: {'check':rowWindow.search}},";
}
//remove last comma from groups
$searchPanel = io::substr($searchPanel, 0, -1);
$searchPanel .= "\n\t\t]\n\t},";
}
$modules = CMS_modulesCatalog::getAll();
if (sizeof($modules) > 1) {
$modulesDatas = array();
$modulesDatas['module'] = array(array('id' => 0, 'label' => '-'));
foreach ($modules as $module) {
$modulesDatas['module'][] = array('id' => $module->getCodename(), 'label' => $module->getLabel($cms_language));
}
//json encode websites datas
$modulesDatas = sensitiveIO::jsonEncode($modulesDatas);
$searchPanel .= "{\n\t\txtype:\t\t\t\t'combo',\n\t\tid:\t\t\t\t\t'moduleField',\n\t\tname:\t\t\t\t'module',\n\t\tfieldLabel:\t\t\t'{$cms_language->getJSMessage(MESSAGE_PAGE_MODULES)}',\n\t\tanchor:\t\t\t\t'-20px',\n\t\tforceSelection:\t\ttrue,\n\t\tmode:\t\t\t\t'local',\n\t\ttriggerAction:\t\t'all',\n\t\tvalueField:\t\t\t'id',\n\t\thiddenName: \t\t'module',\n\t\tdisplayField:\t\t'label',\n\t\tstore:\t\t\t\tnew Ext.data.JsonStore({\n\t\t\tid:\t\t\t\t'id',\n\t\t\troot: \t\t\t'module',\n\t\t\tfields: \t\t['id', 'label'],\n\t\t\tdata:\t\t\t{$modulesDatas}\n\t\t}),\n\t\tvalidateOnBlur:\t\tfalse,\n\t\tallowBlank: \t\ttrue,\n\t\tselectOnFocus:\t\ttrue,\n\t\teditable:\t\t\ttrue,\n\t\ttypeAhead:\t\t\ttrue,\n\t\tlisteners:\t\t\t{'valid':rowWindow.search}\n\t},";
}
$searchPanel .= "{\n\txtype:\t\t\t'atmPageField',\n\tfieldLabel:\t\t'{$cms_language->getJSMessage(MESSAGE_PAGE_PAGE)}',\n\tname:\t\t\t'page',\n\tvalue:\t\t\t'',\n\tanchor:\t\t\t'-20px',\n\tallowBlank:\t\ttrue,\n\tvalidateOnBlur:\tfalse,\n\tlisteners:\t\t{'valid':{\n\t\tfn: \t\t\trowWindow.search,\n\t\toptions:\t\t{buffer:300}\n\t}}\n},";
$searchPanel .= "{\n\thideLabel:\t\ttrue,\n\tlabelSeparator:\t'',\n\tlabelAlign:\t\t'left',\n\txtype:\t\t\t'checkbox',\n\tboxLabel: \t\t'{$cms_language->getJSMessage(MESSAGE_PAGE_VIEW_INACTIVE_ROWS)}',\n\tname: \t\t\t'viewinactive',\n\tinputValue:\t\t'1',\n\tchecked:\t\ttrue,\n\tlisteners: \t\t{'check':rowWindow.search}\n}";
//$searchPanel = io::substr($searchPanel, 0, -1);
$jscontent = <<<END
\tvar rowWindow = Ext.getCmp('{$winId}');
\tvar fatherWindow = Ext.getCmp('{$fatherId}');
\t//define update function into window (to be accessible by parent window)
\trowWindow.updateTab = function() {
\t\t//reload search
\t\trowWindow.search();
\t}
\t//define search function into window (to be accessible by parent window)
示例6: array
if ($searchParamContent) {
$items[] = array('title' => $cms_language->getMessage(MESSAGE_PAGE_SUBTITLE, array($searchName), MOD_POLYMOD_CODENAME), 'xtype' => 'fieldset', 'autoHeight' => true, 'defaults' => array('anchor' => '97%'), 'items' => $searchParamContent);
}
} else {
$cms_message .= $cms_language->getMessage(MESSAGE_PAGE_SEARCH_ROW_ERROR, array($searchName, $row->getLabel()), MOD_POLYMOD_CODENAME) . "\n";
}
}
}
$items = sensitiveIO::jsonEncode($items);
$itemControler = PATH_ADMIN_MODULES_WR . '/' . MOD_POLYMOD_CODENAME . '/items-controler.php';
if (sizeof($rowParams) == 1 && $rowParams[0] == 'item') {
$md5 = md5(mt_rand() . microtime());
$url = PATH_ADMIN_MODULES_WR . '/polymod/item-selector.php';
$fieldName = $searchParamContent[0]['name'];
$selectedItem = $searchParamContent[0]['value'];
$params = sensitiveIO::jsonEncode(array('winId' => 'selector-' . $md5, 'objectId' => $object->getID(), 'selectedItem' => $selectedItem, 'module' => $codename));
//this is only an single item selection, so help selection a little
$jscontent = <<<END
\t\tvar window = Ext.getCmp('{$winId}');
\t\t//set window title
\t\twindow.setTitle('{$winLabel}');
\t\t//set help button on top of page
\t\twindow.tools['help'].show();
\t\t//add a tooltip on button
\t\tvar propertiesTip = new Ext.ToolTip({
\t\t\ttarget:\t\t window.tools['help'],
\t\t\ttitle:\t\t\t '{$cms_language->getJsMessage(MESSAGE_TOOLBAR_HELP)}',
\t\t\thtml:\t\t\t '{$cms_language->getJsMessage(MESSAGE_TOOLBAR_HELP_DESC, false, MOD_POLYMOD_CODENAME)}',
\t\t\tdismissDelay:\t0
\t\t});
\t\tvar selectedItem = '{$selectedItem}';
示例7: array
$view->show();
}
//get records / pages
$recordsPerPage = CMS_session::getRecordsPerPage();
//special users Id
$rootProfileUserId = ROOT_PROFILEUSER_ID;
$anonymousProfileUserId = ANONYMOUS_PROFILEUSER_ID;
//user groups
$userGroups = array();
$userGroups['groups'] = array(array('id' => 0, 'label' => '-', 'description' => '{$cms_language->getJsMessage(MESSAGE_PAGE_NO_GROUP)}'));
$groups = CMS_profile_usersGroupsCatalog::getAll();
foreach ($groups as $group) {
$userGroups['groups'][] = array('id' => $group->getGroupId(), 'label' => $group->getLabel(), 'description' => $group->getDescription());
}
//json encode groups datas
$userGroups = sensitiveIO::jsonEncode($userGroups);
//users letters
$letters = CMS_profile_usersCatalog::getLettersForLastName();
//$letters = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
$lettersButtons = '';
foreach ($letters as $letter) {
$lettersButtons .= '{
text: \'' . io::strtoupper($letter) . '\',
enableToggle: true,
handler: clickLetter
},';
}
//remove last comma
$lettersButtons = io::substr($lettersButtons, 0, -1);
$jscontent = <<<END
\tvar usersWindow = Ext.getCmp('{$winId}');
示例8: array
$cstags = array();
}
$clientspaces = array();
$printableCS = array();
$print_clientspaces = $template->getPrintingClientSpaces();
foreach ($cstags as $tag) {
$id = $tag->getAttribute("id");
//$module = $tag->getAttribute("module");
if (!in_array($id, $print_clientspaces)) {
$clientspaces[] = array($id);
} else {
$printableCS[] = array($id);
}
}
$clientspaces = sensitiveIO::jsonEncode($clientspaces);
$printableCS = sensitiveIO::jsonEncode($printableCS);
$printTab = ",{\n\tid:\t\t\t\t'printcs-{$templateId}',\n\ttitle:\t\t\t'{$cms_language->getJsMessage(MESSAGE_PAGE_PRINT)}',\n\tlayout: \t\t'form',\n\txtype:\t\t\t'atmForm',\n\turl:\t\t\t'templates-controler.php',\n\tbodyStyle: \t\t'padding:5px',\n\tlabelAlign:\t\t'right',\n\tborder:\t\t\tfalse,\n\tbuttonAlign:\t'center',\n\titems:[{\n\t\txtype:\t\t\t'panel',\n\t\tborder:\t\t\tfalse,\n\t\thtml:\t\t\t'{$cms_language->getJsMessage(MESSAGE_PAGE_PRINT_DESC)}',\n\t\tbodyStyle: \t\t'padding:10px 0 10px 0'\n\t},{\n\t\txtype:\t\t\t'itemselector',\n\t\tname:\t\t\t'printableCS',\n\t\tfieldLabel:\t\t'{$cms_language->getJsMessage(MESSAGE_PAGE_PRINT_ZONES)}',\n\t\tdataFields:\t\t['code'],\n\t\ttoData:\t\t\t{$printableCS},\n\t\tmsWidth:\t\t250,\n\t\tmsHeight:\t\t130,\n\t\theight:\t\t\t140,\n\t\tvalueField:\t\t'code',\n\t\tdisplayField:\t'code',\n\t\ttoLegend:\t\t'{$cms_language->getJsMessage(MESSAGE_PAGE_SELECT)}',\n\t\tfromLegend:\t\t'{$cms_language->getJsMessage(MESSAGE_PAGE_AVAILABLE)}',\n\t\tfromData:\t\t{$clientspaces}\n\t}],\n\tbuttons:[{\n\t\ttext:\t\t\t'{$cms_language->getJSMessage(MESSAGE_PAGE_SAVE)}',\n\t\ticonCls:\t\t'atm-pic-validate',\n\t\txtype:\t\t\t'button',\n\t\tname:\t\t\t'submitAdmin',\n\t\thandler:\t\tfunction() {\n\t\t\tvar form = Ext.getCmp('printcs-{$templateId}').getForm();\n\t\t\tform.submit({\n\t\t\t\tparams:{\n\t\t\t\t\taction:\t\t'printcs',\n\t\t\t\t\ttemplateId:\ttemplateWindow.templateId\n\t\t\t\t},\n\t\t\t\tscope:this\n\t\t\t});\n\t\t}\n\t}]\n}";
$automnePath = PATH_MAIN_WR;
$jscontent = <<<END
\tvar templateWindow = Ext.getCmp('{$winId}');
\ttemplateWindow.templateId = '{$templateId}';
\t//set window title
\ttemplateWindow.setTitle('{$title}');
\t//set help button on top of page
\ttemplateWindow.tools['help'].show();
\t//add a tooltip on button
\tvar propertiesTip = new Ext.ToolTip({
\t\ttarget:\t\t templateWindow.tools['help'],
\t\ttitle:\t\t\t '{$cms_language->getJsMessage(MESSAGE_TOOLBAR_HELP)}',
\t\thtml:\t\t\t '{$cms_language->getJsMessage(MESSAGE_TOOLBAR_HELP_DESC)}',
\t\tdismissDelay:\t0
示例9: array
}
$comboLanguages = sensitiveIO::jsonEncode($comboLanguages);
$datesFormat = array(array('format' => '', 'label' => '-'), array('format' => 'd/m/Y', 'label' => date('d/m/Y') . ' (d/m/Y)'), array('format' => 'm/d/Y', 'label' => date('m/d/Y') . ' (m/d/Y)'), array('format' => 'Y/m/d', 'label' => date('Y/m/d') . ' (Y/m/d)'));
$datesFormat = sensitiveIO::jsonEncode($datesFormat);
$modules = CMS_modulesCatalog::getAll();
$modulesDenied = $language->getModulesDenied();
$availableModules = $excludedModules = array();
foreach ($modules as $codename => $module) {
if (in_array($codename, $modulesDenied)) {
$excludedModules[] = array($codename, $module->getLabel($cms_language));
} else {
$availableModules[] = array($codename, $module->getLabel($cms_language));
}
}
$availableModules = sensitiveIO::jsonEncode($availableModules);
$excludedModules = sensitiveIO::jsonEncode($excludedModules);
$selectLanguageDisabled = $language->getCode() ? 'true' : 'false';
$isAvailableForBackoffice = $language->isAvailableForBackoffice() ? 'true' : 'false';
$itemFields = "{\n\txtype:\t\t\t\t'combo',\n\tname:\t\t\t\t'selectedCode',\n\thiddenName:\t\t \t'selectedCode',\n\tforceSelection:\t\ttrue,\n\tfieldLabel:\t\t\t'<span class=\"atm-red\">*</span> {$cms_language->getJSMessage(MESSAGE_PAGE_LANGUAGE)}',\n\tmode:\t\t\t\t'local',\n\ttriggerAction:\t\t'all',\n\tvalueField:\t\t\t'code',\n\tdisplayField:\t\t'label',\n\tvalue:\t\t\t\t'{$language->getCode()}',\n\tanchor:\t\t\t\t'-20px',\n\tstore:\t\t\t\tnew Ext.data.JsonStore({\n\t\tfields:\t\t\t\t['code', 'label'],\n\t\tdata:\t\t\t\t{$comboLanguages}\n\t}),\n\tallowBlank:\t\t \tfalse,\n\tselectOnFocus:\t\ttrue,\n\teditable:\t\t\ttrue,\n\ttypeAhead:\t\t\ttrue,\n\tvalidateOnBlur:\t\tfalse,\n\tdisabled:\t\t\t{$selectLanguageDisabled}\n},{\n\txtype:\t\t\t\t'atmCombo',\n\tname:\t\t\t\t'dateformat',\n\thiddenName:\t\t \t'dateformat',\n\tforceSelection:\t\ttrue,\n\tfieldLabel:\t\t\t'<span class=\"atm-red\">*</span> {$cms_language->getJSMessage(MESSAGE_PAGE_DATE_FORMAT)}',\n\tmode:\t\t\t\t'local',\n\ttriggerAction:\t\t'all',\n\tvalueField:\t\t\t'format',\n\tdisplayField:\t\t'label',\n\tvalue:\t\t\t\t'{$language->getDateFormat()}',\n\tanchor:\t\t\t\t'-20px',\n\tstore:\t\t\t\tnew Ext.data.JsonStore({\n\t\tfields:\t\t\t\t['format', 'label'],\n\t\tdata:\t\t\t\t{$datesFormat}\n\t}),\n\tallowBlank:\t\t \tfalse,\n\tselectOnFocus:\t\ttrue,\n\teditable:\t\t\tfalse,\n\tvalidateOnBlur:\t\tfalse\n},{\n\txtype:\t\t\t'itemselector',\n\tname:\t\t\t'modulesDenied',\n\tfieldLabel:\t\t'<span class=\"atm-help\" ext:qtip=\"{$cms_language->getJSMessage(MESSAGE_PAGE_SELECT_MODULES)}\">{$cms_language->getJSMessage(MESSAGE_PAGE_EXCLUDED_MODULES)}</span>',\n\tdataFields:\t\t['code', 'label'],\n\ttoData:\t\t\t{$excludedModules},\n\tmsWidth:\t\t250,\n\tmsHeight:\t\t130,\n\theight:\t\t\t140,\n\tvalueField:\t\t'code',\n\tdisplayField:\t'label',\n\ttoLegend:\t\t'{$cms_language->getJSMessage(MESSAGE_PAGE_EXCLUDED)}',\n\tfromLegend:\t\t'{$cms_language->getJsMessage(MESSAGE_PAGE_AVAILABLE)}',\n\tfromData:\t\t{$availableModules}\n},{\n\txtype: \t\t'checkbox', \n\tboxLabel: \t'{$cms_language->getJSMessage(MESSAGE_PAGE_LANGUE_AVAILABLE_FOR_ADMIN)}', \n\tinputValue:\t'1',\n\tchecked:\t{$isAvailableForBackoffice},\n\tname: \t\t'admin'\n},";
//remove last comma
$itemFields = io::substr($itemFields, 0, -1);
$itemsControlerURL = PATH_ADMIN_WR . '/languages-controler.php';
$jscontent = <<<END
\tvar window = Ext.getCmp('{$winId}');
\t//set window title
\twindow.setTitle('{$winLabel}');
\t//set help button on top of page
\twindow.tools['help'].show();
\t//add a tooltip on button
\tvar propertiesTip = new Ext.ToolTip({
\t\ttarget:\t\t window.tools['help'],
示例10: array
$protectedItem['listeners'] = array('check' => sensitiveIO::sanitizeJSString('function(el, checked) {
if (checked) {
Automne.message.popup({
msg: \'' . io::htmlspecialchars($cms_language->getMessage(MESSAGE_PAGE_PROTECTED_ALERT)) . '\',
buttons: Ext.MessageBox.OK,
closable: false,
icon: Ext.MessageBox.WARNING
});
}
}', false, false));
}
$items[] = $protectedItem;
}
$count++;
}
$items = sensitiveIO::jsonEncode($items);
//do some search and replace to allow use of js functions in returned code
$items = str_replace('"scope":"this"', '"scope":this', $items);
function replaceCallBack($parts)
{
return 'function(' . str_replace(array('\\"', '\\/'), array('"', '/'), $parts[1]) . '}';
}
$items = preg_replace_callback('#"function\\((.*)}"#U', 'replaceCallBack', $items);
$jscontent = <<<END
\tvar window = Ext.getCmp('{$winId}');
\t//set window title
\twindow.setTitle('{$cms_language->getJsMessage(MESSAGE_PAGE_TITLE)}');
\t//set help button on top of page
\twindow.tools['help'].show();
\t//add a tooltip on button
\tvar propertiesTip = new Ext.ToolTip({
示例11: array
if (isset($logs[1])) {
$welcomeMsg .= '<br /><br />' . $cms_language->getJsMessage(MESSAGE_PAGE_PREVIOUS_LOGIN) . ' ' . $logs[1]->getDateTime()->getLocalizedDate($cms_language->getDateFormat() . ' H:i:s');
}
//validations
if ($userSessionsInfos['hasValidations']) {
$welcomeMsg .= '<br /><br />' . ($userSessionsInfos['awaitingValidation'] ? $cms_language->getJsMessage(MESSAGE_PAGE_USER_VALIDATIONS, array($userSessionsInfos['awaitingValidation'])) : $cms_language->getJsMessage(MESSAGE_PAGE_USER_NOVALIDATION));
}
//debug
if (SYSTEM_DEBUG && $cms_user->hasAdminClearance(CLEARANCE_ADMINISTRATION_EDITVALIDATEALL)) {
$welcomeMsg .= '<br /><br /><span class="atm-red">' . $cms_language->getJsMessage(MESSAGE_PAGE_DEBUG) . '</span> ' . $cms_language->getJsMessage(MESSAGE_PAGE_PRESS_F2_FOR_LOG);
}
//then set context, remove login window and load Automne interface
$jscontent = '/*remove event closeAndBack on window*/
Ext.WindowMgr.get(\'loginWindow\').un(\'beforeclose\', Ext.WindowMgr.get(\'loginWindow\').closeAndBack);
/*add event to load Automne interface after close*/
Ext.WindowMgr.get(\'loginWindow\').on(\'close\', Automne.load.createDelegate(this, [' . sensitiveIO::jsonEncode($userSessionsInfos) . ']));
/*display welcome message*/
Automne.message.show(\'' . sensitiveIO::sanitizeJSString($welcome) . '\', \'' . sensitiveIO::sanitizeJSString($welcomeMsg) . '\', \'\', 6);
try {delete Ext.Element.cache[\'loginField\'];} catch (e) {}
';
//add all JS locales
$jscontent .= CMS_session::getJSLocales();
$jscontent .= '
/*show front page in tab*/
if (Automne.tabPanels.getActiveTab().id != \'edit\') {
Automne.tabPanels.getActiveTab().reload();
}
/*close login window*/
Ext.WindowMgr.get(\'loginWindow\').close();';
//eval content into parent
示例12: foreach
foreach ($allGroups as $aGroup) {
$searchPanel .= "{boxLabel: '{$aGroup}', inputValue:'{$aGroup}', name: 'groups[]', listeners: {'check':templateWindow.search}},";
}
//remove last comma from groups
$searchPanel = io::substr($searchPanel, 0, -1);
$searchPanel .= "\n\t\t]\n\t},";
}
$websites = CMS_websitesCatalog::getAll();
if (sizeof($websites) > 1) {
$websitesDatas = array();
$websitesDatas['website'] = array(array('id' => 0, 'label' => '-'));
foreach ($websites as $website) {
$websitesDatas['website'][] = array('id' => $website->getID(), 'label' => $website->getLabel());
}
//json encode websites datas
$websitesDatas = sensitiveIO::jsonEncode($websitesDatas);
$searchPanel .= "{\n\t\txtype:\t\t\t\t'combo',\n\t\tid:\t\t\t\t\t'websiteField',\n\t\tname:\t\t\t\t'website',\n\t\tfieldLabel:\t\t\t'{$cms_language->getJSMessage(MESSAGE_PAGE_WEBSITES)}',\n\t\tanchor:\t\t\t\t'-20px',\n\t\tforceSelection:\t\ttrue,\n\t\tmode:\t\t\t\t'local',\n\t\ttriggerAction:\t\t'all',\n\t\tvalueField:\t\t\t'id',\n\t\thiddenName: \t\t'website',\n\t\tdisplayField:\t\t'label',\n\t\tstore:\t\t\t\tnew Ext.data.JsonStore({\n\t\t\tid:\t\t\t\t'id',\n\t\t\troot: \t\t\t'website',\n\t\t\tfields: \t\t['id', 'label'],\n\t\t\tdata:\t\t\t{$websitesDatas}\n\t\t}),\n\t\tvalidateOnBlur:\t\tfalse,\n\t\tallowBlank: \t\ttrue,\n\t\tselectOnFocus:\t\ttrue,\n\t\teditable:\t\t\ttrue,\n\t\ttypeAhead:\t\t\ttrue,\n\t\tlisteners:\t\t\t{'valid':templateWindow.search}\n\t},";
}
$searchPanel .= "{\n\txtype:\t\t\t'atmPageField',\n\tfieldLabel:\t\t'{$cms_language->getJSMessage(MESSAGE_PAGE_PAGE)}',\n\tname:\t\t\t'page',\n\tvalidateOnBlur:\tfalse,\n\tvalue:\t\t\t'',\n\tanchor:\t\t\t'-20px',\n\tallowBlank:\t\ttrue,\n\tlisteners:\t\t{'valid':{\n\t\tfn: \t\t\ttemplateWindow.search, \n\t\toptions:\t\t{buffer:300}\n\t}}\n},{\n\thideLabel:\t\ttrue,\n\tlabelSeparator:\t'',\n\tlabelAlign:\t\t'left',\n\txtype:\t\t\t'checkbox',\n\tboxLabel: \t\t'{$cms_language->getJSMessage(MESSAGE_PAGE_VIEW_INACTIVES)}',\n\tname: \t\t\t'viewinactive',\n\tchecked:\t\ttrue,\n\tinputValue:\t\t'1',\n\tlisteners: \t\t{'check':templateWindow.search}\n}";
//$searchPanel = io::substr($searchPanel, 0, -1);
$jscontent = <<<END
\tvar templateWindow = Ext.getCmp('{$winId}');
\tvar fatherWindow = Ext.getCmp('{$fatherId}');
\t
\t//define update function into window (to be accessible by parent window)
\ttemplateWindow.updateTab = function() {
\t\t//reload search
\t\ttemplateWindow.search();
\t}
\t//define search function into window (to be accessible by parent window)
\ttemplateWindow.search = function() {
示例13: array
}
//json encode groups datas
$modules = sensitiveIO::jsonEncode($modules);
//types
$types = array();
$types['types'][] = array('id' => 'all', 'label' => $cms_language->getMessage(MESSAGE_PAGE_TYPE_ALL));
$types['types'][] = array('id' => 'admin', 'label' => $cms_language->getMessage(MESSAGE_PAGE_TYPE_ADMIN));
$types['types'][] = array('id' => 'resource', 'label' => $cms_language->getMessage(MESSAGE_PAGE_TYPE_PUBLICATION));
$types['types'][] = array('id' => 'login', 'label' => $cms_language->getMessage(MESSAGE_PAGE_TYPE_IDENTIFICATION));
$types['types'][] = array('id' => 'email', 'label' => $cms_language->getMessage(MESSAGE_PAGE_TYPE_EMAILS));
$modulesActions = CMS_log_catalog::getModulesActions($cms_language);
if ($modulesActions) {
$types['types'][] = array('id' => 'modules', 'label' => $cms_language->getMessage(MESSAGE_PAGE_TYPE_MODULES));
}
//json encode groups datas
$types = sensitiveIO::jsonEncode($types);
if ($cms_user->hasAdminClearance(CLEARANCE_ADMINISTRATION_EDITVALIDATEALL)) {
$purgeLogs = ",'->',{\n\t\t\txtype:\t\t'button',\n\t\t\ticonCls:\t'atm-pic-deletion',\n\t\t\ttext:\t\t'{$cms_language->getJsMessage(MESSAGE_ACTION_PURGE)}',\n\t\t\ttooltip:\t'{$cms_language->getJsMessage(MESSAGE_ACTION_PURGE_DESC)}',\n\t\t\thandler:\tfunction(button) {\n\t\t\t\tAutomne.message.popup({\n\t\t\t\t\tmsg: \t\t\t\t'{$cms_language->getJsMessage(MESSAGE_ACTION_PURGE_CONFIRM)}',\n\t\t\t\t\tbuttons: \t\t\tExt.MessageBox.OKCANCEL,\n\t\t\t\t\tanimEl: \t\t\tbutton.getEl(),\n\t\t\t\t\tclosable: \t\t\tfalse,\n\t\t\t\t\ticon: \t\t\t\tExt.MessageBox.WARNING,\n\t\t\t\t\tfn: \t\t\t\tfunction (button) {\n\t\t\t\t\t\tif (button == 'ok') {\n\t\t\t\t\t\t\tvar formValues = Ext.getCmp('logsSearchPanel').getForm().getValues();\n\t\t\t\t\t\t\tparams = Ext.apply(formValues, {\n\t\t\t\t\t\t\t\tdel:\t\t\ttrue,\n\t\t\t\t\t\t\t\tlimit:\t\t\t0,\n\t\t\t\t\t\t\t\tstart:\t\t\t0\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tAutomne.server.call('logs-datas.php', function() {\n\t\t\t\t\t\t\t\tlogWindow.launchSearch();\n\t\t\t\t\t\t\t}, params);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}";
} else {
$purgeLogs = '';
}
$dateFormat = $cms_language->getDateFormat();
$jscontent = <<<END
\tvar logWindow = Ext.getCmp('{$winId}');
\t
\t//set window title
\tlogWindow.setTitle('{$cms_language->getJsMessage(MESSAGE_PAGE_TITLE)}');
\t//set help button on top of page
\tlogWindow.tools['help'].show();
\t//add a tooltip on button
\tvar propertiesTip = new Ext.ToolTip({
示例14: ksort
$validationsSorted[$validation->getValidationTypeLabel()][] = $validation;
}
ksort($validationsSorted);
foreach ($validationsSorted as $label => $validations) {
$label = io::decodeEntities($label);
$validation = $validations[0];
$validationsType['validationsType'][] = array('id' => $count, 'module' => $codename, 'editions' => $validation->getEditions(), 'label' => $modLabel . ' : ' . $label . ' : ' . sizeof($validations) . ' ' . $cms_language->getMessage(MESSAGE_PAGE_VALIDATIONS_PENDING_COUNT));
if ($codename == $module && $validation->getEditions() & $editions) {
$selectedValidations = $count;
}
$count++;
}
}
}
//json encode validations types
$validationsType = sensitiveIO::jsonEncode($validationsType);
//get records / pages
$recordsPerPage = CMS_session::getRecordsPerPage();
$jscontent = <<<END
\tvar validationsWindow = Ext.getCmp('{$winId}');
\t//set window title
\tvalidationsWindow.setTitle('{$cms_language->getJSMessage(MESSAGE_PAGE_VALIDATIONS_PENDING)}');
\t//set help button on top of page
\tvalidationsWindow.tools['help'].show();
\t//add a tooltip on button
\tvar propertiesTip = new Ext.ToolTip({
\t\ttarget: \t\tvalidationsWindow.tools['help'],
\t\ttitle: \t\t\t'{$cms_language->getJsMessage(MESSAGE_TOOLBAR_HELP)}',
\t\thtml: \t\t\t'{$cms_language->getJsMessage(MESSAGE_PAGE_VALIDATION_PENDING_INFO)}',
\t\tdismissDelay:\t0
\t});
示例15: foreach
\***************************************/
$logs = ", {\n\t\t\ttitle:\t'" . $cms_language->getMessage(MESSAGE_PAGE_LOG_LABEL) . "',\n\t\t\txtype:\t'atmPanel',\n\t\t\tlayout:\t'fit',\n\t\t\tid:\t\t'logPanel',\n\t\t\tautoLoad:\t\t{\n\t\t\t\turl:\t\t'page-logs.php',\n\t\t\t\tparams:\t\t{\n\t\t\t\t\twinId:\t\t'logPanel',\n\t\t\t\t\tcurrentPage:'{$pageId}',\n\t\t\t\t\taction:\t\t'view'\n\t\t\t\t},\n\t\t\t\tnocache:\ttrue,\n\t\t\t\tscope:\t\tthis\n\t\t\t}\n }";
/***************************************\
* MODULES TABS *
\***************************************/
$modules = CMS_modulesCatalog::getALL();
$modulesTabs = '';
foreach ($modules as $aModule) {
if ($aModule->getCodename() != MOD_STANDARD_CODENAME && $cms_user->hasModuleClearance($aModule->getCodename(), CLEARANCE_MODULE_EDIT) && method_exists($aModule, 'getPageTabsProperties')) {
$tabsInfos = $aModule->getPageTabsProperties($cms_page, $cms_user);
foreach ($tabsInfos as $tabInfos) {
$label = $tabInfos['description'] ? '<span ext:qtip="' . sensitiveIO::sanitizeJSString($tabInfos['description']) . '">' . sensitiveIO::sanitizeJSString($tabInfos['label']) . '</span>' : sensitiveIO::sanitizeJSString($tabInfos['label']);
$url = $tabInfos['url'];
$tabInfos['winId'] = $objectWinId = 'module' . $aModule->getCodename() . (isset($tabInfos['tabId']) ? $tabInfos['tabId'] : '') . 'TabPanel';
$tabInfos['fatherId'] = $winId;
$params = sensitiveIO::jsonEncode($tabInfos);
if (!isset($tabInfos['frame']) || $tabInfos['frame'] == false) {
$modulesTabs .= ",{\n\t\t\t\t\ttitle:\t'{$label}',\n\t\t\t\t\tid:\t\t'{$objectWinId}',\n\t\t\t\t\txtype:\t'atmPanel',\n\t\t\t\t\tlayout:\t'atm-border',\n\t\t\t\t\tautoLoad:\t\t{\n\t\t\t\t\t\turl:\t\t'{$url}',\n\t\t\t\t\t\tparams:\t\t{$params},\n\t\t\t\t\t\tnocache:\ttrue,\n\t\t\t\t\t\tscope:\t\tcenter\n\t\t\t\t\t}\n\t\t\t\t}";
} else {
$modulesTabs .= ",{\n\t\t\t\t\ttitle:\t\t\t'{$label}',\n\t\t\t\t\tid:\t\t\t\t'{$objectWinId}',\n\t\t\t\t\txtype:\t\t\t'framePanel',\n\t\t\t\t\tframeURL:\t\t'{$url}',\n\t\t\t\t\tallowFrameNav:\ttrue\n\t\t\t\t}";
}
}
}
}
//sanitize some js string
$pageTitle = sensitiveIO::sanitizeJSString($pageTitle);
$pageLinkTitle = sensitiveIO::sanitizeJSString($pageLinkTitle);
$pageTplLabel = sensitiveIO::sanitizeJSString($pageTplLabel);
$jscontent = <<<END
\tvar propertiesWindow = Ext.getCmp('{$winId}');
\t//set window title