| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\SpecialPage\Hook; |
| 4 | |
| 5 | use MediaWiki\SpecialPage\ChangesListSpecialPage; |
| 6 | |
| 7 | /** |
| 8 | * This is a hook handler interface, see docs/Hooks.md. |
| 9 | * Use the hook name "ChangesListSpecialPageStructuredFilters" to register handlers implementing this interface. |
| 10 | * |
| 11 | * @stable to implement |
| 12 | * @ingroup Hooks |
| 13 | */ |
| 14 | interface ChangesListSpecialPageStructuredFiltersHook { |
| 15 | /** |
| 16 | * Use this hook to register filters for pages inheriting from ChangesListSpecialPage |
| 17 | * (in core: RecentChanges, RecentChangesLinked, and Watchlist). Generally, you will |
| 18 | * want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects. |
| 19 | * When constructing them, you specify which group they belong to. You can reuse |
| 20 | * existing groups (accessed through $special->getFilterGroup), or create your own |
| 21 | * (ChangesListBooleanFilterGroup or ChangesListStringOptionsFilterGroup). |
| 22 | * If you create new groups, you must register them with $special->registerFilterGroup. |
| 23 | * Note that this is called regardless of whether the user is currently using |
| 24 | * the new (structured) or old (unstructured) filter UI. If you want your boolean |
| 25 | * filter to show on both the new and old UI, specify all the supported fields. |
| 26 | * These include showHide, label, and description. |
| 27 | * See the constructor of each ChangesList* class for documentation of supported |
| 28 | * fields. |
| 29 | * |
| 30 | * @since 1.35 |
| 31 | * |
| 32 | * @param ChangesListSpecialPage $special |
| 33 | * @return bool|void True or no return value to continue or false to abort |
| 34 | */ |
| 35 | public function onChangesListSpecialPageStructuredFilters( $special ); |
| 36 | } |