dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b638843
)
Convert HTMLForm to use more Html::*
author
Aryeh Gregor
<simetrical@users.mediawiki.org>
Mon, 7 Sep 2009 01:47:45 +0000
(
01:47
+0000)
committer
Aryeh Gregor
<simetrical@users.mediawiki.org>
Mon, 7 Sep 2009 01:47:45 +0000
(
01:47
+0000)
includes/HTMLForm.php
patch
|
blob
|
history
diff --git
a/includes/HTMLForm.php
b/includes/HTMLForm.php
index
18dd506
..
335efea
100644
(file)
--- a/
includes/HTMLForm.php
+++ b/
includes/HTMLForm.php
@@
-180,7
+180,7
@@
class HTMLForm {
}
function wrapForm( $html ) {
}
function wrapForm( $html ) {
- return
Xml::tags
(
+ return
Html::rawElement
(
'form',
array(
'action' => $this->getTitle()->getFullURL(),
'form',
array(
'action' => $this->getTitle()->getFullURL(),
@@
-194,8
+194,8
@@
class HTMLForm {
global $wgUser;
$html = '';
global $wgUser;
$html = '';
- $html .=
X
ml::hidden( 'wpEditToken', $wgUser->editToken() ) . "\n";
- $html .=
X
ml::hidden( 'title', $this->getTitle() ) . "\n";
+ $html .=
Ht
ml::hidden( 'wpEditToken', $wgUser->editToken() ) . "\n";
+ $html .=
Ht
ml::hidden( 'title', $this->getTitle() ) . "\n";
return $html;
}
return $html;
}
@@
-213,7
+213,7
@@
class HTMLForm {
$html .= Xml::submitButton( $this->getSubmitText(), $attribs ) . "\n";
if( $this->mShowReset ) {
$html .= Xml::submitButton( $this->getSubmitText(), $attribs ) . "\n";
if( $this->mShowReset ) {
- $html .=
X
ml::element(
+ $html .=
Ht
ml::element(
'input',
array(
'type' => 'reset',
'input',
array(
'type' => 'reset',
@@
-236,7
+236,7
@@
class HTMLForm {
$errorstr = $errors;
}
$errorstr = $errors;
}
- $errorstr =
Xml::tags
( 'div', array( 'class' => 'error' ), $errorstr );
+ $errorstr =
Html::rawElement
( 'div', array( 'class' => 'error' ), $errorstr );
global $wgOut;
$wgOut->addHTML( $errorstr );
global $wgOut;
$wgOut->addHTML( $errorstr );
@@
-251,14
+251,14
@@
class HTMLForm {
$msg = $error;
$error = array();
}
$msg = $error;
$error = array();
}
- $errorstr .=
Xml::tags
(
+ $errorstr .=
Html::rawElement
(
'li',
null,
wfMsgExt( $msg, array( 'parseinline' ), $error )
);
}
'li',
null,
wfMsgExt( $msg, array( 'parseinline' ), $error )
);
}
- $errorstr =
Xml::tags( 'ul', null
, $errorstr );
+ $errorstr =
Html::rawElement( 'ul', array()
, $errorstr );
return $errorstr;
}
return $errorstr;
}
@@
-450,20
+450,20
@@
abstract class HTMLFormField {
if ( $errors === true || !$wgRequest->wasPosted() ) {
$errors = '';
} else {
if ( $errors === true || !$wgRequest->wasPosted() ) {
$errors = '';
} else {
- $errors =
Xml::tags
( 'span', array( 'class' => 'error' ), $errors );
+ $errors =
Html::rawElement
( 'span', array( 'class' => 'error' ), $errors );
}
$html = '';
}
$html = '';
- $html .=
Xml::tags
( 'td', array( 'class' => 'mw-label' ),
-
Xml::tags
( 'label', array( 'for' => $this->mID ), $this->getLabel() )
+ $html .=
Html::rawElement
( 'td', array( 'class' => 'mw-label' ),
+
Html::rawElement
( 'label', array( 'for' => $this->mID ), $this->getLabel() )
);
);
- $html .=
Xml::tags
( 'td', array( 'class' => 'mw-input' ),
+ $html .=
Html::rawElement
( 'td', array( 'class' => 'mw-input' ),
$this->getInputHTML( $value ) ."\n$errors" );
$fieldType = get_class( $this );
$this->getInputHTML( $value ) ."\n$errors" );
$fieldType = get_class( $this );
- $html =
Xml::tags
( 'tr', array( 'class' => "mw-htmlform-field-$fieldType" ),
+ $html =
Html::rawElement
( 'tr', array( 'class' => "mw-htmlform-field-$fieldType" ),
$html ) . "\n";
$helptext = null;
$html ) . "\n";
$helptext = null;
@@
-479,9
+479,9
@@
abstract class HTMLFormField {
}
if ( !is_null( $helptext ) ) {
}
if ( !is_null( $helptext ) ) {
- $row =
Xml::tags
( 'td', array( 'colspan' => 2, 'class' => 'htmlform-tip' ),
+ $row =
Html::rawElement
( 'td', array( 'colspan' => 2, 'class' => 'htmlform-tip' ),
$helptext );
$helptext );
- $row =
Xml::tags( 'tr', null
, $row );
+ $row =
Html::rawElement( 'tr', array()
, $row );
$html .= "$row\n";
}
$html .= "$row\n";
}
@@
-637,7
+637,7
@@
class HTMLCheckField extends HTMLFormField {
}
return Xml::check( $this->mName, $value, $attr ) . ' ' .
}
return Xml::check( $this->mName, $value, $attr ) . ' ' .
-
Xml::tags
( 'label', array( 'for' => $this->mID ), $this->mLabel );
+
Html::rawElement
( 'label', array( 'for' => $this->mID ), $this->mLabel );
}
function getLabel() {
}
function getLabel() {
@@
-743,9
+743,9
@@
class HTMLSelectOrOtherField extends HTMLTextField {
$tbAttribs['maxlength'] = $this->mParams['maxlength'];
}
$tbAttribs['maxlength'] = $this->mParams['maxlength'];
}
- $textbox =
X
ml::input( $this->mName . '-other',
+ $textbox =
Ht
ml::input( $this->mName . '-other',
$this->getSize(),
$this->getSize(),
- $valInSelect ? '' : $value,
+ $valInSelect ? '
text
' : $value,
$tbAttribs );
return "$select<br/>\n$textbox";
$tbAttribs );
return "$select<br/>\n$textbox";
@@
-800,14
+800,14
@@
class HTMLMultiSelectField extends HTMLFormField {
foreach( $options as $label => $info ) {
if( is_array( $info ) ) {
foreach( $options as $label => $info ) {
if( is_array( $info ) ) {
- $html .=
Xml::tags( 'h1', null
, $label ) . "\n";
+ $html .=
Html::rawElement( 'h1', array()
, $label ) . "\n";
$html .= $this->formatOptions( $info, $value );
} else {
$thisAttribs = array( 'id' => $this->mID . "-$info", 'value' => $info );
$checkbox = Xml::check( $this->mName . '[]', in_array( $info, $value ),
$attribs + $thisAttribs );
$html .= $this->formatOptions( $info, $value );
} else {
$thisAttribs = array( 'id' => $this->mID . "-$info", 'value' => $info );
$checkbox = Xml::check( $this->mName . '[]', in_array( $info, $value ),
$attribs + $thisAttribs );
- $checkbox .= ' ' .
Xml::tags
( 'label', array( 'for' => $this->mID . "-$info" ), $label );
+ $checkbox .= ' ' .
Html::rawElement
( 'label', array( 'for' => $this->mID . "-$info" ), $label );
$html .= $checkbox . '<br />';
}
$html .= $checkbox . '<br />';
}
@@
-871,14
+871,14
@@
class HTMLRadioField extends HTMLFormField {
foreach( $options as $label => $info ) {
if( is_array( $info ) ) {
foreach( $options as $label => $info ) {
if( is_array( $info ) ) {
- $html .=
Xml::tags( 'h1', null
, $label ) . "\n";
+ $html .=
Html::rawElement( 'h1', array()
, $label ) . "\n";
$html .= $this->formatOptions( $info, $value );
} else {
$id = Sanitizer::escapeId( $this->mID . "-$info" );
$html .= Xml::radio( $this->mName, $info, $info == $value,
$attribs + array( 'id' => $id ) );
$html .= ' ' .
$html .= $this->formatOptions( $info, $value );
} else {
$id = Sanitizer::escapeId( $this->mID . "-$info" );
$html .= Xml::radio( $this->mName, $info, $info == $value,
$attribs + array( 'id' => $id ) );
$html .= ' ' .
-
Xml::tags
( 'label', array( 'for' => $id ), $label );
+
Html::rawElement
( 'label', array( 'for' => $id ), $label );
$html .= "<br/>\n";
}
$html .= "<br/>\n";
}