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