Ejemplo n.º 1
0
 /**
  * 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'));
 }
Ejemplo n.º 2
0
 /**
  * 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'));
 }
Ejemplo n.º 3
0
 /**
  * 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'];
     }
 }
Ejemplo n.º 4
0
 /**
  * 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));
 }