/** * This view is sent when $wgFbDisableLogin is true. In this case, the user * must be logged in to Facebook to view the wiki, so we present a single * login button. */ private function exclusiveLoginToFacebookView() { global $wgOut, $wgSitename, $wgUser; $loginFormWidth = 400; // pixels $this->outputHeader(); $html = ' <div id="userloginForm"> <form style="width: ' . $loginFormWidth . 'px;"> <h2>' . wfMsg('userlogin') . '</h2> <p>' . wfMsg('facebook-only-text', $wgSitename) . '<br/><br/></p>' . "\n"; // Compatiblity with MW < 1.18 global $wgVersion; if (version_compare($wgVersion, '1.18', '>=')) { $skin = $this->getSkin(); } else { global $wgUser; $skin = $wgUser->getSkin(); } $html .= '<fb:login-button show-faces="true" width="' . $loginFormWidth . '" max-rows="3" scope="' . FacebookAPI::getPermissions() . '" colorscheme="' . FacebookXFBML::getColorScheme($skin->getSkinName()) . '"></fb:login-button><br/><br/><br/>' . "\n"; // Add a pretty Like box to entice the user to log in $html .= '<fb:like href="' . Title::newMainPage()->getFullURL() . '" send="false" width="' . $loginFormWidth . '" show_faces="true"></fb:like>'; $html .= ' </form> </div>'; $wgOut->addHTML($html); }