Function Module_cms_banners->get_form_fields

Definitions

cms/pages/modules/cms_banners.php

  • Get Tempcode for adding/editing form.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: array

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$name ID_TEXT No No Blank (empty string) N/A N/A The name of the banner (blank: new)
$image_url URLPATH No No Blank (empty string) N/A N/A The URL to the banner image
$site_url URLPATH No No Blank (empty string) N/A N/A The URL to the site the banner leads to
$caption SHORT_TEXT No No Blank (empty string) N/A N/A The caption of the banner
$direct_code LONG_TEXT No No Blank (empty string) N/A N/A Complete HTML/PHP for the banner
$notes LONG_TEXT No No Blank (empty string) N/A N/A Any notes associated with the banner
$display_likelihood integer No No 3 N/A 1 max The banner's "Display likelihood"
$campaign_remaining ?integer No No 50 N/A 0 max The number of hits the banner may have (null: not applicable for this banner type)
$deployment_agreement SHORT_INTEGER No No 0 0 1 2 N/A The type of banner (a BANNER_* constant)
$expiry_date ?TIME No No Null N/A N/A The banner expiry date (null: never expires)
$submitter ?MEMBER No No Null N/A N/A The banners submitter (null: current member)
$validated BINARY No No 1 N/A N/A Whether the banner has been validated
$validation_time ?TIME No No Null N/A N/A The time on which this content should be validated (null: do not schedule)
$b_type ID_TEXT No No Blank (empty string) N/A N/A The banner type (can be anything, where blank means 'normal')
$b_types array No No [] N/A N/A The secondary banner types (empty: no secondary banner types)
$regions array No No [] N/A N/A The regions (empty: not region-limited)
$title_text SHORT_TEXT No No Blank (empty string) N/A N/A The title text for the banner (only used for text banners, and functions as the 'trigger text' if the banner type is shown inline)

Returns

  • A tuple: The input fields, Hidden fields, ...
  • Type: array
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Get Tempcode for adding/editing form.
 *
 * @param  ID_TEXT $name The name of the banner (blank: new)
 * @param  URLPATH $image_url The URL to the banner image
 * @param  URLPATH $site_url The URL to the site the banner leads to
 * @param  SHORT_TEXT $caption The caption of the banner
 * @param  LONG_TEXT $direct_code Complete HTML/PHP for the banner
 * @param  LONG_TEXT $notes Any notes associated with the banner
 * @param  integer $display_likelihood The banner's "Display likelihood"
 * @range 1 max
 * @param  ?integer $campaign_remaining The number of hits the banner may have (null: not applicable for this banner type)
 * @range 0 max
 * @param  SHORT_INTEGER $deployment_agreement The type of banner (a BANNER_* constant)
 * @set 0 1 2
 * @param  ?TIME $expiry_date The banner expiry date (null: never expires)
 * @param  ?MEMBER $submitter The banners submitter (null: current member)
 * @param  BINARY $validated Whether the banner has been validated
 * @param  ?TIME $validation_time The time on which this content should be validated (null: do not schedule)
 * @param  ID_TEXT $b_type The banner type (can be anything, where blank means 'normal')
 * @param  array $b_types The secondary banner types (empty: no secondary banner types)
 * @param  array $regions The regions (empty: not region-limited)
 * @param  SHORT_TEXT $title_text The title text for the banner (only used for text banners, and functions as the 'trigger text' if the banner type is shown inline)
 * @return array A tuple: The input fields, Hidden fields, ...
 */

public function get_form_fields(string $name = '', string $image_url = '', string $site_url = '', string $caption = '', string $direct_code = '', string $notes = '', int $display_likelihood = 3, ?int $campaign_remaining = 50, int $deployment_agreement = 0, ?int $expiry_date = null, ?int $submitter = null, int $validated = 1, ?int $validation_time = null, string $b_type = '', array $b_types = [], array $regions = [], string $title_text = '') : array