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


PHP XenForo_Link::buildSubComponentLink方法代码示例

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


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

示例1: buildLink

 public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
 {
     if ($action == 'categories' && isset($data['categorytitle'])) {
         $data['title'] = $data['categorytitle'];
     }
     return XenForo_Link::buildSubComponentLink($this->_getSubcomponents(), $outputPrefix, $action, $extension, $data);
 }
开发者ID:NixFifty,项目名称:XenForo-SimplePortal,代码行数:7,代码来源:Lpmanage.php

示例2: buildLink

 /**
  * @param $originalPrefix
  * @param $outputPrefix
  * @param $action
  * @param $extension
  * @param $data
  * @param array $extraParams
  * @return false|string
  */
 public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
 {
     $parts = explode('/', $action, 2);
     $subComponentName = strtolower($parts[0]);
     if ($subComponentName === 'photos') {
         if (isset($data['photo_id']) && !isset($data['content_id'])) {
             $data['content_id'] = $data['photo_id'];
         }
         if (isset($data['title']) && $data['title'] == $data['content_id']) {
             $data['title'] = '';
         }
     }
     if ($subComponentName === 'videos') {
         if (isset($data['title']) && $data['title'] == $data['content_id']) {
             $data['title'] = '';
         }
     }
     if ($subComponentName === 'locations' && isset($data['location_url'])) {
         $data['location_url'] = sonnb_XenGallery_Model_Gallery::getTitleForUrl($data['location_url']);
     }
     if ($subComponentName === 'cameras' && isset($data['camera_url'])) {
         $data['camera_url'] = sonnb_XenGallery_Model_Gallery::getTitleForUrl($data['camera_url']);
     }
     $link = XenForo_Link::buildSubComponentLink($this->_subComponents, $outputPrefix, $action, $extension, $data);
     if (!$link) {
         $link = XenForo_Link::buildBasicLinkWithIntegerParam($outputPrefix, $action, $extension, $data, '');
     }
     return $link;
 }
开发者ID:Sywooch,项目名称:forums,代码行数:38,代码来源:XenGallery.php

示例3: buildLink

 /**
  * Method to build a link to the specified page/action with the provided
  * data and params.
  *
  * @see XenForo_Route_BuilderInterface
  */
 public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
 {
     $link = XenForo_Link::buildSubComponentLink($this->_subComponents, $outputPrefix, $action, $extension, $data);
     if (!$link) {
         if ($data && isset($data['resource_title'])) {
             $data['title'] = $data['resource_title'];
         }
         if (isset($extraParams['review']) && is_array($extraParams['review'])) {
             $extraParams['resource_rating_id'] = $extraParams['review']['resource_rating_id'];
             unset($extraParams['review']);
         }
         $link = XenForo_Link::buildBasicLinkWithIntegerParam($outputPrefix, $action, $extension, $data, 'resource_id', 'title');
     }
     return $link;
 }
开发者ID:Sywooch,项目名称:forums,代码行数:21,代码来源:Resources.php

示例4: buildLink

 public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
 {
     $csrf = false;
     if (isset($extraParams['t'])) {
         $csrf = true;
         unset($extraParams['t']);
     }
     // special params to banning
     if (!empty($data[Nobita_Teams_Banning::BANNING_ID_KEY])) {
         $banData = Nobita_Teams_Banning::getBanningParamsFromData($data);
         if ($banData) {
             $extraParams['team_id'] = $banData[0];
             $extraParams['type'] = $banData[1];
             $extraParams['user_id'] = $banData[2];
         }
         unset($data[Nobita_Teams_Banning::BANNING_ID_KEY]);
     }
     // comment extraData
     if (!empty($data['comment_type']) && !empty($data['team_id'])) {
         $extraParams['comment_type'] = $data['comment_type'];
         $extraParams['team_id'] = $data['team_id'];
         $extraParams[$data['comment_type'] . '_id'] = $data['post_id'];
     }
     if ($csrf) {
         // set csrf token into last params
         $extraParams['t'] = XenForo_Visitor::getInstance()->csrf_token_page;
     }
     $link = XenForo_Link::buildSubComponentLink($this->_subComponents, $outputPrefix, $action, $extension, $data);
     if (!$link) {
         $action = XenForo_Link::getPageNumberAsAction($action, $extraParams);
         if (is_array($data) && !empty($data['custom_url'])) {
             $link = XenForo_Link::buildBasicLinkWithStringParam($outputPrefix, $action, $extension, $data, 'custom_url');
         } else {
             if ($data && isset($data['team_title'])) {
                 $data['title'] = $data['team_title'];
             }
             $link = XenForo_Link::buildBasicLinkWithIntegerParam($outputPrefix, $action, $extension, $data, 'team_id', 'title');
         }
     }
     return $link;
 }
开发者ID:Sywooch,项目名称:forums,代码行数:41,代码来源:Teams.php


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