/**
  * Execute the action
  *
  * @return  void
  */
 public function execute()
 {
     // get parameters
     $this->id = $this->getParameter('id', 'int');
     // does the item exists
     if ($this->id !== null && BackendSlideshowModel::existsGallery($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();
         // load datagrids
         $this->loadDataGrid();
         // validate the form
         $this->validateForm();
         // parse
         $this->parse();
         // display the page
         $this->display();
     } else {
         // no item found, throw an exception, because somebody is f*****g with our URL
         $this->redirect(BackendModel::createURLForAction('Index') . '&error=non-existing');
     }
 }
 /**
  * Execute the action
  *
  * @return  void
  */
 public function execute()
 {
     // get parameters
     $this->id = $this->getParameter('id', 'int');
     // does the item exist
     if ($this->id !== null && BackendSlideshowModel::existsGallery($this->id)) {
         // call parent, this will probably add some general CSS/JS or other required files
         parent::execute();
         // delete widget
         BackendSlideshowModel::deleteWidget($this->id);
         // delete item
         BackendSlideshowModel::deleteGallery($this->id);
         // trigger event
         BackendModel::triggerEvent($this->getModule(), 'after_delete', array('id' => $this->id));
         // item was deleted, so redirect
         $this->redirect(BackendModel::createURLForAction('Index') . '&report=deleted');
     } else {
         // something went wrong
         $this->redirect(BackendModel::createURLForAction('Index') . '&error=non-existing');
     }
 }