/** * Load the data, don't forget to validate the incoming data */ private function getData() { // validate incoming parameters if ($this->URL->getParameter(1) === null) { $this->redirect(FrontendNavigation::getURL(404)); } // load revision if ($this->URL->getParameter('revision', 'int') != 0) { // get data $this->record = FrontendBlogModel::getRevision($this->URL->getParameter(1), $this->URL->getParameter('revision', 'int')); // add no-index, so the draft won't get accidentally indexed $this->header->addMetaData(array('name' => 'robots', 'content' => 'noindex, nofollow'), true); } else { $this->record = FrontendBlogModel::get($this->URL->getParameter(1)); } // anything found? if (empty($this->record)) { $this->redirect(FrontendNavigation::getURL(404)); } // get comments $this->comments = FrontendBlogModel::getComments($this->record['id']); // get tags $this->record['tags'] = FrontendTagsModel::getForItem('blog', $this->record['id']); // get settings $this->settings = FrontendModel::getModuleSettings('blog'); // overwrite URLs $this->record['category_full_url'] = FrontendNavigation::getURLForBlock('blog', 'category') . '/' . $this->record['category_url']; $this->record['full_url'] = FrontendNavigation::getURLForBlock('blog', 'detail') . '/' . $this->record['url']; $this->record['allow_comments'] = $this->record['allow_comments'] == 'Y'; $this->record['comments_count'] = count($this->comments); // reset allow comments if (!$this->settings['allow_comments']) { $this->record['allow_comments'] = false; } }
/** * Parse the data into the template */ private function parse() { // show message $this->tpl->assign('locationItems', FrontendLocationModel::getAll()); // hide form $this->tpl->assign('locationSettings', FrontendModel::getModuleSettings('location')); }
/** * Load the data, don't forget to validate the incoming data * * @return void */ private function getData() { // get articles $this->items = FrontendBlogModel::getAll(30); // get settings $this->settings = FrontendModel::getModuleSettings('blog'); }
/** * Parse the data into the template */ private function parse() { // show message $this->tpl->assign('widgetLocationItems', FrontendLocationModel::get((int) $this->data['id'])); // hide form $this->tpl->assign('widgetLocationSettings', FrontendModel::getModuleSettings('location')); }
/** * Load the data, don't forget to validate the incoming data */ private function getData() { // validate incoming parameters if ($this->URL->getParameter(1) === null) { $this->redirect(FrontendNavigation::getURL(404)); } // get by URL $this->record = FrontendFaqModel::get($this->URL->getParameter(1)); // anything found? if (empty($this->record)) { $this->redirect(FrontendNavigation::getURL(404)); } // overwrite URLs $this->record['category_full_url'] = FrontendNavigation::getURLForBlock('faq', 'category') . '/' . $this->record['category_url']; $this->record['full_url'] = FrontendNavigation::getURLForBlock('faq', 'detail') . '/' . $this->record['url']; // get tags $this->record['tags'] = FrontendTagsModel::getForItem('faq', $this->record['id']); // get settings $this->settings = FrontendModel::getModuleSettings('faq'); // reset allow comments if (!$this->settings['allow_feedback']) { $this->record['allow_feedback'] = false; } // ge status $this->status = $this->URL->getParameter(2); if ($this->status == FL::getAction('Success')) { $this->status = 'success'; } if ($this->status == FL::getAction('Spam')) { $this->status = 'spam'; } }
/** * Load the data */ protected function loadData() { $this->items = FrontendLocationModel::getAll(); $this->settings = FrontendLocationModel::getMapSettings(0); $firstMarker = current($this->items); if (empty($this->settings)) { $this->settings = FrontendModel::getModuleSettings('location'); $this->settings['center']['lat'] = $firstMarker['lat']; $this->settings['center']['lng'] = $firstMarker['lng']; } // no center point given yet, use the first occurance if (!isset($this->settings['center'])) { $this->settings['center']['lat'] = $firstMarker['lat']; $this->settings['center']['lng'] = $firstMarker['lng']; } }
/** * Load the data */ protected function loadData() { $this->items = FrontendLocationModel::get($this->data['id']); $this->settings = FrontendLocationModel::getMapSettings($this->data['id']); if (empty($this->settings)) { $settings = FrontendModel::getModuleSettings('location'); $this->settings['width'] = $settings['width_widget']; $this->settings['height'] = $settings['height_widget']; $this->settings['map_type'] = $settings['map_type_widget']; $this->settings['zoom_level'] = $settings['zoom_level_widget']; $this->settings['center']['lat'] = $this->items['lat']; $this->settings['center']['lng'] = $this->items['lng']; } // no center point given yet, use the first occurance if (!isset($this->settings['center'])) { $this->settings['center']['lat'] = $this->items['lat']; $this->settings['center']['lng'] = $this->items['lng']; } $this->settings['maps_url'] = FrontendLocationModel::buildUrl($this->settings, array($this->items)); }
/** * Load the data, don't forget to validate the incoming data */ private function getData() { $this->items = FrontendBlogModel::getAll(30); $this->settings = FrontendModel::getModuleSettings('blog'); }