You are here

function rate_ui_delete_form in Rate 7.2

Implements hook_form().

Delete widget form.

1 string reference to 'rate_ui_delete_form'
rate_ui_menu in ui/rate_ui.module
Implements hook_menu().

File

ui/rate_ui.form.inc, line 1119
This file contains the differtent Rate UI forms.

Code

function rate_ui_delete_form($form, &$form_state, $widget_type) {

  // Get widget by widget type.
  $widget = db_select('rate_widget', 'w')
    ->fields('w', array(
    'wid',
    'name',
  ))
    ->condition('w.type', $widget_type)
    ->execute()
    ->fetchObject();
  if (!$widget) {
    print drupal_not_found();
    module_invoke_all('exit') & exit;
  }
  $form['#widget_type'] = $widget_type;
  $form['#widget_wid'] = $widget->wid;
  $form['#widget_name'] = $widget->name;
  $form['info'] = array(
    '#markup' => '<p>' . t('Are you sure you want to delete the widget %name?', array(
      '%name' => $widget->name,
    )) . '</p>',
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Delete'),
  );
  $form['cancel'] = array(
    '#markup' => l(t('cancel'), 'admin/structure/rate'),
  );
  return $form;
}