本文整理汇总了PHP中NNFrameworkFunctions::html_entity_decoder方法的典型用法代码示例。如果您正苦于以下问题:PHP NNFrameworkFunctions::html_entity_decoder方法的具体用法?PHP NNFrameworkFunctions::html_entity_decoder怎么用?PHP NNFrameworkFunctions::html_entity_decoder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NNFrameworkFunctions
的用法示例。
在下文中一共展示了NNFrameworkFunctions::html_entity_decoder方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInput
function getInput($name, $id, $value, $params, $children, $j15 = 0)
{
$this->params = $params;
$description = $value != '' ? $value : $this->def('description');
// variables
$v1 = JText::_($this->def('var1'));
$v2 = JText::_($this->def('var2'));
$v3 = JText::_($this->def('var3'));
$v4 = JText::_($this->def('var4'));
$v5 = JText::_($this->def('var5'));
$html = JText::sprintf($description, $v1, $v2, $v3, $v4, $v5);
$html = trim(NNFrameworkFunctions::html_entity_decoder($html));
$html = str_replace('"', '"', $html);
$html = str_replace('span style="font-family:monospace;"', 'span class="nn_code"', $html);
if (!$j15 && ($this->def('label') || $value)) {
// display as label on Joomla 1.6+ if there is more than just a description
$html = '<fieldset id="' . $id . '" class="radio"><label>' . $html . '</label></fieldset>';
}
return $html;
}
示例2: processModule
function processModule($module, $style = 'none', $overrides = array())
{
$db =& JFactory::getDBO();
$where = ' AND ( title=' . $db->quote(NNFrameworkFunctions::html_entity_decoder($module)) . '';
if (is_numeric($module)) {
$where .= ' OR id=' . $module;
}
$where .= ' ) ';
if (!$this->params->ignore_state) {
$where .= ' AND published = 1';
}
$query = 'SELECT *' . ' FROM #__modules' . ' WHERE client_id = 0' . ' AND access ' . (defined('_JACL') ? 'IN (' . $this->params->aid_jaclplus . ')' : '<= ' . (int) $this->params->aid) . $where . ' ORDER BY ordering' . ' LIMIT 1';
$db->setQuery($query);
$module = $db->loadObject();
$html = '';
if ($module) {
//determine if this is a custom module
$module->user = substr($module->module, 0, 4) == 'mod_' ? 0 : 1;
// set style
$module->style = $style;
// override module settings
$params = '';
foreach ($overrides as $key => $val) {
$params .= "\n" . $key . '=' . $val;
}
if ($params != '') {
$module->params = trim($module->params) . $params . "\n\n";
}
$document = clone JFactory::getDocument();
$document->_type = 'html';
$renderer = $document->loadRenderer('module');
$html = $renderer->render($module, array('style' => $style));
}
return $html;
}
示例3: getTitleBlock
private function getTitleBlock($title = '', $description = '', $start = 0, $j15 = 0)
{
$nostyle = $this->def('nostyle', 0);
if ($title) {
$title = NNFrameworkFunctions::html_entity_decoder(JText::_($title));
}
if ($description) {
// variables
$v1 = $this->def('var1');
$v2 = $this->def('var2');
$v3 = $this->def('var3');
$v4 = $this->def('var4');
$v5 = $this->def('var5');
$description = NNFrameworkFunctions::html_entity_decoder(trim(JText::sprintf($description, $v1, $v2, $v3, $v4, $v5)));
$description = str_replace('span style="font-family:monospace;"', 'span class="nn_code"', $description);
}
$html = array();
if ($title) {
if ($nostyle) {
$html[] = '<div style="clear:both;"><div>';
} else {
$class = 'panel nn_panel nn_panel_title';
if ($j15) {
$class .= ' nn_panel_15';
}
if ($start || $description) {
$class .= ' nn_panel_top';
}
$html[] = '<div class="' . $class . '"><div class="nn_block nn_title">';
}
$html[] = $title;
$html[] = '<div style="clear: both;"></div>';
$html[] = '</div></div>';
}
if ($description) {
if ($nostyle) {
$html[] = '<div style="clear:both;"><div>';
} else {
$class = 'panel nn_panel nn_panel_description';
if ($j15) {
$class .= ' nn_panel_15';
}
if ($start) {
$class .= ' nn_panel_top';
}
if ($title) {
$class .= ' nn_panel_hastitle';
}
$html[] = '<div class="' . $class . '"><div class="nn_block nn_title">';
}
$html[] = $description;
$html[] = '<div style="clear: both;"></div>';
$html[] = '</div></div>';
}
return implode('', $html);
}
示例4: getInput
function getInput($name, $id, $value, $params, $children, $j15 = 0)
{
$this->params = $params;
$document = JFactory::getDocument();
$document->addStyleSheet(JURI::root(true) . '/plugins/system/nnframework/css/style.css?v=' . $this->_version);
$title = $this->def('label');
$description = $this->def('description');
$xml = $this->def('xml');
$lang_file = $this->def('language_file');
$image = $this->def('image');
$image_w = $this->def('image_w');
$image_h = $this->def('image_h');
$url = $this->def('url');
$help_url = $this->def('help_url');
if ($description) {
// variables
$v1 = $this->def('var1');
$v2 = $this->def('var2');
$v3 = $this->def('var3');
$v4 = $this->def('var4');
$v5 = $this->def('var5');
$description = NNFrameworkFunctions::html_entity_decoder(trim(JText::sprintf($description, $v1, $v2, $v3, $v4, $v5)));
}
if ($lang_file) {
jimport('joomla.filesystem.file');
// Include extra language file
$language = JFactory::getLanguage();
$lang = str_replace('_', '-', $language->getTag());
$inc = '';
$lang_path = 'language/' . $lang . '/' . $lang . '.' . $lang_file . '.inc.php';
if (JFile::exists(JPATH_ADMINISTRATOR . '/' . $lang_path)) {
$inc = JPATH_ADMINISTRATOR . '/' . $lang_path;
} else {
if (JFile::exists(JPATH_SITE . '/' . $lang_path)) {
$inc = JPATH_SITE . '/' . $lang_path;
}
}
if (!$inc && $lang != 'en-GB') {
$lang = 'en-GB';
$lang_path = 'language/' . $lang . '/' . $lang . '.' . $lang_file . '.inc.php';
if (JFile::exists(JPATH_ADMINISTRATOR . '/' . $lang_path)) {
$inc = JPATH_ADMINISTRATOR . '/' . $lang_path;
} else {
if (JFile::exists(JPATH_SITE . '/' . $lang_path)) {
$inc = JPATH_SITE . '/' . $lang_path;
}
}
}
if ($inc) {
include $inc;
}
}
if ($title) {
$title = JText::_($title);
}
if ($description) {
$description = str_replace('span style="font-family:monospace;"', 'span class="nn_code"', $description);
if ($description['0'] != '<') {
$description = '<p>' . $description . '</p>';
}
}
if ($xml) {
$xml = JApplicationHelper::parseXMLInstallFile(JPATH_SITE . '/' . $xml);
$version = 0;
if ($xml && isset($xml['version'])) {
$version = $xml['version'];
}
if ($version) {
if (!(strpos($version, 'PRO') === false)) {
$version = str_replace('PRO', '', $version);
$version .= ' <small style="color:green">[PRO]</small>';
} else {
if (!(strpos($version, 'FREE') === false)) {
$version = str_replace('FREE', '', $version);
$version .= ' <small style="color:green">[FREE]</small>';
}
}
if ($title) {
$title .= ' v';
} else {
$title = JText::_('Version') . ' ';
}
$title .= $version;
}
}
if ($url) {
$url = '<a href="' . $url . '" target="_blank" title="' . preg_replace('#<[^>]*>#', '', $title) . '">';
}
$html = array();
$html[] = '<div class="panel nn_panel' . ($j15 ? ' nn_panel_15' : '') . '"><div class="nn_block nn_title">';
if ($image) {
$image = str_replace('/', "\n", str_replace('\\', '/', $image));
$image = explode("\n", trim($image));
if ($image['0'] == 'administrator') {
$image['0'] = JURI::base(true);
} else {
$image['0'] = JURI::root(true) . '/' . $image['0'];
}
$image = '<img src="' . implode('/', $image) . '" border="0" style="float:right;margin-left:10px" alt=""';
if ($image_w) {
//.........这里部分代码省略.........
示例5: processModule
function processModule($module, $style = 'none', $overrides = array())
{
$db =& JFactory::getDBO();
$where = ' AND ( title=' . $db->quote(NNFrameworkFunctions::html_entity_decoder($module)) . '';
if (is_numeric($module)) {
$where .= ' OR id=' . $module;
}
$where .= ' ) ';
if (!$this->params->ignore_state) {
$where .= ' AND published = 1';
}
$query = 'SELECT *' . ' FROM #__modules' . ' WHERE client_id = 0' . ' AND access IN (' . implode(',', $this->params->aid) . ')' . $where . ' ORDER BY ordering' . ' LIMIT 1';
$db->setQuery($query);
$module = $db->loadObject();
$html = '';
if ($module) {
//determine if this is a custom module
$module->user = substr($module->module, 0, 4) == 'mod_' ? 0 : 1;
// set style
$module->style = $style;
// override module parameters
$params = json_decode($module->params);
foreach ($overrides as $key => $val) {
if (isset($params->{$key}) && is_array($params->{$key})) {
$val = explode(',', $val);
}
$params->{$key} = $val;
}
$module->params = json_encode($params);
$document = clone JFactory::getDocument();
$document->_type = 'html';
$renderer = $document->loadRenderer('module');
$html = $renderer->render($module, array('style' => $style));
}
return $html;
}
示例6: getInput
function getInput( $name, $id, $value, $params, $children, $j15 = 0 )
{
$this->params = $params;
$label = $this->def( 'label' );
$description = $this->def( 'description' );
$lang_file = $this->def( 'language_file' );
$show_apply = $this->def( 'show_apply' );
$html = '</td></tr></table></div></div>';
$html .= '<div class="panel"><h3 class="jpane-toggler title" id="advanced-page"><span>';
$html .= NNFrameworkFunctions::html_entity_decoder( JText::_( $label ) );
$html .= '</span></h3>';
$html .= '<div class="jpane-slider content"><table width="100%" class="paramlist admintable" cellspacing="1"><tr><td colspan="2" class="paramlist_value">';
if ( $description ) {
// variables
$v1 = $this->def( 'var1' );
$v2 = $this->def( 'var2' );
$v3 = $this->def( 'var3' );
$v4 = $this->def( 'var4' );
$v5 = $this->def( 'var5' );
$description = NNFrameworkFunctions::html_entity_decoder( trim( JText::sprintf( $description, $v1, $v2, $v3, $v4, $v5 ) ) );
}
if ( $lang_file ) {
jimport( 'joomla.filesystem.file' );
// Include extra language file
$language = JFactory::getLanguage();
$lang = str_replace( '_', '-', $language->getTag() );
$inc = '';
$lang_path = 'language/'.$lang.'/'.$lang.'.'.$lang_file.'.inc.php';
if ( JFile::exists( JPATH_ADMINISTRATOR.'/'.$lang_path ) ) {
$inc = JPATH_ADMINISTRATOR.'/'.$lang_path;
} else if ( JFile::exists( JPATH_SITE.'/'.$lang_path ) ) {
$inc = JPATH_SITE.'/'.$lang_path;
}
if ( !$inc && $lang != 'en-GB' ) {
$lang = 'en-GB';
$lang_path = 'language/'.$lang.'/'.$lang.'.'.$lang_file.'.inc.php';
if ( JFile::exists( JPATH_ADMINISTRATOR.'/'.$lang_path ) ) {
$inc = JPATH_ADMINISTRATOR.'/'.$lang_path;
} else if ( JFile::exists( JPATH_SITE.'/'.$lang_path ) ) {
$inc = JPATH_SITE.'/'.$lang_path;
}
}
if ( $inc ) {
include $inc;
}
}
if ( $description ) {
$description = str_replace( 'span style="font-family:monospace;"', 'span class="nn_code"', $description );
if ( $description['0'] != '<' ) {
$description = '<p>'.$description.'</p>';
}
$class = 'panel nn_panel nn_panel_description';
if ( $j15 ) {
$class .= ' nn_panel_15';
}
$html .= '<div class="'.$class.'"><div class="nn_block nn_title">';
if ( $show_apply ) {
$apply_button = '<a href="#" onclick="submitbutton( \'apply\' );" title="'.JText::_( 'Apply' ).'"><img align="right" border="0" alt="'.JText::_( 'Apply' ).'" src="images/tick.png"/></a>';
$html .= $apply_button;
}
$html .= $description;
$html .= '<div style="clear: both;"></div></div></div>';
}
return $html;
}
示例7: getInput
function getInput( $name, $id, $value, $params, $children, $j15 = 0 )
{
$this->params = $params;
$start = $this->def( 'start' );
$end = $this->def( 'end' );
$blocktype = $this->def( 'blocktype' );
if ( $blocktype == 'spacer' ) {
return;
}
$document =& JFactory::getDocument();
$document->addStyleSheet( JURI::root( true ).'/plugins/system/nnframework/css/style.css?v='.$this->_version );
if ( $end ) {
$html = '';
if ( $j15 ) {
$random = rand( 100000, 999999 );
$html .= '<div id="end-'.$random.'"></div><script type="text/javascript">NNFrameworkHideTD( "end-'.$random.'" );</script>';
$html .= '</td></tr></table>';
} else {
$html .= '<div style="clear: both;"></div></li></ul>';
}
if ( $j15 && $blocktype == 'fieldset' ) {
$html .= '</fieldset>';
} else {
$html .= '</div></div>';
}
return $html;
}
$description = $this->def( 'description' );
$nostyle = $this->def( 'nostyle' );
$title = $this->def( 'label' );
$lang_file = $this->def( 'language_file' );
$message_type = $this->def( 'message_type' );
$image = $this->def( 'image' );
$image_w = $this->def( 'image_w' );
$image_h = $this->def( 'image_h' );
$show_apply = $this->def( 'show_apply' );
$toggle = $this->def( 'toggle' );
$tooltip = $this->def( 'tooltip' );
// The main url
$url = $this->def( 'url' );
$help = $this->def( 'help_url' );
$extension = $this->def( 'extension' );
$xml = $this->def( 'xml' );
$version = $this->def( 'version' );
$version_file = $this->def( 'version_file' );
if ( !$extension ) {
$extension = str_replace( 'version_', '', $version_file );
}
$msg = '';
if ( $description ) {
// variables
$v1 = $this->def( 'var1' );
$v2 = $this->def( 'var2' );
$v3 = $this->def( 'var3' );
$v4 = $this->def( 'var4' );
$v5 = $this->def( 'var5' );
$description = NNFrameworkFunctions::html_entity_decoder( trim( JText::sprintf( $description, $v1, $v2, $v3, $v4, $v5 ) ) );
}
if ( $lang_file ) {
jimport( 'joomla.filesystem.file' );
// Include extra language file
$language =& JFactory::getLanguage();
$lang = str_replace( '_', '-', $language->getTag() );
$inc = '';
$lang_path = 'language/'.$lang.'/'.$lang.'.'.$lang_file.'.inc.php';
if ( JFile::exists( JPATH_ADMINISTRATOR.'/'.$lang_path ) ) {
$inc = JPATH_ADMINISTRATOR.'/'.$lang_path;
} else if ( JFile::exists( JPATH_SITE.'/'.$lang_path ) ) {
$inc = JPATH_SITE.'/'.$lang_path;
}
if ( !$inc && $lang != 'en-GB' ) {
$lang = 'en-GB';
$lang_path = 'language/'.$lang.'/'.$lang.'.'.$lang_file.'.inc.php';
if ( JFile::exists( JPATH_ADMINISTRATOR.'/'.$lang_path ) ) {
$inc = JPATH_ADMINISTRATOR.'/'.$lang_path;
} else if ( JFile::exists( JPATH_SITE.'/'.$lang_path ) ) {
$inc = JPATH_SITE.'/'.$lang_path;
}
}
if ( $inc ) {
include $inc;
}
}
if ( $description ) {
$description = str_replace( 'span style="font-family:monospace;"', 'span class="nn_code"', $description );
if ( !$nostyle && $description['0'] != '<' ) {
//.........这里部分代码省略.........
示例8: processArticle
function processArticle($article, $art, $text = '', $type = 'article')
{
if ($type == 'k2' && !$this->params->dbselects_k2) {
$type = '';
}
$regex = '#\\{(/?[^\\}]+)\\}#si';
if (preg_match_all($regex, $text, $matches, PREG_SET_ORDER) > 0) {
if ($type == 'k2') {
$selects = $this->params->dbselects_k2;
} else {
$selects = $this->params->dbselects_content;
}
if ($art && in_array($article, array('current', 'self', '{id}', '{title}', '{alias}'))) {
if (isset($art->id)) {
$article = $art->id;
} else {
if (isset($art->link) && preg_match('#&id=([0-9]*)#', $art->link, $match)) {
$article = $match['1'];
}
}
}
foreach ($matches as $match) {
$data = trim($match['1']);
if (!(strpos($data, 'intro') === false)) {
$selects[] = 'introtext';
} else {
if (!(strpos($data, 'full') === false)) {
$selects[] = 'fulltext';
} else {
if (!(strpos($data, 'text') === false)) {
$selects[] = 'introtext';
$selects[] = 'fulltext';
}
}
}
}
$selects = array_unique($selects);
$selects = 'c.`' . implode('`, c.`', $selects) . '`';
$joins = '';
if ($type == 'article') {
$selects .= ', CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(":", c.id, c.alias) ELSE c.id END as slug';
$selects .= ', CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":", cc.id, cc.alias) ELSE cc.id END as catslug';
$joins = ' LEFT JOIN #__categories as cc ON cc.id = c.catid';
}
$where = ' AND ( c.title = ' . $this->database->quote(NNFrameworkFunctions::html_entity_decoder($article));
$where .= ' OR c.alias = ' . $this->database->quote(NNFrameworkFunctions::html_entity_decoder($article));
if (is_numeric($article)) {
$where .= ' OR c.id = ' . $article;
}
$where .= ' ) ';
if (!$this->params->ignore_state) {
$jnow =& JFactory::getDate();
$now = $jnow->toMySQL();
$nullDate = $this->database->getNullDate();
if ($type == 'k2') {
$where .= ' AND c.published = 1 AND trash = 0';
} else {
$where .= ' AND c.state = 1';
}
$where .= ' AND ( c.publish_up = ' . $this->database->quote($nullDate) . ' OR c.publish_up <= ' . $this->database->quote($now) . ' )' . ' AND ( c.publish_down = ' . $this->database->quote($nullDate) . ' OR c.publish_down >= ' . $this->database->quote($now) . ' )';
}
$query = 'SELECT ' . $selects . ' FROM ' . ($type == 'k2' ? '#__k2_items as c' : '#__content as c') . $joins . ' WHERE c.access IN (' . implode(',', $this->params->aid) . ')' . $where . ' ORDER BY c.ordering' . ' LIMIT 1';
$this->database->setQuery($query);
$article = $this->database->loadObject();
if (!$article) {
return '<!-- ' . JText::_('AA_ACCESS_TO_ARTICLE_DENIED') . ' -->';
}
$ifregex = '#\\{if:([^\\}]+)\\}(.*?)(?:\\{else\\}(.*?))?\\{/if\\}#si';
if (preg_match_all($ifregex, $text, $ifs, PREG_SET_ORDER) > 0) {
foreach ($ifs as $if) {
$pass = 0;
$eval = '$pass = ( ( $article->' . str_replace('=', '==', trim($if['1'])) . ' ) ? 1 : 0 );';
$eval = str_replace('$article->!', '!$article->', $eval);
eval($eval);
if (!$pass) {
$text = str_replace($if['0'], isset($if['3']) ? $if['3'] : '', $text);
} else {
$text = str_replace($if['0'], $if['2'], $text);
}
}
}
}
if (preg_match_all($regex, $text, $matches, PREG_SET_ORDER) > 0) {
foreach ($matches as $match) {
$data = trim($match['1']);
$ok = 0;
$str = '';
$data = explode(':', $data, 2);
$tag = trim($data['0']);
$extra = isset($data['1']) ? trim($data['1']) : '';
if ($tag == '/link') {
$str = '</a>';
$ok = 1;
} else {
if ($tag == '/div') {
$str = '</div>';
$ok = 1;
} else {
if ($tag == 'div' || strpos($tag, 'div ') === 0) {
if ($tag != 'div') {
//.........这里部分代码省略.........
示例9: cleanText
function cleanText(&$string)
{
// replace chr style enters with normal enters
$string = str_replace(array(chr(194) . chr(160), ' '), ' ', $string);
// replace linbreak tags with normal linebreaks (paragraphs, enters, etc).
$enter_tags = array('p', 'br');
$regex = '#</?((' . implode(')|(', $enter_tags) . '))+[^>]*?>\\n?#si';
$string = preg_replace($regex, " \n", $string);
// replace indent characters with spaces
$string = preg_replace('#<' . 'img [^>]*/sourcerer/images/tab\\.png[^>]*>#si', ' ', $string);
// strip all other tags
$regex = '#<(/?\\w+((\\s+\\w+(\\s*=\\s*(?:".*?"|\'.*?\'|[^\'">\\s]+))?)+\\s*|\\s*)/?)>#si';
$string = preg_replace($regex, "", $string);
// reset htmlentities
$string = NNFrameworkFunctions::html_entity_decoder($string);
// convert protected html entities &_...; -> &...;
$string = preg_replace('#&_([a-z0-9\\#]+?);#i', '&\\1;', $string);
}