You are here

function ad_channel_admin_confirm_delete_container_submit in Advertisement 5.2

Same name and namespace in other branches
  1. 6.3 channel/ad_channel.module \ad_channel_admin_confirm_delete_container_submit()
  2. 6.2 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 586
Ad Channel

Code

function ad_channel_admin_confirm_delete_container_submit($form_id, $form_values) {
  $container = _ad_channel_get_containers($form_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');
}