From 8671b4f2efb228dc654123b391fd794b23b99d49 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 23 Jan 2015 00:14:31 -0800 Subject: [PATCH] Civi\Angular - Docblock improvements. --- CRM/Utils/Hook.php | 12 ++++++++++-- Civi/Angular/Manager.php | 17 ++++++++++++++++- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/CRM/Utils/Hook.php b/CRM/Utils/Hook.php index 0fe99d4203..1953cfc620 100644 --- a/CRM/Utils/Hook.php +++ b/CRM/Utils/Hook.php @@ -1863,8 +1863,16 @@ abstract class CRM_Utils_Hook { * * @code * function mymod_civicrm_angularModules(&$angularModules) { - * $angularModules['myAngularModule'] = array('ext' => 'org.example.mymod', 'js' => array('js/myAngularModule.js')); - * $angularModules['myBigAngularModule'] = array('ext' => 'org.example.mymod', 'js' => array('js/part1.js', 'js/part2.js'), 'css' => array('css/myAngularModule.css')); + * $angularModules['myAngularModule'] = array( + * 'ext' => 'org.example.mymod', + * 'js' => array('js/myAngularModule.js'), + * ); + * $angularModules['myBigAngularModule'] = array( + * 'ext' => 'org.example.mymod', + * 'js' => array('js/part1.js', 'js/part2.js'), + * 'css' => array('css/myAngularModule.css'), + * 'partials' => array('partials/myBigAngularModule'), + * ); * } * @endcode */ diff --git a/Civi/Angular/Manager.php b/Civi/Angular/Manager.php index a93c8790ba..8b151802cd 100644 --- a/Civi/Angular/Manager.php +++ b/Civi/Angular/Manager.php @@ -17,9 +17,14 @@ class Manager { * @var array|NULL * Each item has some combination of these keys: * - ext: string + * The Civi extension which defines the Angular module. * - js: array(string $relativeFilePath) + * List of JS files (relative to the extension). * - css: array(string $relativeFilePath) + * List of CSS files (relative to the extension). * - partials: array(string $relativeFilePath) + * A list of partial-HTML folders (relative to the extension). + * This will be mapped to "~/moduleName" by crmResource. */ protected $modules = NULL; @@ -35,7 +40,16 @@ class Manager { * Get a list of AngularJS modules which should be autoloaded * * @return array - * (string $name => array('ext' => string $key, 'js' => array $paths, 'css' => array $paths)) + * Each item has some combination of these keys: + * - ext: string + * The Civi extension which defines the Angular module. + * - js: array(string $relativeFilePath) + * List of JS files (relative to the extension). + * - css: array(string $relativeFilePath) + * List of CSS files (relative to the extension). + * - partials: array(string $relativeFilePath) + * A list of partial-HTML folders (relative to the extension). + * This will be mapped to "~/moduleName" by crmResource. */ public function getModules() { if ($this->modules === NULL) { @@ -270,4 +284,5 @@ class Manager { } return $result; } + } -- 2.25.1