Get the html for the table.

@param tablelog $tablelog table object.

@return string table html
965791
protected function render_tablelog(tablelog $tablelog) {
        $o = '';
        ob_start();
        $tablelog->out($tablelog->pagesize, false);
        $o = ob_get_contents();
        ob_end_clean();

        return $o;
    }
1143124
public function parseLog($log)
    {
        $commits = $tags = [];

        for ($i = 0, $lines = count($log); $i < $lines; $i++) {
            $tmp = explode(': ', $log[$i]);
            $tmp = array_map('trim', $tmp);

            if ($tmp[0] == 'changeset') {
                $commit = $tmp[1];
            }

            if ($tmp[0] == 'user') {
                $email  = $this->extractEmail($tmp[1]);
                $author = $this->extractAuthor($tmp[1]);
            }

            if ($tmp[0] == 'date') {
                $date = trim($tmp[1]);
            }

            if ($tmp[0] == 'tag') {
                $tags[] = trim($tmp[1]);
            }

            if ($tmp[0] == 'summary') {
                $commits[] = [
                    'commit'  => trim($commit),
                    'author'  => trim($author),
                    'email'   => trim($email),
                    'date'    => DateTime::createFromFormat('D M j H:i:s Y O', $date),
                    'summary' => trim($tmp[1]),
                    'tags'    => $tags,
                    'vcs'     => trim($this->repository_type),
                ];
                $tags = [];
            }
        }

        return $commits;
    }
403156
public static function tableformat($array){  
		
		
		
		$t_str = '';
		$content = $array['content'];
		$i = 0;
		
								
		if(is_array($content) && !empty($content)){
			foreach($content as $d){
				$i++;
				if($i == 1){
					$t_str .='<thead><tr>';
					if(is_array($d) && !empty($d)){
						foreach($d as $v){
							$t_str .='<th>'.$v.'</th>';
						}
					}
					$t_str .='</tr></thead>';
				}else{
					if($i == 2)
						$t_str .='<tbody>';
					
					$t_str .='<tr>';
					if(is_array($d) && !empty($d)){
						foreach($d as $v){
							$t_str .='<td>'.$v.'</td>';
						}
					}
					$t_str .='</tr>';
					
				}
				
			}
			$t_str .='</tbody>';
		}
		$str = '
			<style>
			table.list th:first-child{
				width:22%;
				
			}
			</style>
			<table class="list" style="width:100%">
				<thead>
					<tr>
						<th>'.$array['title'].'</th>
					</tr>
				</thead>
				<tbody>
					
					<tr>
						<td>
							'.$array['description'].'
							<br/>
							
							<table class="list" style="width:100%">
								'.$t_str.'
							</table>
						</td>
					</tr>
				</tbody>
			</table>
		<br/>';
		
		return $str;
			
	}
258201
public function generateHtml($key, $table)
    {
        $storage = $this->storageRepository->loadElement($table, $key);
        $html = "";
        if ($storage["tca"]) {
            foreach ($storage["tca"] as $fieldKey => $fieldConfig) {
                $html .= $this->generateFieldHtml($fieldKey, $key, $table);
            }
        }
        return $html;
    }
524501
protected function createRequestFromLog($requestLog)
    {
        if (strpos($requestLog, "\n\n")) {
            list($head, $content) = explode("\n\n", $requestLog, 2);
        } else {
            $head = $requestLog;
            $content = null;
        }

        $headers = explode("\n", $head);
        $main = array_shift($headers);
        list($method, $url) = explode(' ', $main, 2);

        return $this->panel->getHttpClient()->createRequest()
            ->setMethod($method)
            ->setUrl($url)
            ->setHeaders($headers)
            ->setContent($content);
    }
637091
public function getHtmlTable(): string
  {
    $this->addClass(static::$class);

    $ret = $this->getHtmlPrefix();

    $ret .= Html::generateTag('table', $this->attributes);

    $childAttributes = ['class' => static::$class];

    // Generate HTML code for the table header.
    $ret .= Html::generateTag('thead', $childAttributes);
    $ret .= $this->getHtmlHeader();
    $ret .= '</thead>';

    // Generate HTML code for the table body.
    $ret .= Html::generateTag('tbody', $childAttributes);
    $ret .= $this->rows;
    $ret .= '</tbody>';

    // Generate HTML code for the table header.
    $ret .= Html::generateTag('tfoot', $childAttributes);
    $ret .= $this->getHtmlFooter();
    $ret .= '</tfoot>';

    $ret .= '</table>';

    $ret .= $this->getHtmlPostfix();

    return $ret;
  }
192913
public function getHtml(): string
  {
    $this->prepareOverviewTable();

    if (!empty($this->templateData))
    {
      $this->setAttrData('slat-name', $this->submitName);

      // If required add template row to this louver control. This row will be used by JS for adding dynamically
      // additional rows to the louver control.
      $this->templateData[$this->templateKey] = 0;
      $row                                    = $this->rowFactory->createRow($this, $this->templateData);
      $row->addClass('slat_template');
      $row->setAttrStyle('visibility: collapse');
      $row->prepare($this->submitName);
    }

    $ret = $this->prefix;

    $ret .= Html::generateTag('table', $this->attributes);

    // Generate HTML code for the column classes.
    $ret .= '<colgroup>';
    $ret .= $this->rowFactory->getHtmlColumnGroup();
    $ret .= '</colgroup>';

    $ret .= Html::generateTag('thead', ['class' => OverviewTable::$class]);
    $ret .= $this->getHtmlHeader();
    $ret .= '</thead>';

    if ($this->footerControl)
    {
      $ret .= Html::generateTag('tfoot', ['class' => OverviewTable::$class]);
      $ret .= '<tr>';
      $ret .= Html::generateTag('td', ['colspan' => $this->rowFactory->getNumberOfColumns()]);
      $ret .= $this->footerControl->getHtml();
      $ret .= '</td>';
      $ret .= '<td class="error"></td>';
      $ret .= '</tr>';
      $ret .= '</tfoot>';
    }

    $ret .= Html::generateTag('tbody', ['class' => OverviewTable::$class]);
    $ret .= $this->getHtmlBody();
    $ret .= '</tbody>';

    $ret .= '</table>';

    $ret .= $this->postfix;

    $this->rowFactory->generateResponsiveCss($this->getAttribute('id'));

    return $ret;
  }
1327118
public function render(TableStructure $table, int $indent = 8): string
    {
        return str_repeat(' ', $indent)
            . "\$this->addPrimaryKey('"
            . ($this->name ?: self::GENERIC_PRIMARY_KEY)
            . "', '"
            . $table->renderName()
            . "', ['"
            . implode("', '", $this->columns)
            . "']);";
    }
277652
public function getHtml()
  {
    $html = "";

    $table_classes = $this->getTableClasses();

    if($this->table_responsive)
    {
      $html.= "<div class=\"table-responsive\">\n";
    }

    $id_tag = $this->getTagId();

    $html.= "<table {$id_tag} class=\"table {$table_classes}\">\n";

    // table header
    if( isset($this->header) )
    {
        $html.= "\t<thead>\n";
        $html.= $this->header->getHtml();
        $html.= $this->fillWithEmptyCells($this->header, $this->header->getTagRow() );
        $html.= "\t</thead>\n";
    }

    // table data
    if( isset($this->rows))
    {
      $html.= "\t<tbody>\n";
      foreach($this->rows as $row)
      {
        $html.= $row->getHtml();
        $html.= $this->fillWithEmptyCells($row, $row->getTagRow() );
      }
      $html.= "\t</tbody>\n";
    }

    $html.= "</table>\n";

    if($this->table_responsive)
    {
      $html.= "</div>\n";
    }

    return $html;
  }
1201980
public function getCreateTable(string $table): string
	{
		return (string) $this->context->query('SHOW CREATE TABLE ' . $table)->fetch()->{'Create Table'};
	}
1197541
public function getHTML()
    {
        $loggedin = "";
        $html = "";

        $isadmin = $this->sess['isadmin'] === 1 ? true : false;

        $create = $this->setUrlCreator("comm/create");
        $del = $this->setUrlCreator("comm/admindelete");
        $viewone = $this->setUrlCreator("comm/view-one");

        $loggedin = $this->getLoginLink($isadmin, $create, $del);

        $html .= '<div class="col-sm-12 col-xs-12">
        <div class="col-lg-6 col-sm-7 col-xs-7">
        <h3>Gruppinlägg <span class="small">' . $loggedin . '</span></h3>
        <hr />';

        foreach ($this->comments as $value) {
            if ((int)$value->parentid > 0) {
                continue;
            }
            $html .= $this->getValHtml($value, $isadmin, $viewone);
        }
        
        $html .= '</div></div>';
        return $html;
    }
859042
public function report_selector_form(report_log_renderable $reportlog) {
        echo html_writer::start_tag('form', array('class' => 'logselecform', 'action' => $reportlog->url, 'method' => 'get'));
        echo html_writer::start_div();
        echo html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'chooselog', 'value' => '1'));
        echo html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'showusers', 'value' => $reportlog->showusers));
        echo html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'showcourses',
            'value' => $reportlog->showcourses));

        $selectedcourseid = empty($reportlog->course) ? 0 : $reportlog->course->id;

        // Add course selector.
        $sitecontext = context_system::instance();
        $courses = $reportlog->get_course_list();
        if (!empty($courses) && $reportlog->showcourses) {
            echo html_writer::label(get_string('selectacourse'), 'menuid', false, array('class' => 'accesshide'));
            echo html_writer::select($courses, "id", $selectedcourseid, null);
        } else {
            $courses = array();
            $courses[$selectedcourseid] = get_course_display_name_for_list($reportlog->course) . (($selectedcourseid == SITEID) ?
                ' (' . get_string('site') . ') ' : '');
            echo html_writer::label(get_string('selectacourse'), 'menuid', false, array('class' => 'accesshide'));
            echo html_writer::select($courses, "id", $selectedcourseid, false);
            // Check if user is admin and this came because of limitation on number of courses to show in dropdown.
            if (has_capability('report/log:view', $sitecontext)) {
                $a = new stdClass();
                $a->url = new moodle_url('/report/log/index.php', array('chooselog' => 0,
                    'group' => $reportlog->get_selected_group(), 'user' => $reportlog->userid,
                    'id' => $selectedcourseid, 'date' => $reportlog->date, 'modid' => $reportlog->modid,
                    'showcourses' => 1, 'showusers' => $reportlog->showusers));
                $a->url = $a->url->out(false);
                print_string('logtoomanycourses', 'moodle', $a);
            }
        }

        // Add group selector.
        $groups = $reportlog->get_group_list();
        if (!empty($groups)) {
            echo html_writer::label(get_string('selectagroup'), 'menugroup', false, array('class' => 'accesshide'));
            echo html_writer::select($groups, "group", $reportlog->groupid, get_string("allgroups"));
        }

        // Add user selector.
        $users = $reportlog->get_user_list();

        if ($reportlog->showusers) {
            echo html_writer::label(get_string('selctauser'), 'menuuser', false, array('class' => 'accesshide'));
            echo html_writer::select($users, "user", $reportlog->userid, get_string("allparticipants"));
        } else {
            $users = array();
            if (!empty($reportlog->userid)) {
                $users[$reportlog->userid] = $reportlog->get_selected_user_fullname();
            } else {
                $users[0] = get_string('allparticipants');
            }
            echo html_writer::label(get_string('selctauser'), 'menuuser', false, array('class' => 'accesshide'));
            echo html_writer::select($users, "user", $reportlog->userid, false);
            $a = new stdClass();
            $a->url = new moodle_url('/report/log/index.php', array('chooselog' => 0,
                'group' => $reportlog->get_selected_group(), 'user' => $reportlog->userid,
                'id' => $selectedcourseid, 'date' => $reportlog->date, 'modid' => $reportlog->modid,
                'showusers' => 1, 'showcourses' => $reportlog->showcourses));
            $a->url = $a->url->out(false);
            echo html_writer::start_span('mx-1');
            print_string('logtoomanyusers', 'moodle', $a);
            echo html_writer::end_span();
        }

        // Add date selector.
        $dates = $reportlog->get_date_options();
        echo html_writer::label(get_string('date'), 'menudate', false, array('class' => 'accesshide'));
        echo html_writer::select($dates, "date", $reportlog->date, get_string("alldays"));

        // Add activity selector.
        $activities = $reportlog->get_activities_list();
        echo html_writer::label(get_string('activities'), 'menumodid', false, array('class' => 'accesshide'));
        echo html_writer::select($activities, "modid", $reportlog->modid, get_string("allactivities"));

        // Add actions selector.
        echo html_writer::label(get_string('actions'), 'menumodaction', false, array('class' => 'accesshide'));
        echo html_writer::select($reportlog->get_actions(), 'modaction', $reportlog->action, get_string("allactions"));

        // Add origin.
        $origin = $reportlog->get_origin_options();
        echo html_writer::label(get_string('origin', 'report_log'), 'menuorigin', false, array('class' => 'accesshide'));
        echo html_writer::select($origin, 'origin', $reportlog->origin, false);

        // Add edulevel.
        $edulevel = $reportlog->get_edulevel_options();
        echo html_writer::label(get_string('edulevel'), 'menuedulevel', false, array('class' => 'accesshide'));
        echo html_writer::select($edulevel, 'edulevel', $reportlog->edulevel, false).$this->help_icon('edulevel');

        // Add reader option.
        // If there is some reader available then only show submit button.
        $readers = $reportlog->get_readers(true);
        if (!empty($readers)) {
            if (count($readers) == 1) {
                $attributes = array('type' => 'hidden', 'name' => 'logreader', 'value' => key($readers));
                echo html_writer::empty_tag('input', $attributes);
            } else {
                echo html_writer::label(get_string('selectlogreader', 'report_log'), 'menureader', false,
                        array('class' => 'accesshide'));
                echo html_writer::select($readers, 'logreader', $reportlog->selectedlogreader, false);
            }
            echo html_writer::empty_tag('input', array('type' => 'submit', 'value' => get_string('gettheselogs'),
                'class' => 'btn btn-secondary'));
        }
        echo html_writer::end_div();
        echo html_writer::end_tag('form');
    }
578514
public function toHtml() {
        global $OUTPUT;

        if ($this->_flagFrozen) {
            return $this->getFrozenHtml();
        } else {
            $value = preg_replace("/(\r\n|\n|\r)/", '&#010;', $this->getValue());

            return $this->_getTabs() .
                $OUTPUT->print_textarea($this->getName(), $this->getAttribute('id'), $value, $this->_options['rows'],
                    $this->_options['cols']);
        }
    }
1106024
public function getTable()
    {
        $prefix = $this->isBaseTable() ? $this->getWpdb()->base_prefix : $this->getWpdb()->prefix ;
        return "{$prefix}posts";
    }
1059310
public function renderTableNode(TableNode $table)
    {
        $arguments = '<table class="argument"> <thead>';
        $header = $table->getRow(0);
        $arguments .= $this->preintTableRows($header);

        $arguments .= '</thead><tbody>';
        foreach ($table->getHash() as $row) {
            $arguments .= $this->preintTableRows($row);
        }

        $arguments .= '</tbody></table>';

        return $arguments;
    }
697514
public function getJs(string $table_id): string
    {
        ob_start();
        $this->getTreeJs();

        if (!$this->ajax_path) {
            $this->ajax_path = '?p='. P .'&do=' . P_DO;
        }

        ?>
        <script>
            var <?= $this->js_object_name ?> =
            new TableTree('<?= $table_id ?>', <?=json_encode($this->child_ids)?>, <?= json_encode($this->js_object_name, JSON_OBJECT_AS_ARRAY) ?>, '<?= $this->ajax_path ?>', <?= (int)$this->ajax ?>, <?= (int)$this->save_inner_state ?>);
        </script><?php

        return ob_get_clean();
    }
557910
public function col_info($log) {
        global $PAGE;

        if (empty($log->info) && empty($log->dir)) {
            return '';
        }

        $info = array();
        if (!empty($log->info)) {
            $info = json_decode($log->info);
        }
        if (!empty($log->dir)) {
            $info[] = get_string('predictorresultsin', 'tool_analytics', $log->dir);
        }
        $PAGE->requires->js_call_amd('tool_analytics/log_info', 'loadInfo', array($log->id, $info));
        return \html_writer::link('#', get_string('view'), array('data-model-log-id' => $log->id));
    }