wfDeprecated( __METHOD__, '1.18' );
if ( $noRedir ) {
$query = 'redirect=no';
- if ( $extraQuery )
+ if ( $extraQuery ) {
$query .= "&$extraQuery";
+ }
} else {
$query = $extraQuery;
}
default:
$conds = null;
wfRunHooks( 'BacklinkCacheGetConditions', array( $table, $this->title, &$conds ) );
- if( !$conds )
+ if( !$conds ) {
throw new MWException( "Invalid table \"$table\" in " . __CLASS__ );
+ }
}
return $conds;
}
function close() {
- if( isset($this->handle) )
+ if( isset($this->handle) ) {
dba_close( $this->handle );
+ }
unset( $this->handle );
}
}
function close() {
- if( isset($this->handle) )
+ if( isset($this->handle) ) {
dba_close( $this->handle );
+ }
if ( wfIsWindows() ) {
unlink( $this->realFileName );
}
public static function buildTagFilterSelector( $selected='', $fullForm = false, Title $title = null ) {
global $wgUseTagFilter;
- if ( !$wgUseTagFilter || !count( self::listDefinedTags() ) )
+ if ( !$wgUseTagFilter || !count( self::listDefinedTags() ) ) {
return $fullForm ? '' : array();
+ }
$data = array( Html::rawElement( 'label', array( 'for' => 'tagfilter' ), wfMessage( 'tag-filter' )->parse() ),
Xml::input( 'tagfilter', 20, $selected, array( 'class' => 'mw-tagfilter-input' ) ) );
array(),
$params
);
- if( $this->isDeleted($rcObj,Revision::DELETED_TEXT) )
+ if( $this->isDeleted( $rcObj, Revision::DELETED_TEXT ) ) {
$link = '<span class="history-deleted">'.$link.'</span> ';
+ }
}
$r .= $link . '</span>';
wfProfileOut( __METHOD__ );
return;
}
- if ( !$this->mTitle->getArticleID() )
+
+ if ( !$this->mTitle->getArticleID() ) {
wfRunHooks( 'EditFormPreloadText', array( &$this->textbox1, &$this->mTitle ) );
- else
+ }
+ else {
wfRunHooks( 'EditFormInitialText', array( $this ) );
+ }
+
}
$this->showEditForm();
// modified by subclasses
wfProfileIn( get_class( $this ) . "::importContentFormData" );
$textbox1 = $this->importContentFormData( $request );
- if ( isset( $textbox1 ) )
+ if ( isset( $textbox1 ) ) {
$this->textbox1 = $textbox1;
+ }
+
wfProfileOut( get_class( $this ) . "::importContentFormData" );
}
$wgOut->wrapWikiMsg( "<div class='error' id='mw-userinvalidcssjstitle'>\n$1\n</div>", array( 'userinvalidcssjstitle', $this->mTitle->getSkinFromCssJsSubpage() ) );
}
if ( $this->formtype !== 'preview' ) {
- if ( $this->isCssSubpage )
+ if ( $this->isCssSubpage ) {
$wgOut->wrapWikiMsg( "<div id='mw-usercssyoucanpreview'>\n$1\n</div>", array( 'usercssyoucanpreview' ) );
- if ( $this->isJsSubpage )
+ }
+
+ if ( $this->isJsSubpage ) {
$wgOut->wrapWikiMsg( "<div id='mw-userjsyoucanpreview'>\n$1\n</div>", array( 'userjsyoucanpreview' ) );
+ }
}
}
}
* @return String
*/
protected function getSummaryPreview( $isSubjectPreview, $summary = "" ) {
- if ( !$summary || ( !$this->preview && !$this->diff ) )
+ if ( !$summary || ( !$this->preview && !$this->diff ) ) {
return "";
+ }
global $wgParser;
- if ( $isSubjectPreview )
+ if ( $isSubjectPreview ) {
$summary = wfMessage( 'newsectionsummary', $wgParser->stripSectionName( $summary ) )
->inContentLanguage()->text();
+ }
$message = $isSubjectPreview ? 'subject-preview' : 'summary-preview';
HTML
);
- if ( !$this->checkUnicodeCompliantBrowser() )
+ if ( !$this->checkUnicodeCompliantBrowser() ) {
$wgOut->addHTML( Html::hidden( 'safemode', '1' ) );
+ }
}
protected function showFormAfterText() {
protected function displayPreviewArea( $previewOutput, $isOnTop = false ) {
global $wgOut;
$classes = array();
- if ( $isOnTop )
+ if ( $isOnTop ) {
$classes[] = 'ontop';
+ }
$attribs = array( 'id' => 'wikiPreview', 'class' => implode( ' ', $classes ) );
- if ( $this->formtype != 'preview' )
+ if ( $this->formtype != 'preview' ) {
$attribs['style'] = 'display: none;';
+ }
$wgOut->addHTML( Xml::openElement( 'div', $attribs ) );
);
// Quick paranoid permission checks...
if ( is_object( $data ) ) {
- if ( $data->log_deleted & LogPage::DELETED_USER )
+ if ( $data->log_deleted & LogPage::DELETED_USER ) {
$data->user_name = wfMessage( 'rev-deleted-user' )->escaped();
- if ( $data->log_deleted & LogPage::DELETED_COMMENT )
+ }
+
+ if ( $data->log_deleted & LogPage::DELETED_COMMENT ) {
$data->log_comment = wfMessage( 'rev-deleted-comment' )->escaped();
+ }
}
return $data;
}
static function fetchFromURL( $url, $params = array() ) {
global $wgExternalStores;
- if( !$wgExternalStores )
+ if( !$wgExternalStores ) {
return false;
+ }
$parts = explode( '://', $url, 2 );
}
$store = self::getStoreObject( $proto, $params );
- if ( $store === false )
+ if ( $store === false ) {
return false;
+ }
+
return $store->fetchFromURL( $url );
}
*/
static function getStoreObject( $proto, $params = array() ) {
global $wgExternalStores;
- if( !$wgExternalStores )
+ if( !$wgExternalStores ) {
return false;
+ }
+
/* Protocol not enabled */
- if( !in_array( $proto, $wgExternalStores ) )
+ if( !in_array( $proto, $wgExternalStores ) ) {
return false;
+ }
$class = 'ExternalStore' . ucfirst( $proto );
/* Any custom modules should be added to $wgAutoLoadClasses for on-demand loading */
$q = array();
$q['action'] = 'delete';
- if( $this->oldimage )
+ if( $this->oldimage ) {
$q['oldimage'] = $this->oldimage;
+ }
return $this->title->getLocalUrl( $q );
}
* @param $depth int
*/
protected function makeHtml( $tagset, $depth = 0 ) {
- foreach ( $tagset as $key => $val )
+ foreach ( $tagset as $key => $val ) {
if ( is_array( $val ) ) {
$this->html .= $this->outputOption(
$key, '',
$depth
);
}
+ }
}
/**
$msgObj = $this->msg( $message );
$text = $msgObj->exists() ? $msgObj->text() : $message;
$attribs['value'] = $value;
- if ( $value === $this->selected )
+ if ( $value === $this->selected ) {
$attribs['selected'] = 'selected';
+ }
+
$val = str_repeat( /*   */ "\xc2\xa0", $depth * 2 ) . $text;
return str_repeat( "\t", $depth ) . Xml::element( 'option', $attribs, $val ) . "\n";
}