本文整理汇总了PHP中icms_core_DataFilter::undoHtmlSpecialChars方法的典型用法代码示例。如果您正苦于以下问题:PHP icms_core_DataFilter::undoHtmlSpecialChars方法的具体用法?PHP icms_core_DataFilter::undoHtmlSpecialChars怎么用?PHP icms_core_DataFilter::undoHtmlSpecialChars使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类icms_core_DataFilter
的用法示例。
在下文中一共展示了icms_core_DataFilter::undoHtmlSpecialChars方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getContent
public function getContent($format = 'S', $c_type = 'T')
{
switch ($format) {
case 'S':
if ($c_type == 'H') {
$content = $this->getVar('content', 'n');
$content = str_replace('{X_SITEURL}', ICMS_URL . '/', $content);
$content = str_replace(XOOPS_DB_SALT, '', $content);
return $content;
} elseif ($c_type == 'P') {
ob_start();
echo eval(icms_core_DataFilter::undoHtmlSpecialChars($this->getVar('content', 'e')));
$content = ob_get_contents();
ob_end_clean();
$content = str_replace('{X_SITEURL}', ICMS_URL . '/', $content);
$content = str_replace(XOOPS_DB_SALT, '', $content);
return $content;
} elseif ($c_type == 'S') {
$myts =& icms_core_Textsanitizer::getInstance();
$content = str_replace('{X_SITEURL}', ICMS_URL . '/', $this->getVar('content', 'n'));
return $myts->displayTarea($content, 1, 1);
} else {
$content = str_replace('{X_SITEURL}', ICMS_URL . '/', $this->getVar('content', 'n'));
return icms_core_DataFilter::checkVar($content, 'text', 'output');
}
break;
case 'E':
return $this->getVar('content', 'e');
break;
default:
return $this->getVar('content', 'n');
break;
}
}
示例2: textsanitizer_geshi_css_highlight
/**
* Highlights the passed source code as css
*
* @param $source
*/
function textsanitizer_geshi_css_highlight($source)
{
if (!@(include_once ICMS_LIBRARIES_PATH . '/geshi/geshi.php')) {
return false;
}
$source = icms_core_DataFilter::undoHtmlSpecialChars($source);
// Create the new GeSHi object, passing relevant stuff
$geshi = new GeSHi($source, 'css');
// Enclose the code in a <div>
$geshi->set_header_type(GESHI_HEADER_NONE);
// Sets the proper encoding charset other than "ISO-8859-1"
$geshi->set_encoding(_CHARSET);
$geshi->set_link_target("_blank");
// Parse the code
$code = $geshi->parse_code();
$code = "<div class=\"icmsCodeCss\"><code>" . $code . "</code></div>";
return $code;
}
示例3: Generate_PDF
/**
* Generates a pdf file
*
* @param string $content The content to put in the PDF file
* @param string $doc_title The title for the PDF file
* @param string $doc_keywords The keywords to put in the PDF file
* @return string Generated output by the pdf (@link TCPDF) class
*/
function Generate_PDF($content, $doc_title, $doc_keywords)
{
global $icmsConfig;
require_once ICMS_PDF_LIB_PATH . '/tcpdf.php';
icms_loadLanguageFile('core', 'pdf');
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor(PDF_AUTHOR);
$pdf->SetTitle($doc_title);
$pdf->SetSubject($doc_title);
$pdf->SetKeywords($doc_keywords);
$sitename = $icmsConfig['sitename'];
$siteslogan = $icmsConfig['slogan'];
$pdfheader = icms_core_DataFilter::undoHtmlSpecialChars($sitename . ' - ' . $siteslogan);
$pdf->SetHeaderData("logo.gif", PDF_HEADER_LOGO_WIDTH, $pdfheader, ICMS_URL);
//set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
//set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
//set image scale factor
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
$pdf->setLanguageArray($l);
//set language items
// set font
$TextFont = @_PDF_LOCAL_FONT && file_exists(ICMS_PDF_LIB_PATH . '/fonts/' . _PDF_LOCAL_FONT . '.php') ? _PDF_LOCAL_FONT : 'dejavusans';
$pdf->SetFont($TextFont);
//initialize document
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->writeHTML($content, true, 0);
return $pdf->Output();
}
示例4: icms_purifyText
/**
* Strip text from unwanted text (purify)
*
* @param string $text String to purify
* @param mixed $keyword The keyword string or false if none was passed
* @return string $text The purified text
* @todo Remove this and use HTML Purifier
*/
function icms_purifyText($text, $keyword = false)
{
$text = str_replace(' ', ' ', $text);
$text = str_replace('<br />', ' ', $text);
$text = str_replace('<br/>', ' ', $text);
$text = str_replace('<br', ' ', $text);
$text = strip_tags($text);
$text = html_entity_decode($text);
$text = icms_core_DataFilter::undoHtmlSpecialChars($text);
$text = str_replace(')', ' ', $text);
$text = str_replace('(', ' ', $text);
$text = str_replace(':', ' ', $text);
$text = str_replace('&euro', ' euro ', $text);
$text = str_replace('&hellip', '...', $text);
$text = str_replace('&rsquo', ' ', $text);
$text = str_replace('!', ' ', $text);
$text = str_replace('?', ' ', $text);
$text = str_replace('"', ' ', $text);
$text = str_replace('-', ' ', $text);
$text = str_replace('\\n', ' ', $text);
$text = str_replace('―', ' ', $text);
if ($keyword) {
$text = str_replace('.', ' ', $text);
$text = str_replace(',', ' ', $text);
$text = str_replace('\'', ' ', $text);
}
$text = str_replace(';', ' ', $text);
return $text;
}
示例5: renderWithPhp
/**
* Rendering a custom tag that contains PHP
*/
public function renderWithPhp() {
if (!$this->content && !$this->evaluated) {
$ret = $this->getVar('customtag_content', 'e');
$ret = icms_core_DataFilter::undoHtmlSpecialChars($ret);
// check for PHP if we are not on admin side
if (!defined('XOOPS_CPFUNC_LOADED' ) && $this->getVar('customtag_type') == ICMS_CUSTOMTAG_TYPE_PHP) {
// we have PHP code, let's evaluate
ob_start();
echo eval($ret);
$ret = ob_get_contents();
ob_end_clean();
$this->evaluated = TRUE;
}
$this->content = $ret;
}
return $this->content;
}
示例6: getOutputValue
/**
* Returns a value for output of this field
*
* @param icms_member_user_Object $user object to get the value of
* @param mod_profile_Profile $profile object to get the value of
* @global array $icmsConfigAuth
* @return mixed
**/
public function getOutputValue(&$user, $profile)
{
global $icmsConfigAuth;
$value = in_array($this->getVar('field_name'), $this->getUserVars()) ? $user->getVar($this->getVar('field_name')) : $profile->getVar($this->getVar('field_name'));
switch ($this->getVar('field_type')) {
case "textarea":
case "dhtml":
return icms_core_DataFilter::undoHtmlSpecialChars(str_replace('&', '&', $value), 1);
break;
case "select":
case "radio":
$options = unserialize($this->getVar('field_options', 'n'));
return isset($options[$value]) ? htmlspecialchars($options[$value]) : "";
break;
case "select_multi":
case "checkbox":
$options = unserialize($this->getVar('field_options', 'n'));
$ret = array();
if (count($options) > 0) {
foreach (array_keys($options) as $key) {
if (in_array($key, $value)) {
$ret[$key] = htmlspecialchars($options[$key]);
}
}
}
return $ret;
break;
case "group":
//change to retrieve groups and return name of group
return $value;
break;
case "group_multi":
//change to retrieve groups and return array of group names
return "";
break;
case "longdate":
//return YYYY/MM/DD format - not optimal as it is not using local date format, but how do we do that
//when we cannot convert it to a UNIX timestamp?
return str_replace("-", "/", $value);
case "date":
if ($value > 0) {
return formatTimestamp($value, 's');
}
return "";
break;
case "datetime":
if ($value > 0) {
return formatTimestamp($value, 'm');
}
return "";
break;
case "autotext":
$value = $user->getVar($this->getVar('field_name'), 'n');
//autotext can have HTML in it
$value = str_replace("{X_UID}", $user->getVar("uid"), $value);
$value = str_replace("{X_URL}", ICMS_URL, $value);
$value = str_replace("{X_UNAME}", $user->getVar("uname"), $value);
return $value;
break;
case "rank":
$userrank = $user->rank();
return '<img src="' . $userrank['image'] . '" alt="' . $userrank['title'] . '" /> ' . $userrank['title'];
break;
case "yesno":
return $value ? _YES : _NO;
break;
case "timezone":
$timezones = icms_form_elements_select_Timezone::getTimeZoneList();
return $timezones[str_replace('.0', '', $value)];
break;
case "image":
if ($value == "") {
return '';
}
return "<img src='" . ICMS_UPLOAD_URL . "/" . basename(dirname(dirname(__FILE__))) . "/" . $value . "' alt='image' />";
break;
case "url":
if ($value == "") {
return '';
}
return icms_core_DataFilter::makeClickable(formatURL($value));
case "location":
if ($value == "") {
return '';
}
return $value . ' <a href="http://maps.google.com/?q=' . $value . '" target="_blank" ><img src="' . ICMS_URL . '/modules/' . basename(dirname(dirname(__FILE__))) . '/images/mapsgoogle.gif" alt="" /></a>';
case "email":
if ($value == "") {
return '';
}
if ($user->getVar('user_viewemail') || is_object(icms::$user) && (icms::$user->isAdmin() || icms::$user->getVar('uid') == $user->getVar('uid'))) {
return '<a href="mailto:' . $value . '">' . $value . '</a>';
//.........这里部分代码省略.........
示例7: undoHtmlSpecialChars
/**
* Reverses {@link htmlSpecialChars()}
*
* @param string $text
* @return string
**/
public static function undoHtmlSpecialChars($text)
{
icms_core_Debug::setDeprecated('icms_core_DataFilter::undoHtmlSpecialChars', sprintf(_CORE_REMOVE_IN_VERSION, '1.4'));
return icms_core_DataFilter::undoHtmlSpecialChars($text);
}