Отрисовывает интерфейс списка изображений

@return string  HTML
497836
private function adminRenderImagesList()
    {
        // Определяем текущую страницу списка
        $pg = arg('pg') ? arg('pg', 'int') : 1;

        $section = arg('section', 'int');

        $maxCount = $this->settings['useGroups'] ?
            $this->settings['groupsPerPage'] :
            $this->settings['itemsPerPage'];

        $startFrom = ($pg - 1) * $maxCount;

        /* @var Gallery_Entity_Table_AbstractContent $table */
        if ($this->settings['useGroups'])
        {
            $table = ORM::getTable($this, 'Group');
        }
        else
        {
            $table = ORM::getTable($this, 'Image');
        }

        $items = $table->findInSection($section, $maxCount, $startFrom, false);

        // Данные для подстановки в шаблон
        $vars = array();
        $vars['this'] = $this;
        $vars['page'] = Eresus_Kernel::app()->getPage();
        $vars['Eresus'] = Eresus_CMS::getLegacyKernel();
        $vars['sectionId'] = arg('section', 'int');
        $vars['items'] = $items;

        /* Шаблоны адресов действий */
        $vars['urlEdit'] = str_replace('&', '&amp;',
            Eresus_Kernel::app()->getPage()->url(array('id' => '%s')));
        $vars['urlToggle'] = str_replace('&', '&amp;',
            Eresus_Kernel::app()->getPage()->url(array('toggle' => '%s')));
        $vars['urlCover'] = str_replace('&', '&amp;',
            Eresus_Kernel::app()->getPage()->url(array('cover' => '%s')));
        $vars['urlUp'] = str_replace('&', '&amp;',
            Eresus_Kernel::app()->getPage()->url(array('up' => '%s')));
        $vars['urlDown'] = str_replace('&', '&amp;',
            Eresus_Kernel::app()->getPage()->url(array('down' => '%s')));
        $vars['urlDelete'] = str_replace('&', '&amp;',
            Eresus_Kernel::app()->getPage()->url(array('delete' => '%s')));

        $totalPages = ceil($table->countInSection($section) / $maxCount);

        if ($totalPages > 1)
        {
            $pager = new PaginationHelper($totalPages, $pg,
                Eresus_Kernel::app()->getPage()->url(array('pg' => '%s')));
            $vars['pager'] = $pager->render();
        }
        else
        {
            $vars['pager'] = '';
        }

        /* Создаём экземпляр шаблона */
        if ($this->settings['useGroups'])
        {
            $tmpl = $this->templates()->admin('image-grouped-list.html');
            // Изображения вне групп
            $table = ORM::getTable($this, 'Album');
            /* @var Gallery_Entity_Album $album */
            $album = $table->find($section);
            $vars['orphans'] = $album->getOrphans();
        }
        else
        {
            $tmpl = $this->templates()->admin('image-list.html');
        }

        // Компилируем шаблон и данные
        $html = $tmpl->compile($vars);

        return $html;
    }
1060868
protected function render()
    {
        if (!isset($this->items[0])) {
            return '';
        }
        foreach ($this->items as $itemId => $item) {
            $item->setCollapsable(
                self::$id, 
                self::$id . $itemId, 
                in_array($itemId, $this->openedItems));
        }
        $this->setAttribute('id', self::$id);
        $this->addCssClass($this->itemType . '-group');
        return $this
            ->html('<div' . $this->getEltDecorationStr() . '>')
            ->html(implode("\n", $this->items))
            ->html('</div>')
            ->getHtml();
    }
1157586
private function sectionStdAdd()
	{
		/*
		 * Создаём список имеющихся шаблонов чтобы отфильтровать их из списка доступных.
		 */
		$templates = Templates::getInstance();
		$list = array_keys($templates->enum('std'));
		$existed = array();
		foreach ($list as $key)
		{
			$existed []= $key;
		}


		$values = array();
		$items = array();
		$jsArray = "var aTemplates = Array();\n";
		foreach ($this->stdTemplates as $key => $item)
		{
			if (in_array($key, $existed))
			{
				continue;
			}
			if (!isset($hint))
			{
				$hint = isset($item['hint']) ? $item['hint'] : '';
			}
			$values[] = $key;
			$items[] = $item['caption'];
			$jsArray .= "aTemplates['".$key."'] = '".(isset($item['hint'])?$item['hint']:'')."'\n";
		}
		if (!isset($hint))
		{
			$hint = '';
		}

		Eresus_Kernel::app()->getPage()->addScripts($jsArray."
			function onTemplateNameChange()
			{
				document.getElementById('templateHint').innerHTML =
					aTemplates[document.addForm.elements.namedItem('name').value];
			}
		");
		$form = array(
			'name' => 'addForm',
			'caption' => Eresus_Kernel::app()->getPage()->title.ADM_T_DIV.ADM_ADD,
			'width' => '100%',
			'fields' => array (
				array('type'=>'hidden','name'=>'action', 'value'=>'insert'),
				array('type'=>'hidden','name'=>'section', 'value'=>arg('section')),
				array('type'=>'select','name'=>'name','label'=>ADM_THEMES_TEMPLATE, 'values'=>$values,
					'items'=>$items, 'extra' => 'onChange="onTemplateNameChange()"'),
				array('type'=>'text','name'=>'hint', 'value' => $hint, 'extra' => 'id="templateHint"'),
				array('type'=>'memo','name'=>'code', 'height'=>'30', 'syntax' => 'html'),
			),
			'buttons' => array('ok','cancel'),
		);
		/* @var TAdminUI $page */
		$page = Eresus_Kernel::app()->getPage();
		$result = $page->renderForm($form);
		return $result;
	}
814176
public function getHTML()
    {
        $this->parse();
        $xml = clone $this->xml;

        /* Удаляем расширенные теги */
        $tags = $xml->getElementsByTagNameNS(self::NS, '*');
        while ($tags->length > 0)
        {
            $node = $tags->item(0);
            $node->parentNode->removeChild($node);
        }

        // Есть ли поля для выбора файлов?
        $hasFileInputs = false;

        /*
         * Удаляем расширенные атрибуты
         * Ищем input[type=file]
         */
        $tags = $xml->getElementsByTagName('*');
        for ($i = 0; $i < $tags->length; $i++)
        {
            $node = $tags->item($i);

            $isElement = $node->nodeType == XML_ELEMENT_NODE;
            /** @var DOMElement $node */
            $hasAttributes = $isElement && $node->hasAttributes();

            if ($isElement && $hasAttributes)
            {
                /** @var DOMNamedNodeMap $attrs */
                $attrs = $node->attributes;
                for ($j = 0; $j < $attrs->length; $j++)
                {
                    /** @var DOMAttr $attr */
                    $attr = $attrs->item($j);
                    if ($attr->namespaceURI == self::NS)
                    {
                        $attr->ownerElement->removeAttributeNode($attr);
                        $j--;
                    }
                }

                if ($node->tagName == 'input' && $node->getAttribute('type') == 'file')
                {
                    $hasFileInputs = true;
                }
            }
        }

        if ($hasFileInputs)
        {
            /** @var DOMElement $element */
            $element = $xml->firstChild->nextSibling;
            $element->setAttribute('enctype', 'multipart/form-data');
        }

        // Предотвращаем схлопывание пустых textarea
        $tags = $xml->getElementsByTagName('textarea');
        for ($i = 0; $i < $tags->length; $i++)
        {
            $node = $tags->item($i);
            $cdata = $xml->createCDATASection('');
            $node->appendChild($cdata);
        }

        $xml->formatOutput = true;
        $html = $xml->saveXML($xml->firstChild->nextSibling);
        // Удаляем атрибуты пространств имён
        $html = preg_replace('/\s*xmlns:\w+=("|\').*?("|\')/', '', $html);
        // Удаляем пустые <![CDATA[]]>
        $html = str_replace('<![CDATA[]]>', '', $html);

        return $html;
    }
231331
public function Render()
    {

        $HtmlTag = $this->getTag();

        $attributes = $HtmlTag->attr('*'); //атрибуты с шаблона
        unset($attributes["zippy"]);

        $attributes['id'] = $this->id;

        if (isset($this->attributes["class"])) {
            if (strlen($this->attributes["class"]) > 0) {
                $attributes['class'] = $attributes['class'] . ' ' . $this->attributes["class"];
            } else {
                $attributes['class'] = str_replace($this->attributes["class"], "", $attributes['class']);
            }
        }
        if (isset($this->attributes["style"])) {
            if (strlen($this->attributes["style"]) > 0) {
                $attributes['style'] = $attributes['style'] . ';  ' . $this->attributes["style"];
            } else {
                $attributes['style'] = str_replace($this->attributes["style"], "", $attributes['style']);
            }
        }

        foreach ($attributes as $key => $value) {

            if (!array_key_exists($key, $this->attributes)) {
                $this->attributes[$key] = $value;
            }
        }


        $this->beforeRender();
        //вызываем имплементацию  рендеринга наследуемым  классом
        $this->RenderImpl();
        //рендерим   аттрибуты
        foreach ($this->attributes as $name => $value) {
            $attr = $this->getAttribute($name);
            $HtmlTag->attr($name, $attr);
            if (strlen($attr) == 0) {
                $HtmlTag->removeAttr($name);
            }
        }
        $this->afterRender();
    }
589546
public function render()
    {
        if (!$this->grid->showColumnSelector()) {
            return '';
        }
        $show = array_filter(explode(',', request(static::SELECT_COLUMN_NAME)));

        $columns = $this->getGridColumns();

        $this->setupScript();

        $lists = $columns->map(function ($val, $key) use ($show) {
            if (empty($show)) {
                $checked = 'checked';
            } else {
                $checked = in_array($key, $show) ? 'checked' : '';
            }

            return <<<HTML
<li class="checkbox icheck" style="margin: 0;">
    <label style="width: 100%;padding: 3px;">
        <input type="checkbox" class="column-select-item" value="{$key}" {$checked}/>&nbsp;&nbsp;&nbsp;{$val}
    </label>
</li>
HTML;
        })->implode("\r\n");

        $btns = [
            'all'    => __('admin.all'),
            'submit' => __('admin.submit'),
        ];

        return <<<EOT

<div class="dropdown pull-right column-selector" style="margin-right: 10px">
    <button type="button" class="btn btn-sm btn-instagram dropdown-toggle" data-toggle="dropdown">
        <i class="fa fa-table"></i>
        &nbsp;
        <span class="caret"></span>
    </button>
    <ul class="dropdown-menu" role="menu" style="padding: 10px;">
        <li>
            <ul style='padding: 0;'>
                {$lists}
            </ul>
        </li>
        <li class="divider"></li>
        <li class="text-right">
            <button class="btn btn-sm btn-defalut column-select-all">{$btns['all']}</button>&nbsp;&nbsp;
            <button class="btn btn-sm btn-primary column-select-submit">{$btns['submit']}</button>
        </li>
    </ul>
</div>
EOT;
    }
212477
public function getHtml(): string
  {
    $this->attributes['type']    = 'checkbox';
    $this->attributes['name']    = $this->submitName;
    $this->attributes['checked'] = !empty($this->value);

    $html = $this->prefix;
    $html .= $this->getHtmlPrefixLabel();
    $html .= Html::generateVoidElement('input', $this->attributes);
    $html .= $this->getHtmlPostfixLabel();
    $html .= $this->postfix;

    return $html;
  }
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;
  }
798037
private function render(): string
    {
        switch ($this->mode) {
            case 'button':
                $html = '<button class="btn' . $this->classes() . '" type="submit" ' .
                    (($this->disabled === true) ? 'disabled ' : null) .
                    '>' . $this->view->escapeHtml($this->label) . '</button>';
                break;

            case 'input':
                $html = '<input class="btn' . $this->classes() . '" type="' .
                    $this->input_type . '" value="' .
                    $this->view->escapeHtml($this->label) . '" ' .
                    (($this->disabled === true) ? ' disabled ' : null) . '/>';
                break;

            default:
                $html = '<a href="' . (($this->link !== null) ? $this->view->escapeUrl($this->link) : '#') .
                    '" class="btn' . $this->classes() .
                    (($this->disabled === true) ? ' disabled' : null) .
                    '" role="button">' . $this->view->escapeHtml($this->label) . '</a>';
                break;
        }

        return $html;
    }
404427
public function getHtmlHeader(): string
  {
    $ret = Html::generateTag('tr', ['class' => [OverviewTable::$class, 'header']]);
    foreach ($this->slatJoints as $factory)
    {
      $ret .= $factory->getHtmlColumnHeader();
    }
    $ret .= '<th class="error"></th>';
    $ret .= '</tr>';

    if ($this->filter)
    {
      $ret .= Html::generateTag('tr', ['class' => [OverviewTable::$class, 'filter']]);
      foreach ($this->slatJoints as $factory)
      {
        $ret .= $factory->getHtmlColumnFilter();
      }
      $ret .= '<th class="error"></th>';
      $ret .= '</tr>';
    }

    return $ret;
  }
91956
public function toHtml()
    {
        $filename = $this->getTemplateFolder().$this->getTemplate();
        $data = (is_subclass_of($this->_data, 'erdiko\core\Container')) ? $this->_data->toHtml() : $this->_data;

        return $this->getTemplateFile($filename, $data);
    }
530380
public function render()
    {
        $htmlContent = '';
        foreach (self::$httpEquivList as $httpEquivName => $httpEquivValue) {
            $htmlContent .= '<meta http-equiv="' . $httpEquivName . '" content="' . $httpEquivValue . '">' . PHP_EOL;
        }
        foreach (self::$metaList as $metaName => $metaValue) {
            $htmlContent .= '<meta name="' . $metaName . '" content="' . $metaValue . '">' . PHP_EOL;
        }
        return $htmlContent;
    }
682009
public function _info()
    {
        $inf = array();
        $ar  = array();
        foreach ($this->attribs as $i => $a) {
            $ar[$i] = self::html_attr2str($a);
        }

        $inf['attribs']   = $ar;
        $inf['attrs']     = $this->attrs;
        $inf['idx_attr']  = $this->idx_attr;
        $inf['tag_idx']   = $this->tag_idx;
        $inf['attr_idx']  = $this->attr_idx;
        $inf['class_idx'] = $this->class_idx;

        $lev = array();
        $nm  = array();
        $st  = array();
        $pb  = -1;
        $pe  = PHP_INT_MAX;
        $l   = 0;
        foreach ($this->ids as $b => $e) {
            if ($pb < $b && $b < $pe) {
                $st[]          = array($pb, $pe);
                list($pb, $pe) = array($b, $e);
            } else {
                while ($pe < $b && $st) {
                    list($pb, $pe) = array_pop($st);
                }
            }

            $nm[$b]  = $this->tags[$b];
            $lev[$b] = count($st);
        }
        foreach ($nm as $b => &$n) {
            $n = str_repeat(' -', $lev[$b]) . ' < ' . $n . ' ' . $this->get_attr_byId($b, null, true) . ' >';
        }
        $nm           = implode("\n", $nm);
        $inf['struc'] = $nm;
        unset($lev, $st, $nm);
        return $inf;
    }
420077
public function getHtml(): string
  {
    $html = $this->prefix;
    $html .= Html::generateTag('span', $this->attributes);

    if (is_array($this->options))
    {
      foreach ($this->options as $option)
      {
        $inputAttributes = $this->inputAttributes($option);
        $labelAttributes = $this->labelAttributes($option);

        $labelAttributes['for'] = $inputAttributes['id'];

        // Get the (database) key of the option.
        $key  = $option[$this->keyKey];

        // If an obfuscator is installed compute the obfuscated code of the (database) ID.
        $code = ($this->optionsObfuscator) ? $this->optionsObfuscator->encode(Cast::toOptInt($key)) : $key;

        $inputAttributes['name']    = ($this->submitName!=='') ? $this->submitName.'['.$code.']' : $code;
        $inputAttributes['checked'] = ($this->checkedKey!==null && !empty($option[$this->checkedKey]));

        $html .= Html::generateVoidElement('input', $inputAttributes);

        $html .= $this->labelPrefix;
        $html .= Html::generateElement('label',
                                       $labelAttributes,
                                       Cast::toOptString($option[$this->labelKey]),
                                       $this->labelIsHtml);
        $html .= $this->labelPostfix;
      }
    }

    $html .= '</span>';
    $html .= $this->postfix;

    return $html;
  }
1093766
public function getHTML()
    {
        $details = $this->getHTMLDetails();
        extract($details);

        $label = isset($this['label'])
            ? " value='{$this['label']}'"
            : null;
        $classSubmit = isset($this['class-submit'])
            ? " class='{$this['class-submit']}'"
            : null;

        return <<<EOD
<{$wrapperElement}{$wrapperClass}>
<input id='$id' type='search'{$class}{$name}{$value}{$autofocus}{$required}{$readonly}{$placeholder}/>
<input id='do-{$id}' type='submit'{$classSubmit}{$label}{$readonly}{$title}/>
</{$wrapperElement}>
<p class='cf-desc'>{$description}</p>
EOD;
    }
304229
public function field()
    {
        $optionsCode = '';

        if (is_array($this->options['options'])) {
            foreach ($this->options['options'] as $key => $value) {
                $optionsCode .= '<option value="'.$key.'"'.($this->value == $key ?
                    ' selected="selected"' : null).'>'.
                    $value.'</option>';
            }
        } elseif ($optionClass = $this->options['options']) {
            $options = $optionClass::orderBy((isset($this->options['optionsSort']) ? $this->options['optionsSort'] : 'id'),
                                              (isset($this->options['optionsSortOrder']) ? $this->options['optionsSortOrder'] : 'asc'))->get();

            foreach ($options as $option) {
                $optionValue = isset($this->options['optionsValue']) ? $this->options['optionsValue'] : 'id';
                $optionShow = isset($this->options['optionsShow']) ? $this->options['optionsShow'] : 'name';

                $optionsCode .= '<option value="'.$option->$optionValue.'"'.($this->value == $option->$optionValue ?
                    ' selected="selected"' : null).'>'.
                    $option->$optionShow.'</option>';
            }
        }

        $input = new HTMLBrick('select', $optionsCode, [
            'id'   => $this->id,
            'name' => $this->name,
        ]);
        $input->addClass('form-control');

        return $input;
    }
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']);
        }
    }