Changeset 547 for trunk/includes/Page.php
- Timestamp:
- Jun 18, 2013, 6:58:22 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/Page.php
r545 r547 325 325 } 326 326 327 function FormatOutput($s) 328 { 329 $out = ''; 330 $nn = 0; 331 $n = 0; 332 while($s != '') 333 { 334 $start = strpos($s, '<'); 335 $end = strpos($s, '>'); 336 if($start != 0) 337 { 338 $end = $start - 1; 339 $start = 0; 340 } 341 $line = trim(substr($s, $start, $end + 1)); 342 if(strlen($line) > 0) 343 if($line[0] == '<') 344 { 345 if($s[$start + 1] == '/') 346 { 347 $n = $n - 2; 348 $nn = $n; 349 } else 350 { 351 if(strpos($line, ' ')) $cmd = substr($line, 1, strpos($line, ' ') - 1); 352 else $cmd = substr($line, 1, strlen($line) - 2); 353 //echo('['.$cmd.']'); 354 if(strpos($s, '</'.$cmd.'>')) $n = $n + 2; 355 } 356 }// else $line = '['.$line.']'; 357 //if($line != '') echo(htmlspecialchars(str_repeat(' ',$nn).$line."\n")); 358 if($line != '') $out .= (str_repeat(' ', $nn).$line."\n"); 359 $s = substr($s, $end + 1, strlen($s)); 360 $nn = $n; 361 } 362 return($out); 363 } 364 327 365 class Page 328 366 {
Note:
See TracChangeset
for help on using the changeset viewer.