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_install().
20 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_install
22 function ckeditor4_civicrm_install() {
23 _ckeditor4_civix_civicrm_install();
27 * Implements hook_civicrm_postInstall().
29 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_postInstall
31 function ckeditor4_civicrm_postInstall() {
32 _ckeditor4_civix_civicrm_postInstall();
36 * Implements hook_civicrm_uninstall().
38 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_uninstall
40 function ckeditor4_civicrm_uninstall() {
41 _ckeditor4_civix_civicrm_uninstall();
45 * Implements hook_civicrm_enable().
47 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_enable
49 function ckeditor4_civicrm_enable() {
50 _ckeditor4_civix_civicrm_enable();
54 * Implements hook_civicrm_disable().
56 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_disable
58 function ckeditor4_civicrm_disable() {
59 _ckeditor4_civix_civicrm_disable();
63 * Implements hook_civicrm_upgrade().
65 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_upgrade
67 function ckeditor4_civicrm_upgrade($op, CRM_Queue_Queue
$queue = NULL) {
68 return _ckeditor4_civix_civicrm_upgrade($op, $queue);
72 * Implements hook_civicrm_entityTypes().
74 * Declare entity types provided by this module.
76 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_entityTypes
78 function ckeditor4_civicrm_entityTypes(&$entityTypes) {
79 _ckeditor4_civix_civicrm_entityTypes($entityTypes);
82 function ckeditor4_civicrm_buildForm($formName, $form) {
83 if ($formName === 'CRM_Admin_Form_Preferences_Display') {
87 CRM_Core_Page
::crmIcon('fa-wrench') . ' ' . E
::ts('Configure CKEditor 4'),
90 'class' => 'crm-button',
91 'style' => 'display:inline-block;vertical-align:middle;float:none!important;',
95 CRM_Core_Region
::instance('form-bottom')->add([
96 'template' => 'CRM/Admin/Form/Preferences/Ckeditor.tpl',
101 function ckeditor4_civicrm_coreResourceList(&$list, $region) {
102 // add wysiwyg editor
103 $editor = \Civi
::settings()->get('editor_id');
104 if ($editor == "CKEditor") {
105 CRM_Ckeditor4_Form_CKEditorConfig
::setConfigDefault();
108 'wysisygScriptLocation' => E
::url('js/crm.ckeditor.js'),
109 'CKEditorCustomConfig' => CRM_Ckeditor4_Form_CKEditorConfig
::getConfigUrl(),
115 // --- Functions below this ship commented out. Uncomment as required. ---
118 * Implements hook_civicrm_preProcess().
120 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_preProcess
122 //function ckeditor4_civicrm_preProcess($formName, &$form) {
127 * Implements hook_civicrm_navigationMenu().
129 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_navigationMenu
131 //function ckeditor4_civicrm_navigationMenu(&$menu) {
132 // _ckeditor4_civix_insert_navigation_menu($menu, 'Mailings', array(
133 // 'label' => E::ts('New subliminal message'),
134 // 'name' => 'mailing_subliminal_message',
135 // 'url' => 'civicrm/mailing/subliminal',
136 // 'permission' => 'access CiviMail',
137 // 'operator' => 'OR',
140 // _ckeditor4_civix_navigationMenu($menu);