Пример #1
0
 /**
  * @see XenForo_Route_BuilderInterface::buildLink()
  * @param $originalPrefix
  * @param $outputPrefix
  * @param $action
  * @param $extension
  * @param $data
  * @param array $extraParams
  * @return string
  */
 public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
 {
     $link = parent::buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, $extraParams);
     if (!$link instanceof XenForo_Link) {
         return $link;
     }
     return XenForo_Link::buildBasicLink('forum', $action, $extension) . strval($link);
 }
Пример #2
0
 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);
     }
 }
Пример #3
0
 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);
     }
 }
Пример #4
0
 public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
 {
     if ($action == 'tagged' and isset($data['entity_id'])) {
         // this is our link
         $newAction = $action . '/' . str_replace(',', '/', $data['entity_id']);
         return XenForo_Link::buildBasicLink($outputPrefix, $newAction, $extension);
     }
     return parent::buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, $extraParams);
 }
Пример #5
0
 public static function buildBasicLink($prefix, $action, $extension)
 {
     if (self::$_setup11x) {
         switch ($prefix) {
             case 'widget-page-index':
                 $prefix = 'index';
                 break;
             case 'index':
                 $prefix = 'forums';
                 break;
         }
     }
     return XenForo_Link::buildBasicLink($prefix, $action, $extension);
 }
Пример #6
0
 /**
  * @see XenForo_Route_BuilderInterface::buildLink()
  * @param $originalPrefix
  * @param $outputPrefix
  * @param $action
  * @param $extension
  * @param $data
  * @param array $extraParams
  * @return bool|string
  */
 public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
 {
     $customIndex = XenForo_Application::get('customIndex');
     $buildIndexLink = true;
     if ($action === '' || $action === 'index') {
         if ($data && $customIndex->params) {
             foreach ($customIndex->params as $param => $value) {
                 if (!isset($data[$param]) || $data[$param] !== $value) {
                     $buildIndexLink = false;
                     break;
                 }
             }
         }
         if ($buildIndexLink) {
             return XenForo_Link::buildBasicLink('index', $action, $extension);
         }
     }
     if (method_exists(get_parent_class($this), 'buildLink')) {
         return parent::buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, $extraParams);
     }
     return false;
 }
Пример #7
0
 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);
 }
Пример #8
0
 /**
  * @see XenForo_Route_BuilderInterface::buildLink()
  * @param $originalPrefix
  * @param $outputPrefix
  * @param $action
  * @param $extension
  * @param $data
  * @param array $extraParams
  * @return string
  */
 public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
 {
     return XenForo_Link::buildBasicLink('forum', $action, $extension);
 }
Пример #9
0
 public static function getSessionActivityDetailsForList(array $activities)
 {
     if (XenForo_Visitor::getInstance()->hasPermission('modm_ajaxchat', 'ajax_chat_view')) {
         foreach ($activities as $key => $activity) {
             switch ($activity['controller_action']) {
                 case "Online":
                     $output[$key] = array(new XenForo_Phrase('modm_ajaxchat_viewing_online_list'), new XenForo_Phrase('modm_ajaxchat_tabname'), XenForo_Link::buildBasicLink('chat', 'online'), false);
                     break;
                 case "Logs":
                 case "ChatLogs":
                     $output[$key] = new XenForo_Phrase('performing_moderation_duties');
                     break;
                 default:
                     $output[$key] = array(new XenForo_Phrase('modm_ajaxchat_browsing'), new XenForo_Phrase('modm_ajaxchat_tabname'), XenForo_Link::buildBasicLink('chat', 'login'), false);
                     break;
             }
         }
         return $output;
     }
 }