You are here

function popup_onload_field_extra_fields in Popup On Load 7

Implements hook_field_extra_fields().

File

./popup_onload.module, line 444
Contains main popup_onload hooks and functions.

Code

function popup_onload_field_extra_fields() {
  $form_elements['name'] = [
    'label' => t('Name'),
    'description' => t('Popup name'),
    'weight' => 0,
  ];
  $form_elements['body'] = [
    'label' => t('Body'),
    'description' => t('Popup body'),
    'weight' => 1,
  ];
  $form_elements['width'] = [
    'label' => t('Width'),
    'description' => t('Popup width'),
    'weight' => 2,
  ];
  $form_elements['height'] = [
    'label' => t('Height'),
    'description' => t('Popup height'),
    'weight' => 3,
  ];
  $form_elements['fixed_position'] = [
    'label' => t('Fixed position'),
    'description' => t('Whether a popup is fixed'),
    'weight' => 4,
  ];
  $form_elements['active_popup'] = [
    'label' => t('Active'),
    'description' => t('Popup status'),
    'weight' => 5,
  ];
  $form_elements['cookie_lifetime_single_checkbox'] = [
    '#title' => t('Specify popup cookie lifetime'),
    '#type' => 'checkbox',
    'weight' => 5,
  ];
  $form_elements['cookie_lifetime_single'] = [
    'label' => t('Cookie lifetime single'),
    'description' => t('Cookie lifetime for single popup.'),
    'weight' => 6,
  ];

  // Since we have only one bundle type, we'll just provide the extra_fields
  // for it here.
  $extra_fields = [
    'popup_onload' => [
      'popup_onload_basic' => [
        'form' => $form_elements,
      ],
    ],
  ];
  return $extra_fields;
}