Esempio n. 1
0
 /**
  * Execute the action
  */
 public function execute()
 {
     $this->id = $this->getParameter('id', 'int');
     // does the item exists
     if ($this->id !== null && BackendLocationModel::exists($this->id)) {
         parent::execute();
         // add js
         $this->header->addJS('http://maps.google.com/maps/api/js?sensor=false', null, null, true, false);
         $this->getData();
         $this->loadForm();
         $this->validateForm();
         $this->parse();
         $this->display();
     } else {
         $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing');
     }
 }
Esempio n. 2
0
 /**
  * Execute the action
  */
 public function execute()
 {
     // get parameters
     $this->id = $this->getParameter('id', 'int');
     // does the item exist
     if ($this->id !== null && BackendLocationModel::exists($this->id)) {
         parent::execute();
         // get all data for the item we want to edit
         $this->record = (array) BackendLocationModel::get($this->id);
         // delete item
         BackendLocationModel::delete($this->id);
         // delete search indexes
         // @todo why is this commented out
         // BackendSearchModel::removeIndex($this->getModule(), $this->id);
         // trigger event
         BackendModel::triggerEvent($this->getModule(), 'after_delete', array('id' => $this->id));
         // user was deleted, so redirect
         $this->redirect(BackendModel::createURLForAction('index') . '&report=deleted&var=' . urlencode($this->record['title']));
     } else {
         $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing');
     }
 }
Esempio n. 3
0
 /**
  * Execute the action
  *
  * @return	void
  */
 public function execute()
 {
     // get parameters
     $this->id = $this->getParameter('id', 'int');
     // does the item exists
     if ($this->id !== null && BackendLocationModel::exists($this->id)) {
         // call parent, this will probably add some general CSS/JS or other required files
         parent::execute();
         // get all data for the item we want to edit
         $this->getData();
         // load the form
         $this->loadForm();
         // validate the form
         $this->validateForm();
         // parse
         $this->parse();
         // display the page
         $this->display();
     } else {
         $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing');
     }
 }
Esempio n. 4
0
 /**
  * Execute the action
  *
  * @return	void
  */
 public function execute()
 {
     // get parameters
     $this->id = $this->getParameter('id', 'int');
     // does the item exist
     if ($this->id !== null && BackendLocationModel::exists($this->id)) {
         // call parent, this will probably add some general CSS/JS or other required files
         parent::execute();
         // get all data for the item we want to edit
         $this->record = (array) BackendLocationModel::get($this->id);
         // delete item
         BackendLocationModel::delete($this->id);
         // delete search indexes
         // if(is_callable(array('BackendSearchModel', 'removeIndex'))) BackendSearchModel::removeIndex($this->getModule(), $this->id);
         // trigger event
         BackendModel::triggerEvent($this->getModule(), 'after_delete', array('id' => $this->id));
         // user was deleted, so redirect
         $this->redirect(BackendModel::createURLForAction('index') . '&report=deleted&var=' . urlencode($this->record['title']));
     } else {
         $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing');
     }
 }