Только онлоад
@return <type>
432993
function get_onload($as_html = true) {
        if (!$as_html) {
            return $this->js_onload;
        }
        if (!count($this->js_onload))
            return '';
        $js = '';
        foreach ($this->js_onload as $k => $_js) {
            $js .= trim($_js) . PHP_EOL;
        }
        $js = 'jQuery(document).ready(function(){' . PHP_EOL . $js . '});';
        $js = $this->prepare($js, $this->get_need_min_onload());
        if (!$this->get_need_build_onload()) {
            $ret = '<script>' . PHP_EOL . $js . PHP_EOL . '</script>';
            return $ret;
        }
        //если требуется собирать инлайн скрипты в один внешний файл
        $build_name = $this->make_file_name($this->js_onload, 'js/onload', 'js');
        $this->require_build($build_name, $js);
        return $this->get_link(Helper::build_url($build_name)) . PHP_EOL;
    }
735678
function getValue() {
		$chosen = parent::getValue(); /** @var string|null $chosen */
		$allowed = $this->dfValues(); /** @var string[] $allowed */
		// 2016-11-13
		// Обрабатываем тот случай, когда значения self::$ORDER и self::$BASE были разрешены
		// в предыдущих версиях модуля, а потом стали запрещены.
		// Так, например, было с модулем Square:
		// там на сегодняшний день разрешены всего 2 валюты: USD и CAD,
		// поэтому я решил убрать опции self::$ORDER и self::$BASE,
		// однако чтобы это не поломало магазины тех клиентов,
		// у которых одно из этих значений уже выбрано (а self::$ORDER было значением по умолчанию).
		return $allowed && (!$chosen || !in_array($chosen, $allowed)) ? df_first($allowed) :
			($chosen ?: self::$ORDER)
		;
	}
30120
public function tok()
    {
        switch ($this->token['type']) {
            case 'space': {
                return '';
            }
            case 'hr': {
                return $this->renderer->hr();
            }
            case 'heading': {
                return $this->renderer->heading(
                    $this->inline->output($this->token['text']),
                    $this->token['depth'],
                    $this->token['text']);
            }
            case 'code': {
                return $this->renderer->code(
                    $this->token['text'],
                    isset($this->token['lang']) ? $this->token['lang'] : null,
                    isset($this->token['escaped']) ? $this->token['escaped'] : false);
            }
            case 'table': {
                $header = '';
                $body = '';
                $i = null;
                $row = null;
                $cell = null;
                $flags = null;
                $j = null;
        
                // header
                $cell = '';
                foreach ($this->token['header'] as $i => $h) {
                    $flags = array(
                        'header' => true,
                        'align' => $this->token['align'][$i]
                    );
                    $cell .= $this->renderer->tablecell(
                        $this->inline->output($h),
                        array(
                            'header' => true,
                            'align' => $this->token['align'][$i]
                        )
                    );
                }
                
                $header .= $this->renderer->tablerow($cell);

                foreach ($this->token['cells'] as $i => $row) {
                    $cell = '';

                    foreach ($row as $j => $c) {
                        $cell .= $this->renderer->tablecell(
                            $this->inline->output($c),
                            array(
                                'header' => false,
                                'align' => $this->token['align'][$j]
                            )
                        );
                    }
        
                    $body .= $this->renderer->tablerow($cell);
                }
                return $this->renderer->table($header, $body);
            }
            case 'blockquote_start': {
                $body = '';
                
                $n = $this->next();
                while ($n['type'] !== 'blockquote_end') {
                    $body .= $this->tok();
                    $n = $this->next();
                }
                
                return $this->renderer->blockquote($body);
            }
            case 'list_start': {
                $body = '';
                $ordered = $this->token['ordered'];
                
                $n = $this->next();
                while ($n['type'] !== 'list_end') {
                    $body .= $this->tok();
                    $n = $this->next();
                }
        
                return $this->renderer->lst($body, $ordered);
            }
            case 'list_item_start': {
                $body = '';
            
                $n = $this->next();
                while ($n['type'] !== 'list_item_end') {
                    $body .= $this->token['type'] === 'text'
                        ? $this->parseText()
                        : $this->tok();
                    $n = $this->next();
                }

                return $this->renderer->listitem($body);
            }
            case 'loose_item_start': {
                $body = '';
                
                $n = $this->next();
                while ($n['type'] !== 'list_item_end') {
                    $body .= $this->tok();
                    $n = $this->next();
                }
        
                return $this->renderer->listitem($body);
            }
            case 'html': {
                $html = !$this->token['pre'] && !$this->options['pedantic']
                    ? $this->inline->output($this->token['text'])
                    : $this->token['text'];
                return $this->renderer->html($html);
            }
            case 'paragraph': {
                return $this->renderer->paragraph($this->inline->output($this->token['text']));
            }
            case 'text': {
                return $this->renderer->paragraph($this->parseText());
            }
        }
    }
693133
private function nameFull() {return dfc($this, function() {return
		$this->isTop()
		? df_trim_text_right($this->getName(), '[value]')
		// Анонимные филдсеты не добавляют своё имя в качестве префикса имён полей.
		: (!$this->_anonymous ? $this->getId() : $this->_parent->nameFull())
	;});}
1055287
function get_external() {
        if (!count($this->js_external))
            return '';
        //если не надо собирать все в один билд-файл
        if (!$this->get_need_build_external()) {
            $js_code = '';
            foreach ($this->js_external as $js => $_js) {
                $condition = \Arr::get($_js, 'condition');
                //если надо подключать все по отдельности
                $js_code .= $this->get_link($js, $condition) . "\n";
            }
            return $js_code;
        } else {
            $build = array();
            $no_build = array();
            $js_code = '';
            foreach ($this->js_external as $js => $_js) {
                $condition = \Arr::get($_js, 'condition');
                if (\Arr::get($_js, 'no_build')) {
                    $no_build[$condition][] = $js;
                } else {
                    $build[$condition][] = $js;
                }
            }
            foreach ($no_build as $condition => $js) {
                $condition = \Arr::get($_js, 'condition');
                foreach ($js as $url) {
                    $js_code .= $this->get_link($url, $condition) . "<!-- no build -->" . PHP_EOL;
                }
            }
            foreach ($build as $condition => $js) {
                $build_name = $this->make_file_name($this->js_external, 'js/external' . ($condition ? '/' . $condition : ''), 'js');
                $build_file = Helper::build_file($build_name);
                if (!file_exists($build_file)) {
                    //соберем билд в первый раз
                    $build = array();
                    foreach ($js as $url) {
                        $_js = $this->get_source($url);
                        $_js = $this->prepare($_js, $this->get_need_min_external());
                        $build[] = $_js;
                    }
                    //если требуется собирать инлайн скрипты в один внешний файл
                    $this->require_build($build_name, implode("\n", $build));
                }
                $js_code .= $this->get_link(Helper::build_url($build_name), $condition) . PHP_EOL;
            }
            //$build_name = $this->make_file_name($this->js_inline, 'js/onload', 'js');
            return $js_code;
        }
    }
1297517
public function DirStructure($type, $innerDirs = 'first', $currentDir = '', $level = 0)
    {
        //Пока отключим файлы
        if ($type == 'files')
        {
            return '';
        }

        $currentDirArr = array();
        if (!empty($currentDir))
        {
            $currentDirArr = preg_split('[\\/]',
                str_replace($this->dir[$type], '', realpath($currentDir)));
            $currentDirArr = array_filter($currentDirArr);
        }

        if ($innerDirs == 'first')
        {
            $innerDirs = $this->Tree($this->dir[$type]);
            if (realpath($currentDir) == $this->dir[$type] && !$this->firstAct)
            {
                $firstAct = 'folderAct';
                $this->firstAct = true;
            }
            else
            {
                $firstAct = '';
            }
            $ret = '';
            if ($innerDirs == false)
            {
                return 'Неверно задана корневая директория (' . DIR_IMAGES . ')';
            }
            foreach ($innerDirs as $v)
            {
                $ret = '<div class="folder' . ucfirst($type) . ' ' . $firstAct . '" path="" pathtype="' . $type . '">' . ($type == 'images' ? 'Изображения' : 'Файлы') . ($v['count'] > 0 ? ' (' . $v['count'] . ')' : '') . '</div><div class="folderOpenSection" style="display:block;">';
                if (isset($v['childs']))
                {
                    $ret .= $this->DirStructure($type, $v['childs'], $currentDir, $level);
                }
                break;
            }
            $ret .= '</div>';
            return $ret;
        }

        if (sizeof($innerDirs) == 0)
        {
            return false;
        }
        $ret = '';
        foreach ($innerDirs as $v)
        {
            // TODO: Нафига?!
            foreach ($v as $v)
            {
            }
            if (isset($v['count']))
            {
                $files = 'Файлов: ' . $v['count'];
                $count_childs = isset($v['childs']) ? sizeof($v['childs']) : 0;
                if ($count_childs != 0)
                {
                    $files .= ', папок: ' . $count_childs;
                }
            }
            else
            {
                $files = '';
            }
            if (isset($v['childs']))
            {
                $folderOpen = '';
                $folderAct = '';
                $folderClass = 'folderS';
                if (isset($currentDirArr[$level + 1]))
                {
                    if ($currentDirArr[$level + 1] == $v['name'])
                    {
                        $folderOpen = 'style="display:block;"';
                        $folderClass = 'folderOpened';
                        if ($currentDirArr[sizeof($currentDirArr)] == $v['name'] && !$this->folderAct)
                        {
                            $folderAct = 'folderAct';
                            $this->folderAct = true;
                        }
                        else
                        {
                            $folderAct = '';
                        }
                    }
                }
                $ret .= '<div class="' . $folderClass . ' ' . $folderAct . '" path="' . $v['path'] . '" title="' . $files . '" pathtype="' . $type . '">' . $v['name'] . ($v['count'] > 0 ? ' (' . $v['count'] . ')' : '') . '</div><div class="folderOpenSection" ' . $folderOpen . '>';
                $ret .= $this->DirStructure($type, $v['childs'], $currentDir, $level + 1);
                $ret .= '</div>';
            }
            else
            {
                $soc = sizeof($currentDirArr);
                if ($soc > 0 && $currentDirArr[$soc] == $v['name'])
                {
                    $folderAct = 'folderAct';
                }
                else
                {
                    $folderAct = '';
                }
                $ret .= '<div class="folderClosed ' . $folderAct . '" path="' . $v['path'] . '" title="' . $files . '" pathtype="' . $type . '">' . $v['name'] . ($v['count'] > 0 ? ' (' . $v['count'] . ')' : '') . '</div>';
            }
        }

        return $ret;
    }
511399
public function getType() : ?string 
    {
        if ( ! $this->hasType()) {
            $this->setType($this->getDefaultType());
        }
        return $this->type;
    }
311856
public function getHTML()
    {
        // Открывающий тег
        $html = '<' . $this->tagName;

        /* Добавляем атрибуты */
        foreach ($this->attrs as $name => $value)
        {
            $html .= ' ' . $name;

            if ($value !== true)
            {
                $html .= '="' . $value . '"';
            }
        }

        $html .= '>';

        /* Если есть содержимое, то добавляем его и закрывающий тег */
        if ($this->contents !== null)
        {
            $html .= $this->contents . '</' . $this->tagName . '>';
        }

        return $html;
    }
240473
function getExternal($as_html = true) {
        if(!$as_html) {
            return $this->css_external;
        }
        if(!count($this->css_external)) {
            return '';
        }
        $css_code = '';
        /* если не надо собирать файлы в один */
        if(!config('larakit.lk-staticfiles.css.external.build', false)) {
            foreach($this->css_external as $css => $_css) {
                $css_code .= '        ' . $this->getLink($css, Arr::get($_css, 'media'), Arr::get($_css, 'condition')) . PHP_EOL;
            }
        } else {
            $build     = [];
            $no_builds = [];
            $css_code  = '';
            foreach($this->css_external as $css => $_css) {
                $condition = Arr::get($_css, 'condition');
                $media     = Arr::get($_css, 'media');
                $no_build  = Arr::get($_css, 'no_build');
                if($no_build) {
                    $no_builds[$condition . '|' . $media][] = $css;
                } else {
                    $build[$condition . '|' . $media][] = $css;
                }
            }
            foreach($no_builds as $key => $css) {
                list($condition, $media) = explode('|', $key);
                $css_code .= '<!-- [no build] -->' . PHP_EOL;
                foreach($css as $_css) {
                    $css_code .= $this->getLink($_css, $media, $condition, false) . PHP_EOL;
                }
                $css_code .= '<!-- [/no build] -->' . PHP_EOL;
            }
            foreach($build as $key => $css) {
                list($condition, $media) = explode('|', $key);
                $prefix = ['css'];
                if($condition) {
                    $prefix[] = str_replace(' ', '', $condition);
                }
                if($media) {
                    $prefix[] = $media;
                }
                $build_name = $this->makeFileName($css, implode('/', $prefix), 'css');
                $build_file = $this->buildFile($build_name);
                if(!file_exists($build_file)) {
                    //соберем билд в первый раз
                    $build = [];
                    foreach($css as $url) {
                        $_css    = $this->replaceRelativePath($url);
                        $_css    = $this->prepare($_css, config('larakit.lk-staticfiles.css.external.min') || (mb_strpos($url, '.min.') !== false));
                        $build[] = "/**********************************************************************" . PHP_EOL;
                        $build[] = '* ' . $url . PHP_EOL;
                        $build[] = "**********************************************************************/" . PHP_EOL;
                        $build[] = $_css . PHP_EOL . PHP_EOL;
                    }
                    if(!file_exists(dirname($build_file))) {
                        mkdir(dirname($build_file), 0777, true);
                    }
                    
                    $this->save($build_file, implode('', $build));
                }
                $css_code .= $this->getLink($this->buildUrl($build_name), $media, $condition) . "\n";
            }
        }
        
        return $css_code;
    }
840556
protected function getValue()
    {
        if (isset($this->_maker, $this->_name)){
            $parent = $this->_maker->getValue(); // Берется значения родителя (родитель, возможно, берет значения у своего родителя..)
            return isset($parent[$this->_name])? $parent[$this->_name] : null; // Из него выбирается своё
        }else{
            return $this->_value;
        }
    }
62599
public function editAction()
    {
        /** @var Menus_Entity_Table_Menu $table */
        $table = ORM::getTable($this->plugin, 'Menu');
        /** @var Menus_Entity_Menu $menu */
        $menu = $table->find(arg('id', 'int'));

        if (is_null($menu))
        {
            return 'Такое меню не найдено.';
        }

        $req = Eresus_CMS::getLegacyKernel()->request;

        if ('POST' == $req['method'])
        {
            $menu->name = arg('name', 'word');
            $menu->caption = arg('caption', 'dbsafe');
            $menu->active = true;
            $menu->root = arg('root', 'int');
            $menu->rootLevel = arg('rootLevel', 'int');
            $menu->invisible = arg('invisible', 'int');
            $menu->expandLevelAuto = arg('expandLevelAuto', 'int');
            $menu->expandLevelMax = arg('expandLevelMax', 'int');
            $menu->dropDown = arg('dropDown', 'int');
            $menu->template = arg('template', 'dbsafe');

            $test = $table->findByName($menu->name);
            if (is_null($test) || $test->id == $menu->id)
            {
                $table->update($menu);
                HTTP::redirect('admin.php?mod=ext-menus&id=' . $menu->id);
            }
            else
            {
                ErrorMessage('Меню с таким именем уже есть');
            }
        }

        $form = new EresusForm($this->plugin->templates()->adminPath('form.html', false));
        $form->setValue('sections', $this->adminSectionBranch());
        $form->setValue('action', 'edit');
        $form->setValue('menu', $menu);
        $html = $form->compile();

        return $html;
    }
782383
private function renderData()
    {

        if (count($this->datalist) == 0) {
            return ""; //"<tr  ><td  align=\"center\" colspan=\"" . count($this->columns) . "\" >" . MSG_DATATABLE_NODATA . "</td></tr>";
        }
        $rownumber = 0;
        $rows = "";
        foreach ($this->datalist as $item) {     //цикл  по  строкам
            $rownumber++;

            if ($this->selectedrow == $rownumber && $this->selectedclass != "") {
                $row = "<tr class=\"{$this->selectedclass}\" >";
            } else {
                $row = "<tr  >";
            }


            foreach ($this->columns as $fieldname => $column) {       //цикл  по  полям
                if (!$column->visible) {
                    continue;
                }

                $data = strlen($item->{$fieldname}) > 0 ? $item->{$fieldname} : $column->defaultdata;
                $css = strlen($column->rowclass) > 0 ? "class=\"{$column->rowclass}\"" : "";
                $onclick = "";
                $style = "";


                $url = $this->getURLNode() . ':cellclick:' . $fieldname . ':' . $rownumber;
                if ($column->clickable) {

                    $onclick = "window.location='{$url}'";
                }
                if ($column->clickable && $this->useajax) {
                    $onclick = "getUpdate('{$url}&ajax=true');event.returnValue=false; return false;";
                }

                if (strlen($onclick) > 0) {
                    $onclick = " onclick=\"" . $onclick . "\" ";
                    $style = "style=\"cursor:pointer;\"";
                }


                if ($this->cellevent instanceof \Zippy\Event) {
                    $userdata = $this->cellevent->onEvent($this, array('dataitem' => $item, 'field' => $fieldname, 'rownumber' => $rownumber));
                    if ($userdata !== null && $userdata !== false) {
                        $data = $userdata;
                    }
                }

                $row .= ( "<td  {$css} {$onclick} {$style}>{$data}</td>");
            }
            $row .="</tr>";
            $rows .= $row;
        }
        return $rows;
    }
1150249
private function doRun()
    {
        $dispatcher = (new DispatcherInjector)->build();

        //покажем событие Request
        if (($response = $dispatcher->signal('kernel.request')) instanceof ResponseInterface) {
            return $response; // событие завершило очередь
        }

        $resolver = $this->getResolver();

        //покажем событие Route
        if (($response = $dispatcher->signal('kernel.route', ['resolver' => $resolver])) instanceof ResponseInterface) {
            return $response; // событие завершило очередь
        }

        /** @var Console|IController $controller */
        $controller = $resolver->getApp();
        $action = $resolver->getAction();

        //покажем событие Controller
        if (($response = $dispatcher->signal('kernel.controller',
                ['controller' => $controller, 'action' => $action])) instanceof ResponseInterface
        ) {
            return $response; // событие завершило очередь
        }

        $response = $controller->action((string)$action);

        if (!($response instanceof ResponseInterface)) {
            $responser = (new ResponseInjector)->build();
            $stream = $responser->getBody();
            $stream->write((string)$response);

            $response = $responser->withBody($stream);
        }

        $dispatcher->signal('kernel.response', ['response' => $response]);

        return $response;
    }
406697
public function type() {
		if ( isset($this->custom['type']) ) {
			return $this->custom['type'];
		}
		if ( !$this->__type instanceof PostType ) {
			$this->__type = new PostType($this->post_type);
		}
		return $this->__type;
	}
559739
public function getResultingType() : \Dms\Core\Persistence\Db\Schema\Type\Type
    {
        if (in_array($this->operator, [self::ADD, self::SUBTRACT])) {
            return $this->left->getResultingType();
        } else {
            return new Boolean();
        }
    }
123802
public function getType() : int
    {
        $query = 'SELECT type_id FROM info LIMIT 1';

        $typeId = Type::UNKNOWN;
        foreach ($this->getAdapter()->query($query) as $row) {
            $typeId = (int)$row['type_id'];
        }

        return $typeId;
    }
746014
function GetFlexType()
	{
		$rt = $this->Type;
		switch ($this->Type)
		{
			case "int":
				$rt = "int";
				break;
			case "smallint":
				$rt = "int";
				break;
			case "tinyint":
				$rt = $this->MaxSize > 1 ? "int" : "Boolean";
				break;
			case "varchar":
				$rt = "String";
				break;
			case "text":
				$rt = "String";
				break;
			case "tinytext":
				$rt = "String";
				break;
			case "datetime":
				$rt = "Date";
				break;
			case "mediumint":
				$rt = "int";
				break;
			case "bigint":
				$rt = "int";
				break;
			case "decimal":
				$rt = "Number";
				break;
			case "float":
				$rt = "Number";
				break;
			default;
				break;
		}

		return $rt;
	}