Cleaned up comments and whitespace.
authorFrank J. Gómez <frank@ginkgostreet.com>
Mon, 10 Aug 2015 03:55:29 +0000 (23:55 -0400)
committerFrank J. Gómez <frank@ginkgostreet.com>
Mon, 10 Aug 2015 03:55:29 +0000 (23:55 -0400)
CRM/Event/Form/ManageEvent/TabHeader.php
Civi/Angular/Page/Main.php

index 34b55e506f46aff9502084c339de23ab95848215..2597cb0dc652ec249998ff4a91fbb1664d08d498 100644 (file)
@@ -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));
index 664ebbd6052f00903e41a524ec4610c19ef3a65f..c01da3d4938fceecee6914d374897b744bdc5959 100644 (file)
@@ -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(),
+        ),
       ));
     });