getRestParams(); $this->_regions = $this->dataObj->getDTerritoryMap4Select(); if (count($params) == 1 && in_array($params[0], $this->_regions)) { $this->_action = 'loadInfo'; } return parent::exec(); } protected function _doLoadInfo() { return $this->_doView(); } protected function _doLoadInfoAjax() { $areaId = $this->getRestParam(0); $this->dataObj->setAreaId($areaId); $item = array(); $item['list']= $this->dataObj->getList(); $item['region'] = $this->dataObj->getArea(); $item['tpl'] = $this->getTemplate('loadInfo.tpl'); $this->_addItem($item); return $this->_displayJson(array('content' => $this->doc->fetch())); } protected function _doView() { $item = array(); $item['loadContentUrl'] = Qs_SiteMap::find( null, array('type' => 'TerritoryMap_'), array('type' => 'loadInfo'), 'url' ); $item['regions'] = array_combine(array_keys($this->_regions), array_keys($this->_regions)); $item['tpl'] = $this->getTemplate('view.tpl'); $this->_addItem($item); $this->doc->addScript('js/app/territoryMap.js'); $this->doc->addInitFunction('App_TerritoryMap.init', array()); $this->doc->addScript('js/jquery.fancybox.js', array(), 'fancybox'); $this->doc->addStyleSheet('css/jquery.fancybox.css'); return $this; } public function fillConfigForm(Qs_form $form) { $form->addElement( 'select', 'type', array( 'label' => 'Block Type', 'multiOptions' => array('default' => 'Default', 'loadInfo' => 'Load Info') ) ); return $this; } }