Buduje pole
@return string
188577
public function fetchField()
    {
        $view = \Mmi\App\FrontController::getInstance()->getView();
        $view->headLink()->appendStyleSheet('/resource/cmsAdmin/js/jquery-ui/jquery-ui.min.css');
        $view->headLink()->appendStyleSheet('/resource/cmsAdmin/js/jquery-ui/jquery-ui.structure.min.css');
        $view->headLink()->appendStyleSheet('/resource/cmsAdmin/js/jquery-ui/jquery-ui.theme.min.css');
        $view->headLink()->appendStyleSheet('/resource/cmsAdmin/js/plupload/plupload.conf.css');
        $view->headLink()->appendStyleSheet('/resource/cmsAdmin/js/plupload/jquery.ui.plupload/css/jquery.ui.plupload.css');
        $view->headLink()->appendStyleSheet('/resource/cmsAdmin/js/video-frame-extractor/extractor.css');
        $view->headScript()->prependFile('/resource/cmsAdmin/js/jquery/jquery.js');
        $view->headScript()->appendFile('/resource/cmsAdmin/vendors/js/popper.min.js');
        $view->headScript()->appendFile('/resource/cmsAdmin/vendors/js/pace.min.js');
        $view->headScript()->appendFile('/resource/cmsAdmin/vendors/js/bootstrap.min.js');
        $view->headScript()->appendFile('/resource/cmsAdmin/js/tiny/tinymce.min.js');
        $view->headScript()->appendFile('/resource/cmsAdmin/js/jquery-ui/jquery-ui.min.js');
        $view->headScript()->appendFile('/resource/cmsAdmin/js/plupload/plupload.full.min.js');
        $view->headScript()->appendFile('/resource/cmsAdmin/js/plupload/plupload.conf.js');
        $view->headScript()->appendFile('/resource/cmsAdmin/js/plupload/i18n/pl.js');
        $view->headScript()->appendFile('/resource/cmsAdmin/js/plupload/jquery.ui.plupload/jquery.ui.plupload.min.js');
        $view->headScript()->appendFile('/resource/cmsAdmin/js/tiny/tinymce.min.js');
        $view->headScript()->appendFile('/resource/cmsAdmin/js/video-frame-extractor/extractor.js');

        //przygotowanie danych dla pola
        $this->_beforeRender();

        $html = '<div id="' . $this->_id . '">';
        $html .= '<p>Twoja przeglądarka nie posiada wsparcia dla HTML5.</p>';
        $html .= '<p>Proszę zaktualizować oprogramowanie.</p>';
        $html .= '</div>';
        $html .= '<div id="' . $this->_id . '-confirm" class="plupload-confirm-container" title="">';
        $html .= '<p><span class="dialog-info"></span><span class="dialog-file"></span><span class="dialog-info-2"></span></p>';
        $html .= '</div>';
        $html .= '<div id="' . $this->_id . '-edit" class="plupload-edit-container" title="">';
        $html .= '<fieldset>';
        $html .= $this->_renderImprintElements();
        $html .= '<label for="' . $this->_id . '-edit-original">nazwa wyświetlana</label>';
        $html .= '<input type="text" class="text imprint" name="original" id="' . $this->_id . '-edit-userFileName">';
        $html .= '<div id="' . $this->_id . '-edit-buttons" class="plupload-edit-buttons">';
        $html .= '<input type="checkbox" name="active" id="' . $this->_id . '-edit-active" value="1"><label for="' . $this->_id . '-edit-active">aktywny</label>';
        $html .= '<input type="checkbox" name="sticky" id="' . $this->_id . '-edit-sticky" value="1"><label for="' . $this->_id . '-edit-sticky">wyróżniony</label>';
        $html .= '</div>';
        $html .= '</fieldset>';
        $html .= '<div class="dialog-error"><p></p><span class="ui-icon ui-icon-alert"></span></div>';
        $html .= '</div>';
        if ($this->getOption('showConsole')) {
            $html .= '<div class="plupload-log-container">';
            $html .= '<pre class="plupload-log-console" id="' . $this->_id . '-console"></pre>';
            $html .= '</div>';
        }

        //dołączanie skryptu
        $view->headScript()->appendScript("
			$(document).ready(function () {
				'use strict';
				var conf = $.extend(true, {}, PLUPLOADCONF.settings);
				conf.form_element_id = '$this->_id';
				conf.form_object = '$this->_tempObject';
				conf.form_object_id = '" . $this->getUploaderId() . "';
				" . ($this->getOption('showConsole') ? "conf.log_element = '" . $this->_id . "-console';" : "") . "
				" . ($this->getOption('chunkSize') ? "conf.chunk_size = '" . $this->getOption('chunkSize') . "';" : "") . "
				" . ($this->getOption('maxFileSize') ? "conf.max_file_size = '" . $this->getOption('maxFileSize') . "';" : "") . "
				" . ($this->getOption('maxFileCount') ? "conf.max_file_cnt = " . $this->getOption('maxFileCount') . ";" : "") . "
				" . ($this->getOption('mimeTypes') ? "conf.filters.mime_types = " . json_encode($this->getOption('mimeTypes')) . ";" : "") . "
				" . ($this->getOption('fileTypes') ? "conf.file_types = '" . $this->getOption('fileTypes') . "';" : "") . "
				" . ($this->getOption('afterUpload') ? "conf.after_upload = " . json_encode($this->getOption('afterUpload')) . ";" : "") . "
				" . ($this->getOption('afterDelete') ? "conf.after_delete = " . json_encode($this->getOption('afterDelete')) . ";" : "") . "
				conf.preview = " . ($this->getOption('preview') ? $this->getOption('preview') : 0) . ";
                conf.poster = " . ($this->getOption('poster') ? $this->getOption('poster') : 1) . ";
				" . ($this->getOption('afterEdit') ? "conf.after_edit = " . json_encode($this->getOption('afterEdit')) . ";" : "") . "
				$('#$this->_id').plupload(conf);
			});
		");

        return $html;
    }
947159
public function getRoot() {
        $objWebClient = $this->getWebClient();

        $strUri = $this->getApiUrl() . '/';
        $arrHeaders = $this->getHeaders();

        $objRequest = $objWebClient->get($strUri, $arrHeaders);

        $this->objResponse = $objRequest->send();
        $strResponse = $this->objResponse->getBody(TRUE);

        return $strResponse;
    }
1164999
public function encodeUrl(array $params = [])
    {
        //pusty url
        $url = '';
        //aplikacja rout
        foreach ($this->getRoutes() as $route) {
            /* @var $route \Mmi\Mvc\RouterConfigRoute */
            $result = (new RouterMatcher)->tryRouteForParams($route, array_merge($route->default, $params));
            //dopasowano routę
            if ($result['applied']) {
                $url = '/' . $result['url'];
                $matched = $result['matched'];
                break;
            }
        }
        //czyszczenie dopasowanych z routy
        foreach (isset($matched) ? $matched : [] as $match => $value) {
            unset($params[$match]);
        }
        //usuwanie kontrolera jeśli index
        if (isset($params['controller']) && $params['controller'] == 'index') {
            unset($params['controller']);
        }
        //usuwanie akcji jeśli index
        if (isset($params['action']) && $params['action'] == 'index') {
            unset($params['action']);
        }
        //jeśli puste parametry
        if (empty($params)) {
            return $url;
        }
        //budowanie zapytania
        return $url . ($url == '/' ? '?' : '/?') . http_build_query($params);
    }
733600
public function getRealPath()
    {
        //brak prawidłowej nazwy pliku
        if (strlen($this->_name) < 4) {
            return;
        }
        //ścieżka na dysku
        return BASE_PATH . '/var/data/' . $this->_name[0] . '/' . $this->_name[1] . '/' . $this->_name[2] . '/' . $this->_name[3] . '/' . $this->_name;
    }
2942
public function fetchField()
    {
        //wartości pola
        $values = is_array($this->getValue()) ? $this->getValue() : [$this->getValue()];
        $html = '<ul id="' . ($baseId = $this->getId()) . '-list">';
        //filtr url
        $f = new \Mmi\Filter\Url;
        foreach ($this->getMultioptions() as $key => $caption) {
            //nowy checkbox
            $checkbox = new Checkbox($this->getBaseName() . '[]');
            //konfiguracja checkboxa
            $checkbox->setLabel($caption)
                ->setForm($this->_form)
                ->setValue($key)
                ->setId($baseId . '-' . $f->filter($key))
                ->setRenderingOrder(['fetchField', 'fetchLabel']);
            //zaznaczenia wartości
            if (in_array($key, $values)) {
                $checkbox->setChecked();
            }
            //wartość wyłączona
            if (strpos($key, ':disabled') !== false) {
                $checkbox->setValue('')
                    ->setDisabled();
            }
            $html .= '<li ' . ($checkbox->getDisabled() ? 'class="disabled" ' : '') . 'id="' . $checkbox->getId() . '-item' . '">' .
                $checkbox . '</li>';
        }
        return $html . '</ul>';
    }
528480
public function getCheckedValue()
    {
        $checked = 0;
        //iteracja po opcjach
        foreach ($this->getMultioptions() as $option => $caption) {
            $checked = ($option >= $checked) ? $option : $checked;
        }
        return $checked;
    }
996413
private function _getReferrer()
    {
        //powoływanie przestrzeni nazw
        $space = new \Mmi\Session\SessionSpace(self::SESSION_SPACE_PREFIX . $this->originalId);
        //pobranie referera
        $referer = $space->referer;
        //usunięcie
        $space->unsetAll();
        return $referer;
    }
842861
public function getWidgetModel()
    {
        //próba pobrania modelu widgetu z cache
        if (null === $widgetModel = \App\Registry::$cache->load($cacheKey = 'category-widget-model-' . $this->id)) {
            //pobieranie modelu widgetu
            \App\Registry::$cache->save($widgetModel = new \Cms\Model\CategoryWidgetModel($this->id), $cacheKey, 0);
        }
        //zwrot atrybutów
        return $widgetModel;
    }
1038610
public function connect()
    {
        $this->_config->port = $this->_config->port ? $this->_config->port : 3306;
        //nowy obiekt PDO do odczytu danych
        $this->_downstreamPdo = new \PDO(
            $this->_config->driver . ':host=' . $this->_config->host . ';port=' . $this->_config->port . ';dbname=' . $this->_config->name . ';charset=utf8', $this->_config->user, $this->_config->password, [\PDO::ATTR_PERSISTENT => $this->_config->persistent]
        );
        //nowy obiekt pdo do zapisu danych
        $this->_upstreamPdo = new \PDO(
            $this->_config->driver . ':host=' . ($this->_config->upstreamHost ? $this->_config->upstreamHost : $this->_config->host) . ';port=' . ($this->_config->upstreamPort ? $this->_config->upstreamPort : $this->_config->port) . ';dbname=' . $this->_config->name . ';charset=utf8', $this->_config->user, $this->_config->password, [\PDO::ATTR_PERSISTENT => $this->_config->persistent]
        );
        //zmiana stanu na połączony
        $this->_connected = true;
        return $this;
    }
1305512
public function sortAction()
    {
        $this->getResponse()->setTypePlain();
        if (!$this->getPost()->__get('item-file')) {
            return $this->view->getTranslate()->_('Przenoszenie nie powiodło się');
        }
        \Cms\Model\File::sortBySerial($this->getPost()->__get('item-file'));
        return '';
    }
587030
public function parse()
	{
		$matches = array();

		// строка вида {env._SERVER.LC_NAME}
		if (preg_match_all('/\{env\.([\w\.]+)\}/im', $this->record->formatted, $macrosList) > 0)
		{
			foreach ($macrosList[1] as $match)
			{
				$parts = explode(".", $match);
				$array = @$GLOBALS[$parts[0]];
				array_shift($parts);
				$val = $array;

				foreach ($parts as $i => $key)
				{
					if (is_array($val))
						$val = @$val[$key];
					else if (is_object($val))
						$val = $val->{$key};
				}

				if (is_array($val) || is_object($val))
					$val = print_r($val, 1);

				$this->record->formatted = str_replace("{env." . $match . "}", $val, $this->record->formatted);
			}
		}

		return $this->record;
	}
663849
protected final function _prepareFrom()
    {
        //przygotowanie tabeli
        $table = DbConnector::getAdapter()->prepareTable($this->_query->getTableName());
        //jeśli brak joinów sama tabela
        if (empty($this->_query->getQueryCompile()->joinSchema)) {
            return $table;
        }
        //tabela do której jest łączenie
        $baseTable = $table;
        //przygotowanie joinów
        foreach ($this->_query->getQueryCompile()->joinSchema as $schema) {
            //tabela docelowa
            $targetTable = isset($schema[3]) ? $schema[3] : $baseTable;
            //typ połączenia (zwykłe, lewe)
            $joinType = isset($schema[4]) ? $schema[4] : 'JOIN';
            //alias
            $joinAlias = isset($schema[5]) ? $schema[5] : $schema[0];
            //przygotowanie sql
            $table .= ' ' . $joinType . ' ' . DbConnector::getAdapter()->prepareTable($schema[0]) . ' AS ' . DbConnector::getAdapter()->prepareTable($joinAlias) . ' ON ' .
                DbConnector::getAdapter()->prepareTable($joinAlias) . '.' . DbConnector::getAdapter()->prepareField($schema[1]) .
                ' = ' . DbConnector::getAdapter()->prepareTable($targetTable) . '.' . DbConnector::getAdapter()->prepareField($schema[2]);
        }
        return $table;
    }
271595
public function sortAction()
    {
        $this->getResponse()->setTypePlain();
        //brak pola
        if (null === $serial = $this->getPost()->__get('widget-item')) {
            return $this->view->getTranslate()->_('Przenoszenie nie powiodło się');
        }
        //sortowanie
        (new \Cms\Model\CategoryWidgetModel($this->categoryId))
            ->sortBySerial($serial);
        //pusty zwrot
        return '';
    }
515386
public function getCreationDate()
    {
        //DateTimeOriginal to najlepsze źródło
        if (isset($this->_exif['DateTimeOriginal']) && substr($this->_exif['DateTimeOriginal'], 0, 4) != '0000') {
            return date('Y-m-d H:i:s', strtotime($this->_exif['DateTimeOriginal']));
        }
        //brak DateTimeOriginal, próba z DateTime
        if (isset($this->_exif['DateTime']) && substr($this->_exif['DateTime'], 0, 4) != '0000') {
            return date('Y-m-d H:i:s', strtotime($this->_exif['DateTime']));
        }
        //w pozostałych przypadkach - data utworzenia pliku
        if (!isset($this->_exif['FileDateTime']) && substr($this->_exif['DateTime'], 0, 4) != '0000') {
            return date('Y-m-d H:i:s', strtotime($this->_exif['FileDateTime']));
        }
    }
772714
public function get()
    {
        $elapsed = $this->elapsed();
        //iteracja po danych
        foreach ($this->_data as $key => $item) {
            if ($elapsed == 0) {
                $this->_data[$key]['percent'] = 0;
                continue;
            }
            $this->_data[$key]['percent'] = 100 * $item['elapsed'] / $elapsed;
        }
        return $this->_data;
    }
1272788
public function uploadAction()
    {
        $files = $this->getFiles()->toArray();
        //brak plików lub klasy
        $error = null;
        if (empty($files) || !isset($files['file']) || empty($files['file']) || !$this->class) {
            $error = 'Błąd: nie przesłano pliku';
        }
        //nieprawidłowy hash zabezpieczający
        if ($this->hash != md5($this->t . '+' . \Mmi\Session\Session::getId() . '+' . $this->class)) {
            $error = 'Błąd: nieprawidłowy hash';
        }
        //jeśli nie było błędu
        if ($error === null) {
            //dołączanie plików
            if (!\Cms\Model\File::appendFiles($this->object, $this->objectId, $files, $this->types ? $this->types : [])) {
                $error = 'Nieprawidłowy typ pliku';
            }
        }
        //rendering widgeta uploadera
        return $this->view->widget('cms', 'file', 'uploader', [
                'object' => $this->object,
                'objectId' => $this->objectId,
                'types' => $this->types,
                'error' => $error
        ]);
    }
1201815
public final function findFirst()
    {
        //odpytanie adaptera o rekordy
        $result = DbConnector::getAdapter()->select($this->_prepareFields(), $this->_prepareFrom(), $this->_query->getQueryCompile()->where, $this->_query->getQueryCompile()->groupBy, $this->_query->getQueryCompile()->order, 1, $this->_query->getQueryCompile()->offset, $this->_query->getQueryCompile()->bind);
        //null jeśli brak danych
        if (!is_array($result) || !isset($result[0])) {
            return null;
        }
        //ustalenie klasy rekordu
        $recordName = $this->_query->getRecordName();
        /* @var $record RecordRo */
        $record = new $recordName;
        return $record->setFromArray($result[0])->clearModified();
    }