projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '4.6' into master
[civicrm-core.git]
/
Civi
/
Angular
/
Manager.php
diff --git
a/Civi/Angular/Manager.php
b/Civi/Angular/Manager.php
index 6effe4ce1cc86581721a3368d3ede8147ae692b2..8977e1c14f5eb6451a7ba92e2b9155c8bbc60bfe 100644
(file)
--- a/
Civi/Angular/Manager.php
+++ b/
Civi/Angular/Manager.php
@@
-25,6
+25,8
@@
class Manager {
* - partials: array(string $relativeFilePath)
* A list of partial-HTML folders (relative to the extension).
* This will be mapped to "~/moduleName" by crmResource.
* - partials: array(string $relativeFilePath)
* A list of partial-HTML folders (relative to the extension).
* This will be mapped to "~/moduleName" by crmResource.
+ * - settings: array(string $key => mixed $value)
+ * List of settings to preload.
*/
protected $modules = NULL;
*/
protected $modules = NULL;
@@
-50,9
+52,12
@@
class Manager {
* - partials: array(string $relativeFilePath)
* A list of partial-HTML folders (relative to the extension).
* This will be mapped to "~/moduleName" by crmResource.
* - partials: array(string $relativeFilePath)
* A list of partial-HTML folders (relative to the extension).
* This will be mapped to "~/moduleName" by crmResource.
+ * - settings: array(string $key => mixed $value)
+ * List of settings to preload.
*/
public function getModules() {
if ($this->modules === NULL) {
*/
public function getModules() {
if ($this->modules === NULL) {
+ $config = \CRM_Core_Config::singleton();
$angularModules = array();
$angularModules['angularFileUpload'] = array(
$angularModules = array();
$angularModules['angularFileUpload'] = array(
@@
-68,11
+73,20
@@
class Manager {
'js' => array('ang/crmAttachment.js'),
'css' => array('ang/crmAttachment.css'),
'partials' => array('ang/crmAttachment'),
'js' => array('ang/crmAttachment.js'),
'css' => array('ang/crmAttachment.css'),
'partials' => array('ang/crmAttachment'),
+ 'settings' => array(
+ 'token' => \CRM_Core_Page_AJAX_Attachment::createToken(),
+ ),
);
$angularModules['crmAutosave'] = array(
'ext' => 'civicrm',
'js' => array('ang/crmAutosave.js'),
);
);
$angularModules['crmAutosave'] = array(
'ext' => 'civicrm',
'js' => array('ang/crmAutosave.js'),
);
+ $angularModules['crmCxn'] = array(
+ 'ext' => 'civicrm',
+ 'js' => array('ang/crmCxn.js', 'ang/crmCxn/*.js'),
+ 'css' => array('ang/crmCxn.css'),
+ 'partials' => array('ang/crmCxn'),
+ );
//$angularModules['crmExample'] = array(
// 'ext' => 'civicrm',
// 'js' => array('ang/crmExample.js'),
//$angularModules['crmExample'] = array(
// 'ext' => 'civicrm',
// 'js' => array('ang/crmExample.js'),
@@
-87,6
+101,10
@@
class Manager {
'ext' => 'civicrm',
'js' => array('ang/crmUi.js'),
'partials' => array('ang/crmUi'),
'ext' => 'civicrm',
'js' => array('ang/crmUi.js'),
'partials' => array('ang/crmUi'),
+ 'settings' => array(
+ 'browseUrl' => $config->userFrameworkResourceURL . 'packages/kcfinder/browse.php',
+ 'uploadUrl' => $config->userFrameworkResourceURL . 'packages/kcfinder/upload.php',
+ ),
);
$angularModules['crmUtil'] = array(
'ext' => 'civicrm',
);
$angularModules['crmUtil'] = array(
'ext' => 'civicrm',
@@
-101,6
+119,10
@@
class Manager {
'ext' => 'civicrm',
'js' => array('bower_components/angular-route/angular-route.min.js'),
);
'ext' => 'civicrm',
'js' => array('bower_components/angular-route/angular-route.min.js'),
);
+ $angularModules['ngSanitize'] = array(
+ 'ext' => 'civicrm',
+ 'js' => array('bower_components/angular-sanitize/angular-sanitize.min.js'),
+ );
$angularModules['ui.utils'] = array(
'ext' => 'civicrm',
'js' => array('bower_components/angular-ui-utils/ui-utils.min.js'),
$angularModules['ui.utils'] = array(
'ext' => 'civicrm',
'js' => array('bower_components/angular-ui-utils/ui-utils.min.js'),
@@
-264,9
+286,9
@@
class Manager {
* @param string|array $moduleNames
* List of module names.
* @param string $resType
* @param string|array $moduleNames
* List of module names.
* @param string $resType
- * Type of resource ('js', 'css').
+ * Type of resource ('js', 'css'
, 'settings'
).
* @param string $refType
* @param string $refType
- * Type of reference to the resource ('cacheUrl', 'rawUrl', 'path').
+ * Type of reference to the resource ('cacheUrl', 'rawUrl', 'path'
, 'settings'
).
* @return array
* List of URLs or paths.
* @throws \CRM_Core_Exception
* @return array
* List of URLs or paths.
* @throws \CRM_Core_Exception
@@
-291,6
+313,12
@@
class Manager {
$result[] = $this->res->getUrl($module['ext'], $file, TRUE);
break;
$result[] = $this->res->getUrl($module['ext'], $file, TRUE);
break;
+ case 'settings':
+ if (!empty($module[$resType])) {
+ $result[$moduleName] = $module[$resType];
+ }
+ break;
+
default:
throw new \CRM_Core_Exception("Unrecognized resource format");
}
default:
throw new \CRM_Core_Exception("Unrecognized resource format");
}