Lines Matching refs:text
193 function formatDescription($text, $params) argument
195 $cut = $this->cutTextToLength($text, $params['maxlen']);
196 …$text = preg_replace('/<([a-z]+[^>]*) id="([^>]+)"/', '<$1 id="${2}_htmlabstract_'.microtime(true)…
201 if (FALSE !== ($pos = strrpos($text, "</p>")) && $pos >= $min)
202 $text = substr($text, 0, 4 + $pos);
205 $text .= '... ';
206 $text = $this->closeBrokenTags($text);
207 return $text;
213 function cutTextToLength(&$text, $maxlen) argument
218 $textlen = strlen($text);
220 if ('<' == $text[$i])
222 elseif ('>' == $text[$i])
227 $text = substr($text, 0, $i);
236 function closeBrokenTags($text) argument
240 $textlen = strlen($text);
242 if ($text[$i] == '<')
244 if ($text[$i + 1] != '/' && $text[$i + 1] != '!') //opening tag
247 while ($text[++$j] != ' ' && $text[$j] != '>');
248 array_push($tags, substr($text, $i + 1, $j - $i - 1));
250 elseif ($text[$i + 1] == '/') //closing tag
253 while ($text[++$j] != ' ' && $text[$j] != '>');
254 $closed_tag = substr($text, $i + 2, $j - $i - 2);
261 $text .= '</'.array_pop($tags).'>';
262 return $text;