本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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;
}