本文整理汇总了PHP中io::htmlspecialchars方法的典型用法代码示例。如果您正苦于以下问题:PHP io::htmlspecialchars方法的具体用法?PHP io::htmlspecialchars怎么用?PHP io::htmlspecialchars使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io
的用法示例。
在下文中一共展示了io::htmlspecialchars方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: anchorStart
/**
* Output the anchor start tag
*
* @return string the HTML content
* @access private
*/
function anchorStart($tagName, $anchor, $attributes)
{
if (strpos($_SERVER['SCRIPT_NAME'], PATH_ADMIN_WR) !== false && strpos($_SERVER['SCRIPT_NAME'], 'page-previsualization.php') === false) {
return '<' . $tagName . ' href="' . $anchor . '"' . $attributes . '>';
}
return '<' . $tagName . ' href="' . (pathinfo($_SERVER['SCRIPT_NAME'], PATHINFO_BASENAME) != 'index.php' ? $_SERVER['SCRIPT_NAME'] : pathinfo($_SERVER['SCRIPT_NAME'], PATHINFO_DIRNAME) . (pathinfo($_SERVER['SCRIPT_NAME'], PATHINFO_DIRNAME) == '/' ? '' : '/')) . (isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] ? '?' . io::htmlspecialchars($_SERVER["QUERY_STRING"]) : '') . $anchor . '"' . $attributes . '>';
}
示例2: function
} else {
$pageCopy = '';
}
//draft
if ($fromtab == 'edit' && $cms_user->getUserID() == $hasLock) {
//cancel draft and submit draft to validation
$pageDraft = "\n\t\t\t\t\tmenu.addSeparator();\n\t\t\t\t\tmenu.addItem(new Ext.menu.Item({\n\t\t\t\t\t\ttext: '<span ext:qtip=\"" . $cms_language->getJSMessage(MESSAGE_PAGE_DELETE_DRAFT_INFO) . "\">" . $cms_language->getJSMessage(MESSAGE_PAGE_DELETE_DRAFT) . "</span>',\n\t\t\t\t\t\ticonCls: 'atm-pic-draft-deletion',\n\t\t\t\t\t\thandler: function(){\n\t\t\t\t\t\t\tAutomne.message.popup({\n\t\t\t\t\t\t\t\tmsg: \t\t\t\t'" . $cms_language->getJSMessage(MESSAGE_PAGE_DELETE_DRAFT_CONFIRM) . "',\n\t\t\t\t\t\t\t\tbuttons: \t\t\tExt.MessageBox.OKCANCEL,\n\t\t\t\t\t\t\t\tanimEl: \t\t\tthis.getEl(),\n\t\t\t\t\t\t\t\tclosable: \t\t\tfalse,\n\t\t\t\t\t\t\t\ticon: \t\t\t\tExt.MessageBox.WARNING,\n\t\t\t\t\t\t\t\tfn: \t\t\t\tfunction (button) {\n\t\t\t\t\t\t\t\t\tif (button == 'ok') {\n\t\t\t\t\t\t\t\t\t\t//send to public or edited tab\n\t\t\t\t\t\t\t\t\t\tvar pubTab = tabs.getItem('public');\n\t\t\t\t\t\t\t\t\t\tif (!pubTab.disabled) {\n\t\t\t\t\t\t\t\t\t\t\ttabs.setActiveTab('public');\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\ttabs.setActiveTab('edited');\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tAutomne.server.call({\n\t\t\t\t\t\t\t\t\t\t\turl:\t\t\t\t'page-controler.php',\n\t\t\t\t\t\t\t\t\t\t\tparams: \t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tcurrentPage:\t\t'" . $cms_page->getID() . "',\n\t\t\t\t\t\t\t\t\t\t\t\taction:\t\t\t\t'cancel_draft'\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\tfcnCallback: \t\tfunction() {\n\t\t\t\t\t\t\t\t\t\t\t\t//then reload page infos\n\t\t\t\t\t\t\t\t\t\t\t\ttabs.getPageInfos({\n\t\t\t\t\t\t\t\t\t\t\t\t\tpageId:\t\t'" . $cms_page->getID() . "',\n\t\t\t\t\t\t\t\t\t\t\t\t\tnoreload:\ttrue\n\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\tcallBackScope:\t\tthis\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\t\t\t\t\tmenu.addItem(new Ext.menu.Item({\n\t\t\t\t\t\ttext: '<span ext:qtip=\"" . $cms_language->getJSMessage(MESSAGE_PAGE_DRAFT_TO_VALIDATION_INFO) . "\">" . $cms_language->getJSMessage(MESSAGE_PAGE_DRAFT_TO_VALIDATION) . "</span>',\n\t\t\t\t\t\ticonCls: 'atm-pic-draft-validation',\n\t\t\t\t\t\thandler: function () {\n\t\t\t\t\t\t\t//submit page to validation\n\t\t\t\t\t\t\tAutomne.server.call({\n\t\t\t\t\t\t\t\turl:\t\t\t\t'page-controler.php',\n\t\t\t\t\t\t\t\tparams: \t\t\t{\n\t\t\t\t\t\t\t\t\tcurrentPage:\t\t'" . $cms_page->getID() . "',\n\t\t\t\t\t\t\t\t\taction:\t\t\t\t'submit_for_validation'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfcnCallback: \t\tfunction() {\n\t\t\t\t\t\t\t\t\t//then reload page infos\n\t\t\t\t\t\t\t\t\ttabs.getPageInfos({\n\t\t\t\t\t\t\t\t\t\tpageId:\t\t'" . $cms_page->getID() . "',\n\t\t\t\t\t\t\t\t\t\tnoreload:\ttrue\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tcallBackScope:\t\tthis\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}));";
} else {
$pageDraft = '';
}
if ($cms_user->hasPageClearance($cms_page->getID(), CLEARANCE_PAGE_EDIT)) {
if ($hasLock) {
//unlock
if ($fromtab != 'edit' && ($cms_user->getUserID() == $hasLock || $cms_user->hasAdminClearance(CLEARANCE_ADMINISTRATION_EDITVALIDATEALL))) {
$lockUser = CMS_profile_usersCatalog::getById($hasLock);
$panelContent .= "\n\t\t\t\t\t\t\tmenu.addItem(new Ext.menu.Item({\n\t\t\t\t\t\t\t\ttext: '<span ext:qtip=\"" . $cms_language->getJSMessage(MESSAGE_PAGE_UNLOCK_LOCKED_PAGE, array(io::htmlspecialchars($lockUser->getFullName()))) . "\">" . $cms_language->getJSMessage(MESSAGE_PAGE_UNLOCK_PAGE) . "</span>',\n\t\t\t\t\t\t\t\ticonCls: 'atm-pic-unlock',\n\t\t\t\t\t\t\t\thandler: function(){\n\t\t\t\t\t\t\t\t\tAutomne.message.popup({\n\t\t\t\t\t\t\t\t\t\tmsg: \t\t\t\t'" . $cms_language->getJSMessage(MESSAGE_PAGE_UNLOCK_CONFIRM, array(io::htmlspecialchars($lockUser->getFullName()))) . "',\n\t\t\t\t\t\t\t\t\t\tbuttons: \t\t\tExt.MessageBox.OKCANCEL,\n\t\t\t\t\t\t\t\t\t\tanimEl: \t\t\tthis.getEl(),\n\t\t\t\t\t\t\t\t\t\tclosable: \t\t\tfalse,\n\t\t\t\t\t\t\t\t\t\ticon: \t\t\t\tExt.MessageBox.WARNING,\n\t\t\t\t\t\t\t\t\t\tfn: \t\t\t\tfunction (button) {\n\t\t\t\t\t\t\t\t\t\t\tif (button == 'ok') {\n\t\t\t\t\t\t\t\t\t\t\t\tAutomne.server.call({\n\t\t\t\t\t\t\t\t\t\t\t\t\turl:\t\t\t\t'resource-controler.php',\n\t\t\t\t\t\t\t\t\t\t\t\t\tparams: \t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tresource:\t\t'" . $cms_page->getID() . "',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmodule:\t\t\t'standard',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\taction:\t\t\t'unlock'\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\tcallBackScope:\t\tthis\n\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}));";
} elseif ($fromtab == 'edit' && $cms_user->getUserID() == $hasLock) {
$panelContent .= $pageDraft;
}
} else {
if ($cms_page->getProposedLocation() == RESOURCE_LOCATION_DELETED) {
//undelete
$panelContent .= "\n\t\t\t\t\t\t\tmenu.addItem(new Ext.menu.Item({\n\t\t\t\t\t\t\t\ttext: '<span ext:qtip=\"" . $cms_language->getJSMessage(MESSAGE_PAGE_UNDO_DELETION_INFO) . "\">" . $cms_language->getJSMessage(MESSAGE_PAGE_UNDO_DELETION) . "</span>',\n\t\t\t\t\t\t\t\ticonCls: 'atm-pic-undelete',\n\t\t\t\t\t\t\t\thandler: function () {\n\t\t\t\t\t\t\t\t\tAutomne.server.call({\n\t\t\t\t\t\t\t\t\t\turl:\t\t\t\t'page-controler.php',\n\t\t\t\t\t\t\t\t\t\tparams: \t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tcurrentPage:\t\t'" . $cms_page->getID() . "',\n\t\t\t\t\t\t\t\t\t\t\taction:\t\t\t\t'undelete'\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}));";
} elseif ($cms_page->getProposedLocation() == RESOURCE_LOCATION_ARCHIVED) {
//unarchive
$panelContent .= "\n\t\t\t\t\t\t\tmenu.addItem(new Ext.menu.Item({\n\t\t\t\t\t\t\t\ttext: '<span ext:qtip=\"" . $cms_language->getJSMessage(MESSAGE_PAGE_UNDO_ARCHIVING_INFO) . "\">" . $cms_language->getJSMessage(MESSAGE_PAGE_UNDO_ARCHIVING) . "</span>',\n\t\t\t\t\t\t\t\ticonCls: 'atm-pic-unarchive',\n\t\t\t\t\t\t\t\thandler: function () {\n\t\t\t\t\t\t\t\t\tAutomne.server.call({\n\t\t\t\t\t\t\t\t\t\turl:\t\t\t\t'page-controler.php',\n\t\t\t\t\t\t\t\t\t\tparams: \t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tcurrentPage:\t\t'" . $cms_page->getID() . "',\n\t\t\t\t\t\t\t\t\t\t\taction:\t\t\t\t'unarchive'\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}));";
} else {
if (!$cms_page->isProtected()) {
//move page
$father = CMS_tree::getAncestor($cms_page, 1);
$draggable = is_object($father) && $cms_user->hasPageClearance($father->getID(), CLEARANCE_PAGE_EDIT) && (!$hasSiblings || $cms_user->hasAdminClearance(CLEARANCE_ADMINISTRATION_REGENERATEPAGES) && $cms_page->getID() != APPLICATION_ROOT_PAGE_ID);
示例3: getValue
/**
* get an object value
*
* @param string $name : the name of the value to get
* @param string $parameters (optional) : parameters for the value to get
* @return multidimentionnal array : the object values structure
* @access public
*/
function getValue($name, $parameters = '')
{
$href = new CMS_href($this->_subfieldValues[0]->getValue());
switch ($name) {
case 'validhref':
return $href->hasValidHREF();
break;
case 'hrefvalue':
//get module codename
$moduleCodename = CMS_poly_object_catalog::getModuleCodenameForField($this->_field->getID());
//set location
$location = $this->_public ? RESOURCE_DATA_LOCATION_PUBLIC : RESOURCE_DATA_LOCATION_EDITED;
return $href->getHTML(false, $moduleCodename, $location, false, true);
break;
case 'hreflabel':
return io::htmlspecialchars($href->getLabel());
break;
case 'hreftarget':
return $href->getTarget();
break;
case 'hreftype':
return $href->getLinkType();
break;
case 'popupWidth':
$popup = $href->getPopup();
return $popup['width'];
break;
case 'popupHeight':
$popup = $href->getPopup();
return $popup['height'];
break;
case 'hrefHTML':
//get module codename
$moduleCodename = CMS_poly_object_catalog::getModuleCodenameForField($this->_field->getID());
//set location
$location = $this->_public ? RESOURCE_DATA_LOCATION_PUBLIC : RESOURCE_DATA_LOCATION_EDITED;
//add link title (if any)
if ($parameters) {
$title = $parameters;
//add title attribute to link
$href->setAttributes(array('title' => io::htmlspecialchars($href->getLabel() . ' (' . $title . ')')));
} else {
$title = false;
//add title attribute to link
$href->setAttributes(array('title' => io::htmlspecialchars($href->getLabel())));
}
return $href->getHTML($title, $moduleCodename, $location);
break;
default:
return parent::getValue($name, $parameters);
break;
}
}
示例4: _getIds
//.........这里部分代码省略.........
$languageFieldID = array_shift($languageFieldIDs);
//if any query use this field, use the queried value for stemming strategy
if (isset($this->_whereConditions[$languageFieldID]) && $this->_whereConditions[$languageFieldID]) {
$languageCode = $this->_whereConditions[$languageFieldID][0]['value'];
}
}
//otherwise, we use current language
if (!$languageCode) {
global $cms_language;
$languageCode = $cms_language->getCode();
}
if (!$languageCode) {
$languageCode = io::strtolower(APPLICATION_DEFAULT_LANGUAGE);
}
$module = $this->_object->getValue('module');
//create Xapian search object
$search = new CMS_XapianQuery(trim($value), array($module), $languageCode, true);
//load module interface
if (!($moduleInterface = CMS_ase_interface_catalog::getModuleInterface($module))) {
$this->raiseError('No active Xapian interface for module : ' . $module);
return false;
}
//add previously found IDs to search filters
$moduleInterface->addFilter('items', $IDs);
//set module interface to search engine
$search->setModuleInterface($module, $moduleInterface);
//set page number and max results for xapian query
//we must do a complete search all the time so we start from page 0
$page = 0;
//we limit to a maximum of 1000 results
$maxResults = 1000;
//then search
if (!$search->query($page, $maxResults)) {
$this->raiseError('Error in Xapian query for search : ' . io::htmlspecialchars($value));
return false;
}
//pr($search->getQueryDesc(true));
//if no results : break
if (!$search->getMatchesNumbers()) {
break;
}
$xapianResults = $search->getMatches();
} else {
//get fields
if (!isset($this->_fieldsDefinitions[$type]) || !is_object($this->_fieldsDefinitions[$type])) {
//get object fields definition
$this->_fieldsDefinitions = CMS_poly_object_catalog::getFieldsDefinition($this->_object->getID());
}
//search only in "searchable" fields
$fields = array();
$aseExists = class_exists('CMS_module_ase') && CMS_module_ase::isActive() && $this->_object->getValue('indexable') ? true : false;
foreach ($this->_fieldsDefinitions as $fieldDefinition) {
if ($fieldDefinition->getValue($aseExists ? 'indexable' : 'searchable')) {
$fields[] = $fieldDefinition->getID();
}
}
if (!$fields) {
//if no fields after cleaning, return
break;
}
//add previously found IDs to where clause
$where = $IDs ? ' objectID in (' . $this->_getSQLTmpList() . ') and ' : '';
//filter on specified fields
$where .= $fields ? ' objectFieldID in (' . implode(',', $fields) . ') and ' : '';
//clean user keywords (never trust user input, user is evil)
$value = strtr($value, ",;", " ");
示例5: getHTML
/**
* Get : a full XHTML a tag
*
* @param string $module If false, only returns the filename
* @param string $dataLocation Where does the data lies ? @see CMS_resource constants
* @param string $attrs, any attributes to append into A tag
* @return string, the XHTML Tag
* @access public
*/
function getHTML($label = false, $module = MOD_STANDARD_CODENAME, $dataLocation = RESOURCE_DATA_LOCATION_EDITED, $attrs = false, $hrefOnly = false)
{
if ($label) {
$this->_label = $label;
}
// Building href
$s = '';
$href = '';
$onClick = '';
switch ($this->_linkType) {
case RESOURCE_LINK_TYPE_INTERNAL:
// Get internal page URL
switch ($dataLocation) {
case RESOURCE_DATA_LOCATION_PUBLIC:
case RESOURCE_DATA_LOCATION_EDITED:
default:
if (sensitiveIO::isPositiveInteger($this->_internalLink) && ($href = CMS_tree::getPageValue($this->_internalLink, 'url'))) {
$href = PATH_PAGES_WR && strpos($href, PATH_PAGES_WR) !== false || stripos($href, 'http') !== false ? $href : PATH_PAGES_WR . $href;
}
break;
}
// Set a popup link, not a trivial link
if (isset($this->_popup['width']) && isset($this->_popup['height']) && $this->_popup['width'] > 0 && $this->_popup['height'] > 0) {
$onClick = "javascript:CMS_openPopUpPage('" . $href . "', 'popup_page', " . $this->_popup['width'] . ", " . $this->_popup['height'] . ");return false;";
}
break;
case RESOURCE_LINK_TYPE_EXTERNAL:
$href = io::htmlspecialchars($this->_externalLink);
$href = str_replace('&', '&', $href);
if (strtolower(substr($href, 0, 4)) != 'http') {
$href = 'http://' . $href;
}
// Set a popup link, not a trivial link
if (isset($this->_popup['width']) && $this->_popup['width'] > 0 && isset($this->_popup['height']) && $this->_popup['height'] > 0) {
$onClick = "javascript:CMS_openPopUpPage('" . $href . "', 'external', " . $this->_popup['width'] . ", " . $this->_popup['height'] . ");return false;";
}
break;
case RESOURCE_LINK_TYPE_FILE:
if (is_file($this->getFileLink(true, $module, $dataLocation, PATH_RELATIVETO_FILESYSTEM))) {
$href = $this->getFileLink(true, $module, $dataLocation, PATH_RELATIVETO_WEBROOT);
// Set a popup link, not a trivial link
if (isset($this->_popup['width']) && $this->_popup['width'] > 0 && isset($this->_popup['height']) && $this->_popup['height'] > 0) {
$onClick = "javascript:CMS_openPopUpPage('" . $href . "', 'file', " . $this->_popup['width'] . ", " . $this->_popup['height'] . ");return false;";
}
}
break;
}
if ($hrefOnly) {
return $href;
}
if ($this->_target) {
$target = ' target="' . $this->_target . '"';
}
// Get onClick
if ($onClick != '') {
$onClick = ' onClick="' . $onClick . '"';
}
// Return Link
if (trim($href) != '') {
if (!$attrs) {
$attrs = $this->getAttributesString();
}
$attrs = ' ' . trim($attrs);
$s = '<a href="' . $href . '"' . $onClick . $target . $attrs . '>' . $this->_label . '</a>';
}
return $s;
}
示例6: getMetaTags
/**
* Get HTML meta tags for a given page
*
* @param boolean $public Do we want the edited or public value ? (default : false => edited).
* @param array $tags the tags names to activate/desactivate (by default all tags are present if they have content)
* array('description' => false)
* @return string : HTML meta tags infos infos
* @access public
*/
function getMetaTags($public = false, $tags = array())
{
$website = $this->getWebsite();
$favicon = '';
$metaDatas = '';
if (!is_object($website)) {
return '';
}
if (!isset($tags['icon']) || $tags['icon']) {
if ($website->getMeta('favicon')) {
$infos = pathinfo($website->getMeta('favicon'));
if ($infos['extension']) {
switch ($infos['extension']) {
case 'ico':
$type = 'image/x-icon';
break;
case 'jpg':
$type = 'image/jpeg';
break;
case 'gif':
$type = 'image/gif';
break;
case 'png':
$type = 'image/png';
break;
default:
$type = 'application/octet-stream';
break;
}
} else {
$type = 'application/octet-stream';
}
$metaDatas .= '<?php echo \'<link rel="icon" type="' . $type . '" href="\'.CMS_websitesCatalog::getCurrentDomain().\'' . PATH_REALROOT_WR . $website->getMeta('favicon') . '" />\'."\\n"; ?>' . "\n";
} elseif (file_exists(PATH_REALROOT_FS . '/favicon.ico')) {
$metaDatas .= '<?php echo \'<link rel="icon" type="image/x-icon" href="\'.CMS_websitesCatalog::getCurrentDomain().\'' . PATH_REALROOT_WR . '/favicon.ico" />\'."\\n"; ?>' . "\n";
} elseif (file_exists(PATH_REALROOT_FS . '/img/favicon.png')) {
$metaDatas .= '<?php echo \'<link rel="icon" type="image/png" href="\'.CMS_websitesCatalog::getCurrentDomain().\'' . PATH_REALROOT_WR . '/img/favicon.png" />\'."\\n"; ?>' . "\n";
}
}
if ((!isset($tags['description']) || $tags['description']) && $this->getDescription($public)) {
$metaDatas .= ' <meta name="description" content="' . io::htmlspecialchars($this->getDescription($public), ENT_COMPAT) . '" />' . "\n";
}
if ((!isset($tags['keywords']) || $tags['keywords']) && $this->getKeywords($public)) {
$metaDatas .= ' <meta name="keywords" content="' . io::htmlspecialchars($this->getKeywords($public), ENT_COMPAT) . '" />' . "\n";
}
if (io::strtolower(APPLICATION_XHTML_DTD) != io::strtolower('<!DOCTYPE html>')) {
if ((!isset($tags['category']) || $tags['category']) && $this->getCategory($public)) {
$metaDatas .= ' <meta name="category" content="' . io::htmlspecialchars($this->getCategory($public), ENT_COMPAT) . '" />' . "\n";
}
if ((!isset($tags['robots']) || $tags['robots']) && $this->getRobots($public)) {
$metaDatas .= ' <meta name="robots" content="' . io::htmlspecialchars($this->getRobots($public), ENT_COMPAT) . '" />' . "\n";
}
if ((!isset($tags['language']) || $tags['language']) && $this->getLanguage($public)) {
$metaDatas .= ' <meta name="language" content="' . io::htmlspecialchars($this->getLanguage($public), ENT_COMPAT) . '" />' . "\n";
}
if (!isset($tags['identifier-url']) || $tags['identifier-url']) {
$metaDatas .= ' <?php echo \'<meta name="identifier-url" content="\'.CMS_websitesCatalog::getCurrentDomain().\'' . PATH_REALROOT_WR . '" />\'."\\n"; ?>' . "\n";
}
if ((!isset($tags['revisit-after']) || $tags['revisit-after']) && $this->getReminderPeriodicity($public) && $this->getReminderPeriodicity($public) > 0) {
$metaDatas .= ' <meta name="revisit-after" content="' . $this->getReminderPeriodicity($public) . ' days" />' . "\n";
}
if ((!isset($tags['pragma']) || $tags['pragma']) && $this->getPragma($public)) {
$metaDatas .= ' <meta http-equiv="pragma" content="no-cache" />' . "\n";
}
if ((!isset($tags['refresh']) || $tags['refresh']) && $this->getRefresh($public)) {
$metaDatas .= ' <meta http-equiv="refresh" content="' . io::htmlspecialchars($this->getRefresh($public), ENT_COMPAT) . '" />' . "\n";
}
}
if (!NO_PAGES_EXTENDED_META_TAGS) {
if ((!isset($tags['author']) || $tags['author']) && $this->getAuthor($public)) {
$metaDatas .= ' <meta name="author" content="' . io::htmlspecialchars($this->getAuthor($public), ENT_COMPAT) . '" />' . "\n";
}
if (io::strtolower(APPLICATION_XHTML_DTD) != io::strtolower('<!DOCTYPE html>')) {
if ((!isset($tags['reply-to']) || $tags['reply-to']) && $this->getReplyto($public)) {
$metaDatas .= ' <meta name="reply-to" content="' . io::htmlspecialchars($this->getReplyto($public), ENT_COMPAT) . '" />' . "\n";
}
if ((!isset($tags['copyright']) || $tags['copyright']) && $this->getCopyright($public)) {
$metaDatas .= ' <meta name="copyright" content="' . io::htmlspecialchars($this->getCopyright($public), ENT_COMPAT) . '" />' . "\n";
}
}
}
if (!isset($tags['generator']) || $tags['generator']) {
$metaDatas .= ' <meta name="generator" content="' . CMS_grandFather::SYSTEM_LABEL . '" />' . "\n";
}
if ($this->getMetas($public)) {
$metaDatas .= $this->getMetas($public) . "\n";
}
return $metaDatas;
}
示例7: getFieldXHTML
/**
* Get field XHTML
*
* @param CMS_language $formLanguage : the language for messages
* @return array array(label, input)
*/
function getFieldXHTML($formLanguage = '')
{
// Language
global $cms_language;
if (!$formLanguage) {
$formLanguage = $cms_language;
}
//generate field id datas
$fieldIDDatas = $this->generateFieldIdDatas();
$input = $label = '';
switch ($this->getAttribute("type")) {
case 'hidden':
$input = '<input type="hidden" value="' . io::htmlspecialchars($this->getAttribute("value")) . '" id="' . $fieldIDDatas . '" name="' . $this->getAttribute("name") . '" />';
break;
case 'select':
$label = '<label for="' . $fieldIDDatas . '">' . $this->getAttribute("label") . '</label>';
$input = '<select name="' . $this->getAttribute("name") . '" id="' . $fieldIDDatas . '">';
$options = $this->getAttribute("options");
if (sizeof($options)) {
foreach ($options as $aValue => $anOption) {
$selected = $this->getAttribute("value") == $aValue ? ' selected="selected"' : '';
$input .= '<option value="' . $aValue . '"' . $selected . '>' . $anOption . '</option>';
}
}
$input .= '</select>';
break;
case 'text':
case 'email':
case 'url':
case 'integer':
case 'file':
case 'pass':
case 'checkbox':
$label = '<label for="' . $fieldIDDatas . '">' . $this->getAttribute("label") . '</label>';
$input = '<input';
$fileHelp = '';
switch ($this->getAttribute("type")) {
case 'file':
$input .= ' type="file"';
$fileParams = $this->getAttribute("params");
$fileHelpTab = array();
if ($fileParams) {
foreach ($fileParams as $fileParamName => $fileParamValue) {
switch ($fileParamName) {
case 'extensions':
$fileHelpTab['extensions'] = $formLanguage->getMessage(self::MESSAGE_CMS_FORMS_FILE_PARAMS_ALLOWED_EXTENSIONS, false, MOD_CMS_FORMS_CODENAME) . ' ' . $fileParamValue;
break;
case 'weight':
$fileHelpTab['weight'] = $formLanguage->getMessage(self::MESSAGE_CMS_FORMS_FILE_PARAMS_MAX_FILESIZE, false, MOD_CMS_FORMS_CODENAME) . ' ' . $fileParamValue . 'Ko';
break;
}
}
}
if (!isset($fileHelpTab['weight'])) {
$fileHelpTab['weight'] = $formLanguage->getMessage(self::MESSAGE_CMS_FORMS_FILE_PARAMS_MAX_FILESIZE, false, MOD_CMS_FORMS_CODENAME) . ' ' . CMS_file::getMaxUploadFileSize('K') . 'Ko';
}
if ($fileHelpTab) {
$fileHelp = '<br/>(' . implode(' ; ', $fileHelpTab) . ')';
}
break;
case 'pass':
$input .= ' type="password" value=""';
break;
case 'checkbox':
$input .= ' type="checkbox" value="1" class="checkbox" ' . ($this->getAttribute("value") ? ' checked="checked"' : '');
break;
case 'text':
case 'email':
case 'url':
case 'integer':
default:
$input .= ' type="text" value="' . io::htmlspecialchars($this->getAttribute("value")) . '"';
break;
}
$fileHelp = $fileHelp ? ' <span class="inputHelp">' . $fileHelp . '</span>' : '';
$input .= ' id="' . $fieldIDDatas . '" name="' . $this->getAttribute("name") . '" />' . $fileHelp;
break;
case 'submit':
$input = '<input id="' . $fieldIDDatas . '" type="submit" class="button" name="' . $this->getAttribute("name") . '" value="' . $this->getAttribute("label") . '" />';
break;
case 'textarea':
$label = '<label for="' . $fieldIDDatas . '">' . $this->getAttribute("label") . '</label>';
$input = '<textarea cols="40" rows="6" id="' . $fieldIDDatas . '" name="' . $this->getAttribute("name") . '">' . io::htmlspecialchars($this->getAttribute("value")) . '</textarea>';
break;
}
return array($label, $input);
}
示例8: getContent
function getContent($type = 'menu')
{
//create a random name (useful for onSubmit purposes among other)
$form_name = md5(mt_rand());
$onSubmit = '0';
$method = isset($this->_formAttributes["method"]) ? $this->_formAttributes["method"] : "post";
if ($method != 'post') {
$onSubmit = '1';
}
if ($type == 'DHTML' || $type == 'popup') {
$content = '<tr><td width="100%" height="34" valign="top" nowrap="nowrap">';
} else {
$content = '<td width="34" height="35" onMouseOver="changeColor(this,\'A69C9A\');" onMouseOut="changeColor(this,\'\');" valign="center" align="center">';
}
$content .= '<form name="' . $form_name . '" method="' . $method . '" action="' . $this->_formAction . '" ';
foreach ($this->_formAttributes as $name => $value) {
if ($name != "method" && $name != "onSubmit" && $name != "onsubmit" && $name != "target") {
$content .= $name . '="' . io::htmlspecialchars($value) . '" ';
}
if ($name == "onSubmit" || $name == "onsubmit") {
$content .= $name . '="' . io::htmlspecialchars($value) . '" ';
$onSubmit = '1';
}
if ($name == "target") {
if ($value == "_blank") {
$onSubmit = '1';
}
$content .= $name . '="' . io::htmlspecialchars($value) . '" ';
}
}
if (!$onSubmit && $type != 'popup') {
$content .= ' onSubmit="check();" ';
}
$content .= '>';
foreach ($this->_formHiddens as $name => $value) {
$value = str_replace("\n", "", $value);
$value = str_replace("\r", "", $value);
$value = io::htmlspecialchars($value);
$content .= '<input type="hidden" name="' . $name . '" value="' . $value . '" />';
}
foreach ($this->_formTexts as $name => $textArray) {
$value = $textArray["value"];
$size = $textArray["size"];
$code = $textArray["code"];
$replace = array("\n" => '', "\r" => '');
$value = str_replace(array_keys($replace), $replace, $value);
$value = htmlspecialchars($value);
$content .= SensitiveIO::arraySprintf($code, array('<input type="text" class="admin_input_text" name="' . $name . '" value="' . $value . '" size="' . $size . '" />'));
}
if ($type == 'DHTML' || $type == 'popup') {
if ($this->_picto) {
$content .= '<input align="absmiddle" type="image" src="' . PATH_ADMIN_IMAGES_WR . '/../v3/img/' . $this->_picto . '" alt="' . $this->_label . '" title="' . $this->_label . '" value="' . $this->_label . '" /><input type="submit" onMouseOver="this.style.backgroundColor=\'#D0CBCA\';" onMouseOut="this.style.backgroundColor=\'#FFFFFF\';" class="CMS_dhtml_input_submit" value="' . $this->_label . '" />';
} else {
$content .= '<input type="submit" class="admin_input_submit" value="' . $this->_label . '" style="width:130px" />';
}
} else {
if ($this->_picto) {
$content .= '<input type="image" src="' . PATH_ADMIN_IMAGES_WR . '/../v3/img/' . $this->_picto . '" alt="' . $this->_label . '" title="' . $this->_label . '" value="' . $this->_label . '" />';
} else {
$content .= '<input type="submit" class="admin_input_submit" value="' . $this->_label . '" style="width:130px" />';
}
}
if ($type == 'DHTML' || $type == 'popup') {
$content .= '</form></td></tr>';
} else {
$content .= '</form></td>';
}
return $content;
}
示例9: selectOptions
/**
* For a given category, return options tag list (for a select tag) of all sub categories
*
* @param array $values : parameters values array(parameterName => parameterValue) in :
* selected : the category id which is selected (optional)
* @param multidimentionnal array $tags : xml2Array content of atm-function tag (nothing for this one)
* @return string : options tag list
* @access public
*/
function selectOptions($values, $tags)
{
$usersGroups = $this->getListOfNamesForObject();
$return = "";
if (is_array($usersGroups) && $usersGroups) {
foreach ($usersGroups as $userGroupID => $userGroupLabel) {
$selected = $userGroupID == $values['selected'] ? ' selected="selected"' : '';
$return .= '<option title="' . io::htmlspecialchars($userGroupLabel) . '" value="' . $userGroupID . '"' . $selected . '>' . $userGroupLabel . '</option>';
}
}
return $return;
}
示例10: array
}
} else {
$label = $cms_language->getMessage(MESSAGE_PAGE_PAGE) . ' "' . $page->getTitle() . '" (' . $page->getID() . ')';
$redirect = '<a href="' . $page->getURL(false, false, PATH_RELATIVETO_WEBROOT, true) . '">' . io::htmlspecialchars($label) . '</a>';
}
$content = '
<div id="atm-center">
<div class="atm-alert">' . $cms_language->getMessage(MESSAGE_PAGE_REDIRECT, array($redirect)) . '</div>
</div>';
} else {
if (isset($_GET['url'])) {
$url = urldecode($_GET['url']);
if ($page = CMS_tree::analyseURL($url)) {
$label = $cms_language->getMessage(MESSAGE_PAGE_PAGE) . ' "' . $page->getTitle() . '" (' . $page->getID() . ')';
$redirect = '<a href="' . $page->getURL(false, false, PATH_RELATIVETO_WEBROOT, true) . '">' . io::htmlspecialchars($label) . '</a>';
} else {
$redirect = '<a href="' . $url . '" target="_blank">' . io::htmlspecialchars($url) . '</a>';
}
$content = '
<div id="atm-center">
<div class="atm-alert">' . $cms_language->getMessage(MESSAGE_PAGE_REDIRECT, array($redirect)) . '</div>
</div>';
} else {
$content = '
<div id="atm-center">
<div class="atm-alert">' . $cms_language->getMessage(MESSAGE_PAGE_PAGE_REDIRECT_ERROR) . '</div>
</div>';
}
}
$view->setContent($content);
$view->show(CMS_view::SHOW_HTML);
示例11: _lookForBlockParameters
/**
* Look if this block can have or must have parameters to been set ? (search parameters for now)
*
* @return boolean true
* @access private
*/
private function _lookForBlockParameters()
{
if ($this->_canhasParameters !== null && $this->_musthaveParameters !== null) {
return true;
}
$this->_canhasParameters = false;
$this->_musthaveParameters = false;
$domdocument = new CMS_DOMDocument();
try {
$domdocument->loadXML('<dummy>' . $this->_definition . '</dummy>');
} catch (DOMException $e) {
$this->raiseError('Parse error during search for blocks parameters : ' . $e->getMessage() . " :\n" . io::htmlspecialchars($this->_definition));
return true;
}
$searchTags = $domdocument->getElementsByTagName('atm-search');
if ($searchTags->length) {
foreach ($searchTags as $searchTag) {
$paramTags = array();
$paramTags[] = $searchTag->getElementsByTagName('atm-search-param');
$paramTags[] = $searchTag->getElementsByTagName('atm-search-limit');
$paramTags[] = $searchTag->getElementsByTagName('atm-search-page');
$paramTags[] = $searchTag->getElementsByTagName('atm-search-order');
foreach ($paramTags as $paramTagType) {
foreach ($paramTagType as $paramTag) {
if ($paramTag->hasAttribute('value') && $paramTag->getAttribute('value') == 'block') {
$this->_canhasParameters = true;
//check for mandatory block parameter value (all are mandatory except for atm-search-param which is explicitely defined)
if ($paramTag->getAttribute('mandatory') == 'true' && $paramTag->tagName == 'atm-search-param' || $paramTag->tagName != 'atm-search-param') {
$this->_musthaveParameters = true;
return true;
}
}
}
}
}
}
// if we are here it means that no search mandatory atm-search-param was found
// Let's check for atm-blockvar elements
$blockVarsTags = $domdocument->getElementsByTagName('atm-blockvar');
if ($blockVarsTags->length) {
// at least one atm-blockvar was found, so the tag can have parameters
$this->_canhasParameters = true;
foreach ($blockVarsTags as $blockVarTag) {
if ($blockVarTag->getAttribute('mandatory') == 'true') {
// a mandatory value was found, no need to continue the loop
$this->_musthaveParameters = true;
return true;
}
}
}
return true;
}
示例12: getValue
/**
* get an object value
*
* @param string $name : the name of the value to get
* @param string $parameters (optional) : parameters for the value to get
* @return multidimentionnal array : the object values structure
* @access public
*/
function getValue($name, $parameters = '')
{
$params = $this->getParamsValues();
switch ($name) {
case 'label':
return isset($params['html']) && $params['html'] ? $this->getLabel() : io::htmlspecialchars($this->getLabel());
break;
case 'txtvalue':
if (isset($params['html']) && $params['html']) {
return strip_tags(str_replace('<br />', "\n", str_replace(array("\n", "\r"), "", $this->_evalPHPContent($this->_subfieldValues[0]->getValue()))));
} else {
return $this->_subfieldValues[0]->getValue();
}
break;
case 'htmlvalue':
case 'value':
//do not put an htmlspecialchars on text only value because line-breaks are auto converted to <br /> tags
if (isset($params['html']) && $params['html']) {
return $this->_evalPHPContent($this->_subfieldValues[0]->getValue());
} else {
return $name == 'value' ? str_replace('<br />', "\n", str_replace(array("\n", "\r"), "", $this->_subfieldValues[0]->getValue())) : sensitiveIO::convertTextToHTML($this->_subfieldValues[0]->getValue(), false);
}
break;
case 'hasvalue':
return $this->_subfieldValues[0]->getValue() ? true : false;
break;
case 'rawvalue':
return $this->_subfieldValues[0]->getValue();
break;
default:
return parent::getValue($name, $parameters);
break;
}
}
示例13: array
CMS_grandFather::raiseError('Unknown window Id ...');
$view->show();
}
//load module
$module = CMS_modulesCatalog::getByCodename($codename);
if (!$module) {
CMS_grandFather::raiseError('Unknown module or module 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();
}
$moduleLabel = sensitiveIO::sanitizeJSString(io::htmlspecialchars($module->getLabel($cms_language)));
$jscontent = <<<END
\tvar moduleCategoriesWindow = Ext.getCmp('{$winId}');
\tvar fatherWindow = Ext.getCmp('{$fatherId}');
\t//do not allow change of maxDepth before layout is completely done
\tvar allowChangeMaxdepth = false;
\t
\tvar categoryWindows = [];
\t
\tvar tree = new Ext.tree.TreePanel({
\t\ttitle:\t\t\t'{$cms_language->getJsMessage(MESSAGE_PAGE_DRAG_DROP)}',
\t\tautoScroll:\t\ttrue,
animate:\t\ttrue,
region:\t\t\t'center',
\t\tborder:\t\t\tfalse,
\t\tenableDD:\t\ttrue,
示例14: _parseTemplateForParameters
/**
* Parse the content of a template for module parameters and returns the content.
* Usually used by the getData() function to handle template files and feed them with module parameters
*
* @param string $filename The filename of the template, located in the templates directory
* @return string the data from the rows.
* @access private
*/
protected function _parseTemplateForParameters($filename)
{
$module = CMS_modulesCatalog::getByCodename($this->_attributes["module"]);
if (!$module instanceof CMS_module) {
$this->raiseError("No module defined for the clientspace");
return false;
}
$parameters = $module->getParameters();
$templateFile = new CMS_file(PATH_TEMPLATES_FS . "/" . $filename);
if ($templateFile->exists()) {
$cdata = $templateFile->getContent();
//no need to be complicated if no parameters
if (!$parameters) {
return $cdata;
}
//"parse" template for parameters. No XML parsing (PHP code produces strange results)
//MUST wipe out the linefeeds, because pcre's stop at them !!!
$cdata_pcre = str_replace("\n", "§§", $cdata);
while (true) {
unset($regs);
preg_match('/(.*)(<module-param [^>]*\\/>)(.*)/', $cdata_pcre, $regs);
if (isset($regs[2])) {
$param_value = '';
$domdocument = new CMS_DOMDocument();
try {
$domdocument->loadXML('<dummy>' . $regs[2] . '</dummy>');
} catch (DOMException $e) {
$this->raiseError('Parse error during search for module-param parameters : ' . $e->getMessage() . " :\n" . io::htmlspecialchars($regs[2]));
return false;
}
$paramsTags = $domdocument->getElementsByTagName('module-param');
foreach ($paramsTags as $paramTag) {
$param_value = str_replace("\n", "§§", $parameters[$paramTag->getAttribute("name")]);
}
$cdata_pcre = $regs[1] . $param_value . $regs[3];
} else {
break;
}
}
$cdata = str_replace("§§", "\n", $cdata_pcre);
return $cdata;
} else {
$this->raiseError("Template " . $filename . " isn't readable");
return false;
}
}
示例15: unset
//load interface
Automne.load(' . sensitiveIO::jsonEncode($userSessionsInfos) . ');
//display welcome message
Automne.message.show(\'' . sensitiveIO::sanitizeJSString($welcome) . '\', \'' . sensitiveIO::sanitizeJSString($welcomeMsg) . '\', \'\', 6);
';
//add all JS locales
$jscontent .= CMS_session::getJSLocales();
$view->addJavascript($jscontent);
$view->show(CMS_view::SHOW_RAW);
} else {
unset($cms_user);
}
break;
}
//Send Login form window
$applicationLabel = io::htmlspecialchars(APPLICATION_LABEL);
$loginURL = PATH_ADMIN_WR . '/login-form.php?_ts=' . time();
$rootPath = PATH_REALROOT_WR;
$jscontent = <<<END
\tvar loginWindow = new Automne.frameWindow({
\t\ttitle: \t\t\t'{$cms_language->getJsMessage(MESSAGE_PAGE_TITLE, array($applicationLabel))}',
\t\tid:\t\t\t\t'loginWindow',
\t\tframeURL:\t\t'{$loginURL}',
\t\tallowFrameNav:\ttrue,
\t\twidth: \t\t\t400,
\t\theight:\t\t\t218,
\t\tresizable:\t\tfalse,
\t\tmaximizable:\tfalse,
\t\tautoScroll:\t\tfalse,
\t\tbodyStyle:\t\t'padding:5px;overflow:hidden;'
\t});