コード例 #1
0
 /**
  * Delete record
  *
  * @return  void
  */
 public function removeTask()
 {
     // check token
     Request::checkToken();
     // get request vars
     $ids = Request::getVar('id', array());
     $ids = !is_array($ids) ? array($ids) : $ids;
     // loop through all ids posted
     foreach ($ids as $id) {
         // make sure we have an object
         $hook = new \Hubzero\Content\Import\Model\Hook($id);
         if (!$hook->exists()) {
             continue;
         }
         $hook->set('state', 2);
         if (!$hook->store(true)) {
             App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller . '&task=display', false), $hook->getError(), 'error');
             return;
         }
     }
     //inform user & redirect
     App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller . '&task=display', false), Lang::txt('COM_MEMBERS_IMPORTHOOK_REMOVED'), 'passed');
 }