???
@return void
437509
public function sectionTemplatesDelete()
	{
		$templates = Templates::getInstance();
		$templates->delete(arg('delete'));
		HTTP::redirect(Eresus_Kernel::app()->getPage()->url());
	}
1373393
public function initialize()
    {

        $this->title = '';
        $this->settings = array();
        $this->created = null;
        $this->updated = null;

    }
1259681
public function filter()
    {
        $blueprints = $this->blueprints();
        $values = $blueprints->filter($this->toArray());
        if ($values && isset($values['header'])) {
            $this->header($values['header']);
        }
    }
935331
public function init()
    {
        parent::init();

        foreach ($this->children as $child) {
            $child->init();
            foreach ($child->getPages() as $page) {
                $this->addPage($page);
            }
        }

        foreach ($this->pages as $page) {
            $page->init();
        }
    }
906687
public function compile()
	{
            if(!headers_sent()) { // Sanity check.
		header('HTTP/1.1 ' . $this->httpStatus($this->getStatus()));
		header('Content-Type: ' . $this->content_type);
		foreach($this->headers as $hdrkey => $hdrval) {
			header($hdrkey . ': ' . $hdrval);
		}
            }
            
            echo $this->body;
	}
401588
public function Bind()
	{
		if ( ! is_null( $this->_childs ) )
		{
			foreach ( $this->_childs as $node)
			{
				$node->Bind();
			}
		}
	}
380260
public function aboutAction()
    {
        $this->initHtml();

        $this->html->h3()->sprintf($this->_('About %s'), $this->project->getName());
        $this->html->pInfo(\MUtil_Html_Raw::raw($this->project->getLongDescription($this->locale->getLanguage())));
        $this->html->append($this->_getOrganizationsList());
    }
593871
public function hasValue($value)
    {
        return ! is_null($this->findValueByName($value)) || ! is_null($this->findValueById($value));
    }
1314395
public function getValue() : ?string
    {
        foreach ($this->getOptions() as $option) {
            if ($option->isSelected()) {
                return $option->getValue();
            }
        }

        return null;
    }
592991
protected function handleRequest(): void
    {
        $validator = Validator::make(
            $this->getAttribute('request')->only('rowsNumber', 'search', 'sortBy', 'sortDir'),
            [
                'rowsNumber' => 'required|numeric',
                'search'     => 'nullable|string',
                'sortBy'     => 'nullable|string|in:' . $this->getAttribute('columns')->implode('attribute', ','),
                'sortDir'    => 'nullable|string|in:asc,desc',
            ]
        );
        if ($validator->fails()) {
            $this->getAttribute('request')->merge([
                'rowsNumber' => $this->getAttribute('rowsNumber')
                    ? $this->getAttribute('rowsNumber')
                    : config('tablelist.value.rows_number'),
                'search'     => null,
                'sortBy'     => $this->getAttribute('sortBy'),
                'sortDir'    => $this->getAttribute('sortDir'),
            ]);
        } else {
            $this->setAttribute('rowsNumber', $this->getAttribute('request')->rowsNumber);
            $this->setAttribute('search', $this->getAttribute('request')->search);
        }
    }
1096390
public function showCommandList(): void
    {
        /** @var \Inhere\Console\IO\Input $input */
        $input = $this->input;
        // has option: --auto-completion
        $autoComp = $input->getBoolOpt('auto-completion');
        // has option: --shell-env
        $shellEnv = (string)$input->getLongOpt('shell-env', '');

        // php bin/app list --only-name
        if ($autoComp && $shellEnv === 'bash') {
            $this->dumpAutoCompletion($shellEnv, []);
            return;
        }

        /** @var \Inhere\Console\IO\Output $output */
        $output = $this->output;
        /** @var Router $router */
        $router = $this->getRouter();
        $script = $this->getScriptName();

        $hasGroup    = $hasCommand = false;
        $groupArr    = $commandArr = [];
        $placeholder = 'No description of the command';

        // all console groups/controllers
        if ($groups = $router->getControllers()) {
            $hasGroup = true;
            \ksort($groups);
        }

        // all independent commands, Independent, Single, Alone
        if ($commands = $router->getCommands()) {
            $hasCommand = true;
            \ksort($commands);
        }

        // add split title on both exists.
        if (!$autoComp && $hasCommand && $hasGroup) {
            $groupArr[]   = \PHP_EOL . '- <bold>Group Commands</bold>';
            $commandArr[] = \PHP_EOL . '- <bold>Alone Commands</bold>';
        }

        foreach ($groups as $name => $info) {
            $options    = $info['options'];
            $controller = $info['handler'];
            /** @var \Inhere\Console\AbstractHandler $controller */
            $desc    = $controller::getDescription() ?: $placeholder;
            $aliases = $options['aliases'];
            $extra   = $aliases ? ColorTag::wrap(
                ' [alias: ' . \implode(',', $aliases) . ']',
                'info'
            ) : '';

            // collect
            $groupArr[$name] = $desc . $extra;
        }

        if (!$hasGroup && $this->isDebug()) {
            $groupArr[] = '... Not register any group command(controller)';
        }

        foreach ($commands as $name => $info) {
            $desc    = $placeholder;
            $options = $info['options'];
            $command = $info['handler'];

            /** @var \Inhere\Console\AbstractHandler $command */
            if (\is_subclass_of($command, CommandInterface::class)) {
                $desc = $command::getDescription() ?: $placeholder;
            } elseif ($msg = $options['description'] ?? '') {
                $desc = $msg;
            } elseif (\is_string($command)) {
                $desc = 'A handler : ' . $command;
            } elseif (\is_object($command)) {
                $desc = 'A handler by ' . \get_class($command);
            }

            $aliases = $options['aliases'];
            $extra   = $aliases ? ColorTag::wrap(' [alias: ' . \implode(',', $aliases) . ']', 'info') : '';

            $commandArr[$name] = $desc . $extra;
        }

        if (!$hasCommand && $this->isDebug()) {
            $commandArr[] = '... Not register any alone command';
        }

        // built in commands
        $internalCommands = static::$internalCommands;

        if ($autoComp && $shellEnv === 'zsh') {
            $map = \array_merge($internalCommands, $groupArr, $commandArr);
            $this->dumpAutoCompletion('zsh', $map);
            return;
        }

        \ksort($internalCommands);
        Console::startBuffer();

        if ($appDesc = $this->getParam('description', '')) {
            $appVer = $this->getParam('version', '');
            Console::writeln(\sprintf('%s%s' . \PHP_EOL, $appDesc, $appVer ? " (Version: <info>$appVer</info>)" : ''));
        }

        // built in options
        $internalOptions = FormatUtil::alignOptions(self::$globalOptions);

        Show::mList([
            'Usage:'              => "$script <info>{command}</info> [--opt -v -h ...] [arg0 arg1 arg2=value2 ...]",
            'Options:'            => $internalOptions,
            'Internal Commands:'  => $internalCommands,
            'Available Commands:' => \array_merge($groupArr, $commandArr),
        ], [
            'sepChar' => '  ',
        ]);

        unset($groupArr, $commandArr, $internalCommands);
        Console::write("More command information, please use: <cyan>$script {command} -h</cyan>");
        Console::flushBuffer();
    }
104400
public function init() {
        $this->_req = $this->getRequest()->getParam('request');
        $this->_response = $this->getRequest()->getParam('response');
    }
263102
public function nulls() {
		$prefix = '';
		$tables = $this->_getTables($prefix);

		$todo = [];

		$db = $this->_getConnection();

		$this->out('Checking for tables that need updating:', 1, static::VERBOSE);
		foreach ($tables as $table) {
			// Structure
			$sql = 'DESCRIBE ' . $table['table_name'] . ';';
			$this->out('- ' . $sql, 1, static::VERBOSE);
			/** @var \Traversable $res */
			$res = $db->query($sql);
			$fields = (new Collection($res))->toArray();

			$fieldList = [];
			foreach ($fields as $field) {
				$name = $field['Field'];
				if ($name === 'id' || substr($name, -3) === '_id') {
					continue;
				}

				$type = $field['Type'];
				$null = $field['Null'];

				if (preg_match('/^tinyint\([\d]\)/', $type)) {
					if ($null === 'YES' || $field['Default'] !== null) {
						continue;
					}

					$todo[] = 'ALTER TABLE' . ' ' . $table['table_name'] . ' CHANGE `' . $name . '` `' . $name . '` ' . $type . ' NOT NULL DEFAULT \'0\';';

					continue;
				}

				if (!in_array($type, ['longtext', 'mediumtext', 'text']) && !preg_match('/^(varchar|char)\(/', $type)) {
					continue;
				}
				if ($type === 'varchar(36)' || $type === 'char(36)') {
					continue;
				}

				$fieldList[] = $field['Field'];

				if ($null === 'YES' || $field['Default'] !== null) {
					continue;
				}

				// We need to migrate sth
				if (!in_array($type, ['longtext', 'mediumtext', 'text'])) {
					$todo[] = 'ALTER TABLE' . ' ' . $table['table_name'] . ' CHANGE `' . $name . '` `' . $name . '` ' . $type . ' NOT NULL DEFAULT \'\';';
				} else {
					$todo[] = 'ALTER TABLE' . ' ' . $table['table_name'] . ' CHANGE `' . $name . '` `' . $name . '` ' . $type . ' DEFAULT NULL;';
				}
			}
		}

		if (!$todo) {
			$this->out('Nothing to do :)');
			return;
		}

		$this->out(count($todo) . ' tables/fields need updating.');
		if (!$this->param('dry-run')) {
			$continue = $this->in('Continue?', ['y', 'n'], 'y');
			if ($continue !== 'y') {
				$this->abort('Aborted!');
			}
		}
		$sql = implode(PHP_EOL, $todo);
		if (!$this->param('dry-run')) {
			$this->out($sql);
			return;
		}

		$db->query($sql);
		$this->out('Done :)');
	}
669651
public function check() {
        $field = null;
        $this->_errors = [];
        $fields = $this->_getField();

        foreach ($this->_constraints as $constraints) {
            /** @var \Gcs\Framework\Core\Orm\Entity\Type\File $value */
            foreach ($fields as $value) {
                if ($value != null) {
                    switch ($constraints['type']) {
                        case self::ACCEPT:
                            if (!in_array($value->contentType, $constraints['value'])) {
                                array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);
                            }
                            break;

                        case self::EXTENSION:
                            if (!in_array($value->extension(), $constraints['value'])) {
                                array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);
                            }
                            break;

                        case self::SIZE:
                            if (strlen($value->content) != $constraints['value']) {
                                array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);
                            }
                            break;

                        case self::SIZEMIN:
                            if (strlen($value->content) < $constraints['value']) {
                                array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);
                            }
                            break;

                        case self::SIZEMAX:
                            if (strlen($value->content) > $constraints['value']) {
                                array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);
                            }
                            break;

                        case self::SIZEBETWEEN:
                            if (!in_array(strlen($value->content), $constraints['value'])) {
                                array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);
                            }
                            break;
                    }
                }
                else {
                    array_push($this->_errors, ['field' => $this->_label, 'message' => $constraints['message']]);
                }
            }
        }
    }
1209001
public function process()
    {
        $this->debug->groupCollapsed(__METHOD__);
        if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'HEAD') {
            $this->debug->warn('head request - do not process form');
            $this->debug->groupEnd();
            return;
        }
        $this->alerts->clear();
        $this->configNormalize();
        $this->initPersist();
        $this->status['submitted'] = $this->persist->get('submitted');
        $this->storeValues();
        $this->redirectPost();
        $this->setCurrentFields();
        // $this->debug->log('persist', $this->persist);
        // $this->debug->log('status', $this->status);
        $headers = $this->getHeaders();
        $this->processSubmit();
        $this->trashCollect();
        if (!\headers_sent()) {
            $this->debug->log('headers', $headers);
            foreach ($headers as $header) {
                \header($header);
            }
        }
        $this->persist->set('submitted', false);
        $this->debug->groupEnd();
        return;
    }
1317614
public function validate() : void
    {
        if (null === $this->is_valid) {
            if (null === $this->user_value && null !== $this->default_value) {
                // There is a preset value, and its not being changed
                $this->is_valid = true;
            } elseif (null != $this->validator && false != $this->validator) {
                $validator = $this->validator;
                $valids = array();
                $all_valid = true;
                $pieces = explode(',', $this->user_value);
                foreach ($pieces as $piece) {
                    $result = $validator::quickValidate($piece, $this->constraints);
                    if (null !== $result) {
                        $valids[] = $result;
                    } else {
                        $all_valid = false;
                    }
                }
                $this->user_value = implode(',', $valids);
                $this->is_valid = $all_valid;
                if (!$all_valid) {
                    $this->error = 'The provided value is not valid. Please enter a valid value.';
                }
            } else {
                // This field does not get validated
                $this->is_valid = true;
            }
        }

        // Check if the input is different from the default value
        if ($this->is_valid && null !== $this->user_value) {
            $this->is_changed = ($this->default_value != $this->user_value);
        }
    }
970680
public function init()
    {
        if ($this->countRows < 1) {
            $this->totalPages = 0;
            $this->currentPage = 0;

            return;
        }

        if ($this->limit < 10) {
            $this->limit = 10;
        }

        $this->totalPages = (int)($this->countRows / $this->limit);

        if ($this->countRows % $this->limit) {
            $this->totalPages++;
        }

        if ($this->totalPages === 0) {
            $this->totalPages = 1;
        }

        if ($this->currentPage < 0) {
            $this->currentPage = 0;
        }

        if ($this->currentPage > $this->totalPages) {
            $this->currentPage = $this->totalPages;
        }
    }