当前位置: 首页>>代码示例>>PHP>>正文


PHP SkinTemplate::getRequest方法代码示例

本文整理汇总了PHP中SkinTemplate::getRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP SkinTemplate::getRequest方法的具体用法?PHP SkinTemplate::getRequest怎么用?PHP SkinTemplate::getRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SkinTemplate的用法示例。


在下文中一共展示了SkinTemplate::getRequest方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: onSkinTemplateOutputPageBeforeExec

 /**
  * SkinTemplateOutputPageBeforeExec hook handler
  * @see https://www.mediawiki.org/wiki/Manual:Hooks/SkinTemplateOutputPageBeforeExec
  *
  * Adds a link to view the current page in 'mobile view' to the desktop footer.
  *
  * @param SkinTemplate $skin
  * @param QuickTemplate $tpl
  * @return bool
  */
 public static function onSkinTemplateOutputPageBeforeExec(&$skin, &$tpl)
 {
     $title = $skin->getTitle();
     $context = MobileContext::singleton();
     if (!$context->isBlacklistedPage()) {
         $footerlinks = $tpl->data['footerlinks'];
         $args = $skin->getRequest()->getQueryValues();
         // avoid title being set twice
         unset($args['title']);
         unset($args['useformat']);
         $args['mobileaction'] = 'toggle_view_mobile';
         $mobileViewUrl = $title->getFullURL($args);
         $mobileViewUrl = MobileContext::singleton()->getMobileUrl($mobileViewUrl);
         $link = Html::element('a', array('href' => $mobileViewUrl, 'class' => 'noprint stopMobileRedirectToggle'), wfMessage('mobile-frontend-view')->text());
         $tpl->set('mobileview', $link);
         $footerlinks['places'][] = 'mobileview';
         $tpl->set('footerlinks', $footerlinks);
     }
     return true;
 }
开发者ID:GoProjectOwner,项目名称:mediawiki-extensions-MobileFrontend,代码行数:30,代码来源:MobileFrontend.hooks.php

示例2: onSkinTemplateOutputPageBeforeExec

 /**
  * Modifies the logo on runtime
  * @param SkinTemplate $sktemplate
  * @param BaseTemplate $tpl
  * @return boolean Always true to keep hook running
  */
 public static function onSkinTemplateOutputPageBeforeExec(&$sktemplate, &$tpl)
 {
     $sFlexiskin = $sktemplate->getRequest()->getVal('flexiskin');
     if ($sFlexiskin || BsConfig::get('MW::Flexiskin::Active') != '') {
         $sId = $sFlexiskin != '' ? $sFlexiskin : BsConfig::get('MW::Flexiskin::Active');
         if ($sId != "default") {
             $bPreview = $sktemplate->getRequest()->getVal('preview', false);
             $api = new ApiMain(new DerivativeRequest($sktemplate->getRequest(), array('action' => 'flexiskin', 'type' => 'get', 'mode' => 'config', 'id' => $sId, 'preview' => $bPreview), false), true);
             $api->execute();
             $aResult = $api->getResultData();
             $oResult = FormatJson::decode($aResult['flexiskin']);
             if ($oResult->success === false) {
                 return true;
             }
             $aConfig = FormatJson::decode($oResult->config);
             $sLogo = BsConfig::get("MW::Flexiskin::Logo");
             if ($sLogo == "") {
                 return true;
             }
             $sPath = BS_DATA_PATH . "/flexiskin/" . $sId . "/images/";
             $tpl->set('logopath', $sPath . $sLogo);
             return true;
         }
         return true;
     }
     return true;
 }
开发者ID:hfroese,项目名称:mediawiki-extensions-BlueSpiceExtensions,代码行数:33,代码来源:Flexiskin.class.php

示例3: addApprovalButton

 public static function addApprovalButton(SkinTemplate &$sktemplate, array &$links)
 {
     $title = $sktemplate->getRelevantTitle();
     $user = $sktemplate->getUser();
     if ($sktemplate->isRevisionCurrent() && ApprovedRevs::isAssignedToProject($title) && ApprovedRevs::userCanApprovePage($title, $user) && !ApprovedRevs::isLatestRevisionApproved($title)) {
         /* This is somewhat a replication of code from SkinTemplate::buildContentNavigationUrls() */
         $onPage = $title->equals($sktemplate->getTitle());
         $request = $sktemplate->getRequest();
         $action = $request->getVal('action', 'view');
         /* /Code Replication */
         $isInAction = $onPage && $action == 'approveprojectpage';
         $links['actions']['approveprojectpage'] = array('text' => 'אישור הדף', 'href' => $title->getLocalURL('action=approveprojectpage'), 'class' => $isInAction ? 'selected' : '');
     }
     return true;
 }
开发者ID:kolzchut,项目名称:mediawiki-extensions-WRApprovedRevs,代码行数:15,代码来源:ApprovedRevs.hooks.php

示例4: displayTabs

 /**
  * Display the tabs for a course or institution.
  *
  * @since 0.1
  *
  * @param SkinTemplate $sktemplate
  * @param array $links
  * @param Title $title
  */
 protected static function displayTabs(SkinTemplate &$sktemplate, array &$links, Title $title)
 {
     $classes = array(EP_NS_INSTITUTION => 'EPOrg', EP_NS_COURSE => 'EPCourse');
     $exists = null;
     if (array_key_exists($title->getNamespace(), $classes)) {
         $links['views'] = array();
         $links['actions'] = array();
         $user = $sktemplate->getUser();
         $class = $classes[$title->getNamespace()];
         $exists = $class::hasIdentifier($title->getText());
         $type = $sktemplate->getRequest()->getText('action');
         $isSpecial = $sktemplate->getTitle()->isSpecialPage();
         if ($exists) {
             $links['views']['view'] = array('class' => !$isSpecial && $type === '' ? 'selected' : false, 'text' => wfMsg('ep-tab-view'), 'href' => $title->getLocalUrl());
         }
         if ($user->isAllowed($class::getEditRight())) {
             $links['views']['edit'] = array('class' => $type === 'edit' ? 'selected' : false, 'text' => wfMsg($exists ? 'ep-tab-edit' : 'ep-tab-create'), 'href' => $title->getLocalUrl(array('action' => 'edit')));
         }
         if ($exists) {
             $links['views']['history'] = array('class' => $type === 'history' ? 'selected' : false, 'text' => wfMsg('ep-tab-history'), 'href' => $title->getLocalUrl(array('action' => 'history')));
             if ($title->getNamespace() === EP_NS_COURSE) {
                 if ($user->isAllowed('ep-enroll')) {
                     $student = EPStudent::newFromUser($user);
                     if ($student === false || !$student->hasCourse(array('name' => $title->getText()))) {
                         $links['views']['enroll'] = array('class' => $isSpecial ? 'selected' : false, 'text' => wfMsg('ep-tab-enroll'), 'href' => SpecialPage::getTitleFor('Enroll', $title->getText())->getLocalURL());
                     }
                 }
             }
         }
     }
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:40,代码来源:EducationProgram.hooks.php


注:本文中的SkinTemplate::getRequest方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。