@@ -33,8 +33,8 @@ discard block |
||
33 | 33 | } |
34 | 34 | |
35 | 35 | switch ($op) { |
36 | - case 'notification': |
|
37 | - switch ($fct) { |
|
36 | + case 'notification': |
|
37 | + switch ($fct) { |
|
38 | 38 | case 'send': |
39 | 39 | if (!$GLOBALS['xoopsSecurity']->check()) { |
40 | 40 | redirect_header('index.php', 3, _NOPERM . '<br>' . implode('<br>', $GLOBALS['xoopsSecurity']->getErrors())); |
@@ -130,78 +130,78 @@ discard block |
||
130 | 130 | xoops_cp_footer(); |
131 | 131 | |
132 | 132 | break; |
133 | - } |
|
133 | + } |
|
134 | 134 | break; |
135 | 135 | |
136 | - default: |
|
137 | - case 'default': |
|
138 | - // @author Gregory Mage (Aka Mage) |
|
139 | - //*************************************************************************************** |
|
140 | - xoops_cp_header(); |
|
141 | - // require_once XOOPS_ROOT_PATH . "/modules/extcal/class/admin.php"; |
|
142 | - // $catHandler = xoops_getModuleHandler(_EXTCAL_CLS_CAT, _EXTCAL_MODULE); |
|
143 | - // $eventHandler = xoops_getModuleHandler(_EXTCAL_CLS_EVENT, _EXTCAL_MODULE); |
|
144 | - $adminObject = \Xmf\Module\Admin::getInstance(); |
|
145 | - $adminObject->addInfoBox(_MI_EXTCAL_DASHBOARD); |
|
146 | - $adminObject->addInfoBoxLine(sprintf( '<infolabel>' . _AM_EXTCAL_INDEX_CATEGORIES . '</infolabel>', $catHandler->getCount()), '', 'Green'); |
|
147 | - $adminObject->addInfoBoxLine(sprintf( '<infolabel>' . _AM_EXTCAL_INDEX_EVENT . '</infolabel>', $eventHandler->getCount(new Criteria('event_approved', 1))), '', 'Green'); |
|
148 | - $adminObject->addInfoBoxLine(sprintf( '<infolabel>' . _AM_EXTCAL_INDEX_PENDING . '</infolabel>', $eventHandler->getCount(new Criteria('event_approved', 0))), '', 'Red'); |
|
149 | - $criteriaCompo = new CriteriaCompo(); |
|
150 | - $criteriaCompo->add(new Criteria('event_approved', 1)); |
|
151 | - $criteriaCompo->add(new Criteria('event_start', time(), '>=')); |
|
152 | - $adminObject->addInfoBoxLine(sprintf( '<infolabel>' . _AM_EXTCAL_INDEX_APPROVED . '</infolabel><infotext>', $eventHandler->getCount($criteriaCompo) . '</infotext>'), '', 'Green'); |
|
153 | - |
|
154 | - $adminObject->addConfigBoxLine(); |
|
155 | - $adminObject->addConfigBoxLine(_AM_EXTCAL_PEAR_PATH); |
|
156 | - $adminObject->addConfigBoxLine(_EXTCAL_PEAR_ROOT, 'folder'); |
|
157 | - |
|
158 | - //JJD |
|
159 | - // $adminObject->addConfigBoxLine(XOOPS_ROOT_PATH,'folder'); |
|
160 | - |
|
161 | - // $adminObject->addLineConfigLabel(_AM_EXTCAL_CONFIG_PHP, $xoopsModule->getInfo("min_php"), 'php'); |
|
162 | - // $adminObject->addLineConfigLabel(_AM_EXTCAL_CONFIG_XOOPS, $xoopsModule->getInfo("min_xoops"), 'xoops'); |
|
163 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
164 | - $adminObject->displayIndex(); |
|
165 | - //*************************************************************************************** |
|
166 | - $pendingEvent = $eventHandler->objectToArray($eventHandler->getPendingEvent(), ['cat_id']); |
|
167 | - $eventHandler->formatEventsDate($pendingEvent, 'd/m/Y'); |
|
168 | - |
|
169 | - echo '<fieldset><legend style="font-weight:bold; color:#990000;">' . _AM_EXTCAL_PENDING_EVENT . '</legend>'; |
|
170 | - echo '<fieldset><legend style="font-weight:bold; color:#0A3760;">' . _AM_EXTCAL_INFORMATION . '</legend>'; |
|
171 | - // echo '<img src="../assets/images/icons/on.png" > '._AM_EXTCAL_INFO_APPROVE_PENDING_EVENT.'<br>'; |
|
172 | - echo '<img src=' . $pathIcon16 . '/edit.png> ' . _AM_EXTCAL_INFO_EDIT_PENDING_EVENT . '<br>'; |
|
173 | - echo '<img src=' . $pathIcon16 . '/delete.png> ' . _AM_EXTCAL_INFO_DELETE_PENDING_EVENT . '<br>'; |
|
174 | - echo '</fieldset><br>'; |
|
175 | - |
|
176 | - echo '<table class="outer" style="width:100%;">'; |
|
177 | - echo '<tr style="text-align:center;">'; |
|
178 | - echo '<th>' . _AM_EXTCAL_CATEGORY . '</th>'; |
|
179 | - echo '<th>' . _AM_EXTCAL_TITLE . '</th>'; |
|
180 | - echo '<th>' . _AM_EXTCAL_START_DATE . '</th>'; |
|
181 | - echo '<th>' . _AM_EXTCAL_ACTION . '</th>'; |
|
182 | - echo '</tr>'; |
|
183 | - |
|
184 | - if (count($pendingEvent) > 0) { |
|
185 | - $i = 0; |
|
186 | - foreach ($pendingEvent as $event) { |
|
187 | - $class = (0 == ++$i % 2) ? 'even' : 'odd'; |
|
188 | - echo '<tr style="text-align:center;" class="' . $class . '">'; |
|
189 | - echo '<td>' . $event['cat']['cat_name'] . '</td>'; |
|
190 | - echo '<td>' . $event['event_title'] . '</td>'; |
|
191 | - echo '<td>' . $event['formated_event_start'] . '</td>'; |
|
192 | - echo '<td style="width:10%; text-align:center;">'; |
|
193 | - echo '<a href="event.php?op=modify&event_id=' . $event['event_id'] . '"><img src=' . $pathIcon16 . '/edit.png></a> '; |
|
194 | - echo '<a href="event.php?op=delete&event_id=' . $event['event_id'] . '"><img src=' . $pathIcon16 . '/delete.png></a>'; |
|
195 | - echo '</td>'; |
|
196 | - echo '</tr>'; |
|
136 | + default: |
|
137 | + case 'default': |
|
138 | + // @author Gregory Mage (Aka Mage) |
|
139 | + //*************************************************************************************** |
|
140 | + xoops_cp_header(); |
|
141 | + // require_once XOOPS_ROOT_PATH . "/modules/extcal/class/admin.php"; |
|
142 | + // $catHandler = xoops_getModuleHandler(_EXTCAL_CLS_CAT, _EXTCAL_MODULE); |
|
143 | + // $eventHandler = xoops_getModuleHandler(_EXTCAL_CLS_EVENT, _EXTCAL_MODULE); |
|
144 | + $adminObject = \Xmf\Module\Admin::getInstance(); |
|
145 | + $adminObject->addInfoBox(_MI_EXTCAL_DASHBOARD); |
|
146 | + $adminObject->addInfoBoxLine(sprintf( '<infolabel>' . _AM_EXTCAL_INDEX_CATEGORIES . '</infolabel>', $catHandler->getCount()), '', 'Green'); |
|
147 | + $adminObject->addInfoBoxLine(sprintf( '<infolabel>' . _AM_EXTCAL_INDEX_EVENT . '</infolabel>', $eventHandler->getCount(new Criteria('event_approved', 1))), '', 'Green'); |
|
148 | + $adminObject->addInfoBoxLine(sprintf( '<infolabel>' . _AM_EXTCAL_INDEX_PENDING . '</infolabel>', $eventHandler->getCount(new Criteria('event_approved', 0))), '', 'Red'); |
|
149 | + $criteriaCompo = new CriteriaCompo(); |
|
150 | + $criteriaCompo->add(new Criteria('event_approved', 1)); |
|
151 | + $criteriaCompo->add(new Criteria('event_start', time(), '>=')); |
|
152 | + $adminObject->addInfoBoxLine(sprintf( '<infolabel>' . _AM_EXTCAL_INDEX_APPROVED . '</infolabel><infotext>', $eventHandler->getCount($criteriaCompo) . '</infotext>'), '', 'Green'); |
|
153 | + |
|
154 | + $adminObject->addConfigBoxLine(); |
|
155 | + $adminObject->addConfigBoxLine(_AM_EXTCAL_PEAR_PATH); |
|
156 | + $adminObject->addConfigBoxLine(_EXTCAL_PEAR_ROOT, 'folder'); |
|
157 | + |
|
158 | + //JJD |
|
159 | + // $adminObject->addConfigBoxLine(XOOPS_ROOT_PATH,'folder'); |
|
160 | + |
|
161 | + // $adminObject->addLineConfigLabel(_AM_EXTCAL_CONFIG_PHP, $xoopsModule->getInfo("min_php"), 'php'); |
|
162 | + // $adminObject->addLineConfigLabel(_AM_EXTCAL_CONFIG_XOOPS, $xoopsModule->getInfo("min_xoops"), 'xoops'); |
|
163 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
164 | + $adminObject->displayIndex(); |
|
165 | + //*************************************************************************************** |
|
166 | + $pendingEvent = $eventHandler->objectToArray($eventHandler->getPendingEvent(), ['cat_id']); |
|
167 | + $eventHandler->formatEventsDate($pendingEvent, 'd/m/Y'); |
|
168 | + |
|
169 | + echo '<fieldset><legend style="font-weight:bold; color:#990000;">' . _AM_EXTCAL_PENDING_EVENT . '</legend>'; |
|
170 | + echo '<fieldset><legend style="font-weight:bold; color:#0A3760;">' . _AM_EXTCAL_INFORMATION . '</legend>'; |
|
171 | + // echo '<img src="../assets/images/icons/on.png" > '._AM_EXTCAL_INFO_APPROVE_PENDING_EVENT.'<br>'; |
|
172 | + echo '<img src=' . $pathIcon16 . '/edit.png> ' . _AM_EXTCAL_INFO_EDIT_PENDING_EVENT . '<br>'; |
|
173 | + echo '<img src=' . $pathIcon16 . '/delete.png> ' . _AM_EXTCAL_INFO_DELETE_PENDING_EVENT . '<br>'; |
|
174 | + echo '</fieldset><br>'; |
|
175 | + |
|
176 | + echo '<table class="outer" style="width:100%;">'; |
|
177 | + echo '<tr style="text-align:center;">'; |
|
178 | + echo '<th>' . _AM_EXTCAL_CATEGORY . '</th>'; |
|
179 | + echo '<th>' . _AM_EXTCAL_TITLE . '</th>'; |
|
180 | + echo '<th>' . _AM_EXTCAL_START_DATE . '</th>'; |
|
181 | + echo '<th>' . _AM_EXTCAL_ACTION . '</th>'; |
|
182 | + echo '</tr>'; |
|
183 | + |
|
184 | + if (count($pendingEvent) > 0) { |
|
185 | + $i = 0; |
|
186 | + foreach ($pendingEvent as $event) { |
|
187 | + $class = (0 == ++$i % 2) ? 'even' : 'odd'; |
|
188 | + echo '<tr style="text-align:center;" class="' . $class . '">'; |
|
189 | + echo '<td>' . $event['cat']['cat_name'] . '</td>'; |
|
190 | + echo '<td>' . $event['event_title'] . '</td>'; |
|
191 | + echo '<td>' . $event['formated_event_start'] . '</td>'; |
|
192 | + echo '<td style="width:10%; text-align:center;">'; |
|
193 | + echo '<a href="event.php?op=modify&event_id=' . $event['event_id'] . '"><img src=' . $pathIcon16 . '/edit.png></a> '; |
|
194 | + echo '<a href="event.php?op=delete&event_id=' . $event['event_id'] . '"><img src=' . $pathIcon16 . '/delete.png></a>'; |
|
195 | + echo '</td>'; |
|
196 | + echo '</tr>'; |
|
197 | + } |
|
198 | + } else { |
|
199 | + echo '<tr><td colspan="4">' . _AM_EXTCAL_NO_PENDING_EVENT . '</td></tr>'; |
|
197 | 200 | } |
198 | - } else { |
|
199 | - echo '<tr><td colspan="4">' . _AM_EXTCAL_NO_PENDING_EVENT . '</td></tr>'; |
|
200 | - } |
|
201 | 201 | |
202 | - echo '</table></fieldset><br>'; |
|
202 | + echo '</table></fieldset><br>'; |
|
203 | 203 | |
204 | - require_once __DIR__ . '/admin_footer.php'; |
|
204 | + require_once __DIR__ . '/admin_footer.php'; |
|
205 | 205 | |
206 | - break; |
|
206 | + break; |
|
207 | 207 | } |