Backend\Modules\Location\Actions\Index::loadData PHP Method

loadData() protected method

Load the settings
protected loadData ( )
    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)) {
            $this->settings = $this->get('fork.settings')->getForModule('Location');
            $this->settings['map_type'] = $this->settings['map_type_widget'];
            $this->settings['map_style'] = isset($this->settings['map_style_widget']) ? $this->settings['map_style_widget'] : 'standard';
            $this->settings['center']['lat'] = $firstMarker['lat'];
            $this->settings['center']['lng'] = $firstMarker['lng'];
        }
        // no center point given yet, use the first occurrence
        if (!isset($this->settings['center'])) {
            $this->settings['center']['lat'] = $firstMarker['lat'];
            $this->settings['center']['lng'] = $firstMarker['lng'];
        }
    }