You are here

function ad_channel_admin_container in Advertisement 5.2

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

Administrative page for creating or editing containers.

1 string reference to 'ad_channel_admin_container'
ad_channel_menu in channel/ad_channel.module
Implementation of hook_menu.

File

channel/ad_channel.module, line 468
Ad Channel

Code

function ad_channel_admin_container($conid = 0) {
  $form = array();
  if ($conid) {
    $container = _ad_channel_get_containers($conid);
    if (empty($container)) {
      drupal_goto('admin/content/ad/channel');
    }
    $form['conid'] = array(
      '#type' => 'hidden',
      '#value' => $conid,
    );
  }
  $form['name'] = array(
    '#type' => 'textfield',
    '#title' => t('Container name'),
    '#required' => TRUE,
    '#description' => t('Channel containers can be used to help organize channels, but they are not required.'),
    '#default_value' => $conid ? $container->name : '',
  );
  $form['description'] = array(
    '#type' => 'textarea',
    '#title' => t('Description'),
    '#description' => t('The channel container description can be used to help you define the purpose of your different channels.  The descriptions are only visible to advertisement administrators.'),
    '#default_value' => $conid ? $container->description : '',
  );
  $form['weight'] = array(
    '#type' => 'weight',
    '#title' => t('Weight'),
    '#description' => t('When listing containers, those with the lighter (smaller) weights get listed before containers with heavier (larger) weights.  Containers with equal weights are sorted alphabetically.'),
    '#default_value' => $conid ? $container->weight : 0,
  );
  if ($conid) {
    $form['update'] = array(
      '#type' => 'submit',
      '#value' => t('Update'),
    );
    $form['delete'] = array(
      '#type' => 'submit',
      '#value' => t('Delete'),
    );
  }
  else {
    $form['create'] = array(
      '#type' => 'submit',
      '#value' => t('Create'),
    );
  }
  $form['cancel'] = array(
    '#type' => 'markup',
    '#value' => l(t('Cancel'), 'admin/content/ad/channel'),
  );
  return $form;
}