Code Duplication    Length = 11-13 lines in 3 locations

includes/page/Article.php 1 location

@@ 1598-1610 (lines=13) @@
1595
	 * @param bool $overrideBaseUrl Whether $url is a full URL, to avoid MW.o.
1596
	 * @since 1.25
1597
	 */
1598
	public function addHelpLink( $to, $overrideBaseUrl = false ) {
1599
		$msg = wfMessage(
1600
			'namespace-' . $this->getTitle()->getNamespace() . '-helppage'
1601
		);
1602
1603
		$out = $this->getContext()->getOutput();
1604
		if ( !$msg->isDisabled() ) {
1605
			$helpUrl = Skin::makeUrl( $msg->plain() );
1606
			$out->addHelpLink( $helpUrl, true );
1607
		} else {
1608
			$out->addHelpLink( $to, $overrideBaseUrl );
1609
		}
1610
	}
1611
1612
	/**
1613
	 * Handle action=render

includes/actions/Action.php 1 location

@@ 390-402 (lines=13) @@
387
	 * @param bool $overrideBaseUrl Whether $url is a full URL, to avoid MW.o.
388
	 * @since 1.25
389
	 */
390
	public function addHelpLink( $to, $overrideBaseUrl = false ) {
391
		global $wgContLang;
392
		$msg = wfMessage( $wgContLang->lc(
393
			Action::getActionName( $this->getContext() )
394
			) . '-helppage' );
395
396
		if ( !$msg->isDisabled() ) {
397
			$helpUrl = Skin::makeUrl( $msg->plain() );
398
			$this->getOutput()->addHelpLink( $helpUrl, true );
399
		} else {
400
			$this->getOutput()->addHelpLink( $to, $overrideBaseUrl );
401
		}
402
	}
403
404
	/**
405
	 * The main action entry point.  Do all output for display and send it to the context

includes/specialpage/SpecialPage.php 1 location

@@ 673-683 (lines=11) @@
670
	 * @param bool $overrideBaseUrl Whether $url is a full URL, to avoid MW.o.
671
	 * @since 1.25
672
	 */
673
	public function addHelpLink( $to, $overrideBaseUrl = false ) {
674
		global $wgContLang;
675
		$msg = $this->msg( $wgContLang->lc( $this->getName() ) . '-helppage' );
676
677
		if ( !$msg->isDisabled() ) {
678
			$helpUrl = Skin::makeUrl( $msg->plain() );
679
			$this->getOutput()->addHelpLink( $helpUrl, true );
680
		} else {
681
			$this->getOutput()->addHelpLink( $to, $overrideBaseUrl );
682
		}
683
	}
684
685
	/**
686
	 * Get the group that the special page belongs in on Special:SpecialPage