示例#1
0
 function _readIntroText($id, $merge_fields = false)
 {
     $system_texts = AMPSystem_Lookup::instance('introTexts');
     if (!isset($system_texts[$id])) {
         return $id;
     }
     $textdata =& new AMPSystem_IntroText($this->dbcon, $id);
     if ($textdata->isHtml()) {
         $this->containsHTML(true);
     }
     if ($merge_fields) {
         $merged_text = $textdata->mergeBodyFields($merge_fields);
     } else {
         $merged_text = $textdata->getBody();
     }
     return AMPDisplay_HTML::_activateIncludes($merged_text) . "\n\n";
 }
示例#2
0
 function _activateIncludes($html)
 {
     $start = AMPDisplay_HTML::_findIncludeStartTag($html);
     if ($start === FALSE) {
         return $html;
     }
     $start = $start + strlen(AMP_INCLUDE_START_TAG);
     $end = AMPDisplay_HTML::_findIncludeEndTag($html, $start);
     if ($end === FALSE) {
         return $html;
     }
     $result = AMPDisplay_HTML::_processInclude(substr($html, $start, $end - $start));
     $block_end = $end + strlen(AMP_INCLUDE_END_TAG);
     $block_start = $start - strlen(AMP_INCLUDE_START_TAG);
     $current_html = AMPDisplay_HTML::_replaceInclude($html, $result, $block_start, $block_end);
     return AMPDisplay_HTML::_activateIncludes($current_html);
 }