empty check for wciform.style_rules
[com.zyxware.civiwci.git] / wci.php
CommitLineData
60488185
M
1<?php
2
3require_once 'wci.civix.php';
4
5/**
6 * Implementation of hook_civicrm_config
7 *
8 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_config
9 */
10function wci_civicrm_config(&$config) {
11 _wci_civix_civicrm_config($config);
12}
13
14/**
15 * Implementation of hook_civicrm_xmlMenu
16 *
17 * @param $files array(string)
18 *
19 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_xmlMenu
20 */
21function wci_civicrm_xmlMenu(&$files) {
22 _wci_civix_civicrm_xmlMenu($files);
23}
24
25/**
26 * Implementation of hook_civicrm_install
27 *
28 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_install
29 */
30function wci_civicrm_install() {
31 return _wci_civix_civicrm_install();
32}
33
34/**
35 * Implementation of hook_civicrm_uninstall
36 *
37 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_uninstall
38 */
39function wci_civicrm_uninstall() {
40 return _wci_civix_civicrm_uninstall();
41}
42
43/**
44 * Implementation of hook_civicrm_enable
45 *
46 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_enable
47 */
48function wci_civicrm_enable() {
49 return _wci_civix_civicrm_enable();
50}
51
52/**
53 * Implementation of hook_civicrm_disable
54 *
55 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_disable
56 */
57function wci_civicrm_disable() {
58 return _wci_civix_civicrm_disable();
59}
60
61/**
62 * Implementation of hook_civicrm_upgrade
63 *
64 * @param $op string, the type of operation being performed; 'check' or 'enqueue'
65 * @param $queue CRM_Queue_Queue, (for 'enqueue') the modifiable list of pending up upgrade tasks
66 *
67 * @return mixed based on op. for 'check', returns array(boolean) (TRUE if upgrades are pending)
68 * for 'enqueue', returns void
69 *
70 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_upgrade
71 */
72function wci_civicrm_upgrade($op, CRM_Queue_Queue $queue = NULL) {
73 return _wci_civix_civicrm_upgrade($op, $queue);
74}
75
76/**
77 * Implementation of hook_civicrm_managed
78 *
79 * Generate a list of entities to create/deactivate/delete when this module
80 * is installed, disabled, uninstalled.
81 *
82 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_managed
83 */
84function wci_civicrm_managed(&$entities) {
85 return _wci_civix_civicrm_managed($entities);
86}
87
88/**
89 * Implementation of hook_civicrm_caseTypes
90 *
91 * Generate a list of case-types
92 *
93 * Note: This hook only runs in CiviCRM 4.4+.
94 *
95 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_caseTypes
96 */
97function wci_civicrm_caseTypes(&$caseTypes) {
98 _wci_civix_civicrm_caseTypes($caseTypes);
99}
100
101/**
102 * Implementation of hook_civicrm_alterSettingsFolders
103 *
104 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_alterSettingsFolders
105 */
106function wci_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) {
107 _wci_civix_civicrm_alterSettingsFolders($metaDataFolders);
108}
51fa85d7
J
109
110function wci_civicrm_navigationMenu( &$params ) {
51fa85d7
J
111
112 $navId = CRM_Core_DAO::singleValueQuery("SELECT max(id) FROM civicrm_navigation");
113 if (is_integer($navId)) {
114 $navId++;
115 }
116 // Find the Help menu
117 $helpID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Navigation', 'Help', 'id', 'name');
118 $params[$navId] = $params[$helpID];
119 // inserting WCI menu at the place of old help location
120 $params[$helpID] = array (
cde51233 121 'attributes' => array (
09e2ab5d 122 'label' => ts('Widgets and Progress Bars'),
cde51233
J
123 'name' => 'WCI',
124 'url' => null,
125 'permission' => 'access CiviReport,access CiviContribute',
126 'operator' => 'OR',
127 'separator' => 0,
128 'parentID' => 0,
129 'navID' => $navId,
130 'active' => 1),
131 'child' => array (
132 '1' => array (
133 'attributes' => array (
540f6530 134 'label' => ts('New Widget'),
cde51233
J
135 'name' => 'new_widget',
136 'url' => 'civicrm/wci/widget/add',
137 'permission' => 'access CiviReport,access CiviContribute',
138 'operator' => 'OR',
139 'separator' => 1,
cf57e520 140 'parentID' => $navId,
cde51233
J
141 'navID' => $navId+1,
142 'active' => 1)),
143
144 '2' => array (
145 'attributes' => array (
540f6530 146 'label' => ts('Manage Widget'),
cde51233 147 'name' => 'manage_widget',
ca0dca6f 148 'url' => 'civicrm/wci/widget?reset=1',
cde51233
J
149 'permission' => 'access CiviReport,access CiviContribute',
150 'operator' => 'OR',
151 'separator' => 1,
cf57e520 152 'parentID' => $navId,
cde51233
J
153 'navID' => $navId+2,
154 'active' => 1)),
155
156 '3' => array (
157 'attributes' => array (
540f6530 158 'label' => ts('New Progress Bar'),
cde51233
J
159 'name' => 'new_progress_bar',
160 'url' => 'civicrm/wci/progress-bar/add',
161 'permission' => 'access CiviReport,access CiviContribute',
162 'operator' => 'OR',
163 'separator' => 1,
cf57e520 164 'parentID' => $navId,
cde51233
J
165 'navID' => $navId+3,
166 'active' => 1)),
167
168 '4' => array (
169 'attributes' => array (
540f6530 170 'label' => ts('Manage Progress Bar'),
cde51233 171 'name' => 'manage_progress_bar',
10119db1 172 'url' => 'civicrm/wci/progress-bar?reset=1',
cde51233
J
173 'permission' => 'access CiviReport,access CiviContribute',
174 'operator' => 'OR',
175 'separator' => 1,
cf57e520 176 'parentID' => $navId,
cde51233 177 'navID' => $navId+4,
4f895956
J
178 'active' => 1)),
179
180 '5' => array (
181 'attributes' => array (
13e70378
J
182 'label' => ts('New Embed Code'),
183 'name' => 'new_embed-code',
184 'url' => 'civicrm/wci/embed-code/add',
185 'permission' => 'access CiviReport,access CiviContribute',
186 'operator' => 'OR',
187 'separator' => 1,
188 'parentID' => $navId,
189 'navID' => $navId+5,
190 'active' => 1)),
191
192 '6' => array (
193 'attributes' => array (
194 'label' => ts('Manage Embed Code'),
195 'name' => 'manage-emebed-code',
196 'url' => 'civicrm/wci/embed-code?reset=1',
197 'permission' => 'access CiviReport,access CiviContribute',
198 'operator' => 'OR',
199 'separator' => 1,
200 'parentID' => $navId,
201 'navID' => $navId+6,
202 'active' => 1)),
203
204 '7' => array (
205 'attributes' => array (
68f8aff6 206 'label' => ts('Widget Settings'),
13e70378 207 'name' => 'widget-settings',
4f895956
J
208 'url' => 'civicrm/wci/settings?reset=1',
209 'permission' => 'access CiviReport,access CiviContribute',
210 'operator' => 'OR',
211 'separator' => 1,
212 'parentID' => $navId,
13e70378 213 'navID' => $navId+7,
4f895956 214 'active' => 1)),
cde51233 215 ),
51fa85d7
J
216 );
217}
b18480e2 218