Function Hook_cns_warnings_ban_ip->get_form_fields
Definitions
sources/hooks/systems/cns_warnings/ban_ip.php
- Render form fields for the warnings screen.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| &$add_text | Tempcode | Yes | No | required parameter | N/A | N/A | Tempcode to be included on the intro paragraph of the warnings screen (passed by reference) |
| &$fields | Tempcode | Yes | No | required parameter | N/A | N/A | The fields to be rendered (passed by reference) |
| &$hidden | Tempcode | Yes | No | required parameter | N/A | N/A | The hidden fields to be included (passed by reference) |
| $new | boolean | No | No | required parameter | N/A | N/A | Whether it is a new warning/punishment record |
| $explanation | LONG_TEXT | No | No | required parameter | N/A | N/A | The explanation for the warning/punishment record |
| $is_warning | BINARY | No | No | required parameter | N/A | N/A | Whether to make this a formal warning |
| $member_id | MEMBER | No | No | required parameter | N/A | N/A | The member the warning is for |
| $spam_mode | BINARY | No | No | required parameter | N/A | N/A | Whether this is a spam warning |
| $post_id | ?AUTO_LINK | No | No | required parameter | N/A | N/A | The ID of the forum post of which we clicked warn (null: we are not warning on a forum post) |
| $ip_address | ?SHORT_TEXT | No | No | required parameter | N/A | N/A | The IP address of the poster (null: we are not warning on a forum post) |
Preview
Code (PHP)
/**
* Render form fields for the warnings screen.
*
* @param Tempcode $add_text Tempcode to be included on the intro paragraph of the warnings screen (passed by reference)
* @param Tempcode $fields The fields to be rendered (passed by reference)
* @param Tempcode $hidden The hidden fields to be included (passed by reference)
* @param boolean $new Whether it is a new warning/punishment record
* @param LONG_TEXT $explanation The explanation for the warning/punishment record
* @param BINARY $is_warning Whether to make this a formal warning
* @param MEMBER $member_id The member the warning is for
* @param BINARY $spam_mode Whether this is a spam warning
* @param ?AUTO_LINK $post_id The ID of the forum post of which we clicked warn (null: we are not warning on a forum post)
* @param ?SHORT_TEXT $ip_address The IP address of the poster (null: we are not warning on a forum post)
*/
public function get_form_fields(object &$add_text, object &$fields, object &$hidden, bool $new, string $explanation, int $is_warning, int $member_id, int $spam_mode, ?int $post_id, ?string $ip_address)
* Render form fields for the warnings screen.
*
* @param Tempcode $add_text Tempcode to be included on the intro paragraph of the warnings screen (passed by reference)
* @param Tempcode $fields The fields to be rendered (passed by reference)
* @param Tempcode $hidden The hidden fields to be included (passed by reference)
* @param boolean $new Whether it is a new warning/punishment record
* @param LONG_TEXT $explanation The explanation for the warning/punishment record
* @param BINARY $is_warning Whether to make this a formal warning
* @param MEMBER $member_id The member the warning is for
* @param BINARY $spam_mode Whether this is a spam warning
* @param ?AUTO_LINK $post_id The ID of the forum post of which we clicked warn (null: we are not warning on a forum post)
* @param ?SHORT_TEXT $ip_address The IP address of the poster (null: we are not warning on a forum post)
*/
public function get_form_fields(object &$add_text, object &$fields, object &$hidden, bool $new, string $explanation, int $is_warning, int $member_id, int $spam_mode, ?int $post_id, ?string $ip_address)

