protected function getDefaultHeaderVars()
 {
     global $wgRequest, $wgLanguageCode, $wgSSLsite, $wgUser;
     $t = $this->t;
     $articleName = $t->getText();
     $action = $wgRequest->getVal('action', 'view');
     $deviceOpts = $this->getDevice();
     $pageExists = $t->exists();
     $randomUrl = '/' . wfMsg('special-randomizer');
     $isMainPage = $articleName == wfMsg('mainpage');
     $titleBar = $isMainPage ? wfMsg('mobile-mainpage-title') : wfMsg('pagetitle', $articleName);
     $canonicalUrl = 'http://' . MobileWikihow::getNonMobileSite() . '/' . $t->getPartialURL();
     $js = $wgLanguageCode == 'en' && class_exists('BounceTimeLogger') ? array('mjq', 'stu') : array('mjq');
     if ($wgUser->getID() > 0) {
         $login_link = '/Special:Mypage';
         $login_text = wfMsg('me');
     } else {
         $login_link = '/Special:Userlogin';
         $login_text = wfMsg('log_in');
     }
     if (SSL_LOGIN_DOMAIN && !$wgSSLsite) {
         $login_link = 'https://' . SSL_LOGIN_DOMAIN . $login_link;
     }
     $headerVars = array('isMainPage' => $isMainPage, 'title' => $titleBar, 'css' => $this->cssScriptsCombine, 'js' => $js, 'randomUrl' => $randomUrl, 'deviceOpts' => $deviceOpts, 'canonicalUrl' => $canonicalUrl, 'pageExists' => $pageExists, 'jsglobals' => Skin::makeGlobalVariablesScript(array('skinname' => 'mobile'), $t), 'lang' => $wgLanguageCode, 'loginlink' => $login_link, 'logintext' => $login_text);
     return $headerVars;
 }
Exemplo n.º 2
0
 protected function generateFooter()
 {
     global $wgUser;
     if ($wgUser->getID() > 0) {
         $tipsUrl = '/Special:TipsPatrol';
     } else {
         $tipsUrl = '/Special:Userlogin?returnto=Special:TipsPatrol';
     }
     $footerVars = $this->getDefaultFooterVars();
     $t = $this->t;
     $partialUrl = $t->getPartialURL();
     $footerVars['redirMainBase'] = $footerVars['redirMainUrl'];
     $footerVars['redirMainUrl'] = $footerVars['redirMainUrl'] . urlencode($partialUrl);
     $baseMainUrl = 'http://' . MobileWikihow::getNonMobileSite() . '/';
     $footerVars['editUrl'] = $baseMainUrl . 'index.php?action=edit&title=' . $partialUrl;
     $footerVars['tipsUrl'] = $tipsUrl;
     return EasyTemplate::html('footer.tmpl.php', $footerVars);
 }