You are here

function ad_channel_admin_container_submit in Advertisement 5.2

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

Save the container.

File

channel/ad_channel.module, line 545
Ad Channel

Code

function ad_channel_admin_container_submit($form_id, $form_values) {
  switch ($form_values['op']) {
    case t('Create'):
      db_query("INSERT INTO {ad_channel_container} (name, description, weight) VALUES('%s', '%s', %d)", $form_values['name'], $form_values['description'], $form_values['weight']);
      drupal_set_message(t('The %name container has been created.', array(
        '%name' => $form_values['name'],
      )));
      break;
    case t('Update'):
      db_query("UPDATE {ad_channel_container} SET name = '%s', description = '%s', weight = '%s' WHERE conid = %d", $form_values['name'], $form_values['description'], $form_values['weight'], $form_values['conid']);
      drupal_set_message(t('The %name container has been updated.', array(
        '%name' => $form_values['name'],
      )));
      break;
    case t('Delete'):
      drupal_goto('admin/content/ad/channel/container/' . $form_values['conid'] . '/delete');
  }
  drupal_goto('admin/content/ad/channel');
}