コード例 #1
0
 /**
  * The main function of the SpecialPage.  Adds the content for the page
  * to the wgOut global.
  */
 function execute($par)
 {
     global $wgOut, $wgHooks, $wgDevelEnvironment, $wgUser;
     if (!$wgUser->isAllowed('devboxpanel')) {
         throw new PermissionsError('devboxpanel');
     }
     $wgHooks['BeforePageDisplay'][] = 'devBoxPanelAdditionalScripts';
     $wgOut->setPageTitle(wfMsg("devbox-title"));
     $wgOut->setRobotpolicy('noindex,nofollow');
     $wgOut->setArticleRelated(false);
     if ($wgDevelEnvironment) {
         if (isset($_REQUEST['switch'])) {
             svnHandleSwitch();
         }
         if (isset($_REQUEST['update'])) {
             svnHandleUpdate();
         }
         $tmpl = new EasyTemplate(dirname(__FILE__) . "/templates/");
         $tmpl->set_vars(array("svnToolHtml" => getHtmlForSvnTool(), "dbComparisonHtml" => getHtmlForDatabaseComparisonTool(), "infoHtml" => getHtmlForInfo(), "footer" => wfMsg("devbox-footer", __FILE__)));
         $wgOut->addHTML($tmpl->render('special-devboxpanel'));
     } else {
         $wgOut->addHTML(wfMsg('devbox-panel-not-enabled'));
     }
 }
コード例 #2
0
 /**
  * The main function of the SpecialPage.  Adds the content for the page
  * to the wgOut global.
  */
 function execute($par)
 {
     global $wgOut, $wgExtensionsPath, $wgDevelEnvironment, $wgUser;
     if (!$wgUser->isAllowed('devboxpanel')) {
         throw new PermissionsError('devboxpanel');
     }
     $wgOut->addStyle("{$wgExtensionsPath}/wikia/Development/SpecialDevBoxPanel/DevBoxPanel.css");
     $wgOut->addScript("<script type='text/javascript' src='{$wgExtensionsPath}/wikia/Development/SpecialDevBoxPanel/DevBoxPanel.js'></script>");
     $wgOut->setPageTitle(wfMsg("devbox-title"));
     $wgOut->setRobotpolicy('noindex,nofollow');
     $wgOut->setArticleRelated(false);
     if ($wgDevelEnvironment) {
         $tmpl = new EasyTemplate(dirname(__FILE__) . "/templates/");
         $tmpl->set_vars(array("dbComparisonHtml" => getHtmlForDatabaseComparisonTool(), "infoHtml" => getHtmlForInfo(), "footer" => wfMsg("devbox-footer", __FILE__)));
         $wgOut->addHTML($tmpl->render('special-devboxpanel'));
     } else {
         $wgOut->addHTML(wfMsg('devbox-panel-not-enabled'));
     }
 }