You are here

function ad_channel_admin_confirm_delete_container_submit in Advertisement 6.2

Same name and namespace in other branches
  1. 5.2 channel/ad_channel.module \ad_channel_admin_confirm_delete_container_submit()
  2. 6.3 channel/ad_channel.module \ad_channel_admin_confirm_delete_container_submit()
  3. 7 channel/ad_channel.module \ad_channel_admin_confirm_delete_container_submit()

Delete a container.

File

channel/ad_channel.module, line 1039
Ad Channel module.

Code

function ad_channel_admin_confirm_delete_container_submit($form, &$form_state) {
  $container = _ad_channel_get_containers($form_state['values']['conid']);
  if ($container->conid) {
    db_query('UPDATE {ad_channel} SET conid = 0 WHERE conid = %d', $container->conid);
    db_query('DELETE FROM {ad_channel_container} WHERE conid = %d', $container->conid);
    drupal_set_message(t('The %name container has been deleted.', array(
      '%name' => $container->name,
    )));
  }
  drupal_goto('admin/content/ad/channel');
}