* Added GetDoubleUnderscoreIDs hook, for modifying the list of magic words.
* DatabaseUpdater class has two new methods to ease extensions schema changes:
dropExtensionIndex and renameExtensionIndex.
+* New preference type - 'api'. Preferences of this type are not shown on
+ Special:Preferences, but are still available via the action=options API.
=== Bug fixes in 1.21 ===
* (bug 40353) SpecialDoubleRedirect should support interwiki redirects.
'HistoryBlobStub' => 'includes/HistoryBlob.php',
'Hooks' => 'includes/Hooks.php',
'Html' => 'includes/Html.php',
+ 'HTMLApiField' => 'includes/HTMLForm.php',
'HTMLCheckField' => 'includes/HTMLForm.php',
'HTMLEditTools' => 'includes/HTMLForm.php',
'HTMLFloatField' => 'includes/HTMLForm.php',
// A mapping of 'type' inputs onto standard HTMLFormField subclasses
static $typeMappings = array(
+ 'api' => 'HTMLApiField',
'text' => 'HTMLTextField',
'textarea' => 'HTMLTextAreaField',
'select' => 'HTMLSelectField',
return $msg;
}
}
+
+class HTMLApiField extends HTMLFormField {
+ public function getTableRow( $value ) {
+ return '';
+ }
+
+ public function getDiv( $value ) {
+ return $this->getTableRow( $value );
+ }
+
+ public function getRaw( $value ) {
+ return $this->getTableRow( $value );
+ }
+
+ public function getInputHTML( $value ) {
+ return '';
+ }
+}
$formDescriptor = array_diff_key( $formDescriptor, $removeKeys );
}
+ // Remove type=api preferences. They are not intended for rendering in the form.
+ foreach ( $formDescriptor as $name => $info ) {
+ if ( isset( $info['type'] ) && $info['type'] === 'api' ) {
+ unset( $formDescriptor[$name] );
+ }
+ }
+
/**
* @var $htmlForm PreferencesForm
*/