Sestavení šablony pro vkládání nových souborů.

@return Html
438736
public function buildFileContainerTemplate() {
		$tr = Html::el("tr");
		
		$preview = Html::el("td class='align-middle'");
		$preview->addHtml($this->elements["imagePreview"]->setAttribute("width", "100%")->setAttribute("class", "rounded"));
		$preview->addHtml($this->elements["filePreview"]->setName("span")->setAttribute("class", "badge badge-pill badge-info"));
		$tr->addHtml($preview);
		
		$name = Html::el("td class='align-middle'");
		$name->addHtml($this->elements["filename"]);
		$tr->addHtml($name);
		
		$progressTd = Html::el("td class='align-middle'");
		$progressContainer = Html::el("div class='progress'");
		$progress = $this->elements["fileProgress"]->setAttribute("class", "progress-bar")
			->setAttribute("style", "height: 10px");
		$progressContainer->addHtml($progress);
		$progressTd->addHtml($progressContainer);
		$tr->addHtml($progressTd);
		
		$delete = Html::el("td class='align-middle text-center'");
		$delete->addHtml(
			$this->elements["delete"]
				->setAttribute("class", "btn btn-outline-danger")
				->setHtml("&times;")
		);
		$tr->addHtml($delete);
		
		return $tr;
	}
595839
public function getHtml()
    {
        $html = new Core\Tag(
            'html',
            array((isset($this->args[1]) ? $this->args[1] : null)),
            array('generate', 'start')
        );
        $html->setAttrs($this->htmlattrs);

        return $html;
    }
860396
public function _toHtml()
    {
        $html = '';

        foreach ($this->getChildNames() as $childName) {
            if ($html === '') {
                $renderer = $this->getChildBlock($childName);
                $html = $renderer->render($this->getFilter());
            }
        }

        return $html;
    }
623002
public function main()
    {
        $mainPageHTML = '';
        $dbMaterials = array();

        // Получим все материалы
        if (
        dbQuery('samsoncms\api\Material')
            ->join('user')
            ->cond('Active', 1)
            ->cond('Draft', 0)
            ->order_by('Created', 'DESC')
            ->cond('Name', "", dbRelation::NOT_EQUAL)
            ->limit(5)
            ->exec($dbMaterials)
        ) {
            // Render material rows
            $rowsHTML = '';
            foreach ($dbMaterials as $dbMaterial) {
                $rowsHTML .= $this->view('main/row')
                    ->set($dbMaterial, 'material')
                    ->set(isset($dbMaterial->onetoone['_user']) ? $dbMaterial->onetoone['_user'] : array(), 'user')
                    ->output();
            }

            for ($i = sizeof($dbMaterials); $i < 5; $i++) {
                $rowsHTML .= $this->view('main/row')->output();
            }

            // Render main template
            $mainPageHTML = $this->view('main/index')->set($rowsHTML, 'rows')->output();
        }

        // Return material block HTML on main page
        return $mainPageHTML;
    }
1044287
protected function getHtml()
    {
        array_walk($this->lines, 'trim');
        $html = trim(implode('', $this->lines));
        $this->lines = [];
        return $html;
    }
471709
public function __toHtml()
    {
        return $this->toHtml($submitted = false, $blnSimpleLayout = false, $blnLabel = true, $blnDisplayError = true);
    }
151001
public function renderForm()
    {
        $html = $this->form_open();
        $html .= $this->renderSubForm();
        $html .= $this->form_close();

        return $html;
    }
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;
  }
207472
public function addPluginSeo()
    {
        $row = new FormInput('seo_title', 'Title материала');
        $this->rows['seo_title'] = $rows_plugin[] = $row->setTab('seo', 'Seo')->setValid('max:255')
            ->setTypo()->setHelp('По-умолчанию равно заголовку материала');

        $row = new FormInput('seo_description', 'Description материала');
        $this->rows['seo_description'] = $rows_plugin[] = $row->setTab('seo', 'Seo')->setValid('max:255')
            ->setTypo()->setHelp('По-умолчанию равно заголовку материала');

        $row = new FormTextarea('seo_keywords', 'Keywords материала');
        $this->rows['seo_keywords'] = $rows_plugin[] = $row->setTab('seo', 'Seo')->setValid('max:255')
            ->setCssClass('not-editor uk-width-1-1');

        $this->plugins_backend['seo']['rows'] = $rows_plugin;

        $row = new FormInput('url', 'URL материала');
        $this->rows['url'] = $row->setTab('seo', 'SEO')
            ->setValid('max:155|required|unique:'.$this->table)->setCssClass('uk-width-1-1')->setFillable();

        return $this;
    }
924942
public function adminhtml(){
		$bsh=BBoostrapHelper::getInstance();
		return $bsh->input_img(0,$this->getid($this->id),$this->value);
		}
948645
protected function _toHtml()
    {
        $html = false;

        if ($this->canRenderFilter()) {
            $html = $this->getLayout()
                ->createBlock($this->block)
                ->setSwatchFilter($this->getFilter())
                ->toHtml();
        }

        return $html;
    }
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']);
        }
    }
468708
function html()
	{
		$params = $this->params();

		if(!empty($params['property']))
			$params['name'] = $params['property'];

		$form = $this->form();

		extract($params);

		$obj = $form->object();
		if(!$obj)
			$obj = $form->call('calling_object');

		$el_params = "";
		foreach(explode(' ', 'size style') as $p)
			if(!empty($$p))
				$el_params .= " $p=\"{$$p}\"";

		if(!empty($xref))
		{
			// Задан класс m2m связей
			if(is_object($xref))
				$xref_obj = $xref;
			else
				$xref_obj = bors_foo($xref);

			$list = $xref_obj->named_list($obj);
			$name = $xref_obj->name($obj, $xref_obj->class_name());
		}

		// http://admin2.aviaport.wrk.ru/newses/256783/form2/
		if(!empty($named_list))
			$list = bors_foo($named_list)->named_list();

		if(!is_array($list))
		{
			if(preg_match("!^(\w+)\->(\w+)$!", $list, $m))
			{
				if($m[1] == 'this')
					$list = call_user_func([$obj, $m[2]]);
				else
					$list = call_user_func([bors_foo($m[1]), $m[2]]);
			}
			elseif(preg_match("!^(\w+)\->(\w+)\('(.+)'\)!", $list, $m))
			{
				if($m[1] == 'this')
					$list = call_user_func([$obj, $m[2]], $m[3]);
				else
					$list = call_user_func([bors_foo($m[1]), $m[2]], $m[3]);
			}
			elseif(preg_match("!^\w+$!", $list))
			{
				$list_class = $list;
				$list = new $list_class(@$args);
				$list = $list->get('named_list');
				if(!$list)
					$list = base_list::make($list_class, array(), $params + array('non_empty' => true));
			}
			else
			{
				eval('$list='.$list);
			}
		}

		if(!$current && !empty($list['default']))
			$current = $list['default'];

		if(empty($delim))
			$delim = "<br />";

		$ids = array();

		$values = $value;

		if(empty($values))
		{
			if(empty($get))
				$current = preg_match('!^\w+$!', $name) ? (isset($value)?$value:($obj?$obj->get($name):0)) : 0;
			else
				$current = $obj->$get();

			if(!$current && !empty($list['default']))
				$current = $list['default'];

			if(!is_array($current))
				$current = array($current);
		}
		else
			$current = $values;

		$class = explode(' ', defval($params, 'class'));

		if(in_array($name, explode(',', session_var('error_fields'))))
			$class[] = "error";

		if($class)
			$class = ' class="'.join(' ', $class).'"';
		else
			$class = '';

		$label_css = explode(' ', defval($params, 'label_css', ''));

		if(in_array($name, explode(',', session_var('error_fields'))))
			$label_css[] = "error";

		if(!empty($label_css))
			$label_css = " class=\"".join(" ", $label_css)."\"";
		else
			$label_css = "";

		if($input_data_toggle = defval($params, 'input_data_toggle', ''))
			$input_data_toggle = " data-toggle=\"$input_data_toggle\"";

		$html = '';

		// Если нужно, добавляем заголовок поля
		$html .= $this->label_html();

		// Если отдельный блок, то на всю ширину.
		if($this->label() && empty($style))
			$style = "width: 99%";

		$labels_html = array();

		if($columns)
		{
			$labels_html[] = "<table><tr><td style=\"padding: 0 10px 0 0\">";
			$per_column = ceil(count($list) / $columns);
		}

		$pos = 0;

		foreach($list as $id => $iname)
		{
			if($columns && $pos && $pos % $per_column == 0)
				$labels_html[] = "</td><td>";

			$ids[] = $id;
			$checked = in_array($id, $current);
			$labels_html[] = "<label{$label_css}><input type=\"checkbox\" name=\"".addslashes($name)."[]\" value=\"$id\"".($checked ? " checked=\"checked\"" : "")."$el_params$class$input_data_toggle />".($checked?'<b>':'')."&nbsp;$iname".($checked?'</b>':'')."</label>$delim\n";
			$pos++;

		}

		if($columns)
			$labels_html[] = "</td></tr></table>";

		$labels_html = join("", $labels_html);

		if($container = defval($params, 'label_container'))
			$labels_html = sprintf($container, $labels_html);

		$html .= $labels_html;

		$form->append_attr('checkboxes_list', $name);

		if($form->get('has_form_table'))
			$html .= "</td></tr>\n";

		return $html;
	}
1129091
public function buildDefaultTemplate() {
		$table = $this->elements["container"];
		$table->setAttribute("cellpadding", "5px");
		
		// Header
		$tr = Html::el("tr");
		$th = Html::el("th colspan='2' style='border-right: none'");
		$th->setText("Nahrávání souborů");
		$tr->addHtml($th);
		$th2 = Html::el("th colspan='2' style='text-align: right; border-left: none'");
		$th2->addHtml($this->elements["input"]->setAttribute("style", "display: none"));
		$button = Html::el("button type='button'");
		$button->setText("Nahrát soubor");
		$id = $this->elements["input"]->getAttribute("id");
		$button->setAttribute("onclick", "document.getElementById('$id').click(); return false;");
		$th2->addHtml($button);
		
		$tr->addHtml($th2);
		$table->addHtml($tr);
		
		// Global Progress
		$tr = Html::el("tr");
		$td = Html::el("td colspan='4'");
		$td->addHtml($this->elements["globalProgress"]);
		$tr->addHtml($td);
		$table->addHtml($tr);
		
		return $table;
	}
516482
public function render()
  {
    $html = parent::render();

    $items = '';

    // Affichage lien FIRST
    if ($this->currentPage > 1) {
      $first = $this->getElementTemplate('first');
      $first = str_replace('%page%', 1, $first);
      $items .= $first;
    }

    // Affichage previous
    if ($this->currentPage > 1) {
      $prev = $this->getElementTemplate('previous');
      $prev = str_replace('%page%', $this->currentPage - 1, $prev);
      $items .= $prev;
    }

    // Affichage des pages
    $startPage = $this->currentPage - floor($this->maxShowedPages / 2);
    $endPage   = $this->currentPage + floor($this->maxShowedPages / 2);
    if ($startPage < 1) {
      $endPage += (1 - $startPage);
      $startPage = 1;
    }
    if ($endPage > $this->nbPages) {
      $endPage = $this->nbPages;
    }
    if (($endPage - $startPage + 1) != $this->maxShowedPages) {
      $startPage = $endPage - $this->maxShowedPages + 1;
      if ($startPage < 1) {
        $startPage = 1;
      }
    }
    for ($i = $startPage; $i <= $endPage; $i++) {
      if ($this->currentPage == $i) {
        $page = $this->getElementTemplate('selectedpage');
      } else {
        $page = $this->getElementTemplate('page');
      }
      $page = str_replace('%page%', $i, $page);
      $items .= $page;
    }

    // Affichage next
    if ($this->currentPage < $this->nbPages) {
      $next = $this->getElementTemplate('next');
      $next = str_replace('%page%', $this->currentPage + 1, $next);
      $items .= $next;
    }

    // Affichage last
    if ($this->currentPage != $this->nbPages && $this->nbPages > 0) {
      $last = $this->getElementTemplate('last');
      $last = str_replace('%page%', $this->nbPages, $last);
      $items .= $last;
    }

    $html = str_replace('%items%', $items, $html);

    return $html;
  }
1370837
private function html()
    {
        $filename = $this->getFilename($this->key);
        if (!$filename) return false;
        return @file_put_contents($filename, ob_get_contents(), LOCK_EX);
    }
657817
public function getPaginationHTML()
    {
        if ($this->pagination->haveToPaginate()) {
            $view = new TwitterBootstrap3View();
            $me = $this;
            $result = $view->render(
                $this->pagination,
                function ($page) use ($me) {
                    $list = $me->getItemListObject();
                    $result = (string) $me->getBaseURL();
                    $result .= strpos($result, '?') === false ? '?' : '&';
                    $result .= ltrim($list->getQueryPaginationPageParameter(), '&') . '=' . $page;

                    return $result;
                },
                [
                    'prev_message' => tc('Pagination', '&larr; Previous'),
                    'next_message' => tc('Pagination', 'Next &rarr;'),
                    'active_suffix' => '<span class="sr-only">' . tc('Pagination', '(current)') . '</span>',
                ]
            );
        } else {
            $result = '';
        }

        return $result;
    }