"Reedy" changed the status of MediaWiki.r106128 to "fixme" and commented it.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/106128#c27766

Old Status: ok
> New Status: fixme

Commit summary for MediaWiki.r106128:

create Mobile Frontend Template class and switch views to inherit from this 
class

Reedy's comment:

In your code you're using

<source lang="php">
$noticeHtml = ( !empty( $noticeHtml ) ) ? $noticeHtml : '';
</source>

But $noticeHtml is never defined anywhere. Presumably it used to be when it was 
pulling in the view files

FIXME comments left in r106342



As an aside, it seems there's quite a lot of code duplication.. I'm guessing 
that'll be cleaned up at a later date

<source lang="php">
        /**
         * @return string
         */
        private function renderOptInMobileSiteXHTML() {
                wfProfileIn( __METHOD__ );
                if ( $this->contentFormat == 'XHTML' ) {
                        $this->getMsg();
                        $searchTemplate = $this->getSearchTemplate();
                        $searchWebkitHtml = $searchTemplate->getHTML();
                        $footerTemplate = $this->getFooterTemplate();
                        $footerHtml = $footerTemplate->getHTML();
                        $optInTemplate = new OptInTemplate();
                        $options = array(
                                                        'explainOptIn' => 
self::$messages['mobile-frontend-opt-in-explain'],
                                                        'optInMessage' => 
self::$messages['mobile-frontend-opt-in-message'],
                                                        'yesButton' => 
self::$messages['mobile-frontend-opt-in-yes-button'],
                                                        'noButton' => 
self::$messages['mobile-frontend-opt-in-no-button'],
                                                        'formAction' => 
wfExpandUrl( Title::newMainPage()->getFullURL(), PROTO_CURRENT ),
                                                        );
                        $optInTemplate->setByArray( $options );
                        $optInHtml = $optInTemplate->getHTML();
                        $contentHtml = $optInHtml;
                        $noticeHtml = ( !empty( $noticeHtml ) ) ? $noticeHtml : 
''; // FIXME: $noticeHtml is never already set
                        $applicationTemplate = $this->getApplicationTemplate();
                        $options = array(
                                                        'noticeHtml' => 
$noticeHtml,
                                                        'htmlTitle' => 
self::$messages['mobile-frontend-opt-in-title'],
                                                        'searchWebkitHtml' => 
$searchWebkitHtml,
                                                        'contentHtml' => 
$contentHtml,
                                                        'footerHtml' => 
$footerHtml,
                                                        );
                        $applicationTemplate->setByArray( $options );
                        $applicationHtml = $applicationTemplate->getHTML();
                        wfProfileOut( __METHOD__ );
                        return $applicationHtml;
                }
                wfProfileOut( __METHOD__ );
                return '';
        }

        /**
         * @return string
         */
        private function renderOptOutMobileSiteXHTML() {
                wfProfileIn( __METHOD__ );
                if ( $this->contentFormat == 'XHTML' ) {
                        $this->getMsg();
                        $searchTemplate = $this->getSearchTemplate();
                        $searchWebkitHtml = $searchTemplate->getHTML();
                        $footerTemplate = $this->getFooterTemplate();
                        $footerHtml = $footerTemplate->getHTML();
                        $optOutTemplate = new OptOutTemplate();
                        $options = array(
                                                        'explainOptOut' => 
self::$messages['mobile-frontend-opt-out-explain'],
                                                        'optOutMessage' => 
self::$messages['mobile-frontend-opt-out-message'],
                                                        'yesButton' => 
self::$messages['mobile-frontend-opt-out-yes-button'],
                                                        'noButton' => 
self::$messages['mobile-frontend-opt-out-no-button'],
                                                        'formAction' => 
wfExpandUrl( Title::newMainPage()->getFullURL(), PROTO_CURRENT ),
                                                        );
                        $optOutTemplate->setByArray( $options );
                        $optOutHtml = $optOutTemplate->getHTML();
                        $contentHtml = $optOutHtml;
                        $noticeHtml = ( !empty( $noticeHtml ) ) ? $noticeHtml : 
''; // FIXME: $noticeHtml is never already set
                        $applicationTemplate = $this->getApplicationTemplate();
                        $options = array(
                                                        'noticeHtml' => 
$noticeHtml,
                                                        'htmlTitle' => 
self::$messages['mobile-frontend-opt-out-title'],
                                                        'searchWebkitHtml' => 
$searchWebkitHtml,
                                                        'contentHtml' => 
$contentHtml,
                                                        'footerHtml' => 
$footerHtml,
                                                        );
                        $applicationTemplate->setByArray( $options );
                        $applicationHtml = $applicationTemplate->getHTML();
                        wfProfileOut( __METHOD__ );
                        return $applicationHtml;
                }
                wfProfileOut( __METHOD__ );
                return '';
        }
</source>

_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to