function processModules(&$string, $area = 'articles', $context = '') { // Check if tags are in the text snippet used for the search component if (strpos($context, 'com_search.') === 0) { $limit = explode('.', $context, 2); $limit = (int) array_pop($limit); $string_check = substr($string, 0, $limit); if (!NNText::stringContains($string_check, $this->params->start_tags)) { return; } } if (!NNText::stringContains($string, $this->params->start_tags)) { return; } jimport('joomla.application.module.helper'); if (!NNFrameworkFunctions::isFeed()) { JPluginHelper::importPlugin('content'); } $this->replace($string, $area); }
function replaceInTheRest(&$string) { if (!is_string($string) || $string == '') { return; } list($pre_string, $string, $post_string) = NNText::getContentContainingSearches($string, array('{' . $this->src_params->syntax_word), array('{/' . $this->src_params->syntax_word . '}')); if ($string == '') { $string = $pre_string . $string . $post_string; return; } // COMPONENT if (NNFrameworkFunctions::isFeed()) { $s = '#(<item[^>]*>)#s'; $string = preg_replace($s, '\\1<!-- START: SRC_COMPONENT -->', $string); $string = str_replace('</item>', '<!-- END: SRC_COMPONENT --></item>', $string); } if (strpos($string, '<!-- START: SRC_COMPONENT -->') === false) { $this->tagArea($string, 'SRC', 'component'); } $components = $this->getTagArea($string, 'SRC', 'component'); foreach ($components as $component) { $this->replace($component['1'], 'components', ''); $string = str_replace($component['0'], $component['1'], $string); } // EVERYWHERE $this->replace($string, 'other'); $string = $pre_string . $string . $post_string; }