*/
public function showHelpBox( $msg /*, ... */ ) {
$args = func_get_args();
- $html = call_user_func_array( [ $this, 'getHelpBox' ], $args );
+ $html = $this->getHelpBox( ...$args );
$this->output->addHTML( $html );
}
public function showStatusMessage( Status $status ) {
$errors = array_merge( $status->getErrorsArray(), $status->getWarningsArray() );
foreach ( $errors as $error ) {
- call_user_func_array( [ $this, 'showMessage' ], $error );
+ $this->showMessage( ...$error );
}
}
* Parameters are:
* var: The variable to be configured (required)
* label: The message name for the label (required)
+ * labelAttribs:Additional attributes for the label element (optional)
* attribs: Additional attributes for the input element (optional)
* controlName: The name for the input element (optional)
* value: The current value of the variable (optional)
if ( !isset( $params['help'] ) ) {
$params['help'] = "";
}
+ if ( !isset( $params['labelAttribs'] ) ) {
+ $params['labelAttribs'] = [];
+ }
if ( isset( $params['rawtext'] ) ) {
$labelText = $params['rawtext'];
} else {
return "<div class=\"config-input-check\">\n" .
$params['help'] .
- "<label>\n" .
- Xml::check(
- $params['controlName'],
- $params['value'],
- $params['attribs'] + [
- 'id' => $params['controlName'],
- 'tabindex' => $this->nextTabIndex(),
- ]
- ) .
- $labelText . "\n" .
- "</label>\n" .
+ Html::rawElement(
+ 'label',
+ $params['labelAttribs'],
+ Xml::check(
+ $params['controlName'],
+ $params['value'],
+ $params['attribs'] + [
+ 'id' => $params['controlName'],
+ 'tabindex' => $this->nextTabIndex(),
+ ]
+ ) .
+ $labelText . "\n"
+ ) .
"</div>\n";
}
* @return string
*/
protected function getDocUrl( $page ) {
- $url = "{$_SERVER['PHP_SELF']}?page=" . urlencode( $page );
+ $query = [ 'page' => $page ];
if ( in_array( $this->currentPageName, $this->pageSequence ) ) {
- $url .= '&lastPage=' . urlencode( $this->currentPageName );
+ $query['lastPage'] = $this->currentPageName;
}
- return $url;
+ return $this->getUrl( $query );
}
/**
public function docLink( $linkText, $attribs, $parser ) {
$url = $this->getDocUrl( $attribs['href'] );
- return '<a href="' . htmlspecialchars( $url ) . '">' .
- htmlspecialchars( $linkText ) .
- '</a>';
+ return Html::element( 'a', [ 'href' => $url ], $linkText );
}
/**