r95746 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95745‎ | r95746 | r95747 >
Date:09:42, 30 August 2011
Author:nikerabbit
Status:deferred
Tags:
Comment:
*Use $this->getTitle()
*Fixed a bug where namespace was dropped on submit
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialPageProperty.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialPageProperty.php
@@ -53,7 +53,7 @@
5454 }
5555
5656 $subject = SMWDataValueFactory::newTypeIDValue( '_wpg', $pagename );
57 - $pagename = $subject->isValid() ? $subject->getText() : '';
 57+ $pagename = $subject->isValid() ? $subject->getPrefixedText() : '';
5858 $property = SMWPropertyValue::makeUserProperty( $propname );
5959 $propname = $property->isValid() ? $property->getWikiValue() : '';
6060
@@ -62,6 +62,7 @@
6363 if ( ( $propname == '' ) ) { // no property given, show a message
6464 $html .= wfMsg( 'smw_pp_docu' ) . "\n";
6565 } else { // property given, find and display results
 66+ // FIXME: very ugly, needs i18n
6667 $wgOut->setPagetitle( ( $pagename != '' ? $pagename . ' ':'' ) . $property->getWikiValue() );
6768
6869 // get results (get one more, to see if we have to add a link to more)
@@ -77,7 +78,7 @@
7879 $navigation = Html::element(
7980 'a',
8081 array(
81 - 'href' => SpecialPage::getSafeTitleFor( 'PageProperty' )->getLocalURL( array(
 82+ 'href' => $this->getTitle()->getLocalURL( array(
8283 'offset' => max( 0, $offset - $limit ),
8384 'limit' => $limit,
8485 'type' => $propname,
@@ -100,7 +101,7 @@
101102 $navigation = Html::element(
102103 'a',
103104 array(
104 - 'href' => SpecialPage::getSafeTitleFor( 'PageProperty' )->getLocalURL( array(
 105+ 'href' => $this->getTitle()->getLocalURL( array(
105106 'offset' => ( $offset + $limit ),
106107 'limit' => $limit,
107108 'type' => $propname,
@@ -146,7 +147,7 @@
147148 }
148149
149150 // Display query form
150 - $spectitle = SpecialPage::getTitleFor( 'PageProperty' );
 151+ $spectitle = $this->getTitle();
151152 $html .= '<p>&#160;</p>';
152153 $html .= '<form name="pageproperty" action="' . $spectitle->escapeLocalURL() . '" method="get">' . "\n" .
153154 '<input type="hidden" name="title" value="' . $spectitle->getPrefixedText() . '"/>' ;