Hygiene: Simplify if statement and move comment
It feels like the comment about history link time should be located next to the getHistoryLink function, not somewhere in the code. Statements like: if ( a ) { if ( b ) { // do sth; } } can be easily wrapped into: if ( a && b ) { // do sth } Change-Id: I98c071ecdd855210bc0a92f032ee622fb91e8df5
This commit is contained in:
parent
d8de612e0c
commit
0ac08cafb2
|
@ -479,6 +479,10 @@ class SkinMinerva extends SkinTemplate {
|
|||
* Prepare the content for the 'last edited' message, e.g. 'Last edited on 30 August
|
||||
* 2013, at 23:31'. This message is different for the main page since main page
|
||||
* content is typically transcluded rather than edited directly.
|
||||
*
|
||||
* The relative time is only rendered on the latest revision.
|
||||
* For older revisions the last modified information will not render with a relative time
|
||||
* nor will it show the name of the editor.
|
||||
* @param Title $title The Title object of the page being viewed
|
||||
* @return array
|
||||
*/
|
||||
|
@ -614,16 +618,9 @@ class SkinMinerva extends SkinTemplate {
|
|||
$out->setPageTitle( $pageTitle );
|
||||
}
|
||||
|
||||
if ( $this->canUseWikiPage() ) {
|
||||
// If it's a page that exists, add last edited timestamp
|
||||
// The relative time is only rendered on the latest revision.
|
||||
// For older revisions the last modified
|
||||
// information will not render with a relative time
|
||||
// nor will it show the name of the editor.
|
||||
if ( $this->getWikiPage()->exists() ) {
|
||||
if ( $this->canUseWikiPage() && $this->getWikiPage()->exists() ) {
|
||||
$tpl->set( 'historyLink', $this->getHistoryLink( $title ) );
|
||||
}
|
||||
}
|
||||
$tpl->set( 'headinghtml', $this->getHeadingHtml() );
|
||||
|
||||
$tpl->set( 'footer-site-heading-html', $this->getSitename() );
|
||||
|
|
Loading…
Reference in New Issue