Esempio n. 1
0
 /**
  * Generate a list from sscText
  * @param array $bulk Lines representing body content
  * @param int $i Index in content array representing next line
  * @param int $level Level of indentation 
  * @return string XHTML markup equivalent
  */
 static function _do_list(&$input, &$i, $level = 0)
 {
     $out = '<ul>';
     while (isset($input[$i]) && substr($input[$i], $level, 1) == '*') {
         while (isset($input[$i]) && substr($input[$i], $level + 1, 1) == '*') {
             $out .= '<li>' . sscText::_do_list($input, $i, $level + 1) . '</li>';
         }
         if (substr($input[$i], $level, 1) == '*') {
             $out .= '<li>' . substr($input[$i], $level + 1) . '</li>';
             $i++;
         }
     }
     return $out . '</ul>';
 }