| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Hook; |
| 4 | |
| 5 | use MediaWiki\HTMLForm\HTMLForm; |
| 6 | |
| 7 | /** |
| 8 | * This is a hook handler interface, see docs/Hooks.md. |
| 9 | * Use the hook name "SpecialCreateAccountBenefits" to register handlers implementing this interface. |
| 10 | * |
| 11 | * @stable to implement |
| 12 | * @ingroup Hooks |
| 13 | */ |
| 14 | interface SpecialCreateAccountBenefitsHook { |
| 15 | |
| 16 | /** |
| 17 | * Replace the default signup page content about the benefits of registering an account |
| 18 | * ("Wikipedia is made by people like you...") on Special:CreateAccount. |
| 19 | * |
| 20 | * @param string|null &$html HTML to use instead of the default .mw-createacct-benefits-container |
| 21 | * block. By default, this is null, which means the default content will be used. |
| 22 | * @param array $info Array of information: |
| 23 | * - context: (IContextSource) Context object. |
| 24 | * - form: (HTMLForm) The signup form. Read-only - the form HTML has already been generated. |
| 25 | * @phan-param array{context:\MediaWiki\Context\IContextSource,form:HTMLForm} $info |
| 26 | * @param array &$options Array of modifiable options: |
| 27 | * - beforeForm: (bool, default false) Whether to insert the HTML before the form. This is |
| 28 | * mainly useful on mobile (where the login form might push the benefits out of view; but |
| 29 | * also, a long benefits block might push the form out of view). |
| 30 | * @phan-param array{beforeForm:bool} &$options |
| 31 | * @return bool|void True or no return value to continue or false to abort. |
| 32 | * @since 1.40 |
| 33 | */ |
| 34 | public function onSpecialCreateAccountBenefits( ?string &$html, array $info, array &$options ); |
| 35 | |
| 36 | } |