From 6bd0dca977db04e5675ddac0f953954a2682d649 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Frank=20J=2E=20G=C3=B3mez?= Date: Sun, 9 Aug 2015 23:55:29 -0400 Subject: [PATCH] Cleaned up comments and whitespace. --- CRM/Event/Form/ManageEvent/TabHeader.php | 12 ++++++++++-- Civi/Angular/Page/Main.php | 10 +++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CRM/Event/Form/ManageEvent/TabHeader.php b/CRM/Event/Form/ManageEvent/TabHeader.php index 34b55e506f..2597cb0dc6 100644 --- a/CRM/Event/Form/ManageEvent/TabHeader.php +++ b/CRM/Event/Form/ManageEvent/TabHeader.php @@ -210,7 +210,15 @@ WHERE e.id = %1 return $tabs; } - // wraps CRM_Utils_System. needs real doc :-) + /** + * 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']); @@ -221,7 +229,7 @@ WHERE e.id = %1 // we translate this to a URL param $params['route'] = $urlParts['fragment']; - // Force the Angular route to load as a snippet. This is being rendered in a tab, after all. + // 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)); diff --git a/Civi/Angular/Page/Main.php b/Civi/Angular/Page/Main.php index 664ebbd605..c01da3d493 100644 --- a/Civi/Angular/Page/Main.php +++ b/Civi/Angular/Page/Main.php @@ -70,11 +70,11 @@ class Main extends \CRM_Core_Page { $this->res->addSettingsFactory(function () use (&$modules, $page) { // TODO optimization; client-side caching return array_merge($page->angular->getResources(array_keys($modules), 'settings', 'settings'), array( - 'resourceUrls' => \CRM_Extension_System::singleton()->getMapper()->getActiveModuleUrls(), - 'angular' => array( - 'modules' => array_merge(array('ngRoute'), array_keys($modules)), - 'cacheCode' => $page->res->getCacheCode(), - ), + 'resourceUrls' => \CRM_Extension_System::singleton()->getMapper()->getActiveModuleUrls(), + 'angular' => array( + 'modules' => array_merge(array('ngRoute'), array_keys($modules)), + 'cacheCode' => $page->res->getCacheCode(), + ), )); }); -- 2.25.1