+ function makeSelfLinkObj( &$nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
+ $u = $nt->escapeLocalURL( $query );
+ if ( '' == $text ) {
+ $text = htmlspecialchars( $nt->getPrefixedText() );
+ }
+ $inside = '';
+ if ( '' != $trail ) {
+ if ( preg_match( $this->linktrail, $trail, $m ) ) {
+ $inside = $m[1];
+ $trail = $m[2];
+ }
+ }
+ return "<strong>{$prefix}{$text}{$inside}</strong>{$trail}";
+ }
+
+ /* these are used extensively in SkinPHPTal, but also some other places */
+ /*static*/ function makeSpecialUrl( $name, $urlaction='' ) {
+ $title = Title::makeTitle( NS_SPECIAL, $name );
+ $this->checkTitle($title, $name);
+ return $title->getLocalURL( $urlaction );
+ }
+ /*static*/ function makeTalkUrl ( $name, $urlaction='' ) {
+ $title = Title::newFromText( $name );
+ $title = $title->getTalkPage();
+ $this->checkTitle($title, $name);
+ return $title->getLocalURL( $urlaction );
+ }
+ /*static*/ function makeArticleUrl ( $name, $urlaction='' ) {
+ $title = Title::newFromText( $name );
+ $title= $title->getSubjectPage();
+ $this->checkTitle($title, $name);
+ return $title->getLocalURL( $urlaction );
+ }
+ /*static*/ function makeI18nUrl ( $name, $urlaction='' ) {
+ $title = Title::newFromText( wfMsg($name) );
+ $this->checkTitle($title, $name);
+ return $title->getLocalURL( $urlaction );
+ }
+ /*static*/ function makeUrl ( $name, $urlaction='' ) {
+ $title = Title::newFromText( $name );
+ $this->checkTitle($title, $name);
+ return $title->getLocalURL( $urlaction );
+ }
+ # this can be passed the NS number as defined in Language.php
+ /*static*/ function makeNSUrl( $name, $urlaction='', $namespace=0 ) {
+ $title = Title::makeTitleSafe( $namespace, $name );
+ $this->checkTitle($title, $name);
+ return $title->getLocalURL( $urlaction );
+ }
+
+ /* these return an array with the 'href' and boolean 'exists' */
+ /*static*/ function makeUrlDetails ( $name, $urlaction='' ) {
+ $title = Title::newFromText( $name );
+ $this->checkTitle($title, $name);
+ return array(
+ 'href' => $title->getLocalURL( $urlaction ),
+ 'exists' => $title->getArticleID() != 0?true:false
+ );
+ }
+ /*static*/ function makeTalkUrlDetails ( $name, $urlaction='' ) {
+ $title = Title::newFromText( $name );
+ $title = $title->getTalkPage();
+ $this->checkTitle($title, $name);
+ return array(
+ 'href' => $title->getLocalURL( $urlaction ),
+ 'exists' => $title->getArticleID() != 0?true:false
+ );
+ }
+ /*static*/ function makeArticleUrlDetails ( $name, $urlaction='' ) {
+ $title = Title::newFromText( $name );
+ $title= $title->getSubjectPage();
+ $this->checkTitle($title, $name);
+ return array(
+ 'href' => $title->getLocalURL( $urlaction ),
+ 'exists' => $title->getArticleID() != 0?true:false
+ );
+ }
+ /*static*/ function makeI18nUrlDetails ( $name, $urlaction='' ) {
+ $title = Title::newFromText( wfMsg($name) );
+ $this->checkTitle($title, $name);
+ return array(
+ 'href' => $title->getLocalURL( $urlaction ),
+ 'exists' => $title->getArticleID() != 0?true:false
+ );