本文整理汇总了PHP中CRM_Utils_Hook::angularModules方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Utils_Hook::angularModules方法的具体用法?PHP CRM_Utils_Hook::angularModules怎么用?PHP CRM_Utils_Hook::angularModules使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Utils_Hook
的用法示例。
在下文中一共展示了CRM_Utils_Hook::angularModules方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getModules
/**
* Get a list of AngularJS modules which should be autoloaded.
*
* @return array
* 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.
* - settings: array(string $key => mixed $value)
* List of settings to preload.
*/
public function getModules()
{
if ($this->modules === NULL) {
$config = \CRM_Core_Config::singleton();
$angularModules = array();
$angularModules['angularFileUpload'] = array('ext' => 'civicrm', 'js' => array('bower_components/angular-file-upload/dist/angular-file-upload.min.js'));
$angularModules['crmApp'] = array('ext' => 'civicrm', 'js' => array('ang/crmApp.js'));
$angularModules['crmAttachment'] = array('ext' => 'civicrm', '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['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'),
// 'partials' => array('ang/crmExample'),
//);
$angularModules['crmResource'] = array('ext' => 'civicrm', 'js' => array('js/angular-crmResource/all.js'));
$angularModules['crmUi'] = array('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', 'js' => array('ang/crmUtil.js'));
// https://github.com/jwstadler/angular-jquery-dialog-service
$angularModules['dialogService'] = array('ext' => 'civicrm', 'js' => array('bower_components/angular-jquery-dialog-service/dialog-service.js'));
$angularModules['ngRoute'] = array('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.sortable'] = array('ext' => 'civicrm', 'js' => array('bower_components/angular-ui-sortable/sortable.min.js'));
$angularModules['unsavedChanges'] = array('ext' => 'civicrm', 'js' => array('bower_components/angular-unsavedChanges/dist/unsavedChanges.min.js'));
foreach (\CRM_Core_Component::getEnabledComponents() as $component) {
$angularModules = array_merge($angularModules, $component->getAngularModules());
}
\CRM_Utils_Hook::angularModules($angularModules);
$this->modules = $this->resolvePatterns($angularModules);
}
return $this->modules;
}
示例2: getAngularModules
/**
* Get a list of AngularJS modules which should be autoloaded
*
* @return array (string $name => array('ext' => string $key, 'js' => array $paths, 'css' => array $paths))
*/
public static function getAngularModules()
{
$angularModules = array();
$angularModules['ui.utils'] = array('ext' => 'civicrm', 'js' => array('packages/bower_components/angular-ui-utils/ui-utils.min.js'));
$angularModules['ui.sortable'] = array('ext' => 'civicrm', 'js' => array('packages/bower_components/angular-ui-sortable/sortable.min.js'));
$angularModules['unsavedChanges'] = array('ext' => 'civicrm', 'js' => array('packages/bower_components/angular-unsavedChanges/dist/unsavedChanges.min.js'));
$angularModules['crmUi'] = array('ext' => 'civicrm', 'js' => array('js/angular-crm-ui.js'));
foreach (CRM_Core_Component::getEnabledComponents() as $component) {
$angularModules = array_merge($angularModules, $component->getAngularModules());
}
CRM_Utils_Hook::angularModules($angularModules);
return $angularModules;
}
示例3: getModules
public function getModules()
{
if ($this->modules === NULL) {
$config = \CRM_Core_Config::singleton();
$angularModules = array();
//$angularModules['angularFileUpload'] = array(
// 'ext' => 'civicrm',
// 'js' => array('bower_components/angular-file-upload/angular-file-upload.min.js'),
//);
$angularModules['crmApp'] = array('ext' => 'civicrm', 'js' => array('ang/crmApp.js'));
//$angularModules['crmAttachment'] = array(
// 'ext' => 'civicrm',
// '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['crmCxn'] = array('ext' => 'civicrm', 'js' => array('ang/crmCxn.js', 'ang/crmCxn/*.js'), 'css' => array('ang/crmCxn.css'), 'partials' => array('ang/crmCxn'));
$angularModules['crmResource'] = array('ext' => 'civicrm', 'js' => array('js/angular-crmResource/all.js'));
$angularModules['crmUi'] = array('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', 'js' => array('ang/crmUtil.js'));
// https://github.com/jwstadler/angular-jquery-dialog-service
$angularModules['dialogService'] = array('ext' => 'civicrm', 'js' => array('bower_components/angular-jquery-dialog-service/dialog-service.js'));
$angularModules['ngRoute'] = array('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.sortable'] = array('ext' => 'civicrm', 'js' => array('bower_components/angular-ui-sortable/sortable.min.js'));
$angularModules['unsavedChanges'] = array('ext' => 'civicrm', 'js' => array('bower_components/angular-unsavedChanges/dist/unsavedChanges.min.js'));
\CRM_Utils_Hook::angularModules($angularModules);
//Lets filter out unneeded modules
foreach ($angularModules as $name => $module) {
//If the module doesn't request to be part of our page, and isn't a core module
// that we have included, remove it
if ((!array_key_exists("volunteer", $module) || !$module['volunteer']) && $module['ext'] != 'civicrm' && $module['ext'] != 'org.civicrm.angularprofiles') {
unset($angularModules[$name]);
}
}
$this->modules = $this->resolvePatterns($angularModules);
}
return $this->modules;
}