本文整理汇总了PHP中XenForo_Link::buildBasicLinkWithIntegerParam方法的典型用法代码示例。如果您正苦于以下问题:PHP XenForo_Link::buildBasicLinkWithIntegerParam方法的具体用法?PHP XenForo_Link::buildBasicLinkWithIntegerParam怎么用?PHP XenForo_Link::buildBasicLinkWithIntegerParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XenForo_Link
的用法示例。
在下文中一共展示了XenForo_Link::buildBasicLinkWithIntegerParam方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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['temp_hash']) && empty($data['content_id'])) {
$extraParams['temp_hash'] = $data['temp_hash'];
}
return XenForo_Link::buildBasicLinkWithIntegerParam($outputPrefix, $action, $extension, $data, 'attachment_id', 'filename');
}
示例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
/**
* 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 (preg_match('#^auto/(.*)$#i', $action, $match)) {
return XenForo_Link::buildBasicLinkWithIntegerParam("{$outputPrefix}/auto", $match[1], $extension, $data, 'auto_warning_id');
}
return parent::buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, $extraParams);
}
示例4: 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;
}
示例5: 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);
}
}
示例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)
{
if (is_numeric($data)) {
$data = array('field_attachment_id' => $data);
}
return XenForo_Link::buildBasicLinkWithIntegerParam($outputPrefix, $action, $extension, $data, 'field_attachment_id');
}
示例7: 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['ip_id'])) {
$extraParams['ip_id'] = $data['ip_id'];
}
return XenForo_Link::buildBasicLinkWithIntegerParam($outputPrefix, $action, $extension, $data, 'user_id', 'username');
}
示例8: 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 (preg_match('#^action/(.*)$#i', $action, $match)) {
return XenForo_Link::buildBasicLinkWithIntegerParam("{$outputPrefix}/action", $match[1], $extension, $data, 'warning_action_id');
} else {
return XenForo_Link::buildBasicLinkWithIntegerParam($outputPrefix, $action, $extension, $data, 'warning_definition_id', 'title');
}
}
示例9: buildLink
public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
{
if (is_array($data)) {
return XenForo_Link::buildBasicLinkWithIntegerParam($outputPrefix, $action, $extension, $data, 'subscription_id');
} else {
return XenForo_Link::buildBasicLink($outputPrefix, $action, $extension);
}
}
示例10: 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)
{
// 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');
}
示例11: buildLink
public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
{
if (is_null($this->_getKey())) {
return null;
//return XenForo_Link::buildLink($action); // TODO: test this?
}
return \XenForo_Link::buildBasicLinkWithIntegerParam($outputPrefix, $action, $extension, $data, $this->_getKey(), $this->_title);
}
示例12: buildLink
public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
{
if ($action === self::PREFIX_COMMENTS and isset($extraParams[self::PARAM_COMMENT_ID])) {
$action .= sprintf('/%d', $extraParams[self::PARAM_COMMENT_ID]);
unset($extraParams[self::PARAM_COMMENT_ID]);
}
return XenForo_Link::buildBasicLinkWithIntegerParam($outputPrefix, $action, $extension, $data, 'profile_post_id');
}
示例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)
{
if (isset($extraParams['page'])) {
if (strval($extraParams['page']) !== XenForo_Application::$integerSentinel && $extraParams['page'] <= 1) {
unset($extraParams['page']);
}
}
return XenForo_Link::buildBasicLinkWithIntegerParam($outputPrefix, $action, $extension, $data, 'user_id', 'username');
}
示例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)
{
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');
}
}
示例15: 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)
{
/* @var $classModel ThemeHouse_Objects_Model_Class */
$classModel = XenForo_Model::create('ThemeHouse_Objects_Model_Class');
$classes = $classModel->getAllClasses();
$classId = str_replace("-", "_", $originalPrefix);
if (array_key_exists($classId, $classes)) {
return XenForo_Link::buildBasicLinkWithIntegerParam($outputPrefix, $action, $extension, $data, $classId . '_id', 'title');
}
return XenForo_Link::buildBasicLinkWithIntegerParam($outputPrefix, $action, $extension, $data, 'object_id', 'title');
}