Example #1
0
 public function deleteDocumentTask()
 {
     $id = Request::getVar('docID', 0);
     $hubid = Request::getVar('hubid', 0);
     $type = Request::getVar('type', '');
     $hubSearch = new SearchEngine();
     $noIndex = new Noindex();
     $noIndex = $noIndex->oneOrNew(0);
     $noIndex->set('hubtype', $type);
     $noIndex->set('hubid', $hubid);
     if ($hubSearch->delete($id) === TRUE && $noIndex->save()) {
         App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller . '&task=documentByType&type=' . $type, false), 'Successfully deleted Document ID: ' . $id . '.', 'success');
     } elseif ($type != '') {
         App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller . '&task=documentByType&type=' . $type, false), 'Failed to Document ID: ' . $id . '.', 'error');
     }
 }