You are here

function ad_external_node_form in Advertisement 5.2

Same name and namespace in other branches
  1. 5 external/ad_external.module \ad_external_node_form()
  2. 6.3 external/ad_external.module \ad_external_node_form()
  3. 6 external/ad_external.module \ad_external_node_form()
  4. 6.2 external/ad_external.module \ad_external_node_form()
  5. 7 external/ad_external.module \ad_external_node_form()

Adapi helper function for displaying a node form.

1 call to ad_external_node_form()
ad_external_adapi in external/ad_external.module

File

external/ad_external.module, line 96
Enhances the ad module to support externally hosted ads, served via IFrames. It is recommended that you configure "Administer >> Content management >> Ads >> Settings >> Global settings >> Display type" to…

Code

function ad_external_node_form(&$node) {
  $form = array();
  $form['ad_external'] = array(
    '#type' => 'fieldset',
    '#title' => t('External'),
    '#collapsible' => TRUE,
  );
  $form['ad_external']['preview'] = array(
    '#type' => 'markup',
    '#value' => ad_external_display_ad($node),
  );
  if ((arg(1) == 'add' || arg(2) == 'edit') && user_access('create advertisements')) {
    $form['ad_external']['url'] = array(
      '#type' => 'textfield',
      '#title' => t('External Source URL'),
      '#required' => TRUE,
      '#default_value' => $node->url,
      '#description' => t('Enter the complete URL where your external ad his hosted.  The URL must begin with http:// or https://.  For example, %url.', array(
        '%url' => t('http://www.sample.org/external/ad.php'),
      )),
    );
  }
  return $form;
}