3 require_once 'ckeditor4.civix.php';
5 use CRM_Ckeditor4_ExtensionUtil
as E
;
9 * Implements hook_civicrm_config().
11 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_config/
13 function ckeditor4_civicrm_config(&$config) {
14 _ckeditor4_civix_civicrm_config($config);
18 * Implements hook_civicrm_xmlMenu().
20 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_xmlMenu
22 function ckeditor4_civicrm_xmlMenu(&$files) {
23 _ckeditor4_civix_civicrm_xmlMenu($files);
27 * Implements hook_civicrm_install().
29 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_install
31 function ckeditor4_civicrm_install() {
32 _ckeditor4_civix_civicrm_install();
36 * Implements hook_civicrm_postInstall().
38 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_postInstall
40 function ckeditor4_civicrm_postInstall() {
41 _ckeditor4_civix_civicrm_postInstall();
45 * Implements hook_civicrm_uninstall().
47 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_uninstall
49 function ckeditor4_civicrm_uninstall() {
50 _ckeditor4_civix_civicrm_uninstall();
54 * Implements hook_civicrm_enable().
56 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_enable
58 function ckeditor4_civicrm_enable() {
59 _ckeditor4_civix_civicrm_enable();
63 * Implements hook_civicrm_disable().
65 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_disable
67 function ckeditor4_civicrm_disable() {
68 _ckeditor4_civix_civicrm_disable();
72 * Implements hook_civicrm_upgrade().
74 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_upgrade
76 function ckeditor4_civicrm_upgrade($op, CRM_Queue_Queue
$queue = NULL) {
77 return _ckeditor4_civix_civicrm_upgrade($op, $queue);
81 * Implements hook_civicrm_managed().
83 * Generate a list of entities to create/deactivate/delete when this module
84 * is installed, disabled, uninstalled.
86 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_managed
88 function ckeditor4_civicrm_managed(&$entities) {
89 _ckeditor4_civix_civicrm_managed($entities);
93 * Implements hook_civicrm_caseTypes().
95 * Generate a list of case-types.
97 * Note: This hook only runs in CiviCRM 4.4+.
99 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_caseTypes
101 function ckeditor4_civicrm_caseTypes(&$caseTypes) {
102 _ckeditor4_civix_civicrm_caseTypes($caseTypes);
106 * Implements hook_civicrm_angularModules().
108 * Generate a list of Angular modules.
110 * Note: This hook only runs in CiviCRM 4.5+. It may
111 * use features only available in v4.6+.
113 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_angularModules
115 function ckeditor4_civicrm_angularModules(&$angularModules) {
116 _ckeditor4_civix_civicrm_angularModules($angularModules);
120 * Implements hook_civicrm_entityTypes().
122 * Declare entity types provided by this module.
124 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_entityTypes
126 function ckeditor4_civicrm_entityTypes(&$entityTypes) {
127 _ckeditor4_civix_civicrm_entityTypes($entityTypes);
131 * Implements hook_civicrm_themes().
133 function ckeditor4_civicrm_themes(&$themes) {
134 _ckeditor4_civix_civicrm_themes($themes);
137 function ckeditor4_civicrm_buildForm($formName, $form) {
138 if ($formName === 'CRM_Admin_Form_Preferences_Display') {
142 CRM_Core_Page
::crmIcon('fa-wrench') . ' ' . E
::ts('Configure CKEditor 4'),
145 'class' => 'crm-button',
146 'style' => 'display:inline-block;vertical-align:middle;float:none!important;',
150 CRM_Core_Region
::instance('form-bottom')->add([
151 'template' => 'CRM/Admin/Form/Preferences/Ckeditor.tpl',
156 function ckeditor4_civicrm_coreResourceList(&$list, $region) {
157 // add wysiwyg editor
158 $editor = \Civi
::settings()->get('editor_id');
159 if ($editor == "CKEditor") {
160 CRM_Ckeditor4_Form_CKEditorConfig
::setConfigDefault();
163 'wysisygScriptLocation' => E
::url('js/crm.ckeditor.js'),
164 'CKEditorCustomConfig' => CRM_Ckeditor4_Form_CKEditorConfig
::getConfigUrl(),
170 // --- Functions below this ship commented out. Uncomment as required. ---
173 * Implements hook_civicrm_preProcess().
175 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_preProcess
177 //function ckeditor4_civicrm_preProcess($formName, &$form) {
182 * Implements hook_civicrm_navigationMenu().
184 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_navigationMenu
186 //function ckeditor4_civicrm_navigationMenu(&$menu) {
187 // _ckeditor4_civix_insert_navigation_menu($menu, 'Mailings', array(
188 // 'label' => E::ts('New subliminal message'),
189 // 'name' => 'mailing_subliminal_message',
190 // 'url' => 'civicrm/mailing/subliminal',
191 // 'permission' => 'access CiviMail',
192 // 'operator' => 'OR',
195 // _ckeditor4_civix_navigationMenu($menu);