Builds the HTML to display the control

@param string $data Unused
@param string $query
@return string
486999
public function output_html($data, $query='') {
        global $CFG, $OUTPUT;

        $return = '';
        $brtag = html_writer::empty_tag('br');

        $searchareas = \core_search\manager::get_search_areas_list();
        $anyenabled = !empty(\core_search\manager::get_search_areas_list(true));
        $anyindexed = false;
        foreach ($searchareas as $areaid => $searcharea) {
            list($componentname, $varname) = $searcharea->get_config_var_name();
            if (get_config($componentname, $varname . '_indexingstart')) {
                $anyindexed = true;
                break;
            }
        }

        $return .= $OUTPUT->heading(get_string('searchsetupinfo', 'admin'), 3, 'main');

        $table = new html_table();
        $table->head = array(get_string('step', 'search'), get_string('status'));
        $table->colclasses = array('leftalign step', 'leftalign status');
        $table->id = 'searchsetup';
        $table->attributes['class'] = 'admintable generaltable';
        $table->data = array();

        $return .= $brtag . get_string('searchsetupdescription', 'search') . $brtag . $brtag;

        // Select a search engine.
        $row = array();
        $url = new moodle_url('/admin/settings.php?section=manageglobalsearch#admin-searchengine');
        $row[0] = '1. ' . html_writer::tag('a', get_string('selectsearchengine', 'admin'),
                        array('href' => $url));

        $status = html_writer::tag('span', get_string('no'), array('class' => 'statuscritical'));
        if (!empty($CFG->searchengine)) {
            $status = html_writer::tag('span', get_string('pluginname', 'search_' . $CFG->searchengine),
                array('class' => 'statusok'));

        }
        $row[1] = $status;
        $table->data[] = $row;

        // Available areas.
        $row = array();
        $url = new moodle_url('/admin/searchareas.php');
        $row[0] = '2. ' . html_writer::tag('a', get_string('enablesearchareas', 'admin'),
                        array('href' => $url));

        $status = html_writer::tag('span', get_string('no'), array('class' => 'statuscritical'));
        if ($anyenabled) {
            $status = html_writer::tag('span', get_string('yes'), array('class' => 'statusok'));

        }
        $row[1] = $status;
        $table->data[] = $row;

        // Setup search engine.
        $row = array();
        if (empty($CFG->searchengine)) {
            $row[0] = '3. ' . get_string('setupsearchengine', 'admin');
            $row[1] = html_writer::tag('span', get_string('no'), array('class' => 'statuscritical'));
        } else {
            $url = new moodle_url('/admin/settings.php?section=search' . $CFG->searchengine);
            $row[0] = '3. ' . html_writer::tag('a', get_string('setupsearchengine', 'admin'),
                            array('href' => $url));
            // Check the engine status.
            $searchengine = \core_search\manager::search_engine_instance();
            try {
                $serverstatus = $searchengine->is_server_ready();
            } catch (\moodle_exception $e) {
                $serverstatus = $e->getMessage();
            }
            if ($serverstatus === true) {
                $status = html_writer::tag('span', get_string('yes'), array('class' => 'statusok'));
            } else {
                $status = html_writer::tag('span', $serverstatus, array('class' => 'statuscritical'));
            }
            $row[1] = $status;
        }
        $table->data[] = $row;

        // Indexed data.
        $row = array();
        $url = new moodle_url('/admin/searchareas.php');
        $row[0] = '4. ' . html_writer::tag('a', get_string('indexdata', 'admin'), array('href' => $url));
        if ($anyindexed) {
            $status = html_writer::tag('span', get_string('yes'), array('class' => 'statusok'));
        } else {
            $status = html_writer::tag('span', get_string('no'), array('class' => 'statuscritical'));
        }
        $row[1] = $status;
        $table->data[] = $row;

        // Enable global search.
        $row = array();
        $url = new moodle_url("/admin/search.php?query=enableglobalsearch");
        $row[0] = '5. ' . html_writer::tag('a', get_string('enableglobalsearch', 'admin'),
                        array('href' => $url));
        $status = html_writer::tag('span', get_string('no'), array('class' => 'statuscritical'));
        if (\core_search\manager::is_global_search_enabled()) {
            $status = html_writer::tag('span', get_string('yes'), array('class' => 'statusok'));
        }
        $row[1] = $status;
        $table->data[] = $row;

        $return .= html_writer::table($table);

        return highlight($query, $return);
    }
577362
public function output_html($data, $query='') {
        global $OUTPUT;

        $default = $this->get_defaultsetting();
        $current = $this->get_setting();

        if (!$this->load_choices() || empty($this->choices)) {
            return '';
        }

        $context = (object) [
            'id' => $this->get_id(),
            'name' => $this->get_full_name(),
        ];

        if (!is_null($default) && array_key_exists($default, $this->choices)) {
            $defaultinfo = $this->choices[$default];
        } else {
            $defaultinfo = NULL;
        }

        // Warnings.
        $warning = '';
        if ($current === null) {
            // First run.
        } else if (empty($current) && (array_key_exists('', $this->choices) || array_key_exists(0, $this->choices))) {
            // No warning.
        } else if (!array_key_exists($current, $this->choices)) {
            $warning = get_string('warningcurrentsetting', 'admin', $current);
            if (!is_null($default) && $data == $current) {
                $data = $default; // Use default instead of first value when showing the form.
            }
        }

        $options = [];
        $template = 'core_admin/setting_configselect';

        if (!empty($this->optgroups)) {
            $optgroups = [];
            foreach ($this->optgroups as $label => $choices) {
                $optgroup = array('label' => $label, 'options' => []);
                foreach ($choices as $value => $name) {
                    $optgroup['options'][] = [
                        'value' => $value,
                        'name' => $name,
                        'selected' => (string) $value == $data
                    ];
                    unset($this->choices[$value]);
                }
                $optgroups[] = $optgroup;
            }
            $context->options = $options;
            $context->optgroups = $optgroups;
            $template = 'core_admin/setting_configselect_optgroup';
        }

        foreach ($this->choices as $value => $name) {
            $options[] = [
                'value' => $value,
                'name' => $name,
                'selected' => (string) $value == $data
            ];
        }
        $context->options = $options;

        $element = $OUTPUT->render_from_template($template, $context);

        return format_admin_setting($this, $this->visiblename, $element, $this->description, true, $warning, $defaultinfo, $query);
    }
1035397
public function output_html($data, $query='') {
        global $OUTPUT;

        $default = $this->get_defaultsetting();
        if (is_array($default)) {
            $defaultinfo = $default['h'].':'.$default['m'];
        } else {
            $defaultinfo = NULL;
        }

        $context = (object) [
            'id' => $this->get_id(),
            'name' => $this->get_full_name(),
            'hours' => array_map(function($i) use ($data) {
                return [
                    'value' => $i,
                    'name' => $i,
                    'selected' => $i == $data['h']
                ];
            }, range(0, 23)),
            'minutes' => array_map(function($i) use ($data) {
                return [
                    'value' => $i,
                    'name' => $i,
                    'selected' => $i == $data['m']
                ];
            }, range(0, 59, 5))
        ];

        $element = $OUTPUT->render_from_template('core_admin/setting_configtime', $context);

        return format_admin_setting($this, $this->visiblename, $element, $this->description,
            $this->get_id() . 'h', '', $defaultinfo, $query);
    }
1366757
public function build(Query $query): string
    {
        $this->query = $query;

        $sql = $this->buildQueryStart();

        switch ($this->query->getType()) {
            case Query\Type::INSERT:
                $sql .=
                    $this->buildInto() .
                    $this->buildSet();
                break;
            case Query\Type::SELECT:
                $sql .=
                    $this->buildColumns() .
                    $this->buildFrom() .
                    $this->buildWhere() .
                    $this->buildOrderBy() .
                    $this->buildGroupBy() .
                    $this->buildLimit();
                break;
            case Query\Type::UPDATE:
                $sql .=
                    ' ' . $this->query->getTable() . ' t' .
                    $this->buildSet() .
                    $this->buildWhere();
                break;
            case Query\Type::DELETE:
                $sql .=
                    $this->buildFrom() .
                    $this->buildWhere();
                break;
            default:
                throw new \UnexpectedValueException('Unexpected value of property $type');
        }

        return $sql;
    }
81685
public function build(&$query)
    {
        $segments = array();

        if (isset($query['oid'])) {
            $segments[] = '@'.$query['oid'];
        }

        if (isset($query['q'])) {
            $segments[] = $query['q'];
        }

        //we don't need the view
        unset($query['view']);
        unset($query['oid']);
        unset($query['q']);

        return $segments;
    }
706151
public function output_html($data, $query='') {
        global $OUTPUT, $PAGE;

        $default = $this->get_defaultsetting();
        $context = (object) [
            'id' => $this->get_id(),
            'name' => $this->get_full_name(),
            'value' => $data,
            'descriptions' => $this->util->describe_file_types($data),
        ];
        $element = $OUTPUT->render_from_template('core_admin/setting_filetypes', $context);

        $PAGE->requires->js_call_amd('core_form/filetypes', 'init', [
            $this->get_id(),
            $this->visiblename->out(),
            $this->onlytypes,
            $this->allowall,
        ]);

        return format_admin_setting($this, $this->visiblename, $element, $this->description, true, '', $default, $query);
    }
1284600
public function output_html($data, $query='') {
        global $OUTPUT;

        $this->load_choices();
        $currentsetting = array();
        foreach ($data as $key) {
            if ($key != 'none' and array_key_exists($key, $this->choices)) {
                $currentsetting[] = $key; // already selected first
            }
        }

        $context = (object) [
            'id' => $this->get_id(),
            'name' => $this->get_full_name(),
        ];

        $options = $this->choices;
        $selects = [];
        for ($i = 0; $i < count($this->choices) - 1; $i++) {
            if (!array_key_exists($i, $currentsetting)) {
                $currentsetting[$i] = 'none';
            }
            $selects[] = [
                'key' => $i,
                'options' => array_map(function($option) use ($options, $currentsetting, $i) {
                    return [
                        'name' => $options[$option],
                        'value' => $option,
                        'selected' => $currentsetting[$i] == $option
                    ];
                }, array_keys($options))
            ];
        }
        $context->selects = $selects;

        $element = $OUTPUT->render_from_template('core_admin/setting_courselist_frontpage', $context);

        return format_admin_setting($this, $this->visiblename, $element, $this->description, false, '', null, $query);
    }
612462
public function compileSelect(Builder $query)
    {
        if (is_null($query->columns)) $query->columns = array('*');

        return trim($this->concatenate($this->compileComponents($query)));
    }
417587
public function output_html($data, $query='') {
        global $OUTPUT;

        // The order matters very much because of the implied numeric keys.
        $days = array('sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday');
        $context = (object) [
            'name' => $this->get_full_name(),
            'id' => $this->get_id(),
            'days' => array_map(function($index) use ($days, $data) {
                return [
                    'index' => $index,
                    'label' => get_string($days[$index], 'calendar'),
                    'checked' => in_array($index, $data)
                ];
            }, array_keys($days))
        ];

        $element = $OUTPUT->render_from_template('core_admin/setting_special_calendar_weekend', $context);

        return format_admin_setting($this, $this->visiblename, $element, $this->description, false, '', NULL, $query);

    }
142788
public function compile_update( &$query )
	{
		$build = 'update '.$this->escape_table( $query ).' set ';

		// add the array values.
		foreach( $query->values as $key => $value )
		{
			$build .= $this->escape( $key ).' = '.$this->param( $value ).', ';
		}

		$build = substr( $build, 0, -2 );
		$build .= $this->compile_where( $query );
		$build .= $this->compile_limit( $query );

		// cut the last comma away
		return $build;
	}
486427
public function renderPage(string $template, array $data = []): string
    {
        $this->thisShouldMakeItUniqueCodeCollabTemplateHtmlVariables = $data;

        /** @noinspection PhpUnusedLocalVariableInspection */
        $content = $this->render($template, $data);

        try {
            ob_start();

            /** @noinspection PhpIncludeInspection */
            require $this->thisShouldMakeItUniqueCodeCollabTemplateHtmlBasePage;
        } finally {
            $output = ob_get_clean();
        }

        return $output;
    }
449924
protected function _renderQuery($query, $key = '')
    {
        $input = '';
        foreach ($query as $name => $value) {
            $name = $key ? $key.'['.$name.']' : $name;
            if (is_array($value)) {
                $input .= $this->_renderQuery($value, $name);
            } else {
                $input .= PHP_EOL.'<input type="hidden" name="'.$name.'" value="'.$value.'" />';
            }
        }
        
        return $input;
    }
548453
protected function _createViewblock($data)
    {
        $output = '';
        foreach ($data as $key => $type) {
            if ($type === 'element') {
                $output = $this->element($key);
            } elseif ($type === 'Html::css') {
                $output .= $this->Html->css($key);
            } elseif ($type === 'Html::script') {
                $output .= $this->Html->script($key);
            } else {
                $output .= $key;
            }
        }

        return $output;
    }
311748
public static function fromString($query, array $data = [])
    {
        $url = parse_url($query);
        $query = isset($url['query']) ? $url['query'] : $url['path'];
        parse_str($query, $data);

        return new QueryString($data);
    }
888047
public function create($routeName, array $data = array(), array $query = array())
    {
        return $this->createUrl(parent::create($routeName, $data, $query));
    }
1127254
public function output_html($data, $query='') {
        global $CFG, $OUTPUT;
        $default = $this->get_defaultsetting();
        require_once("$CFG->libdir/filelib.php");

        $context = (object) [
            'id' => $this->get_id(),
            'name' => $this->get_full_name(),
            'size' => $this->size,
            'value' => $data,
            'showvalidity' => !empty($data),
            'valid' => $data && file_exists($data) && !is_dir($data) && file_is_executable($data),
            'readonly' => !empty($CFG->preventexecpath),
            'forceltr' => $this->get_force_ltr()
        ];

        if (!empty($CFG->preventexecpath)) {
            $this->visiblename .= '<div class="form-overridden">'.get_string('execpathnotallowed', 'admin').'</div>';
        }

        $element = $OUTPUT->render_from_template('core_admin/setting_configexecutable', $context);

        return format_admin_setting($this, $this->visiblename, $element, $this->description, true, '', $default, $query);
    }
698129
public function doQueryOne($query, $data = null)
	{
		// Prepare and execute the entered query
		$prepQuery = parent::prepare($query);
		$prepQuery->execute($data);
		
		// Since this function is only to return one row, only return the first row
		return $prepQuery->fetch();
	}