You are here

function _ad_html_node_form in Advertisement 7

Adapi helper function for displaying a node form.

1 call to _ad_html_node_form()
ad_html_adapi in html/ad_html.module
Implementation of the ad module's _adapi hook.

File

html/ad_html.module, line 113
Enhances the ad module to support html ads.

Code

function _ad_html_node_form(&$node) {
  $form = array();
  $form['ad_html'] = array(
    '#type' => 'fieldset',
    '#title' => t('HTML'),
    '#collapsible' => TRUE,
  );
  $form['ad_html']['display'] = array(
    '#type' => 'markup',
    '#value' => ad_html_display_ad($node),
  );
  if (isset($node->nid) && ad_check_permission($node->nid, 'manage ad html') || arg(1) == 'add' && user_access('create advertisements')) {
    $form['ad_html']['html'] = array(
      '#type' => 'textarea',
      '#title' => t('Ad HTML'),
      '#required' => TRUE,
      '#default_value' => isset($node->html) ? $node->html : '',
      '#description' => t('Paste the complete HTML provided by your advertising affiliate.'),
    );
  }
  return $form;
}