You are here

function rate_widget_delete_form in Rate 7

Same name and namespace in other branches
  1. 6.2 rate.admin.inc \rate_widget_delete_form()

Form for deleting widgets.

1 string reference to 'rate_widget_delete_form'
rate_menu in ./rate.module
Implements hook_menu().

File

./rate.admin.inc, line 756
Rating admin

Code

function rate_widget_delete_form($form, &$form_state, $id) {
  $form = array();
  $widgets = variable_get(RATE_VAR_WIDGETS, array());
  $form['#widget_id'] = $id;
  if (!isset($widgets[$id])) {
    drupal_not_found();
    module_invoke_all('exit') && exit;
  }
  $title = $widgets[$id]->title;
  $form['info'] = array(
    '#markup' => '<p>' . t('Are you sure you want to delete widget %title?', array(
      '%title' => $title,
    )) . '</p>',
  );
  $form['buttons']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Delete'),
  );
  $form['buttons']['cancel'] = array(
    '#markup' => l(t('Cancel'), RATE_PATH_ADMIN_PAGE),
  );
  return $form;
}