Function Module_cms_polls->get_form_fields

Definitions

cms/pages/modules/cms_polls.php

  • Get Tempcode for a poll 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
$id ?AUTO_LINK No No Null N/A N/A The poll ID (null: new)
$question SHORT_TEXT No No Blank (empty string) N/A N/A The question
$a1 SHORT_TEXT No No Blank (empty string) N/A N/A The first answer
$a2 SHORT_TEXT No No Blank (empty string) N/A N/A The second answer
$a3 SHORT_TEXT No No Blank (empty string) N/A N/A The third answer
$a4 SHORT_TEXT No No Blank (empty string) N/A N/A The fourth answer
$a5 SHORT_TEXT No No Blank (empty string) N/A N/A The fifth answer
$a6 SHORT_TEXT No No Blank (empty string) N/A N/A The sixth answer
$a7 SHORT_TEXT No No Blank (empty string) N/A N/A The seventh answer
$a8 SHORT_TEXT No No Blank (empty string) N/A N/A The eighth answer
$a9 SHORT_TEXT No No Blank (empty string) N/A N/A The ninth answer
$a10 SHORT_TEXT No No Blank (empty string) N/A N/A The tenth answer
$current boolean No No True N/A N/A Whether the poll is/will-be currently active
$allow_rating ?BINARY No No 1 N/A N/A Whether rating is allowed (null: decide statistically, based on existing choices)
$allow_comments ?SHORT_INTEGER No No 1 N/A N/A Whether comments are allowed (0=no, 1=yes, 2=review style) (null: decide statistically, based on existing choices)
$allow_trackbacks ?BINARY No No 1 N/A N/A Whether trackbacks are allowed (null: decide statistically, based on existing choices)
$notes LONG_TEXT No No Blank (empty string) N/A N/A Notes for the poll

Returns

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

Preview

Code (PHP)

/**
 * Get Tempcode for a poll adding/editing form.
 *
 * @param  ?AUTO_LINK $id The poll ID (null: new)
 * @param  SHORT_TEXT $question The question
 * @param  SHORT_TEXT $a1 The first answer
 * @param  SHORT_TEXT $a2 The second answer
 * @param  SHORT_TEXT $a3 The third answer
 * @param  SHORT_TEXT $a4 The fourth answer
 * @param  SHORT_TEXT $a5 The fifth answer
 * @param  SHORT_TEXT $a6 The sixth answer
 * @param  SHORT_TEXT $a7 The seventh answer
 * @param  SHORT_TEXT $a8 The eighth answer
 * @param  SHORT_TEXT $a9 The ninth answer
 * @param  SHORT_TEXT $a10 The tenth answer
 * @param  boolean $current Whether the poll is/will-be currently active
 * @param  ?BINARY $allow_rating Whether rating is allowed (null: decide statistically, based on existing choices)
 * @param  ?SHORT_INTEGER $allow_comments Whether comments are allowed (0=no, 1=yes, 2=review style) (null: decide statistically, based on existing choices)
 * @param  ?BINARY $allow_trackbacks Whether trackbacks are allowed (null: decide statistically, based on existing choices)
 * @param  LONG_TEXT $notes Notes for the poll
 * @return array A pair: The input fields, Hidden fields
 */

public function get_form_fields(?int $id = null, string $question = '', string $a1 = '', string $a2 = '', string $a3 = '', string $a4 = '', string $a5 = '', string $a6 = '', string $a7 = '', string $a8 = '', string $a9 = '', string $a10 = '', bool $current = true, ?int $allow_rating = 1, ?int $allow_comments = 1, ?int $allow_trackbacks = 1, string $notes = '') : array