Exemplo n.º 1
0
 public function sessiondelete($co_degre, $co_modu, $sessid)
 {
     // delete session
     $entry = array('sess_id' => $sessid);
     $DBWriteStatus = BbCrudController::delete('gbb_session', $entry);
     drupal_set_message('Session supprimée');
     $routeparameters = array('co_degre' => $co_degre, 'co_modu' => $co_modu);
     return $this->redirect('bb.moduleng', $routeparameters, array('fragment' => 'sessions'));
 }
Exemplo n.º 2
0
 public function deleteForm(array &$form, FormStateInterface $form_state)
 {
     /* Fetch the array of the file stored temporarily in database */
     $afile = $form_state->getValue('fileToDelete');
     //  *************************
     // POURQUOI CA MARCHE PAS ????
     //  *************************
     /* Load the object of the file by it's fid */
     // $file = File::load( $afile );
     /* Set the status flag temporary of the file object */
     // $file->setTemporary();
     /* Save the file in database */
     // $file->save();
     $current_uri = \Drupal::request()->getRequestUri();
     $path_args = array_slice(explode('/', $current_uri), -2, 2);
     $entry = array('fid' => $afile);
     dpm($afile);
     $module = BbCrudController::delete('gbb_file', $entry);
 }