本文整理汇总了PHP中XenForo_Link::buildBasicLinkWithStringParam方法的典型用法代码示例。如果您正苦于以下问题:PHP XenForo_Link::buildBasicLinkWithStringParam方法的具体用法?PHP XenForo_Link::buildBasicLinkWithStringParam怎么用?PHP XenForo_Link::buildBasicLinkWithStringParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XenForo_Link
的用法示例。
在下文中一共展示了XenForo_Link::buildBasicLinkWithStringParam方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildLink
public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
{
$components = explode('/', $action);
$subPrefix = strtolower(array_shift($components));
$intParams = '';
$strParams = '';
$title = '';
$slice = false;
switch ($subPrefix) {
case 'special':
$subPrefix = strtolower(array_shift($components));
if ($subPrefix == 'edit-template' || $subPrefix == 'delete-template') {
$outputPrefix .= '/special';
$strParams = 'template_name';
}
$slice = true;
break;
case 'archive':
$intParams = 'history_id';
$slice = true;
break;
default:
$strParams = 'page_slug';
}
if ($slice) {
$outputPrefix .= '/' . $subPrefix;
$action = implode('/', $components);
}
$action = XenForo_Link::getPageNumberAsAction($action, $extraParams);
if ($strParams) {
return XenForo_Link::buildBasicLinkWithStringParam($outputPrefix, $action, $extension, $data, $strParams);
} else {
return XenForo_Link::buildBasicLinkWithIntegerParam($outputPrefix, $action, $extension, $data, $intParams, $title);
}
}
示例2: buildLink
public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
{
$actions = explode('/', $action);
switch ($actions[0]) {
case 'top-owned-games':
$intParams = 'owned_id';
$strParams = '';
break;
case 'top-played-games':
$intParams = 'played_id';
$strParams = '';
break;
case 'top-recently-played-games':
$intParams = 'recent_id';
$strParams = '';
break;
default:
$intParams = '';
$strParams = '';
break;
}
$action = XenForo_Link::getPageNumberAsAction($action, $extraParams);
if ($intParams) {
return XenForo_Link::buildBasicLinkWithIntegerParam($outputPrefix, $action, $extension, $data, $intParams, $strParams);
} else {
return XenForo_Link::buildBasicLinkWithStringParam($outputPrefix, $action, $extension, $data, $strParams);
}
}
示例3: buildLink
public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
{
$components = explode('/', $action);
$subPrefix = strtolower(array_shift($components));
$strParams = '';
$title = '';
$slice = false;
switch ($subPrefix) {
case 'options':
$strParams = 'option_id';
$slice = true;
break;
case 'layouts':
$strParams = 'layout_id';
$slice = true;
break;
case 'blocks':
$strParams = 'block_id';
$slice = true;
break;
case 'categories':
$strParams = 'category_slug';
$slice = true;
break;
}
if ($slice) {
$outputPrefix .= '/' . $subPrefix;
$action = implode('/', $components);
}
$action = XenForo_Link::getPageNumberAsAction($action, $extraParams);
return XenForo_Link::buildBasicLinkWithStringParam($outputPrefix, $action, $extension, $data, $strParams);
}
示例4: buildLink
public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
{
if (is_array($data)) {
return XenForo_Link::buildBasicLinkWithStringParam($outputPrefix, $action, $extension, $data, 'client_id');
} else {
return XenForo_Link::buildBasicLink($outputPrefix, $action, $extension);
}
}
示例5: 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)
{
if (is_array($data) && !empty($data['url_portion'])) {
return XenForo_Link::buildBasicLinkWithStringParam($outputPrefix, $action, $extension, $data, 'url_portion');
} else {
if (isset($data['social_forum_title'])) {
$data['title'] = $data['social_forum_title'];
}
return XenForo_Link::buildBasicLinkWithIntegerParam($outputPrefix, $action, $extension, $data, 'social_forum_id', 'title');
}
}
示例6: 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)
{
$action = XenForo_Link::getPageNumberAsAction($action, $extraParams);
if (is_array($data) && !empty($data['node_name'])) {
return XenForo_Link::buildBasicLinkWithStringParam($outputPrefix, $action, $extension, $data, 'node_name');
} else {
// for situations such as an array with thread and node info
if (isset($data['node_title'])) {
$data['title'] = $data['node_title'];
}
return XenForo_Link::buildBasicLinkWithIntegerParam($outputPrefix, $action, $extension, $data, 'node_id', 'title');
}
}
示例7: buildLink
public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
{
$action = XenForo_Link::getPageNumberAsAction($action, $extraParams);
if (!empty($data['node_id']) and $data['node_id'] == WidgetFramework_Option::get('indexNodeId')) {
if (XenForo_Application::$versionId > 1020000 and !empty($action) and preg_match('#^page-(\\d+)$#i', $action)) {
// support http://domain.com/xenforo/page-2/ uris
// XenForo 1.2.0 and up only
return WidgetFramework_Helper_Index::buildBasicLink($action, '', $extension);
} elseif (empty($action)) {
return new XenForo_Link(XenForo_Link::buildPublicLink('widget-page-index', null, $extraParams));
}
}
return XenForo_Link::buildBasicLinkWithStringParam($outputPrefix, $action, $extension, $data, 'node_name');
}
示例8: buildLink
/**
*
* @see XenForo_Route_PrefixAdmin_AddOns::buildLink()
*/
public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
{
$parts = explode('/', $action, 2);
if (count($parts) > 1) {
if ($parts[0] == 'languages') {
if (empty($data['addon_id'])) {
$link = $outputPrefix . '/';
} else {
$link = XenForo_Link::buildBasicLinkWithStringParam($outputPrefix, '', $extension, $data, 'addon_id');
}
$link = $link . XenForo_Link::buildBasicLinkWithIntegerParam('languages', $parts[1], $extension, $extraParams, 'language_id', 'title');
unset($extraParams['language_id'], $extraParams['title']);
return $link;
}
}
return parent::buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, $extraParams);
}
示例9: 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)
{
if (!empty($data['chapter'])) {
if (!empty($data['verse'])) {
if (!empty($data['verse_to'])) {
$action = $data['chapter'] . ':' . $data['verse'] . '-' . $data['verse_to'] . '/' . $action;
} else {
$action = $data['chapter'] . ':' . $data['verse'] . '/' . $action;
}
} else {
$action = $data['chapter'] . '/' . $action;
}
}
$xenOptions = XenForo_Application::get('options');
if (isset($extraParams['bible_id']) && $extraParams['bible_id'] == $xenOptions->th_bible_defaultBible) {
unset($extraParams['bible_id']);
}
return XenForo_Link::buildBasicLinkWithStringParam($outputPrefix, $action, $extension, $data, 'url_portion');
}
示例10: 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;
}
示例11: buildLink
public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
{
if (!empty($data)) {
if (!is_array($data)) {
$data = array('tag_text' => $data);
}
if (!empty($data['tag_text'])) {
if (Tinhte_XenTag_Option::get('linkFormat') == Tinhte_XenTag_Option::LINK_FORMAT_BEAUTIFUL) {
// try to use the beautiful format
if (self::_isSafeText($data['tag_text'])) {
$encodedData = array('tag_text' => urlencode($data['tag_text']));
$action = XenForo_Link::getPageNumberAsAction($action, $extraParams);
return XenForo_Link::buildBasicLinkWithStringParam($outputPrefix, $action, $extension, $encodedData, 'tag_text');
}
}
// use the ugly format
$extraParams[Tinhte_XenTag_Constants::URI_PARAM_TAG_TEXT] = $data['tag_text'];
return XenForo_Link::buildBasicLink($outputPrefix, $action, $extension);
}
}
return XenForo_Link::buildBasicLink($outputPrefix, $action, $extension);
}
示例12: 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)
{
return XenForo_Link::buildBasicLinkWithStringParam($outputPrefix, $action, $extension, $data, 'page_name');
}
示例13: 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)
{
$action = XenForo_Link::getPageNumberAsAction($action, $extraParams);
return XenForo_Link::buildBasicLinkWithStringParam($outputPrefix, $action, $extension, $data, 'tag_url');
}
示例14: 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)
{
return XenForo_Link::buildBasicLinkWithStringParam($outputPrefix, $action, $extension, $data, 'handler_type_id', 'title');
}
示例15: buildLink
public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
{
$components = explode('/', $action);
$subPrefix = strtolower(array_shift($components));
$intParams = '';
$strParams = '';
$title = '';
$slice = false;
switch ($subPrefix) {
case 'monthly':
$strParams = 'strParam';
$title = 'month';
$slice = true;
$data['strParam'] = $data['month'] . '.' . $data['year'];
break;
case 'weekly':
$strParams = 'strParam';
$title = 'week';
$slice = true;
$data['strParam'] = $data['week'] . '.' . $data['wYear'];
break;
case 'daily':
$strParams = 'strParam';
$title = 'daynum';
$slice = true;
$data['strParam'] = $data['daynum'] . '.' . $data['year'];
break;
case 'birthdays':
$strParams = 'strParam';
$title = 'day';
$slice = true;
$data['strParam'] = $data['day'] . '.' . $data['month'];
break;
default:
$intParams = 'event_id';
$title = 'event_title';
}
if ($slice) {
$outputPrefix .= '/' . $subPrefix;
$action = implode('/', $components);
}
$action = XenForo_Link::getPageNumberAsAction($action, $extraParams);
if ($strParams) {
return XenForo_Link::buildBasicLinkWithStringParam($outputPrefix, $action, $extension, $data, $strParams);
} else {
return XenForo_Link::buildBasicLinkWithIntegerParam($outputPrefix, $action, $extension, $data, $intParams, $title);
}
}