- /**
- * Returns an array of html code of the following checkboxes old style:
- * minor and watch
- *
- * @deprecated since 1.30 Use getCheckboxesWidget() or getCheckboxesDefinition() instead
- * @param int &$tabindex Current tabindex
- * @param array $checked See getCheckboxesDefinition()
- * @return array
- */
- public function getCheckboxes( &$tabindex, $checked ) {
- wfDeprecated( __METHOD__, '1.30' );
- $checkboxes = [];
- $checkboxesDef = $this->getCheckboxesDefinition( $checked );
-
- // Backwards-compatibility for the EditPageBeforeEditChecks hook
- if ( !$this->isNew ) {
- $checkboxes['minor'] = '';
- }
- $checkboxes['watch'] = '';
-
- foreach ( $checkboxesDef as $name => $options ) {
- $legacyName = isset( $options['legacy-name'] ) ? $options['legacy-name'] : $name;
- $label = $this->context->msg( $options['label-message'] )->parse();
- $attribs = [
- 'tabindex' => ++$tabindex,
- 'id' => $options['id'],
- ];
- $labelAttribs = [
- 'for' => $options['id'],
- ];
- if ( isset( $options['tooltip'] ) ) {
- $attribs['accesskey'] = $this->context->msg( "accesskey-{$options['tooltip']}" )->text();
- $labelAttribs['title'] = Linker::titleAttrib( $options['tooltip'], 'withaccess' );
- }
- if ( isset( $options['title-message'] ) ) {
- $labelAttribs['title'] = $this->context->msg( $options['title-message'] )->text();
- }
- if ( isset( $options['label-id'] ) ) {
- $labelAttribs['id'] = $options['label-id'];
- }
- $checkboxHtml =
- Xml::check( $name, $options['default'], $attribs ) .
- ' ' .
- Xml::tags( 'label', $labelAttribs, $label );
-
- $checkboxes[ $legacyName ] = $checkboxHtml;
- }
-
- // Avoid PHP 7.1 warning of passing $this by reference
- $editPage = $this;
- Hooks::run( 'EditPageBeforeEditChecks', [ &$editPage, &$checkboxes, &$tabindex ], '1.29' );
- return $checkboxes;
- }
-
- /**
- * Returns an array of checkboxes for the edit form, including 'minor' and 'watch' checkboxes and
- * any other added by extensions.
- *
- * @deprecated since 1.30 Use getCheckboxesWidget() or getCheckboxesDefinition() instead
- * @param int &$tabindex Current tabindex
- * @param array $checked Array of checkbox => bool, where bool indicates the checked
- * status of the checkbox
- *
- * @return array Associative array of string keys to OOUI\FieldLayout instances
- */
- public function getCheckboxesOOUI( &$tabindex, $checked ) {
- wfDeprecated( __METHOD__, '1.30' );
- return $this->getCheckboxesWidget( $tabindex, $checked );
- }
-