1
에서 여러 항목을 삭제하기 전에 내가 단일 항목을 삭제하기 전에 확인을 요청하며 다음과 같이 잘 작동 :요청 확인 드루팔
function tema_delete_confirm ($form, &$form_state, $tema) {
$form['id'] = array('#type' => 'value', '#value' => $tema);
return confirm_form ($form,
'Are you sure you want to delete (tema: '.$tema.')?',
'admin/temas',
'This action cannot be undone.',
'Delete',
'Cancel'
);
}
/**
* Executes "tema" deletion.
*
* @see tema_delete_confirm()
*/
function tema_delete_confirm_submit ($form, &$form_state) {
if ($form_state['values']['confirm']) {
$id = $form_state['values']['id'];
tema_delete($id);
drupal_set_message('Tema: '.$id.' has been deleted.');
}
}
것은이 checkox로 표시된 항목을 삭제하려면 여러입니다, 확인 페이지 메시지가 표시되지 않습니다, 제출 중 후 내가 확인 "페이지"내가 잘못
/**
* Multiple "temas" deletion confirmation form for temas_admin_content().
*/
function temas_multiple_delete_confirm ($form, &$form_state, $temas) {
$form['temas'] = array('#prefix' => '<ul>', '#suffix' => '</ul>', '#tree' => TRUE);
// array_filter returns only elements with TRUE values
foreach ($temas as $id => $value) {
$title = db_query('SELECT nombre FROM {sescam_tema} WHERE id = :id', array(':id' => $id))->fetchField();
$form['temas'][$id] = array(
'#type' => 'hidden',
'#value' => $id,
'#prefix' => '<li>',
'#suffix' => check_plain($title) . "</li>\n",
);
}
$form['#submit'][] = 'temas_multiple_delete_confirm_submit';
$confirm_question = format_plural(count($temas),
'Are you sure you want to delete this item?',
'Are you sure you want to delete these items?');
return confirm_form($form,
$confirm_question,
'admin/temas',
'This action cannot be undone.',
'Delete',
'Cancel');
}
/**
* Form submission handler for temas_multiple_delete_confirm().
*/
function temas_multiple_delete_confirm_submit ($form, &$form_state) {
die('hola');
if ($form_state['values']['confirm']) {
temas_delete_multiple(array_keys($form_state['input']['temas']));
$count = count($form_state['input']['temas']);
drupal_set_message(format_plural($count, 'Eliminado 1 tema.', 'Eliminados @count temas.'));
}
$form_state['redirect'] = 'admin/temas';
}
어떤 생각을하고있는 중이없이 hello
로그를 얻을?