From 32f93260f04feddffab2d40666e78c6b7fabfc2a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Frank=20J=2E=20G=C3=B3mez?= Date: Wed, 12 Aug 2015 15:21:50 -0400 Subject: [PATCH] CRM-16994: Removed code that made too many assumptions about what the link passed to the tabset would be. --- CRM/Event/Form/ManageEvent/TabHeader.php | 27 +----------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/CRM/Event/Form/ManageEvent/TabHeader.php b/CRM/Event/Form/ManageEvent/TabHeader.php index f614e00785..4fe449204f 100644 --- a/CRM/Event/Form/ManageEvent/TabHeader.php +++ b/CRM/Event/Form/ManageEvent/TabHeader.php @@ -202,7 +202,7 @@ WHERE e.id = %1 $link = "civicrm/event/manage/{$key}"; $query = "{$reset}action={$action}&id={$eventID}&component=event{$tabs[$key]['qfKey']}"; - $tabs[$key]['link'] = (isset($value['link']) ? self::url($value['link']) : + $tabs[$key]['link'] = (isset($value['link']) ? $value['link'] : CRM_Utils_System::url($link, $query)); } } @@ -210,31 +210,6 @@ WHERE e.id = %1 return $tabs; } - /** - * Parses a link passed via hook_civicrm_tabset formats it so CiviCRM can use it. - * - * Wraps CRM_Utils_System::url. Allows for passing routes to Angular. - * - * @param string $url - * @return string - * An HTML string containing a link to the given path. - */ - public static function url($url) { - $urlParts = parse_url($url); - $path = (strpos($urlParts['path'], '/') === 0 ? substr($urlParts['path'], 1) : $urlParts['path']); - - $params = parse_str(CRM_Utils_Array::value('query', $urlParts)); - - // PHP doesn't know about URL fragments (i.e, what comes after the #), so - // we translate this to a URL param - $params['route'] = CRM_Utils_Array::value('fragment', $urlParts); - - // Force the page to load as a snippet. This is being rendered in a tab, after all. - $params['snippet'] = CRM_Core_Smarty::PRINT_SNIPPET; - - return CRM_Utils_System::url($path, http_build_query($params)); - } - /** * @param CRM_Event_Form_ManageEvent $form */ -- 2.25.1