Data utworzenia zdjęcia
@return string
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']));
        }
    }
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;
    }
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;
    }
750426
public function build()
    {
        if (!empty($this->build)) {
            return $this->build;
        }
        //root
        $this->build = [[
            'active' => true,
            'name' => '',
            'label' => '',
            'id' => 'root',
            'level' => 0,
            'uri' => '',
            'children' => []
        ]];
        foreach ($this->_data as $element) {
            $this->build[0]['children'][$element->getId()] = $element->build();
        }
        //usuwanie konfiguracji po zbudowaniu
        $this->_data = [];
        return $this->build;
    }
943274
public function toArray()
    {
        //tworzy array z opcji
        $array = $this->_options;
        //dołącza joinowane tabele
        foreach ($this->_joined as $name => $value) {
            if ($value instanceof \Mmi\Orm\RecordRo) {
                $value = $value->toArray();
            }
            $array[$name] = $value;
        }
        //dołącza pola obiektu
        foreach ($this as $name => $value) {
            //tylko publiczne zmienne
            if (substr($name, 0, 1) == '_') {
                continue;
            }
            $array[$name] = $value;
        }
        return $array;
    }
202899
public function fetchField()
    {
        //labelka jako value
        if ($this->getLabel()) {
            $this->setValue($this->getLabel());
        }
        //opcje do widoku
        \Mmi\App\FrontController::getInstance()->getView()->_htmlOptions = $this->_getHtmlOptions();
        //render szablonu
        return \Mmi\App\FrontController::getInstance()->getView()->renderTemplate(static::TEMPLATE_FIELD);
    }
267821
public final function fetchBegin()
    {
        $class = get_class($this);
        //dodawanie klasy z klasą forma
        $this->addClass(strtolower(substr($class, strrpos($class, '\\') + 1)));
        //dodawanie klasy błędu jeśli wystąpiły
        if ($this->getErrors()) {
            $this->addClass('error');
        }
        //element do widoku
        \Mmi\App\FrontController::getInstance()->getView()->_element = $this;
        //render szablonu
        return \Mmi\App\FrontController::getInstance()->getView()->renderTemplate(static::TEMPLATE_BEGIN);
    }
1039289
public function getDataOcorrencia()
    {
        $data = $this->data_de_ocorrencia ? \DateTime::createFromFormat('dmy', sprintf('%06d', $this->data_de_ocorrencia)) : false;
        if ($data) {
            $data->setTime(0, 0, 0);
        }

        return $data;
    }
386352
public function indexAction()
    {
        $year = $this->year ? $this->year : date('Y');
        $month = $this->month ? $this->month : date('m');
        //form filtrujący
        $form = new \CmsAdmin\Form\Stat\StatObject(null, ['object' => $this->object,
            'year' => $year,
            'month' => $month,
        ]);
        //przekazanie formularza
        $this->view->objectForm = $form;
        if ($form->isMine()) {
            //przekierowanie po odczycie pól z formularza
            if ($form->getElement('object')->getValue() && $form->getElement('month')->getValue() >= 1 && $form->getElement('month')->getValue() <= 12 && $form->getElement('year')->getValue() <= date('Y')) {
                $this->getResponse()->redirect('cmsAdmin', 'stat', 'index', ['object' => $form->getElement('object')->getValue(),
                    'year' => $form->getElement('year')->getValue(),
                    'month' => $form->getElement('month')->getValue(),
                ]);
            }
            //przekierowanie na dany miesiąc - bez zmiany obiektu
            $this->getResponse()->redirect('cmsAdmin', 'stat', 'index', ['year' => $form->getElement('year')->getValue(),
                'month' => $form->getValue('month'),
            ]);
        }
        if (!$this->object || !$this->year || !$this->month) {
            return;
        }
        $object = $this->object;
        $year = intval($year);
        $month = intval($month);
        $label = \Cms\Orm\CmsStatLabelQuery::byObject($object)
            ->findFirst();
        if ($label === null) {
            return;
        }
        $this->view->label = $label;
        //staty dzienne

        $prevMonth = ($month - 1) > 0 ? $month - 1 : 12;
        $prevYear = ($prevMonth == 12) ? $year - 1 : $year;
        $day = (ltrim(date('m'), '0') == $month) ? date('d') : date('t', strtotime($year . '-' . $month));

        //statystyki dzienne
        $this->view->dailyChart = \Cms\Model\StatFlot::getCode('dailyChart', [
                //bieżący miesiąc
                ['object' => $label->object,
                    'label' => $label->label . ': ' . $this->view->_('dni'),
                    'data' => \Cms\Model\Stat::toDate($object, null, $year, $month, $day)
                ],
                //poprzedni miesiąc
                ['object' => $label->object,
                    'label' => $this->view->_('Poprzedni miesiąc: dni'),
                    'data' => \Cms\Model\Stat::toDate($object, null, $prevYear, $prevMonth, $day)
                ]], 'lines', true);
        //statystyki miesięczne
        $this->view->monthlyChart = \Cms\Model\StatFlot::getCode('monthlyChart', [
                ['object' => $label->object,
                    'label' => $label->label . ': ' . $this->view->_('miesiące'),
                    'data' => \Cms\Model\Stat::monthly($object, null, $year)
                ]], 'bars');
        //statystyki roczne
        $this->view->yearlyChart = \Cms\Model\StatFlot::getCode('yearlyChart', [
                ['object' => $label->object,
                    'label' => $label->label . ': ' . $this->view->_('lata'),
                    'data' => \Cms\Model\Stat::yearly($object, null)
                ]], 'bars');
        //rozkład godzinowy
        $this->view->avgHourlyChart = \Cms\Model\StatFlot::getCode('avgHourlyChart', [
                ['object' => $label->object,
                    'label' => $label->label . ': ' . $this->view->_('rozkład godzinowy'),
                    'data' => \Cms\Model\Stat::avgHourly($object, null, $year, $month)
                ]], 'bars');
        //rozkład godzinowy
        $this->view->avgHourlyAllChart = \Cms\Model\StatFlot::getCode('avgHourlyAllChart', [
                ['object' => $label->object,
                    'label' => $label->label . ': ' . $this->view->_('rozkład ogólny'),
                    'data' => \Cms\Model\Stat::avgHourly($object, null, null, null)
                ]], 'bars');
    }
869056
public function getAllVariables()
    {
        //pobranie danych widoku
        $data = $this->_data;
        //iteracja po danych
        foreach ($data as $key => $value) {
            //kasowanie danych prywatnych mmi (zaczynają się od _)
            if ($key[0] == '_') {
                //usuwanie klucza
                unset($data[$key]);
            }
        }
        //zwrot danych
        return $data;
    }
1206451
public function toggleAction()
    {
        //wyszukiwanie relacji do edycji
        if (null === $widgetRelation = (new \Cms\Orm\CmsCategoryWidgetCategoryQuery)
            ->whereCmsCategoryId()->equals($this->categoryId)
            ->findPk($this->id)) {
            return '';
        }
        //zmiana widoczności relacji
        $widgetRelation->toggle();
        return '';
    }
606559
public function deleteAction()
    {
        //wyszukiwanie relacji do edycji
        if (null === $widgetRelation = (new \Cms\Orm\CmsCategoryWidgetCategoryQuery)
            ->whereCmsCategoryId()->equals($this->categoryId)
            ->findPk($this->id)) {
            return '';
        }
        //usuwanie relacji
        $widgetRelation->delete();
        return '';
    }
59773
public function getDataOcorrencia()
    {
        $data = $this->segmento_u->data_ocorrencia ? \DateTime::createFromFormat('dmY', sprintf('%08d', $this->segmento_u->data_ocorrencia)) : false;
        if ($data) {
            $data->setTime(0, 0, 0);
        }

        return $data;
    }
814637
public function toData()
    {
        $data = [
            'type' => 'standard',
        ];

        if ($this->imageSize) {
            $data['image_size'] = $this->imageSize;
        }

        if ($this->ref) {
            $data['data'] = $this->ref;
        }


        return $data;
    }
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 '';
    }
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;
    }
1354023
protected final function _getDistributedStorage()
    {
        //ładowanie rozproszonego bufora z bufora lokalnego
        if (null === $distributedStorage = $this->_undistributedCache->load(self::STORAGE_KEY)) {
            //zapis z krótkim, zdefiniowanym odświeżaniem
            $this->_undistributedCache->save($distributedStorage = new DistributedStorage(), self::STORAGE_KEY, self::DISTRIBUTED_REFRESH_INTERVAL);
        }
        //zapis lokalnym buforze
        return $distributedStorage;
    }