);
}
+ /**
+ * Export permission data to the client to enable smarter GUIs.
+ *
+ * Note: Application security stems from the server's enforcement
+ * of the security logic (e.g. in the API permissions). There's no way
+ * the client can use this info to make the app more secure; however,
+ * it can produce a better-tuned (non-broken) UI.
+ *
+ * @param array $permNames
+ * List of permission names to check/export.
+ * @return CRM_Core_Resources
+ */
+ public function addPermissions($permNames) {
+ $permNames = (array) $permNames;
+ $perms = array();
+ foreach ($permNames as $permName) {
+ $perms[$permName] = CRM_Core_Permission::check($permName);
+ }
+ return $this->addSetting(array(
+ 'permissions' => $perms,
+ ));
+ }
+
/**
* Add a JavaScript file to the current page using <SCRIPT SRC>.
*
foreach ((array) $text as $str) {
$translated = ts($str, array(
'domain' => ($domain == 'civicrm') ? NULL : array($domain, NULL),
+ 'raw' => TRUE,
));
// We only need to push this string to client if the translation
// Add global settings
$settings = array(
'config' => array(
- 'ajaxPopupsEnabled' => $this->ajaxPopupsEnabled,
'isFrontend' => $config->userFrameworkFrontend,
),
);
'contactCreate' => CRM_Core_BAO_UFGroup::getCreateLinks(),
'filters' => self::getEntityRefFilters(),
),
+ 'ajaxPopupsEnabled' => self::singleton()->ajaxPopupsEnabled,
);
print CRM_Core_Smarty::singleton()->fetchWith('CRM/common/l10n.js.tpl', $vars);
CRM_Utils_System::civiExit();
"bower_components/jquery-ui/themes/smoothness/jquery-ui$min.css",
"bower_components/lodash-compat/lodash.min.js",
"packages/jquery/plugins/jquery.mousewheel$min.js",
- "packages/jquery/plugins/select2/select2$min.js",
- "packages/jquery/plugins/select2/select2.css",
+ "bower_components/select2/select2$min.js",
+ "bower_components/select2/select2.css",
"packages/jquery/plugins/jquery.tableHeader.js",
"packages/jquery/plugins/jquery.textarearesizer.js",
"packages/jquery/plugins/jquery.form$min.js",
"packages/jquery/plugins/jquery.blockUI$min.js",
"packages/jquery/plugins/DataTables/media/js/jquery.dataTables$min.js",
"packages/jquery/plugins/DataTables/media/css/jquery.dataTables$min.css",
- "packages/jquery/plugins/jquery.validate$min.js",
+ "bower_components/jquery-validation/dist/jquery.validate$min.js",
"packages/jquery/plugins/jquery.ui.datepicker.validation.pack.js",
"js/Common.js",
"js/crm.ajax.js",