From: <ro...@us...> - 2012-02-13 09:52:31
|
Revision: 64 http://wm-incubator.svn.sourceforge.net/wm-incubator/?rev=64&view=rev Author: robin-p Date: 2012-02-13 09:52:20 +0000 (Mon, 13 Feb 2012) Log Message: ----------- Modified Paths: -------------- trunk/IncubatorTest.php trunk/InfoPage.css trunk/InfoPage.php trunk/WikimediaIncubator.php Modified: trunk/IncubatorTest.php =================================================================== --- trunk/IncubatorTest.php 2012-02-09 20:31:51 UTC (rev 63) +++ trunk/IncubatorTest.php 2012-02-13 09:52:20 UTC (rev 64) @@ -66,10 +66,9 @@ array_key_exists( $alldata[$wmincPref.'-project'], $wmincProjects ) && !$input ) { return Xml::element( 'span', array( 'class' => 'error' ), - wfMessage( 'wminc-prefinfo-error' )->text() ); - } else { - return true; + wfMessage( 'wminc-prefinfo-error' )->plain() ); } + return true; } /** @@ -374,7 +373,7 @@ global $wgUser; if ( $wgUser->isAllowed( 'viewuserlang' ) ) { $user = $nt->getText(); - $links[] = $wgUser->getSkin()->link( + $links[] = Linker::linkKnown( SpecialPage::getTitleFor( 'ViewUserLang', $user ), wfMessage( 'wminc-viewuserlang' )->escaped() ); @@ -566,7 +565,7 @@ # The edit page was reached via a red link. # Redirect to the article page and let them click the edit tab if # they really want to create this info page. - $wgOut->redirect( $title->getFullUrl() ); + #$wgOut->redirect( $title->getFullUrl() ); } # Prefill when &action=edit, but not for sister projects if( !array_key_exists( $prefix['project'], $wmincSisterProjects ) ) { @@ -635,6 +634,22 @@ } /** + * Valid Wx/xyz info pages should be considered as existing pages + * Note: TitleIsKnown hook exists since 1.20 + * @param $title Title + * @param $isKnown + * @return Boolean + */ + public static function onTitleIsKnown( $obj, &$isKnown ) { + if( $obj->getNamespace() != NS_MAIN ) { + return true; # not for other namespaces + } + $isValidInfoPage = self::validatePrefix( $obj->getText(), /* only info page */ true ); + $isKnown = $isValidInfoPage ? true : null; + return true; + } + + /** * Whether we should use the feature of custom logos per project * @param $title Title object * @return false or Array from analyzePrefix() Modified: trunk/InfoPage.css =================================================================== --- trunk/InfoPage.css 2012-02-09 20:31:51 UTC (rev 63) +++ trunk/InfoPage.css 2012-02-13 09:52:20 UTC (rev 64) @@ -55,9 +55,6 @@ padding: 0; line-height: 1em; } -#ca-nstab-main a { - color: black; -} span.subpages { display: none !important; } \ No newline at end of file Modified: trunk/InfoPage.php =================================================================== --- trunk/InfoPage.php 2012-02-09 20:31:51 UTC (rev 63) +++ trunk/InfoPage.php 2012-02-13 09:52:20 UTC (rev 64) @@ -178,7 +178,7 @@ if( $this->mThisLangData['type'] != 'invalid' ) { $gotoLink = Linker::link( IncubatorTest::getMainPage( $this->mLangCode, $this->mPrefix ), - wfMessage( 'wminc-infopage-enter' )->plain() ); + wfMessage( 'wminc-infopage-enter' )->escaped() ); $gotoMainPage = Html::rawElement( 'span', array( 'class' => 'wminc-infopage-entertest' ), $wgLang->getArrow() . ' ' . ( $this->mIsSister ? $portalLink : $gotoLink ) ); @@ -186,7 +186,7 @@ $subdomain = IncubatorTest::getSubdomain( $this->mLangCode, $this->mProjectCode ); $subdomainLink = IncubatorTest::makeExternalLinkText( $subdomain, true ); $content = Html::rawElement( 'div', array( 'class' => 'wminc-infopage-status' ), - wfMessage( 'wminc-infopage-status-' . $substatus, $subdomainLink, $portalLink )->parseAsBlock() ); + wfMessage( 'wminc-infopage-status-' . $substatus )->rawParams( $subdomainLink, $portalLink )->parseAsBlock() ); if( $this->mSubStatus != 'approved' && $this->mThisLangData['type'] != 'invalid' ) { $content .= Html::element( 'div', array( 'class' => 'wminc-infopage-contribute' ), @@ -222,7 +222,7 @@ } $content = Html::rawElement( 'div', array( 'class' => 'wminc-infopage-status' ), - wfMessage( 'wminc-infopage-status-' . $this->mSubStatus, $subdomainLink )->parseAsBlock() + wfMessage( 'wminc-infopage-status-' . $this->mSubStatus )->rawParams( $subdomainLink )->parseAsBlock() ) . Html::rawElement( 'ul', array( 'class' => 'wminc-infopage-options' ), Html::rawElement( 'li', null, wfMessage( 'wminc-infopage-option-sisterprojects-other' )->parseAsBlock() . $this->listOtherProjects() ) . Modified: trunk/WikimediaIncubator.php =================================================================== --- trunk/WikimediaIncubator.php 2012-02-09 20:31:51 UTC (rev 63) +++ trunk/WikimediaIncubator.php 2012-02-13 09:52:20 UTC (rev 64) @@ -128,6 +128,7 @@ $wgHooks['ShowMissingArticle'][] = 'IncubatorTest::onShowMissingArticle'; $wgHooks['EditFormPreloadText'][] = 'IncubatorTest::onEditFormPreloadText'; $wgHooks['ArticleFromTitle'][] = 'IncubatorTest::onArticleFromTitle'; +$wgHooks['TitleIsKnown'][] = 'IncubatorTest::onTitleIsKnown'; $wgResourceModules['WikimediaIncubator.InfoPage'] = array( 'styles' => 'InfoPage.css', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |