Passed
Push — master ( d2520f...3f8ec2 )
by Michael
02:50
created
admin/event.php 1 patch
Switch Indentation   +303 added lines, -303 removed lines patch added patch discarded remove patch
@@ -72,177 +72,195 @@  discard block
 block discarded – undo
72 72
 
73 73
 switch ($op) {
74 74
 
75
-    case 'enreg':
76
-
77
-        $eventHandler = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_EVENT);
78
-        $fileHandler  = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_FILE);
79
-        // $t = print_r($_POST,true);
80
-        // echo "<pre>{$t}</pre><br>";
81
-        // exit;
82
-        // If the date format is wrong
83
-        //        if (
84
-        //            !preg_match(_EXTCAL_MOTIF_DATE, $_POST['event_start']['date'])
85
-        //                || !preg_match(_EXTCAL_MOTIF_DATE, $_POST['event_end']['date'])
86
-        //        ) {
87
-        //            redirect_header(
88
-        //                'event.php', 3, _MD_EXTCAL_WRONG_DATE_FORMAT . "<br>"
89
-        //                . implode('<br>', $GLOBALS['xoopsSecurity']->getErrors())
90
-        //            );
91
-        //            exit;
92
-        //        }
93
-
94
-        //exit;
95
-        ///////////////////////////////////////////////////////////////////////////////
96
-        Extcal\Utility::loadImg($_REQUEST, $event_picture1, $event_picture2);
97
-        ///////////////////////////////////////////////////////////////////////////////
98
-        $data = [
99
-            'event_title'         => $_POST['event_title'],
100
-            'cat_id'              => $_POST['cat_id'],
101
-            'event_desc'          => $_POST['event_desc'],
102
-            'event_nbmember'      => $_POST['event_nbmember'],
103
-            'event_organisateur'  => $_POST['event_organisateur'],
104
-            'event_contact'       => $_POST['event_contact'],
105
-            'event_url'           => $_POST['event_url'],
106
-            'event_email'         => $_POST['event_email'],
107
-            'event_address'       => $_POST['event_address'],
108
-            'event_approved'      => 1,
109
-            'event_start'         => $_POST['event_start'],
110
-            'have_end'            => $_POST['have_end'],
111
-            'event_end'           => $_POST['event_end'],
112
-            'event_picture1'      => @$event_picture1,
113
-            'event_picture2'      => @$event_picture2,
114
-            'event_price'         => @$_POST['event_price'],
115
-            'event_etablissement' => $_POST['event_etablissement'],
116
-            'dohtml'              => $extcalConfig['allow_html'],
117
-            'event_icone'         => $_POST['event_icone'],
118
-        ];
119
-
120
-        // Event edited
121
-        if (isset($_POST['event_id'])) {
122
-            if (!$eventHandler->modifyEvent($_POST['event_id'], $data)) {
123
-                redirect_header('event.php', 3, _AM_EXTCAL_EVENT_EDIT_FAILED, false);
75
+        case 'enreg':
76
+
77
+            $eventHandler = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_EVENT);
78
+            $fileHandler  = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_FILE);
79
+            // $t = print_r($_POST,true);
80
+            // echo "<pre>{$t}</pre><br>";
81
+            // exit;
82
+            // If the date format is wrong
83
+            //        if (
84
+            //            !preg_match(_EXTCAL_MOTIF_DATE, $_POST['event_start']['date'])
85
+            //                || !preg_match(_EXTCAL_MOTIF_DATE, $_POST['event_end']['date'])
86
+            //        ) {
87
+            //            redirect_header(
88
+            //                'event.php', 3, _MD_EXTCAL_WRONG_DATE_FORMAT . "<br>"
89
+            //                . implode('<br>', $GLOBALS['xoopsSecurity']->getErrors())
90
+            //            );
91
+            //            exit;
92
+            //        }
93
+
94
+            //exit;
95
+            ///////////////////////////////////////////////////////////////////////////////
96
+            Extcal\Utility::loadImg($_REQUEST, $event_picture1, $event_picture2);
97
+            ///////////////////////////////////////////////////////////////////////////////
98
+            $data = [
99
+                'event_title'         => $_POST['event_title'],
100
+                'cat_id'              => $_POST['cat_id'],
101
+                'event_desc'          => $_POST['event_desc'],
102
+                'event_nbmember'      => $_POST['event_nbmember'],
103
+                'event_organisateur'  => $_POST['event_organisateur'],
104
+                'event_contact'       => $_POST['event_contact'],
105
+                'event_url'           => $_POST['event_url'],
106
+                'event_email'         => $_POST['event_email'],
107
+                'event_address'       => $_POST['event_address'],
108
+                'event_approved'      => 1,
109
+                'event_start'         => $_POST['event_start'],
110
+                'have_end'            => $_POST['have_end'],
111
+                'event_end'           => $_POST['event_end'],
112
+                'event_picture1'      => @$event_picture1,
113
+                'event_picture2'      => @$event_picture2,
114
+                'event_price'         => @$_POST['event_price'],
115
+                'event_etablissement' => $_POST['event_etablissement'],
116
+                'dohtml'              => $extcalConfig['allow_html'],
117
+                'event_icone'         => $_POST['event_icone'],
118
+            ];
119
+
120
+            // Event edited
121
+            if (isset($_POST['event_id'])) {
122
+                if (!$eventHandler->modifyEvent($_POST['event_id'], $data)) {
123
+                    redirect_header('event.php', 3, _AM_EXTCAL_EVENT_EDIT_FAILED, false);
124
+                } else {
125
+                    $fileHandler->createFile((int)$_POST['event_id']);
126
+                    redirect_header('event.php', 3, _AM_EXTCAL_EVENT_EDITED, false);
127
+                }
128
+
129
+                // New event
124 130
             } else {
125
-                $fileHandler->createFile((int)$_POST['event_id']);
126
-                redirect_header('event.php', 3, _AM_EXTCAL_EVENT_EDITED, false);
131
+                $notificationHandler = xoops_getHandler('notification');
132
+                /** @var Extcal\CategoryHandler $catHandler */
133
+                //            $catHandler = xoops_getModuleHandler(_EXTCAL_CLS_CAT, _EXTCAL_MODULE);
134
+                $catHandler = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_CAT);
135
+
136
+                $data['event_submitter']  = $xoopsUser ? $xoopsUser->getVar('uid') : 0;
137
+                $data['event_submitdate'] = time();
138
+
139
+                if ($eventHandler->createEvent($data, $_POST)) {
140
+                    $fileHandler->createFile($eventHandler->getInsertId());
141
+                    $cat = $catHandler->getCat($_POST['cat_id'], $xoopsUser, 'all');
142
+                    $notificationHandler->triggerEvent('global', 0, 'new_event', ['EVENT_TITLE' => $_POST['event_title']]);
143
+                    $notificationHandler->triggerEvent('category', $_POST['cat_id'], 'new_event_cat', [
144
+                        'EVENT_TITLE' => $_POST['event_title'],
145
+                        'CAT_NAME'    => $cat->getVar('cat_name'),
146
+                    ]);
147
+                    redirect_header('event.php', 3, _AM_EXTCAL_EVENT_CREATED, false);
148
+                } else {
149
+                    redirect_header('event.php', 3, _AM_EXTCAL_EVENT_CREATE_FAILED, false);
150
+                }
127 151
             }
152
+            break;
128 153
 
129
-            // New event
130
-        } else {
131
-            $notificationHandler = xoops_getHandler('notification');
132
-            /** @var Extcal\CategoryHandler $catHandler */
133
-            //            $catHandler = xoops_getModuleHandler(_EXTCAL_CLS_CAT, _EXTCAL_MODULE);
134
-            $catHandler = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_CAT);
135
-
136
-            $data['event_submitter']  = $xoopsUser ? $xoopsUser->getVar('uid') : 0;
137
-            $data['event_submitdate'] = time();
138
-
139
-            if ($eventHandler->createEvent($data, $_POST)) {
140
-                $fileHandler->createFile($eventHandler->getInsertId());
141
-                $cat = $catHandler->getCat($_POST['cat_id'], $xoopsUser, 'all');
142
-                $notificationHandler->triggerEvent('global', 0, 'new_event', ['EVENT_TITLE' => $_POST['event_title']]);
143
-                $notificationHandler->triggerEvent('category', $_POST['cat_id'], 'new_event_cat', [
144
-                    'EVENT_TITLE' => $_POST['event_title'],
145
-                    'CAT_NAME'    => $cat->getVar('cat_name'),
146
-                ]);
147
-                redirect_header('event.php', 3, _AM_EXTCAL_EVENT_CREATED, false);
148
-            } else {
149
-                redirect_header('event.php', 3, _AM_EXTCAL_EVENT_CREATE_FAILED, false);
154
+        case 'clone': /* sur validation du formulaire */
155
+        case 'modify':
156
+            $action = (('clone' === $op) ? 'clone' : 'edit');
157
+            xoops_cp_header();
158
+            //================================================
159
+            // require_once (XOOPS_ROOT_PATH . '/class/xoopsform/tc_calendar/formtccalendar.php');
160
+            //
161
+            //        // Call the calendar constructor - use the desired form and format, according to the instructions/samples provided on triconsole.com
162
+            //        $dateBirthday = new \XoopsTcCalendar("datez1", true, false);
163
+            //        //$dateBirthday->setIcon("/images/iconCalendar.gif");
164
+            //        $dateBirthday->setIcon("/class/xoopsform/tc_calendar/images/iconCalendar.gif");
165
+            //        //$dateBirthday->rtl=false;
166
+            //        $dateBirthday->setAutoHide(false);
167
+            //
168
+            //       //$myCalendar->setDate(date('d'), date('m'), date('Y'));
169
+            //       //$dateBirthday->setDate($p['date1_day'], $p['date1_month'], $p['date1_year']);
170
+            //        $dateBirthday->setDate(date('d'), date('m'), date('Y'));
171
+            //
172
+            //        $dateBirthday->setPath(XOOPS_URL . "/class/xoopsform/tc_calendar/");
173
+            //        $dateBirthday->zindex = 150; //default 1
174
+            //        $dateBirthday->setYearInterval(1995, date('Y'));
175
+            //        $dateBirthday->dateAllow('1960-03-01', date('Y-m-d'));
176
+            //        //$dateBirthday->autoSubmit(true, "calendar");
177
+            //        $dateBirthday->disabledDay("sat");
178
+            //        $dateBirthday->disabledDay("sun");
179
+            //        $dateBirthday->setSpecificDate(array("2011-04-14", "2010-12-25"), 0, 'month');
180
+            //        $dateBirthday->setSpecificDate(array("2011-04-01"), 0, 'year');
181
+            //        $dateBirthday->setAlignment('right', 'bottom'); //optional
182
+            // echo "<table><tr><td>zzzzz</td><td></td><td>";
183
+            // echo $dateBirthday->render();
184
+            // echo "</td></tr></table>";
185
+            //echo $dateBirthday->render();
186
+            //================================================
187
+            // @author      Gregory Mage (Aka Mage)
188
+            //***************************************************************************************
189
+            //         require_once XOOPS_ROOT_PATH . "/modules/extcal/class/admin.php";
190
+            $adminObject = \Xmf\Module\Admin::getInstance();
191
+            $adminObject->displayNavigation(basename(__FILE__));
192
+            //***************************************************************************************
193
+
194
+            $eventId      = $_GET['event_id'];
195
+            $eventHandler = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_EVENT);
196
+
197
+            echo '<fieldset><legend style="font-weight:bold; color:#990000;">' . _MD_EXTCAL_EDIT_EVENT . '</legend>';
198
+
199
+            if ($form = $eventHandler->getEventForm('admin', $action, ['event_id' => $eventId])) {
200
+                $form->display();
150 201
             }
151
-        }
152
-        break;
153
-
154
-    case 'clone': /* sur validation du formulaire */
155
-    case 'modify':
156
-        $action = (('clone' === $op) ? 'clone' : 'edit');
157
-        xoops_cp_header();
158
-        //================================================
159
-        // require_once (XOOPS_ROOT_PATH . '/class/xoopsform/tc_calendar/formtccalendar.php');
160
-        //
161
-        //        // Call the calendar constructor - use the desired form and format, according to the instructions/samples provided on triconsole.com
162
-        //        $dateBirthday = new \XoopsTcCalendar("datez1", true, false);
163
-        //        //$dateBirthday->setIcon("/images/iconCalendar.gif");
164
-        //        $dateBirthday->setIcon("/class/xoopsform/tc_calendar/images/iconCalendar.gif");
165
-        //        //$dateBirthday->rtl=false;
166
-        //        $dateBirthday->setAutoHide(false);
167
-        //
168
-        //       //$myCalendar->setDate(date('d'), date('m'), date('Y'));
169
-        //       //$dateBirthday->setDate($p['date1_day'], $p['date1_month'], $p['date1_year']);
170
-        //        $dateBirthday->setDate(date('d'), date('m'), date('Y'));
171
-        //
172
-        //        $dateBirthday->setPath(XOOPS_URL . "/class/xoopsform/tc_calendar/");
173
-        //        $dateBirthday->zindex = 150; //default 1
174
-        //        $dateBirthday->setYearInterval(1995, date('Y'));
175
-        //        $dateBirthday->dateAllow('1960-03-01', date('Y-m-d'));
176
-        //        //$dateBirthday->autoSubmit(true, "calendar");
177
-        //        $dateBirthday->disabledDay("sat");
178
-        //        $dateBirthday->disabledDay("sun");
179
-        //        $dateBirthday->setSpecificDate(array("2011-04-14", "2010-12-25"), 0, 'month');
180
-        //        $dateBirthday->setSpecificDate(array("2011-04-01"), 0, 'year');
181
-        //        $dateBirthday->setAlignment('right', 'bottom'); //optional
182
-        // echo "<table><tr><td>zzzzz</td><td></td><td>";
183
-        // echo $dateBirthday->render();
184
-        // echo "</td></tr></table>";
185
-        //echo $dateBirthday->render();
186
-        //================================================
187
-        // @author      Gregory Mage (Aka Mage)
188
-        //***************************************************************************************
189
-        //         require_once XOOPS_ROOT_PATH . "/modules/extcal/class/admin.php";
190
-        $adminObject = \Xmf\Module\Admin::getInstance();
191
-        $adminObject->displayNavigation(basename(__FILE__));
192
-        //***************************************************************************************
193
-
194
-        $eventId      = $_GET['event_id'];
195
-        $eventHandler = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_EVENT);
196
-
197
-        echo '<fieldset><legend style="font-weight:bold; color:#990000;">' . _MD_EXTCAL_EDIT_EVENT . '</legend>';
198
-
199
-        if ($form = $eventHandler->getEventForm('admin', $action, ['event_id' => $eventId])) {
200
-            $form->display();
201
-        }
202 202
 
203
-        echo '</fieldset><br>';
203
+            echo '</fieldset><br>';
204 204
 
205
-        xoops_cp_footer();
205
+            xoops_cp_footer();
206 206
 
207
-        break;
207
+            break;
208 208
 
209
-    case 'clone2': /* sur clique de l'icone du formulaire*/
209
+        case 'clone2': /* sur clique de l'icone du formulaire*/
210 210
 
211
-        //$newEventId = 1;
212
-        $eventId      = $_GET['event_id'];
213
-        $eventHandler = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_EVENT);
214
-        $event        = $eventHandler->getEvent($eventId);
215
-        $t            = $event->getVars();
216
-        $data         = [];
217
-        //        while (list($key, $val) = each($t)) {
218
-        foreach ($t as $key => $val) {
219
-            $data[$key] = $val['value'];
220
-        }
211
+            //$newEventId = 1;
212
+            $eventId      = $_GET['event_id'];
213
+            $eventHandler = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_EVENT);
214
+            $event        = $eventHandler->getEvent($eventId);
215
+            $t            = $event->getVars();
216
+            $data         = [];
217
+            //        while (list($key, $val) = each($t)) {
218
+            foreach ($t as $key => $val) {
219
+                $data[$key] = $val['value'];
220
+            }
221 221
 
222
-        $data['event_id']    = 0;
223
-        $data['event_title'] .= ' (' . _AM_EXTCAL_CLONE_OF . $eventId . ')';
222
+            $data['event_id']    = 0;
223
+            $data['event_title'] .= ' (' . _AM_EXTCAL_CLONE_OF . $eventId . ')';
224 224
 
225
-        $newEvent = $eventHandler->create();
226
-        $newEvent->setVars($data);
227
-        $t = $eventHandler->insert($newEvent, true);
225
+            $newEvent = $eventHandler->create();
226
+            $newEvent->setVars($data);
227
+            $t = $eventHandler->insert($newEvent, true);
228 228
 
229
-        $newEventId = $newEvent->getVar('event_id');
230
-        $ts         = print_r($newEventId, true);
229
+            $newEventId = $newEvent->getVar('event_id');
230
+            $ts         = print_r($newEventId, true);
231 231
 
232
-        redirect_header("event.php?op=modify&event_id={$newEventId}", 3, _AM_EXTCAL_EVENT_DELETED, false);
233
-        break;
232
+            redirect_header("event.php?op=modify&event_id={$newEventId}", 3, _AM_EXTCAL_EVENT_DELETED, false);
233
+            break;
234 234
 
235
-    case 'delete':
235
+        case 'delete':
236 236
 
237
-        if (isset($_POST['confirm'])) {
238
-            if (!$GLOBALS['xoopsSecurity']->check()) {
239
-                redirect_header('index.php', 3, _NOPERM . '<br>' . implode('<br>', $GLOBALS['xoopsSecurity']->getErrors()));
237
+            if (isset($_POST['confirm'])) {
238
+                if (!$GLOBALS['xoopsSecurity']->check()) {
239
+                    redirect_header('index.php', 3, _NOPERM . '<br>' . implode('<br>', $GLOBALS['xoopsSecurity']->getErrors()));
240
+                }
241
+                //             $eventHandler = xoops_getModuleHandler(_EXTCAL_CLS_EVENT, _EXTCAL_MODULE);
242
+                //             $eventHandler->deleteEvent($_POST['event_id']);
243
+                deleteEvents($_POST['event_id']);
244
+                redirect_header('event.php', 3, _AM_EXTCAL_EVENT_DELETED, false);
245
+            } else {
246
+                xoops_cp_header();
247
+                // @author      Gregory Mage (Aka Mage)
248
+                //***************************************************************************************
249
+                //require_once XOOPS_ROOT_PATH . "/modules/extcal/class/admin.php";
250
+                $adminObject = \Xmf\Module\Admin::getInstance();
251
+                $adminObject->displayNavigation(basename(__FILE__));
252
+                //***************************************************************************************
253
+
254
+                $hiddens = ['event_id' => $_GET['event_id'], 'form_delete' => '', 'confirm' => 1];
255
+                xoops_confirm($hiddens, 'event.php?op=delete', _AM_EXTCAL_CONFIRM_DELETE_EVENT, _DELETE, 'event.php');
256
+
257
+                xoops_cp_footer();
240 258
             }
241
-            //             $eventHandler = xoops_getModuleHandler(_EXTCAL_CLS_EVENT, _EXTCAL_MODULE);
242
-            //             $eventHandler->deleteEvent($_POST['event_id']);
243
-            deleteEvents($_POST['event_id']);
244
-            redirect_header('event.php', 3, _AM_EXTCAL_EVENT_DELETED, false);
245
-        } else {
259
+
260
+            break;
261
+
262
+        case 'deleteSelection':
263
+
246 264
             xoops_cp_header();
247 265
             // @author      Gregory Mage (Aka Mage)
248 266
             //***************************************************************************************
@@ -250,185 +268,167 @@  discard block
 block discarded – undo
250 268
             $adminObject = \Xmf\Module\Admin::getInstance();
251 269
             $adminObject->displayNavigation(basename(__FILE__));
252 270
             //***************************************************************************************
271
+            if (isset($_POST['deleteSelection'][0])) {
272
+                $msg = _AM_EXTCAL_CONFIRM_DELETE_ALL;
273
+                $ids = array_keys($_POST['deleteAllEvents']);
274
+            } else {
275
+                $msg = _AM_EXTCAL_CONFIRM_DELETE_SELECTION;
276
+                $ids = array_keys($_POST['deleteEvents']);
277
+            }
253 278
 
254
-            $hiddens = ['event_id' => $_GET['event_id'], 'form_delete' => '', 'confirm' => 1];
255
-            xoops_confirm($hiddens, 'event.php?op=delete', _AM_EXTCAL_CONFIRM_DELETE_EVENT, _DELETE, 'event.php');
279
+            //           $msg = ((isset($_POST['deleteSelection'][0])) ? _AM_EXTCAL_CONFIRM_DELETE_ALL : _AM_EXTCAL_CONFIRM_DELETE_SELECTION);
280
+            //           $ids = array_keys($_POST['deleteEvents']);
281
+            $ids = implode(',', $ids);
282
+            //echo $ids.'<br>';
283
+            $hiddens = ['event_ids' => $ids, 'form_delete' => '', 'confirm' => 1];
284
+            //$hiddens = array('event_ids' => $_POST['deleteEvents'], 'form_delete' => '', 'confirm' => 1);
285
+            xoops_confirm($hiddens, 'event.php?op=deleteSelectionOK', $msg, _DELETE, 'event.php');
256 286
 
257 287
             xoops_cp_footer();
258
-        }
259 288
 
260
-        break;
261
-
262
-    case 'deleteSelection':
263
-
264
-        xoops_cp_header();
265
-        // @author      Gregory Mage (Aka Mage)
266
-        //***************************************************************************************
267
-        //require_once XOOPS_ROOT_PATH . "/modules/extcal/class/admin.php";
268
-        $adminObject = \Xmf\Module\Admin::getInstance();
269
-        $adminObject->displayNavigation(basename(__FILE__));
270
-        //***************************************************************************************
271
-        if (isset($_POST['deleteSelection'][0])) {
272
-            $msg = _AM_EXTCAL_CONFIRM_DELETE_ALL;
273
-            $ids = array_keys($_POST['deleteAllEvents']);
274
-        } else {
275
-            $msg = _AM_EXTCAL_CONFIRM_DELETE_SELECTION;
276
-            $ids = array_keys($_POST['deleteEvents']);
277
-        }
289
+            break;
278 290
 
279
-        //           $msg = ((isset($_POST['deleteSelection'][0])) ? _AM_EXTCAL_CONFIRM_DELETE_ALL : _AM_EXTCAL_CONFIRM_DELETE_SELECTION);
280
-        //           $ids = array_keys($_POST['deleteEvents']);
281
-        $ids = implode(',', $ids);
282
-        //echo $ids.'<br>';
283
-        $hiddens = ['event_ids' => $ids, 'form_delete' => '', 'confirm' => 1];
284
-        //$hiddens = array('event_ids' => $_POST['deleteEvents'], 'form_delete' => '', 'confirm' => 1);
285
-        xoops_confirm($hiddens, 'event.php?op=deleteSelectionOK', $msg, _DELETE, 'event.php');
286
-
287
-        xoops_cp_footer();
288
-
289
-        break;
290
-
291
-    case 'deleteSelectionOK':
292
-        //-----------------------------------------
293
-        // $t = print_r($_GET,true);
294
-        // echo "<hr><pre>{$t}</pre><hr>";
295
-        //
296
-        // $t = print_r($_POST,true);
297
-        // echo "<hr><pre>{$t}</pre><hr>";
298
-        // exit;
299
-        //-----------------------------------------
300
-
301
-        if (isset($_POST['deleteSelection'][0])) {
302
-        } else {
303
-            if (!$GLOBALS['xoopsSecurity']->check()) {
304
-                redirect_header('index.php', 3, _NOPERM . '<br>' . implode('<br>', $GLOBALS['xoopsSecurity']->getErrors()));
305
-            }
291
+        case 'deleteSelectionOK':
292
+            //-----------------------------------------
293
+            // $t = print_r($_GET,true);
294
+            // echo "<hr><pre>{$t}</pre><hr>";
295
+            //
296
+            // $t = print_r($_POST,true);
297
+            // echo "<hr><pre>{$t}</pre><hr>";
298
+            // exit;
299
+            //-----------------------------------------
306 300
 
307
-            deleteEvents($_POST['event_ids']);
301
+            if (isset($_POST['deleteSelection'][0])) {
302
+            } else {
303
+                if (!$GLOBALS['xoopsSecurity']->check()) {
304
+                    redirect_header('index.php', 3, _NOPERM . '<br>' . implode('<br>', $GLOBALS['xoopsSecurity']->getErrors()));
305
+                }
308 306
 
309
-            redirect_header('event.php', 3, _AM_EXTCAL_EVENTS_DELETED, false);
310
-        }
307
+                deleteEvents($_POST['event_ids']);
311 308
 
312
-        break;
309
+                redirect_header('event.php', 3, _AM_EXTCAL_EVENTS_DELETED, false);
310
+            }
313 311
 
314
-    case 'default':
315
-    default:
312
+            break;
316 313
 
317
-        //global $extcalConfig;
318
-        $extcalConfig      = Extcal\Config::getHandler();
319
-        $xoopsModuleConfig = $extcalConfig->getModuleConfig();
314
+        case 'default':
315
+        default:
320 316
 
321
-        $start          = isset($_GET['start']) ? $_GET['start'] : 0;
322
-        $nbEventsByPage = $xoopsModuleConfig['nbEventsByPage'];
317
+            //global $extcalConfig;
318
+            $extcalConfig      = Extcal\Config::getHandler();
319
+            $xoopsModuleConfig = $extcalConfig->getModuleConfig();
323 320
 
324
-        xoops_cp_header();
325
-        // @author      Gregory Mage (Aka Mage)
326
-        //***************************************************************************************
321
+            $start          = isset($_GET['start']) ? $_GET['start'] : 0;
322
+            $nbEventsByPage = $xoopsModuleConfig['nbEventsByPage'];
327 323
 
328
-        $adminObject = \Xmf\Module\Admin::getInstance();
329
-        $adminObject->displayNavigation(basename(__FILE__));
330
-        //***************************************************************************************
324
+            xoops_cp_header();
325
+            // @author      Gregory Mage (Aka Mage)
326
+            //***************************************************************************************
331 327
 
332
-        $eventHandler = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_EVENT);
333
-        $events       = $eventHandler->objectToArray($eventHandler->getNewEvent($start, $nbEventsByPage, 0, true), ['cat_id']);
334
-        $eventHandler->formatEventsDate($events, _SHORTDATESTRING);
328
+            $adminObject = \Xmf\Module\Admin::getInstance();
329
+            $adminObject->displayNavigation(basename(__FILE__));
330
+            //***************************************************************************************
335 331
 
336
-        echo '<fieldset><legend style="font-weight:bold; color:#990000;">' . _AM_EXTCAL_APPROVED_EVENT . '</legend>';
337
-        echo '<fieldset><legend style="font-weight:bold; color:#0A3760;">' . _AM_EXTCAL_INFORMATION . '</legend>';
338
-        //echo'<img src='. XOOPS_URL .'/'. $moduleInfo->getInfo('dirmoduleadmin').'/assets/images/action/edit.png' .' '.'style=vertical-align:middle;>&nbsp;&nbsp;' . _AM_EXTCAL_INFO_EDIT . '<br>';
339
-        //echo'<img src='. XOOPS_URL .'/'. $moduleInfo->getInfo('dirmoduleadmin').'/assets/images/action/delete.png'. ' '."style=vertical-align:middle;>&nbsp;&nbsp;". _AM_EXTCAL_INFO_DELETE;
332
+            $eventHandler = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_EVENT);
333
+            $events       = $eventHandler->objectToArray($eventHandler->getNewEvent($start, $nbEventsByPage, 0, true), ['cat_id']);
334
+            $eventHandler->formatEventsDate($events, _SHORTDATESTRING);
340 335
 
341
-        echo '<img src=' . $pathIcon16 . '/edit.png' . ' ' . 'style=vertical-align:middle;>&nbsp;&nbsp;' . _AM_EXTCAL_INFO_EDIT . '<br>';
342
-        echo '<img src=' . $pathIcon16 . '/delete.png' . ' ' . 'style=vertical-align:middle;>&nbsp;&nbsp;' . _AM_EXTCAL_INFO_DELETE . '<br>';
336
+            echo '<fieldset><legend style="font-weight:bold; color:#990000;">' . _AM_EXTCAL_APPROVED_EVENT . '</legend>';
337
+            echo '<fieldset><legend style="font-weight:bold; color:#0A3760;">' . _AM_EXTCAL_INFORMATION . '</legend>';
338
+            //echo'<img src='. XOOPS_URL .'/'. $moduleInfo->getInfo('dirmoduleadmin').'/assets/images/action/edit.png' .' '.'style=vertical-align:middle;>&nbsp;&nbsp;' . _AM_EXTCAL_INFO_EDIT . '<br>';
339
+            //echo'<img src='. XOOPS_URL .'/'. $moduleInfo->getInfo('dirmoduleadmin').'/assets/images/action/delete.png'. ' '."style=vertical-align:middle;>&nbsp;&nbsp;". _AM_EXTCAL_INFO_DELETE;
343 340
 
344
-        echo '</fieldset><br>';
341
+            echo '<img src=' . $pathIcon16 . '/edit.png' . ' ' . 'style=vertical-align:middle;>&nbsp;&nbsp;' . _AM_EXTCAL_INFO_EDIT . '<br>';
342
+            echo '<img src=' . $pathIcon16 . '/delete.png' . ' ' . 'style=vertical-align:middle;>&nbsp;&nbsp;' . _AM_EXTCAL_INFO_DELETE . '<br>';
345 343
 
346
-        echo '<fieldset><legend style="font-weight:bold; color:#0A3760;">' . _MD_EXTCAL_SUBMITED_EVENT . '</legend>';
344
+            echo '</fieldset><br>';
347 345
 
348
-        echo '<form method="POST" action="event.php">';
349
-        echo '<input type="hidden" name="op" value="deleteSelection">';
346
+            echo '<fieldset><legend style="font-weight:bold; color:#0A3760;">' . _MD_EXTCAL_SUBMITED_EVENT . '</legend>';
350 347
 
351
-        echo '<table class="outer" style="width:100%;">';
352
-        echo '<tr style="text-align:center;">';
353
-        echo '<th>' . _AM_EXTCAL_DELETE . '</th>';
354
-        echo '<th>#</th>';
355
-        echo '<th>' . _AM_EXTCAL_CATEGORY . '</th>';
356
-        echo '<th>' . _AM_EXTCAL_TITLE . '</th>';
357
-        echo '<th>' . _AM_EXTCAL_START_DATE . '</th>';
358
-        echo '<th>' . _AM_EXTCAL_END_DATE . '</th>';
359
-        echo '<th>' . _AM_EXTCAL_RECURRENT . '</th>';
360
-        echo '<th>' . _AM_EXTCAL_START_RULES . '</th>';
361
-        echo '<th>' . _AM_EXTCAL_ACTION . '</th>';
348
+            echo '<form method="POST" action="event.php">';
349
+            echo '<input type="hidden" name="op" value="deleteSelection">';
362 350
 
363
-        echo '</tr>';
351
+            echo '<table class="outer" style="width:100%;">';
352
+            echo '<tr style="text-align:center;">';
353
+            echo '<th>' . _AM_EXTCAL_DELETE . '</th>';
354
+            echo '<th>#</th>';
355
+            echo '<th>' . _AM_EXTCAL_CATEGORY . '</th>';
356
+            echo '<th>' . _AM_EXTCAL_TITLE . '</th>';
357
+            echo '<th>' . _AM_EXTCAL_START_DATE . '</th>';
358
+            echo '<th>' . _AM_EXTCAL_END_DATE . '</th>';
359
+            echo '<th>' . _AM_EXTCAL_RECURRENT . '</th>';
360
+            echo '<th>' . _AM_EXTCAL_START_RULES . '</th>';
361
+            echo '<th>' . _AM_EXTCAL_ACTION . '</th>';
364 362
 
365
-        if (count($events) > 0) {
366
-            $i = 0;
367
-            foreach ($events as $event) {
368
-                $class = (0 == ++$i % 2) ? 'even' : 'odd';
369
-                echo '<tr style="text-align:left;" class="' . $class . '">';
370
-                echo "<td width='10%' align='center'>";
371
-                echo "<input type='checkbox' name='deleteEvents[{$event['event_id']}]' value='1' >";
372
-                echo "<input type='hidden' name='deleteAllEvents[{$event['event_id']}]' value='1'>";
373
-                echo '</td>';
374
-                echo "<td align = 'center' width='5%'>" . $event['event_id'] . '</td>';
375
-                echo "<td  width='10%'>" . '<a href=cat.php?op=modify&amp;cat_id=' . $event['Category']['cat_id'] . '&form_modify' . '>' . $event['Category']['cat_name'] . '</a>' . '</td>';
376
-
377
-                echo '<td>' . '<a href=event.php?op=modify&amp;event_id=' . $event['event_id'] . '>' . $event['event_title'] . '</a>' . '</td>';
378
-
379
-                //                 if ($event['event_isrecur']) {
380
-                //                     echo '<td>' . $event['formated_reccur_rule'] . '</td>';
381
-                //                 } else {
382
-                //                     echo '<td>' . $event['formated_event_start'] . '</td>';
383
-                //                 }
384
-
385
-                echo "<td align = 'center' width='10%'>" . $event['formated_event_start'] . '</td>';
386
-                echo "<td align = 'center' width='10%'>" . $event['formated_event_end'] . '</td>';
387
-                echo '<td align="center">' . ((1 == $event['event_isrecur']) ? _YES : _NO) . '</td>';
388
-                if (!isset($event['formated_reccur_rule'])) {
389
-                    $event['formated_reccur_rule'] = '';
363
+            echo '</tr>';
364
+
365
+            if (count($events) > 0) {
366
+                $i = 0;
367
+                foreach ($events as $event) {
368
+                    $class = (0 == ++$i % 2) ? 'even' : 'odd';
369
+                    echo '<tr style="text-align:left;" class="' . $class . '">';
370
+                    echo "<td width='10%' align='center'>";
371
+                    echo "<input type='checkbox' name='deleteEvents[{$event['event_id']}]' value='1' >";
372
+                    echo "<input type='hidden' name='deleteAllEvents[{$event['event_id']}]' value='1'>";
373
+                    echo '</td>';
374
+                    echo "<td align = 'center' width='5%'>" . $event['event_id'] . '</td>';
375
+                    echo "<td  width='10%'>" . '<a href=cat.php?op=modify&amp;cat_id=' . $event['Category']['cat_id'] . '&form_modify' . '>' . $event['Category']['cat_name'] . '</a>' . '</td>';
376
+
377
+                    echo '<td>' . '<a href=event.php?op=modify&amp;event_id=' . $event['event_id'] . '>' . $event['event_title'] . '</a>' . '</td>';
378
+
379
+                    //                 if ($event['event_isrecur']) {
380
+                    //                     echo '<td>' . $event['formated_reccur_rule'] . '</td>';
381
+                    //                 } else {
382
+                    //                     echo '<td>' . $event['formated_event_start'] . '</td>';
383
+                    //                 }
384
+
385
+                    echo "<td align = 'center' width='10%'>" . $event['formated_event_start'] . '</td>';
386
+                    echo "<td align = 'center' width='10%'>" . $event['formated_event_end'] . '</td>';
387
+                    echo '<td align="center">' . ((1 == $event['event_isrecur']) ? _YES : _NO) . '</td>';
388
+                    if (!isset($event['formated_reccur_rule'])) {
389
+                        $event['formated_reccur_rule'] = '';
390
+                    }
391
+                    echo '<td>' . $event['formated_reccur_rule'] . '</td>';
392
+
393
+                    echo '<td style="width:10%; text-align:center;">';
394
+                    echo '<a href=event.php?op=modify&amp;event_id=' . $event['event_id'] . "><img src='" . $pathIcon16 . "/edit.png' title='" . _AM_EXTCAL_ICONE_EDIT . "'></a>&nbsp;&nbsp;";
395
+                    echo '<a href=event.php?op=delete&amp;event_id=' . $event['event_id'] . "><img src='" . $pathIcon16 . "/delete.png' title='" . _AM_EXTCAL_ICONE_DELETE . "'></a>&nbsp;&nbsp;";
396
+                    echo '<a href=event.php?op=clone&amp;event_id=' . $event['event_id'] . "><img src='" . $pathIcon16 . "/editcopy.png' title='" . _AM_EXTCAL_ICONE_CLONE . "'></a>";
397
+                    echo '</td>';
398
+
399
+                    echo '</tr>';
390 400
                 }
391
-                echo '<td>' . $event['formated_reccur_rule'] . '</td>';
401
+                //---------------------------------------------------------
402
+                $pageNav = new \XoopsPageNav($eventHandler->getCountNewEvent(), $nbEventsByPage, $start);
392 403
 
393
-                echo '<td style="width:10%; text-align:center;">';
394
-                echo '<a href=event.php?op=modify&amp;event_id=' . $event['event_id'] . "><img src='" . $pathIcon16 . "/edit.png' title='" . _AM_EXTCAL_ICONE_EDIT . "'></a>&nbsp;&nbsp;";
395
-                echo '<a href=event.php?op=delete&amp;event_id=' . $event['event_id'] . "><img src='" . $pathIcon16 . "/delete.png' title='" . _AM_EXTCAL_ICONE_DELETE . "'></a>&nbsp;&nbsp;";
396
-                echo '<a href=event.php?op=clone&amp;event_id=' . $event['event_id'] . "><img src='" . $pathIcon16 . "/editcopy.png' title='" . _AM_EXTCAL_ICONE_CLONE . "'></a>";
404
+                echo '<tr><td colspan="2" style="text-align: right;">';
405
+                echo $pageNav->renderNav(2);
397 406
                 echo '</td>';
398 407
 
399
-                echo '</tr>';
400
-            }
401
-            //---------------------------------------------------------
402
-            $pageNav = new \XoopsPageNav($eventHandler->getCountNewEvent(), $nbEventsByPage, $start);
408
+                echo '<td colspan="2" style="text-align: right;">';
403 409
 
404
-            echo '<tr><td colspan="2" style="text-align: right;">';
405
-            echo $pageNav->renderNav(2);
406
-            echo '</td>';
410
+                echo '<input type="submit" value="' . _AM_EXTCAL_DELETE_ALL . '" name="deleteSelection[0]">';
411
+                echo '<input type="submit" value="' . _AM_EXTCAL_DELETE_SELECTION . '" name="deleteSelection[1]">';
407 412
 
408
-            echo '<td colspan="2" style="text-align: right;">';
409
-
410
-            echo '<input type="submit" value="' . _AM_EXTCAL_DELETE_ALL . '" name="deleteSelection[0]">';
411
-            echo '<input type="submit" value="' . _AM_EXTCAL_DELETE_SELECTION . '" name="deleteSelection[1]">';
412
-
413
-            echo '</td>';
414
-            echo '</tr>';
415
-        } else {
416
-            echo '<tr><td colspan="5">' . _AM_EXTCAL_NO_PENDING_EVENT . '</td></tr>';
417
-        }
418
-        echo '</table>';
419
-        echo '</form>';
413
+                echo '</td>';
414
+                echo '</tr>';
415
+            } else {
416
+                echo '<tr><td colspan="5">' . _AM_EXTCAL_NO_PENDING_EVENT . '</td></tr>';
417
+            }
418
+            echo '</table>';
419
+            echo '</form>';
420 420
 
421
-        echo '</fieldset>';
422
-        echo '</fieldset><br><br>';
423
-        //Fin de la liste des evennement -------------------------------------
424
-        echo '<fieldset><legend style="font-weight:bold; color:#990000;">' . _MD_EXTCAL_SUBMIT_EVENT . '</legend>';
421
+            echo '</fieldset>';
422
+            echo '</fieldset><br><br>';
423
+            //Fin de la liste des evennement -------------------------------------
424
+            echo '<fieldset><legend style="font-weight:bold; color:#990000;">' . _MD_EXTCAL_SUBMIT_EVENT . '</legend>';
425 425
 
426
-        $form = $eventHandler->getEventForm('admin');
427
-        $form->display();
426
+            $form = $eventHandler->getEventForm('admin');
427
+            $form->display();
428 428
 
429
-        echo '</fieldset>';
429
+            echo '</fieldset>';
430 430
 
431
-        require_once __DIR__ . '/admin_footer.php';
431
+            require_once __DIR__ . '/admin_footer.php';
432 432
 
433
-        break;
433
+            break;
434 434
 }
Please login to merge, or discard this patch.
admin/main.php 1 patch
Switch Indentation   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
 }
36 36
 
37 37
 switch ($op) {
38
-    case 'notification':
39
-        switch ($fct) {
38
+        case 'notification':
39
+            switch ($fct) {
40 40
             case 'send':
41 41
                 if (!$GLOBALS['xoopsSecurity']->check()) {
42 42
                     redirect_header('index.php', 3, _NOPERM . '<br>' . implode('<br>', $GLOBALS['xoopsSecurity']->getErrors()));
@@ -132,78 +132,78 @@  discard block
 block discarded – undo
132 132
                 xoops_cp_footer();
133 133
 
134 134
                 break;
135
-        }
135
+            }
136 136
         break;
137 137
 
138
-    default:
139
-    case 'default':
140
-        // @author      Gregory Mage (Aka Mage)
141
-        //***************************************************************************************
142
-        xoops_cp_header();
143
-        //        require_once XOOPS_ROOT_PATH . "/modules/extcal/class/admin.php";
144
-        //        $catHandler = xoops_getModuleHandler(_EXTCAL_CLS_CAT, _EXTCAL_MODULE);
145
-        //        $eventHandler = xoops_getModuleHandler(_EXTCAL_CLS_EVENT, _EXTCAL_MODULE);
146
-        $adminObject = \Xmf\Module\Admin::getInstance();
147
-        $adminObject->addInfoBox(_MI_EXTCAL_DASHBOARD);
148
-        $adminObject->addInfoBoxLine(sprintf('<infolabel>' . _AM_EXTCAL_INDEX_CATEGORIES . '</infolabel>', $catHandler->getCount()), '', 'Green');
149
-        $adminObject->addInfoBoxLine(sprintf('<infolabel>' . _AM_EXTCAL_INDEX_EVENT . '</infolabel>', $eventHandler->getCount(new \Criteria('event_approved', 1))), '', 'Green');
150
-        $adminObject->addInfoBoxLine(sprintf('<infolabel>' . _AM_EXTCAL_INDEX_PENDING . '</infolabel>', $eventHandler->getCount(new \Criteria('event_approved', 0))), '', 'Red');
151
-        $criteriaCompo = new \CriteriaCompo();
152
-        $criteriaCompo->add(new \Criteria('event_approved', 1));
153
-        $criteriaCompo->add(new \Criteria('event_start', time(), '>='));
154
-        $adminObject->addInfoBoxLine(sprintf('<infolabel>' . _AM_EXTCAL_INDEX_APPROVED . '</infolabel><infotext>', $eventHandler->getCount($criteriaCompo) . '</infotext>'), '', 'Green');
155
-
156
-        $adminObject->addConfigBoxLine();
157
-        $adminObject->addConfigBoxLine(_AM_EXTCAL_PEAR_PATH);
158
-        $adminObject->addConfigBoxLine(_EXTCAL_PEAR_ROOT, 'folder');
159
-
160
-        //JJD
161
-        //         $adminObject->addConfigBoxLine(XOOPS_ROOT_PATH,'folder');
162
-
163
-        //        $adminObject->addLineConfigLabel(_AM_EXTCAL_CONFIG_PHP, $xoopsModule->getInfo("min_php"), 'php');
164
-        //        $adminObject->addLineConfigLabel(_AM_EXTCAL_CONFIG_XOOPS, $xoopsModule->getInfo("min_xoops"), 'xoops');
165
-        $adminObject->displayNavigation(basename(__FILE__));
166
-        $adminObject->displayIndex();
167
-        //***************************************************************************************
168
-        $pendingEvent = $eventHandler->objectToArray($eventHandler->getPendingEvent(), ['cat_id']);
169
-        $eventHandler->formatEventsDate($pendingEvent, 'd/m/Y');
170
-
171
-        echo '<fieldset><legend style="font-weight:bold; color:#990000;">' . _AM_EXTCAL_PENDING_EVENT . '</legend>';
172
-        echo '<fieldset><legend style="font-weight:bold; color:#0A3760;">' . _AM_EXTCAL_INFORMATION . '</legend>';
173
-        //        echo '<img src="../assets/images/icons/on.png" >&nbsp;&nbsp;'._AM_EXTCAL_INFO_APPROVE_PENDING_EVENT.'<br>';
174
-        echo '<img src=' . $pathIcon16 . '/edit.png>&nbsp;&nbsp;' . _AM_EXTCAL_INFO_EDIT_PENDING_EVENT . '<br>';
175
-        echo '<img src=' . $pathIcon16 . '/delete.png>&nbsp;&nbsp;' . _AM_EXTCAL_INFO_DELETE_PENDING_EVENT . '<br>';
176
-        echo '</fieldset><br>';
177
-
178
-        echo '<table class="outer" style="width:100%;">';
179
-        echo '<tr style="text-align:center;">';
180
-        echo '<th>' . _AM_EXTCAL_CATEGORY . '</th>';
181
-        echo '<th>' . _AM_EXTCAL_TITLE . '</th>';
182
-        echo '<th>' . _AM_EXTCAL_START_DATE . '</th>';
183
-        echo '<th>' . _AM_EXTCAL_ACTION . '</th>';
184
-        echo '</tr>';
185
-
186
-        if (count($pendingEvent) > 0) {
187
-            $i = 0;
188
-            foreach ($pendingEvent as $event) {
189
-                $class = (0 == ++$i % 2) ? 'even' : 'odd';
190
-                echo '<tr style="text-align:center;" class="' . $class . '">';
191
-                echo '<td>' . $event['Category']['cat_name'] . '</td>';
192
-                echo '<td>' . $event['event_title'] . '</td>';
193
-                echo '<td>' . $event['formated_event_start'] . '</td>';
194
-                echo '<td style="width:10%; text-align:center;">';
195
-                echo '<a href="event.php?op=modify&amp;event_id=' . $event['event_id'] . '"><img src=' . $pathIcon16 . '/edit.png></a>&nbsp;&nbsp;';
196
-                echo '<a href="event.php?op=delete&amp;event_id=' . $event['event_id'] . '"><img src=' . $pathIcon16 . '/delete.png></a>';
197
-                echo '</td>';
198
-                echo '</tr>';
138
+        default:
139
+        case 'default':
140
+            // @author      Gregory Mage (Aka Mage)
141
+            //***************************************************************************************
142
+            xoops_cp_header();
143
+            //        require_once XOOPS_ROOT_PATH . "/modules/extcal/class/admin.php";
144
+            //        $catHandler = xoops_getModuleHandler(_EXTCAL_CLS_CAT, _EXTCAL_MODULE);
145
+            //        $eventHandler = xoops_getModuleHandler(_EXTCAL_CLS_EVENT, _EXTCAL_MODULE);
146
+            $adminObject = \Xmf\Module\Admin::getInstance();
147
+            $adminObject->addInfoBox(_MI_EXTCAL_DASHBOARD);
148
+            $adminObject->addInfoBoxLine(sprintf('<infolabel>' . _AM_EXTCAL_INDEX_CATEGORIES . '</infolabel>', $catHandler->getCount()), '', 'Green');
149
+            $adminObject->addInfoBoxLine(sprintf('<infolabel>' . _AM_EXTCAL_INDEX_EVENT . '</infolabel>', $eventHandler->getCount(new \Criteria('event_approved', 1))), '', 'Green');
150
+            $adminObject->addInfoBoxLine(sprintf('<infolabel>' . _AM_EXTCAL_INDEX_PENDING . '</infolabel>', $eventHandler->getCount(new \Criteria('event_approved', 0))), '', 'Red');
151
+            $criteriaCompo = new \CriteriaCompo();
152
+            $criteriaCompo->add(new \Criteria('event_approved', 1));
153
+            $criteriaCompo->add(new \Criteria('event_start', time(), '>='));
154
+            $adminObject->addInfoBoxLine(sprintf('<infolabel>' . _AM_EXTCAL_INDEX_APPROVED . '</infolabel><infotext>', $eventHandler->getCount($criteriaCompo) . '</infotext>'), '', 'Green');
155
+
156
+            $adminObject->addConfigBoxLine();
157
+            $adminObject->addConfigBoxLine(_AM_EXTCAL_PEAR_PATH);
158
+            $adminObject->addConfigBoxLine(_EXTCAL_PEAR_ROOT, 'folder');
159
+
160
+            //JJD
161
+            //         $adminObject->addConfigBoxLine(XOOPS_ROOT_PATH,'folder');
162
+
163
+            //        $adminObject->addLineConfigLabel(_AM_EXTCAL_CONFIG_PHP, $xoopsModule->getInfo("min_php"), 'php');
164
+            //        $adminObject->addLineConfigLabel(_AM_EXTCAL_CONFIG_XOOPS, $xoopsModule->getInfo("min_xoops"), 'xoops');
165
+            $adminObject->displayNavigation(basename(__FILE__));
166
+            $adminObject->displayIndex();
167
+            //***************************************************************************************
168
+            $pendingEvent = $eventHandler->objectToArray($eventHandler->getPendingEvent(), ['cat_id']);
169
+            $eventHandler->formatEventsDate($pendingEvent, 'd/m/Y');
170
+
171
+            echo '<fieldset><legend style="font-weight:bold; color:#990000;">' . _AM_EXTCAL_PENDING_EVENT . '</legend>';
172
+            echo '<fieldset><legend style="font-weight:bold; color:#0A3760;">' . _AM_EXTCAL_INFORMATION . '</legend>';
173
+            //        echo '<img src="../assets/images/icons/on.png" >&nbsp;&nbsp;'._AM_EXTCAL_INFO_APPROVE_PENDING_EVENT.'<br>';
174
+            echo '<img src=' . $pathIcon16 . '/edit.png>&nbsp;&nbsp;' . _AM_EXTCAL_INFO_EDIT_PENDING_EVENT . '<br>';
175
+            echo '<img src=' . $pathIcon16 . '/delete.png>&nbsp;&nbsp;' . _AM_EXTCAL_INFO_DELETE_PENDING_EVENT . '<br>';
176
+            echo '</fieldset><br>';
177
+
178
+            echo '<table class="outer" style="width:100%;">';
179
+            echo '<tr style="text-align:center;">';
180
+            echo '<th>' . _AM_EXTCAL_CATEGORY . '</th>';
181
+            echo '<th>' . _AM_EXTCAL_TITLE . '</th>';
182
+            echo '<th>' . _AM_EXTCAL_START_DATE . '</th>';
183
+            echo '<th>' . _AM_EXTCAL_ACTION . '</th>';
184
+            echo '</tr>';
185
+
186
+            if (count($pendingEvent) > 0) {
187
+                $i = 0;
188
+                foreach ($pendingEvent as $event) {
189
+                    $class = (0 == ++$i % 2) ? 'even' : 'odd';
190
+                    echo '<tr style="text-align:center;" class="' . $class . '">';
191
+                    echo '<td>' . $event['Category']['cat_name'] . '</td>';
192
+                    echo '<td>' . $event['event_title'] . '</td>';
193
+                    echo '<td>' . $event['formated_event_start'] . '</td>';
194
+                    echo '<td style="width:10%; text-align:center;">';
195
+                    echo '<a href="event.php?op=modify&amp;event_id=' . $event['event_id'] . '"><img src=' . $pathIcon16 . '/edit.png></a>&nbsp;&nbsp;';
196
+                    echo '<a href="event.php?op=delete&amp;event_id=' . $event['event_id'] . '"><img src=' . $pathIcon16 . '/delete.png></a>';
197
+                    echo '</td>';
198
+                    echo '</tr>';
199
+                }
200
+            } else {
201
+                echo '<tr><td colspan="4">' . _AM_EXTCAL_NO_PENDING_EVENT . '</td></tr>';
199 202
             }
200
-        } else {
201
-            echo '<tr><td colspan="4">' . _AM_EXTCAL_NO_PENDING_EVENT . '</td></tr>';
202
-        }
203 203
 
204
-        echo '</table></fieldset><br>';
204
+            echo '</table></fieldset><br>';
205 205
 
206
-        require_once __DIR__ . '/admin_footer.php';
206
+            require_once __DIR__ . '/admin_footer.php';
207 207
 
208
-        break;
208
+            break;
209 209
 }
Please login to merge, or discard this patch.
class/pear/Calendar/docs/examples/1.php 1 patch
Switch Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -35,33 +35,33 @@
 block discarded – undo
35 35
 }
36 36
 
37 37
 switch (@$_GET['view']) {
38
-    default:
39
-        $_GET['view'] = 'calendar_year';
40
-    // no break
41
-    case 'calendar_year':
42
-        require_once CALENDAR_ROOT . 'Year.php';
43
-        $c = new Calendar_Year($_GET['y']);
44
-        break;
45
-    case 'calendar_month':
46
-        require_once CALENDAR_ROOT . 'Month.php';
47
-        $c = new Calendar_Month($_GET['y'], $_GET['m']);
48
-        break;
49
-    case 'calendar_day':
50
-        require_once CALENDAR_ROOT . 'Day.php';
51
-        $c = new Calendar_Day($_GET['y'], $_GET['m'], $_GET['d']);
52
-        break;
53
-    case 'calendar_hour':
54
-        require_once CALENDAR_ROOT . 'Hour.php';
55
-        $c = new Calendar_Hour($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h']);
56
-        break;
57
-    case 'calendar_minute':
58
-        require_once CALENDAR_ROOT . 'Minute.php';
59
-        $c = new Calendar_Minute($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i']);
60
-        break;
61
-    case 'calendar_second':
62
-        require_once CALENDAR_ROOT . 'Second.php';
63
-        $c = new Calendar_Second($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i'], $_GET['s']);
64
-        break;
38
+        default:
39
+            $_GET['view'] = 'calendar_year';
40
+        // no break
41
+        case 'calendar_year':
42
+            require_once CALENDAR_ROOT . 'Year.php';
43
+            $c = new Calendar_Year($_GET['y']);
44
+            break;
45
+        case 'calendar_month':
46
+            require_once CALENDAR_ROOT . 'Month.php';
47
+            $c = new Calendar_Month($_GET['y'], $_GET['m']);
48
+            break;
49
+        case 'calendar_day':
50
+            require_once CALENDAR_ROOT . 'Day.php';
51
+            $c = new Calendar_Day($_GET['y'], $_GET['m'], $_GET['d']);
52
+            break;
53
+        case 'calendar_hour':
54
+            require_once CALENDAR_ROOT . 'Hour.php';
55
+            $c = new Calendar_Hour($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h']);
56
+            break;
57
+        case 'calendar_minute':
58
+            require_once CALENDAR_ROOT . 'Minute.php';
59
+            $c = new Calendar_Minute($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i']);
60
+            break;
61
+        case 'calendar_second':
62
+            require_once CALENDAR_ROOT . 'Second.php';
63
+            $c = new Calendar_Second($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i'], $_GET['s']);
64
+            break;
65 65
 }
66 66
 
67 67
 echo 'Viewing: ' . @$_GET['view'] . '<br>';
Please login to merge, or discard this patch.
class/pear/Calendar/docs/examples/13.php 1 patch
Switch Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -39,33 +39,33 @@
 block discarded – undo
39 39
 }
40 40
 
41 41
 switch (@$_GET['view']) {
42
-    default:
43
-        $_GET['view'] = 'calendar_year';
44
-    // no break
45
-    case 'calendar_year':
46
-        require_once CALENDAR_ROOT . 'Year.php';
47
-        $c = new Calendar_Year($_GET['y']);
48
-        break;
49
-    case 'calendar_month':
50
-        require_once CALENDAR_ROOT . 'Month.php';
51
-        $c = new Calendar_Month($_GET['y'], $_GET['m']);
52
-        break;
53
-    case 'calendar_day':
54
-        require_once CALENDAR_ROOT . 'Day.php';
55
-        $c = new Calendar_Day($_GET['y'], $_GET['m'], $_GET['d']);
56
-        break;
57
-    case 'calendar_hour':
58
-        require_once CALENDAR_ROOT . 'Hour.php';
59
-        $c = new Calendar_Hour($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h']);
60
-        break;
61
-    case 'calendar_minute':
62
-        require_once CALENDAR_ROOT . 'Minute.php';
63
-        $c = new Calendar_Minute($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i']);
64
-        break;
65
-    case 'calendar_second':
66
-        require_once CALENDAR_ROOT . 'Second.php';
67
-        $c = new Calendar_Second($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i'], $_GET['s']);
68
-        break;
42
+        default:
43
+            $_GET['view'] = 'calendar_year';
44
+        // no break
45
+        case 'calendar_year':
46
+            require_once CALENDAR_ROOT . 'Year.php';
47
+            $c = new Calendar_Year($_GET['y']);
48
+            break;
49
+        case 'calendar_month':
50
+            require_once CALENDAR_ROOT . 'Month.php';
51
+            $c = new Calendar_Month($_GET['y'], $_GET['m']);
52
+            break;
53
+        case 'calendar_day':
54
+            require_once CALENDAR_ROOT . 'Day.php';
55
+            $c = new Calendar_Day($_GET['y'], $_GET['m'], $_GET['d']);
56
+            break;
57
+        case 'calendar_hour':
58
+            require_once CALENDAR_ROOT . 'Hour.php';
59
+            $c = new Calendar_Hour($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h']);
60
+            break;
61
+        case 'calendar_minute':
62
+            require_once CALENDAR_ROOT . 'Minute.php';
63
+            $c = new Calendar_Minute($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i']);
64
+            break;
65
+        case 'calendar_second':
66
+            require_once CALENDAR_ROOT . 'Second.php';
67
+            $c = new Calendar_Second($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i'], $_GET['s']);
68
+            break;
69 69
 }
70 70
 
71 71
 // Convert timestamp to human readable date
Please login to merge, or discard this patch.