Function Module_cms_downloads->get_form_fields

Definitions

cms/pages/modules/cms_downloads.php

  • Get Tempcode for a download 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 ID of the download (null: new)
$name SHORT_TEXT No No Blank (empty string) N/A N/A The name of the download
$category_id ?AUTO_LINK No No Null N/A N/A The download category (null: first)
$url URLPATH No No Blank (empty string) N/A N/A The URL for the downloadable file
$author SHORT_TEXT No No Blank (empty string) N/A N/A The name of the author
$description LONG_TEXT No No Blank (empty string) N/A N/A Description for the download
$additional_details LONG_TEXT No No Blank (empty string) N/A N/A Supplementary description for the download
$out_mode_id ?AUTO_LINK No No Null N/A N/A The ID of the download this download is out-modeing (null: none)
$validated BINARY No No 1 N/A N/A Whether the download is validated
$validation_time ?TIME No No Null N/A N/A The time on which this content should be validated (null: do not schedule)
$allow_rating ?BINARY No No Null N/A N/A Whether rating is allowed (null: decide statistically, based on existing choices)
$allow_comments ?SHORT_INTEGER No No Null 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 Null 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
$file_size ?integer No No Null N/A N/A The file size (null: not added yet therefore unknown)
$cost integer No No 0 N/A N/A The point cost of the download
$submitter_gets_points BINARY No No 1 N/A N/A Whether the submitter gets the point cost
$original_filename ?SHORT_TEXT No No Null N/A N/A The original file name for the file (we can't rely on the one on disk) (null: not added yet therefore unknown)
$licence ?AUTO_LINK No No Null N/A N/A The licence to use (null: none)
$default_pic integer No No 1 N/A N/A Which image to use for the downloads representative image (counts from 1)
$url_redirect URLPATH No No Blank (empty string) N/A N/A The URL to redirect

Returns

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

Preview

Code (PHP)

/**
 * Get Tempcode for a download adding/editing form.
 *
 * @param  ?AUTO_LINK $id The ID of the download (null: new)
 * @param  SHORT_TEXT $name The name of the download
 * @param  ?AUTO_LINK $category_id The download category (null: first)
 * @param  URLPATH $url The URL for the downloadable file
 * @param  SHORT_TEXT $author The name of the author
 * @param  LONG_TEXT $description Description for the download
 * @param  LONG_TEXT $additional_details Supplementary description for the download
 * @param  ?AUTO_LINK $out_mode_id The ID of the download this download is out-modeing (null: none)
 * @param  BINARY $validated Whether the download is validated
 * @param  ?TIME $validation_time The time on which this content should be validated (null: do not schedule)
 * @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
 * @param  ?integer $file_size The file size (null: not added yet therefore unknown)
 * @param  integer $cost The point cost of the download
 * @param  BINARY $submitter_gets_points Whether the submitter gets the point cost
 * @param  ?SHORT_TEXT $original_filename The original file name for the file (we can't rely on the one on disk) (null: not added yet therefore unknown)
 * @param  ?AUTO_LINK $licence The licence to use (null: none)
 * @param  integer $default_pic Which image to use for the downloads representative image (counts from 1)
 * @param  URLPATH $url_redirect The URL to redirect
 * @return array A pair: The input fields, Hidden fields
 */

public function get_form_fields(?int $id = null, string $name = '', ?int $category_id = null, string $url = '', string $author = '', string $description = '', string $additional_details = '', ?int $out_mode_id = null, int $validated = 1, ?int $validation_time = null, ?int $allow_rating = null, ?int $allow_comments = null, ?int $allow_trackbacks = null, string $notes = '', ?int $file_size = null, int $cost = 0, int $submitter_gets_points = 1, ?string $original_filename = null, ?int $licence = null, int $default_pic = 1, string $url_redirect = '') : array