Esempio n. 1
0
 /**
  * Parse the datagrid
  */
 protected function parse()
 {
     parent::parse();
     $this->tpl->assign('dataGrid', $this->dataGrid->getNumResults() != 0 ? $this->dataGrid->getContent() : false);
     // get settings
     $settings = BackendModel::getModuleSettings();
     // assign to template
     $this->tpl->assign('items', BackendLocationModel::getAll());
     $this->tpl->assign('settings', $settings['location']);
 }
Esempio n. 2
0
 /**
  * Load the settings
  */
 protected function loadData()
 {
     $this->items = BackendLocationModel::getAll();
     $this->settings = BackendLocationModel::getMapSettings(0);
     $firstMarker = current($this->items);
     // if there are no markers we reset it to the birthplace of Fork
     if ($firstMarker === false) {
         $firstMarker = array('lat' => '51.052146', 'lng' => '3.720491');
     }
     // load the settings from the general settings
     if (empty($this->settings)) {
         $settings = BackendModel::getModuleSettings();
         $this->settings = $settings['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'];
     }
 }