Function Module_cms_news->get_form_fields
Definitions
cms/pages/modules/cms_news.php
- Get Tempcode for a news 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 news ID (null: new) |
| $main_news_category | ?AUTO_LINK | No | No | Null | N/A | N/A | The primary category for the news (null: personal) |
| $news_category | ?array | No | No | Null | N/A | N/A | A list of categories the news is in (null: not known) |
| $title | SHORT_TEXT | No | No | Blank (empty string) | N/A | N/A | The news title |
| $news | LONG_TEXT | No | No | Blank (empty string) | N/A | N/A | The news summary |
| $author | SHORT_TEXT | No | No | Blank (empty string) | N/A | N/A | The name of the author |
| $validated | BINARY | No | No | 1 | N/A | N/A | Whether the news 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) |
| $send_trackbacks | BINARY | No | No | 1 | N/A | N/A | Whether to show the "send trackback" field |
| $notes | LONG_TEXT | No | No | Blank (empty string) | N/A | N/A | Notes for the video |
| $image | URLPATH | No | No | Blank (empty string) | N/A | N/A | URL to the image for the news entry (blank: use cat image) |
| $regions | array | No | No | [] | N/A | N/A | The regions (empty: not region-limited) |
Returns
- A tuple: The input fields, Hidden fields, ...
- Type: array
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Get Tempcode for a news adding/editing form.
*
* @param ?AUTO_LINK $id The news ID (null: new)
* @param ?AUTO_LINK $main_news_category The primary category for the news (null: personal)
* @param ?array $news_category A list of categories the news is in (null: not known)
* @param SHORT_TEXT $title The news title
* @param LONG_TEXT $news The news summary
* @param SHORT_TEXT $author The name of the author
* @param BINARY $validated Whether the news 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 BINARY $send_trackbacks Whether to show the "send trackback" field
* @param LONG_TEXT $notes Notes for the video
* @param URLPATH $image URL to the image for the news entry (blank: use cat image)
* @param array $regions The regions (empty: not region-limited)
* @return array A tuple: The input fields, Hidden fields, ...
*/
public function get_form_fields(?int $id = null, ?int $main_news_category = null, ?array $news_category = null, string $title = '', string $news = '', string $author = '', int $validated = 1, ?int $validation_time = null, ?int $allow_rating = null, ?int $allow_comments = null, ?int $allow_trackbacks = null, int $send_trackbacks = 1, string $notes = '', string $image = '', array $regions = []) : array
* Get Tempcode for a news adding/editing form.
*
* @param ?AUTO_LINK $id The news ID (null: new)
* @param ?AUTO_LINK $main_news_category The primary category for the news (null: personal)
* @param ?array $news_category A list of categories the news is in (null: not known)
* @param SHORT_TEXT $title The news title
* @param LONG_TEXT $news The news summary
* @param SHORT_TEXT $author The name of the author
* @param BINARY $validated Whether the news 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 BINARY $send_trackbacks Whether to show the "send trackback" field
* @param LONG_TEXT $notes Notes for the video
* @param URLPATH $image URL to the image for the news entry (blank: use cat image)
* @param array $regions The regions (empty: not region-limited)
* @return array A tuple: The input fields, Hidden fields, ...
*/
public function get_form_fields(?int $id = null, ?int $main_news_category = null, ?array $news_category = null, string $title = '', string $news = '', string $author = '', int $validated = 1, ?int $validation_time = null, ?int $allow_rating = null, ?int $allow_comments = null, ?int $allow_trackbacks = null, int $send_trackbacks = 1, string $notes = '', string $image = '', array $regions = []) : array

