Returns the Tree as HTML-Table.
@access		public
@return		string
770147
public function toTable()
	{
		$code = "<table cellspacing=1 cellpadding=0>\n<tr><td colspan=2 align=center><hr>".$this->value."</td></tr>";
		if( $this->left || $this->right )
		{
			$code .= "<tr><td align=center valign=top>";
			if( $this->left )
				$code .= $this->left->toTable();
			else
				$code .= "&nbsp;";
			$code .= "</td><td align=center valign=top>";
			if( $this->right )
				$code .= $this->right->toTable();
			else
				$code .= "&nbsp;";
			$code .= "</td></tr>\n";
		}
		$code .= "</table>\n";
		return $code;
	}
1150537
private function _getHtmlTree($tree)
    {
        //obudowujemy sztucznym rootem
        $html = '<ul><li id="0" data-jstree=\'{"type":"root", "opened":true, "selected":false}\'>' . self::ROOT;
        $html = $this->_generateTree(['children' => $tree], $html);
        $html .= '</li></ul>';
        return $html;
    }
924228
function Html()
    {
        $text = $this->html;
        
        $pos = strpos($text, self::$placeholder);
        $phLength = strlen(self::$placeholder);
        while ($pos !== false && $this->currentChild)
        {
            $replacement = $this->RenderCurrentChild();
            $text = substr($text, 0, $pos) . $replacement . substr($text, $pos + $phLength);
            
            $this->currentChild = $this->tree->NextOf($this->currentChild);
            $pos = strpos($text, self::$placeholder, $pos  + strlen($replacement));
        }
        return $text;
    }
1044287
protected function getHtml()
    {
        array_walk($this->lines, 'trim');
        $html = trim(implode('', $this->lines));
        $this->lines = [];
        return $html;
    }
757390
public function render() {
		
		$buffer = ''; 
		
		if ( !empty( $this->header ) ) {
			
			$buffer .= '<tr'.HTML::attr( $this->header[1] ).'>';
			foreach( $this->header[0] as $head ) {
				$head->name = 'th';
				$buffer .= $head->render();
			}
			$buffer .= '</tr>';
			foreach( $this->data as $row ) {
				$buffer .= '<tr'.HTML::attr( $row[1] ).'>';
				foreach( $this->header[0] as $key => $value ) {
					$buffer .= HTML::tag( 'td', $row[0][$key]->value, $row[0][$key]->attr );
				}
				$buffer .= '</tr>';
			}
		}
		else {
			foreach( $this->data as $row ) {
				$buffer .= '<tr'.HTML::attr( $row[1] ).'>';
				foreach( $row[0] as $value ) {
					$buffer .= $value->render();
				}
				$buffer .= '</tr>';
			}
		}
		
		$this->element->value = $buffer;
		
		return $this->element->render();
	}
1232850
public function html() {
        global $OUTPUT;

        if (!empty($this->initerrors)) {
            $warnings = '';
            foreach ($this->initerrors as $mesg) {
                $warnings .= $OUTPUT->notification($mesg);
            }
            return $warnings;
        }
        $table = new html_table();

        $table->head = $this->headers();

        $summary = $this->summary();
        if (!empty($summary)) {
            $table->summary = $summary;
        }

        // To be used for extra formatting.
        $this->index = 0;
        $this->total = count($this->items);

        foreach ($this->items as $item) {
            if ($this->index >= ($this->perpage * $this->page) &&
                $this->index < ($this->perpage * ($this->page + 1))) {
                $table->data[] = $this->format_line($item);
            }
            $this->index++;
        }

        $underlying = get_class($this);

        $data = new stdClass();
        $data->table = $table;
        $data->instance = $this;

        $buttonattr = array('class' => 'singleview_buttons submit');
        $buttonhtml = implode(' ', $this->buttons());

        $buttons = html_writer::tag('div', $buttonhtml, $buttonattr);
        $selectview = new select($this->courseid, $this->itemid, $this->groupid);

        $sessionvalidation = html_writer::empty_tag('input',
            array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey()));

        $html = $selectview->html();
        $html .= html_writer::tag('form',
            $buttons . html_writer::table($table) . $this->bulk_insert() . $buttons . $sessionvalidation,
            array('method' => 'POST')
        );
        $html .= $selectview->html();
        return $html;
    }
232312
public function toHtml()
    {
        $this->detectOtherValues();

        $html = '';
        $html .= "<{$this->mainPaginationTag} class=\"{$this->mainCssClass}\">";
        $html .= $this->getHtml4FirstPage();
        $html .= $this->getHtml4PreviousPage();
        $html .= $this->getHtml4Pages();
        $html .= $this->getHtml4NextPage();
        $html .= $this->getHtml4LastPage();
        $html .= "</{$this->mainPaginationTag}>";

        return $html;
    }
1114726
function getTreeTitle() {
		$title = $this->Title;
		if (!$title) {
			$title = $this->Name;
		}

		$treeTitle = sprintf(
			"<span class=\"jstree-pageicon\"></span><span class=\"item\">%s</span>",
			Convert::raw2xml(str_replace(array("\n","\r"),"", $title))
		);
		return $treeTitle;
	}
1310432
public function getHtmlColumnHeader(): string
  {
    $attributes = [];
    $classes    = [];

    if ($this->headerText===null)
    {
      $classes[] = 'empty';
    }
    else
    {
      if ($this->sortable)
      {
        // Add class indicating this column can be used for sorting.
        $classes[] = 'sort';

        // Add attributes indicating the sort order of this column and direction.
        if ($this->sortOrder!==null)
        {
          $attributes['data-sort-order'] = $this->sortOrder;

          $classes[] = ($this->sortDirection=='desc') ? 'sorted-desc' : 'sorted-asc';
        }
      }
    }

    $attributes['class'] = implode(' ', $classes);

    return Html::generateElement('th', $attributes, $this->headerText);
  }
890383
public function html()
    {
        return $this->builder()
                    ->columns($this->getColumns())
                    ->postAjax()
                    ->parameters($this->getBuilderParameters());
    }
1288085
public function table()
    {
        $first = true;
        $result = "<table>\n";

        foreach ($this as $record) {
            if ($first) {
                $result .= "<tr>";
                foreach ($record as $k => $v) {
                    $result .= "<th>" . Convert::raw2xml($k) . "</th> ";
                }
                $result .= "</tr> \n";
            }

            $result .= "<tr>";
            foreach ($record as $k => $v) {
                $result .= "<td>" . Convert::raw2xml($v) . "</td> ";
            }
            $result .= "</tr> \n";

            $first = false;
        }
        $result .= "</table>\n";

        if ($first) {
            return "No records found";
        }
        return $result;
    }
1292049
function toHtml()
    {
        $tabs = $this->_getTabs();
        $html = "$tabs<a".$this->_getAttrString($this->_attributes).">";
        $html .= $this->_text;
        $html .= "</a>";
        return $html;
    }
531522
public function getHtmlHeadEntrySet()
    {
        $set = parent::getHtmlHeadEntrySet();

        foreach ($this->columns as $column) {
            $set->addEntrySet($column->getHtmlHeadEntrySet());
        }

        foreach ($this->spanning_columns as $column) {
            $set->addEntrySet($column->getHtmlHeadEntrySet());
        }

        foreach ($this->extra_rows as $row) {
            $set->addEntrySet($row->getHtmlHeadEntrySet());
        }

        foreach ($this->groups as $group) {
            $set->addEntrySet($group->getHtmlHeadEntrySet());
        }

        return $set;
    }
306696
public function asXML()
    {
        $ret = "<" . $this->_name;

        //print Attributes
        if (sizeof($this->_attributes)>0) {
            foreach ($this->_attributes as $_name => $_value) {
                $ret .= " " . $_name . '="' . $this->asUTF8(htmlspecialchars($_value)) . '"';
            }
        }

        //if there is nothing more todo, close empty tag and exit
        if (is_null($this->_value) && !sizeof($this->_childNodes)) {
            $ret .= " />";
            return $ret;
        }

        //close opening tag
        $ret .= ">";

        //print value
        if (!is_null($this->_value)) {
            $ret .= $this->asUTF8(htmlspecialchars($this->_value));
        }

        //print child nodes
        if (sizeof($this->_childNodes)>0) {
            foreach ($this->_childNodes as $_node) {
                $ret .= $_node->asXml();
            }
        }

        $ret .= "</" . $this->_name . ">";

        return $ret;
    }
1270056
public function getTree() {
    $children = array();
    $properties = $this->getChildProperties();
    $child = $this->head;
    $i = 0;
    while ($child) {
      $key = array_search($child, $properties, TRUE);
      if (!$key) {
        $key = $i;
      }
      if ($child instanceof ParentNode) {
        $children[$key] = $child->getTree();
      }
      else {
        /** @var TokenNode $child */
        $children[$key] = array($child->getTypeName() => $child->getText());
      }
      $child = $child->next;
      $i++;
    }
    $class_name = get_class($this);
    return array($class_name => $children);
  }
990792
public function getOuterHtml()
    {
        $outer_html = '';

        if ($this->xml_mode && $this->xml_print_pi) {
            $outer_html .= '<?xml version="'.$this->document->xmlVersion.'" encoding="'.$this->document->xmlEncoding.'"?>';
            $outer_html .= "\n\n";
        }

        foreach ($this->nodes as $node) {
            if (isset($this->document)) {
                if ($this->xml_mode) {
                    $outer_html .= $this->document->saveXML($node);
                } else {
                    $outer_html .= $this->document->saveHTML($node);
                }
            }
        }

        $outer_html = $this->handleHtmlResult($outer_html);

        return $outer_html;
    }
982041
public function render()
    {
        $output[] = $this->open();

        if ($this->hasChildNodes()) {
            if ($this->inline) {
                $this->attributes->addAttributeClass('list-inline');
            }

            foreach ($this->childNodes as $childNode) {
                if ($this->inline) {
                    $childNode->attributes->addAttributeClass('list-inline-item');
                }
                $output[] = $childNode;
            }
        }

        $output[] = $this->close();

        return implode(PHP_EOL, $output);
    }