Passed
Push — master ( 66eec6...f2a2b5 )
by Michael
02:23
created
include/oninstall.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 function xoops_module_pre_install_extcal(\XoopsModule $module)
31 31
 {
32 32
     $moduleDirName = basename(dirname(__DIR__));
33
-    $utility     = new Extcal\Utility();
33
+    $utility = new Extcal\Utility();
34 34
 
35 35
     //check for minimum XOOPS version
36 36
     if (!$utility::checkVerXoops($module)) {
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
45 45
     $mod_tables = $module->getInfo('tables');
46 46
     foreach ($mod_tables as $table) {
47
-        $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS ' . $GLOBALS['xoopsDB']->prefix($table) . ';');
47
+        $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS '.$GLOBALS['xoopsDB']->prefix($table).';');
48 48
     }
49 49
 
50 50
     return true;
@@ -73,18 +73,18 @@  discard block
 block discarded – undo
73 73
      */
74 74
 
75 75
     // Access right
76
-    $groupPermissionHandler->addRight($moduleDirName . '_perm_mask', 1, XOOPS_GROUP_ADMIN, $moduleId);
77
-    $groupPermissionHandler->addRight($moduleDirName . '_perm_mask', 1, XOOPS_GROUP_USERS, $moduleId);
78
-    $groupPermissionHandler->addRight($moduleDirName . '_perm_mask', 1, XOOPS_GROUP_ANONYMOUS, $moduleId);
76
+    $groupPermissionHandler->addRight($moduleDirName.'_perm_mask', 1, XOOPS_GROUP_ADMIN, $moduleId);
77
+    $groupPermissionHandler->addRight($moduleDirName.'_perm_mask', 1, XOOPS_GROUP_USERS, $moduleId);
78
+    $groupPermissionHandler->addRight($moduleDirName.'_perm_mask', 1, XOOPS_GROUP_ANONYMOUS, $moduleId);
79 79
 
80 80
     // Can submit
81
-    $groupPermissionHandler->addRight($moduleDirName . '_perm_mask', 2, XOOPS_GROUP_ADMIN, $moduleId);
81
+    $groupPermissionHandler->addRight($moduleDirName.'_perm_mask', 2, XOOPS_GROUP_ADMIN, $moduleId);
82 82
 
83 83
     // Auto approve
84
-    $groupPermissionHandler->addRight($moduleDirName . '_perm_mask', 4, XOOPS_GROUP_ADMIN, $moduleId);
84
+    $groupPermissionHandler->addRight($moduleDirName.'_perm_mask', 4, XOOPS_GROUP_ADMIN, $moduleId);
85 85
 
86 86
     //    $moduleDirName = $xoopsModule->getVar('dirname');
87
-    $configurator = require_once $GLOBALS['xoops']->path('modules/' . $moduleDirName . '/include/config.php');
87
+    $configurator = require_once $GLOBALS['xoops']->path('modules/'.$moduleDirName.'/include/config.php');
88 88
 
89 89
     /** @var Extcal\Utility $utility */
90 90
     $utility = new \XoopsModules\Extcal\Utility();
@@ -96,9 +96,9 @@  discard block
 block discarded – undo
96 96
         }
97 97
     }
98 98
     if (count($configurator['copyFiles']) > 0) {
99
-        $file =  dirname(__DIR__) . '/assets/images/blank.png';
99
+        $file = dirname(__DIR__).'/assets/images/blank.png';
100 100
         foreach (array_keys($configurator['copyFiles']) as $i) {
101
-            $dest = $configurator['copyFiles'][$i] . '/blank.png';
101
+            $dest = $configurator['copyFiles'][$i].'/blank.png';
102 102
             $utility::copyFile($file, $dest);
103 103
         }
104 104
     }
Please login to merge, or discard this patch.
view_year.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -19,11 +19,11 @@  discard block
 block discarded – undo
19 19
 
20 20
 use XoopsModules\Extcal;
21 21
 
22
-require_once dirname(dirname(__DIR__)) . '/mainfile.php';
23
-require_once __DIR__ . '/include/constantes.php';
22
+require_once dirname(dirname(__DIR__)).'/mainfile.php';
23
+require_once __DIR__.'/include/constantes.php';
24 24
 $params                                  = ['view' => _EXTCAL_NAV_YEAR, 'file' => _EXTCAL_FILE_YEAR];
25 25
 $GLOBALS['xoopsOption']['template_main'] = "extcal_view_{$params['view']}.tpl";
26
-require_once __DIR__ . '/header.php';
26
+require_once __DIR__.'/header.php';
27 27
 
28 28
 /** @var Extcal\Helper $helper */
29 29
 $helper = Extcal\Helper::getInstance();
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     'cat'          => $cat,
60 60
     'externalKeys' => 'cat_id',
61 61
 ];
62
-$events   = $eventHandler->getEventsOnPeriode($criteres);
62
+$events = $eventHandler->getEventsOnPeriode($criteres);
63 63
 /**********************************************************************/
64 64
 $eventsArray = $events;
65 65
 // Formating date
@@ -103,21 +103,21 @@  discard block
 block discarded – undo
103 103
 // Making navig data
104 104
 $navig = [
105 105
     'prev' => [
106
-        'uri'  => 'year=' . $prevYear,
106
+        'uri'  => 'year='.$prevYear,
107 107
         'name' => $prevYear,
108 108
     ],
109 109
     'this' => [
110
-        'uri'  => 'year=' . $year,
110
+        'uri'  => 'year='.$year,
111 111
         'name' => $year,
112 112
     ],
113 113
     'next' => [
114
-        'uri'  => 'year=' . $nexYear,
114
+        'uri'  => 'year='.$nexYear,
115 115
         'name' => $nexYear,
116 116
     ],
117 117
 ];
118 118
 
119 119
 // Title of the page
120
-$xoopsTpl->assign('xoops_pagetitle', $xoopsModule->getVar('name') . ' ' . $navig['this']['name']);
120
+$xoopsTpl->assign('xoops_pagetitle', $xoopsModule->getVar('name').' '.$navig['this']['name']);
121 121
 
122 122
 // Assigning navig data to the template
123 123
 $xoopsTpl->assign('navig', $navig);
@@ -171,4 +171,4 @@  discard block
 block discarded – undo
171 171
 $xoopsTpl->assign('lang', $lang);
172 172
 $xoopsTpl->assign('view', 'year');
173 173
 
174
-require_once XOOPS_ROOT_PATH . '/footer.php';
174
+require_once XOOPS_ROOT_PATH.'/footer.php';
Please login to merge, or discard this patch.
view_agenda-week.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -2,11 +2,11 @@  discard block
 block discarded – undo
2 2
 
3 3
 use XoopsModules\Extcal;
4 4
 
5
-require_once dirname(dirname(__DIR__)) . '/mainfile.php';
6
-require_once __DIR__ . '/include/constantes.php';
5
+require_once dirname(dirname(__DIR__)).'/mainfile.php';
6
+require_once __DIR__.'/include/constantes.php';
7 7
 $params                                  = ['view' => _EXTCAL_NAV_AGENDA_WEEK, 'file' => _EXTCAL_FILE_AGENDA_WEEK];
8 8
 $GLOBALS['xoopsOption']['template_main'] = "extcal_view_{$params['view']}.tpl";
9
-require_once __DIR__ . '/header.php';
9
+require_once __DIR__.'/header.php';
10 10
 /** @var Extcal\Helper $helper */
11 11
 $helper = Extcal\Helper::getInstance();
12 12
 
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 $dayTS = mktime(0, 0, 0, $month, $day, $year);
21 21
 //$offset = date('w', $dayTS) - $helper->getConfig('week_start_day');
22 22
 $offset = date('w', $dayTS) + 7 - $helper->getConfig('week_start_day') < 7 ? date('w', $dayTS) + 7 - $helper->getConfig('week_start_day') : 0;
23
-$dayTS  -= ($offset * _EXTCAL_TS_DAY);
23
+$dayTS -= ($offset * _EXTCAL_TS_DAY);
24 24
 $year   = date('Y', $dayTS);
25 25
 $month  = date('n', $dayTS);
26 26
 $day    = date('j', $dayTS);
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     'nbJours'      => $nbJours,
54 54
     'externalKeys' => 'cat_id',
55 55
 ];
56
-$events   = $eventHandler->getEventsOnPeriode($criteres);
56
+$events = $eventHandler->getEventsOnPeriode($criteres);
57 57
 /**********************************************************************/
58 58
 $eventsArray = $events;
59 59
 // Formating date
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 //-------------------------------------------------------------------
86 86
 
87 87
 //$params['colJourWidth'] = (int)((((500-50)/$nbJours)/500*100)+.5);
88
-$params['colJourWidth'] = (int)((((500 - 50) / $nbJours) / 500 * 100) + .6);
88
+$params['colJourWidth'] = (int) ((((500 - 50) / $nbJours) / 500 * 100) + .6);
89 89
 //  echo "agenda_week : {$dayTS}<br>";
90 90
 $tAgenda = agenda_getEvents($eventsArray, $dayTS, $hStart, $hEnd, $mTranche, $nbJours);
91 91
 //$exp = print_r($eventsArray, true);
@@ -107,21 +107,21 @@  discard block
 block discarded – undo
107 107
 
108 108
 $navig = [
109 109
     'prev' => [
110
-        'uri'  => 'year=' . $pWeekCalObj->thisYear() . '&amp;month=' . $pWeekCalObj->thisMonth() . '&amp;day=' . $pWeekCalObj->thisDay(),
110
+        'uri'  => 'year='.$pWeekCalObj->thisYear().'&amp;month='.$pWeekCalObj->thisMonth().'&amp;day='.$pWeekCalObj->thisDay(),
111 111
         'name' => $timeHandler->getFormatedDate($helper->getConfig('nav_date_week'), $pWeekCalObj->getTimestamp()),
112 112
     ],
113 113
     'this' => [
114
-        'uri'  => 'year=' . $weekCalObj->thisYear() . '&amp;month=' . $weekCalObj->thisMonth() . '&amp;day=' . $weekCalObj->thisDay(),
114
+        'uri'  => 'year='.$weekCalObj->thisYear().'&amp;month='.$weekCalObj->thisMonth().'&amp;day='.$weekCalObj->thisDay(),
115 115
         'name' => $timeHandler->getFormatedDate($helper->getConfig('nav_date_week'), $weekCalObj->getTimestamp()),
116 116
     ],
117 117
     'next' => [
118
-        'uri'  => 'year=' . $nWeekCalObj->thisYear() . '&amp;month=' . $nWeekCalObj->thisMonth() . '&amp;day=' . $nWeekCalObj->thisDay(),
118
+        'uri'  => 'year='.$nWeekCalObj->thisYear().'&amp;month='.$nWeekCalObj->thisMonth().'&amp;day='.$nWeekCalObj->thisDay(),
119 119
         'name' => $timeHandler->getFormatedDate($helper->getConfig('nav_date_week'), $nWeekCalObj->getTimestamp()),
120 120
     ],
121 121
 ];
122 122
 
123 123
 // Title of the page
124
-$xoopsTpl->assign('xoops_pagetitle', $xoopsModule->getVar('name') . ' ' . $navig['this']['name']);
124
+$xoopsTpl->assign('xoops_pagetitle', $xoopsModule->getVar('name').' '.$navig['this']['name']);
125 125
 
126 126
 // Assigning navig data to the template
127 127
 $xoopsTpl->assign('navig', $navig);
@@ -162,4 +162,4 @@  discard block
 block discarded – undo
162 162
 $xoopsTpl->assign('lang', $lang);
163 163
 $xoopsTpl->assign('view', 'agendaweek');
164 164
 
165
-require_once XOOPS_ROOT_PATH . '/footer.php';
165
+require_once XOOPS_ROOT_PATH.'/footer.php';
Please login to merge, or discard this patch.
view_calendar-month.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@  discard block
 block discarded – undo
2 2
 
3 3
 use XoopsModules\Extcal;
4 4
 
5
-require_once dirname(dirname(__DIR__)) . '/mainfile.php';
6
-require_once __DIR__ . '/include/constantes.php';
5
+require_once dirname(dirname(__DIR__)).'/mainfile.php';
6
+require_once __DIR__.'/include/constantes.php';
7 7
 
8 8
 /** @var Extcal\Helper $helper */
9 9
 $helper = Extcal\Helper::getInstance();
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 //require_once __DIR__   . '/preloads/autoloader.php';
16 16
 //$catHandler   = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_CAT);
17 17
 
18
-require_once __DIR__ . '/header.php';
18
+require_once __DIR__.'/header.php';
19 19
 
20 20
 /* ========================================================================== */
21 21
 $year  = \Xmf\Request::getInt('year', date('Y'), 'GET');
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     'cat'          => $cat,
43 43
     'externalKeys' => 'cat_id',
44 44
 ];
45
-$events   = $eventHandler->getEventsOnPeriode($criteres);
45
+$events = $eventHandler->getEventsOnPeriode($criteres);
46 46
 /**********************************************************************/
47 47
 
48 48
 // Calculating timestamp for the begin and the end of the month
@@ -138,21 +138,21 @@  discard block
 block discarded – undo
138 138
 // Making navig data
139 139
 $navig = [
140 140
     'prev' => [
141
-        'uri'  => 'year=' . $pMonthCalObj->thisYear() . '&amp;month=' . $pMonthCalObj->thisMonth(),
141
+        'uri'  => 'year='.$pMonthCalObj->thisYear().'&amp;month='.$pMonthCalObj->thisMonth(),
142 142
         'name' => $timeHandler->getFormatedDate($helper->getConfig('nav_date_month'), $pMonthCalObj->getTimestamp()),
143 143
     ],
144 144
     'this' => [
145
-        'uri'  => 'year=' . $monthCalObj->thisYear() . '&amp;month=' . $monthCalObj->thisMonth(),
145
+        'uri'  => 'year='.$monthCalObj->thisYear().'&amp;month='.$monthCalObj->thisMonth(),
146 146
         'name' => $timeHandler->getFormatedDate($helper->getConfig('nav_date_month'), $monthCalObj->getTimestamp()),
147 147
     ],
148 148
     'next' => [
149
-        'uri'  => 'year=' . $nMonthCalObj->thisYear() . '&amp;month=' . $nMonthCalObj->thisMonth(),
149
+        'uri'  => 'year='.$nMonthCalObj->thisYear().'&amp;month='.$nMonthCalObj->thisMonth(),
150 150
         'name' => $timeHandler->getFormatedDate($helper->getConfig('nav_date_month'), $nMonthCalObj->getTimestamp()),
151 151
     ],
152 152
 ];
153 153
 
154 154
 // Title of the page
155
-$xoopsTpl->assign('xoops_pagetitle', $xoopsModule->getVar('name') . ' ' . $navig['this']['name']);
155
+$xoopsTpl->assign('xoops_pagetitle', $xoopsModule->getVar('name').' '.$navig['this']['name']);
156 156
 
157 157
 // Assigning navig data to the template
158 158
 $xoopsTpl->assign('navig', $navig);
@@ -192,4 +192,4 @@  discard block
 block discarded – undo
192 192
 $xoopsTpl->assign('lang', $lang);
193 193
 $xoopsTpl->assign('view', 'calmonth');
194 194
 
195
-require_once XOOPS_ROOT_PATH . '/footer.php';
195
+require_once XOOPS_ROOT_PATH.'/footer.php';
Please login to merge, or discard this patch.
comment_edit.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,5 +17,5 @@
 block discarded – undo
17 17
  * @author       XOOPS Development Team,
18 18
  */
19 19
 
20
-require_once dirname(dirname(__DIR__)) . '/mainfile.php';
21
-require_once XOOPS_ROOT_PATH . '/include/comment_edit.php';
20
+require_once dirname(dirname(__DIR__)).'/mainfile.php';
21
+require_once XOOPS_ROOT_PATH.'/include/comment_edit.php';
Please login to merge, or discard this patch.
class/Location.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 //Kraven 30
22 22
 // defined('XOOPS_ROOT_PATH') || die('Restricted access');
23 23
 
24
-require_once XOOPS_ROOT_PATH . '/kernel/object.php';
24
+require_once XOOPS_ROOT_PATH.'/kernel/object.php';
25 25
 
26 26
 //class Event extends \XoopsObject
27 27
 //class extcal_location extends \XoopsObject
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 
72 72
         $title = $this->isNew() ? sprintf(_MD_EXTCAL_LOCATION_ADD) : sprintf(_MD_EXTCAL_LOCATION_EDIT);
73 73
 
74
-        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
74
+        require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
75 75
 
76 76
         $form = new \XoopsThemeForm($title, 'form', $action, 'post', true);
77 77
         $form->setExtra('enctype="multipart/form-data"');
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         $form->addElement(new \XoopsFormTextArea(_MD_EXTCAL_LOCATION_HORAIRES, 'horaires', $this->getVar('horaires'), 3, 40));
91 91
         $form->addElement(new \XoopsFormTextArea(_MD_EXTCAL_LOCATION_DIVERS, 'divers', $this->getVar('divers'), 5, 40));
92 92
         //$form->addElement( new \XoopsFormTextArea(_MD_EXTCAL_LOCATION_TARIFS, 'tarifs', $this->getVar("tarifs"), 5, 40));
93
-        $form->addElement(new \XoopsFormText(_MD_EXTCAL_LOCATION_TARIFS . ' ( ' . _MD_EXTCAL_DEVISE2 . ' )', 'tarifs', 20, 20, $this->getVar('tarifs')), false);
93
+        $form->addElement(new \XoopsFormText(_MD_EXTCAL_LOCATION_TARIFS.' ( '._MD_EXTCAL_DEVISE2.' )', 'tarifs', 20, 20, $this->getVar('tarifs')), false);
94 94
 
95 95
         //$form->addElement( new \XoopsFormTextArea(_MD_EXTCAL_LOCATION_MAP, 'map', $this->getVar("map"), 5, 40));
96 96
         $form->addElement(new \XoopsFormText(_MD_EXTCAL_LOCATION_MAP, 'map', 150, 255, $this->getVar('map')), false);
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
         //Logo
99 99
         $file_tray = new \XoopsFormElementTray(sprintf(_MD_EXTCAL_FORM_IMG, 2), '');
100 100
         if ('' != $this->getVar('logo')) {
101
-            $file_tray->addElement(new \XoopsFormLabel('', "<img src='" . XOOPS_URL . '/uploads/extcal/location/' . $this->getVar('logo') . "' name='image' id='image' alt=''><br><br>"));
101
+            $file_tray->addElement(new \XoopsFormLabel('', "<img src='".XOOPS_URL.'/uploads/extcal/location/'.$this->getVar('logo')."' name='image' id='image' alt=''><br><br>"));
102 102
             $check_del_img = new \XoopsFormCheckBox('', 'delimg');
103 103
             $check_del_img->addOption(1, _MD_EXTCAL_DEL_IMG);
104 104
             $file_tray->addElement($check_del_img);
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
109 109
         }
110 110
         $file_img->setExtra("size ='40'");
111 111
         $file_tray->addElement($file_img);
112
-        $msg        = sprintf(_MD_EXTCAL_IMG_CONFIG, (int)(3145728 / 1000), 500, 500);
113
-        $file_label = new \XoopsFormLabel('', '<br>' . $msg);
112
+        $msg        = sprintf(_MD_EXTCAL_IMG_CONFIG, (int) (3145728 / 1000), 500, 500);
113
+        $file_label = new \XoopsFormLabel('', '<br>'.$msg);
114 114
         $file_tray->addElement($file_label);
115 115
         $form->addElement($file_tray);
116 116
         $form->addElement(new \XoopsFormHidden('file', $this->getVar('logo')));
Please login to merge, or discard this patch.
class/FileHandler.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 // defined('XOOPS_ROOT_PATH') || die('Restricted access');
22 22
 
23 23
 // // require_once __DIR__ . '/ExtcalPersistableObjectHandler.php';
24
-require_once XOOPS_ROOT_PATH . '/class/uploader.php';
24
+require_once XOOPS_ROOT_PATH.'/class/uploader.php';
25 25
 
26 26
 /**
27 27
  * Class FileHandler.
@@ -46,13 +46,13 @@  discard block
 block discarded – undo
46 46
         $userId = $GLOBALS['xoopsUser'] ? $GLOBALS['xoopsUser']->getVar('uid') : 0;
47 47
 
48 48
         $allowedMimeType = [];
49
-        $mimeType        = require_once XOOPS_ROOT_PATH . '/include/mimetypes.inc.php';
49
+        $mimeType        = require_once XOOPS_ROOT_PATH.'/include/mimetypes.inc.php';
50 50
         foreach ($GLOBALS['xoopsModuleConfig']['allowed_file_extention'] as $fileExt) {
51 51
             $allowedMimeType[] = $mimeType[$fileExt];
52 52
         }
53 53
 
54
-        $uploader = new \XoopsMediaUploader(XOOPS_ROOT_PATH . '/uploads/extcal', $allowedMimeType, 3145728);
55
-        $uploader->setPrefix($userId . '-' . $eventId . '_');
54
+        $uploader = new \XoopsMediaUploader(XOOPS_ROOT_PATH.'/uploads/extcal', $allowedMimeType, 3145728);
55
+        $uploader->setPrefix($userId.'-'.$eventId.'_');
56 56
         if ($uploader->fetchMedia('event_file')) {
57 57
             if (!$uploader->upload()) {
58 58
                 return false;
@@ -113,14 +113,14 @@  discard block
 block discarded – undo
113 113
         if (\Xmf\Request::hasVar('filetokeep', 'POST')) {
114 114
             if (is_array($_POST['filetokeep'])) {
115 115
                 $count = count($_POST['filetokeep']);
116
-                $in    = '(' . $_POST['filetokeep'][0];
116
+                $in    = '('.$_POST['filetokeep'][0];
117 117
                 array_shift($_POST['filetokeep']);
118 118
                 foreach ($_POST['filetokeep'] as $elmt) {
119
-                    $in .= ',' . $elmt;
119
+                    $in .= ','.$elmt;
120 120
                 }
121 121
                 $in .= ')';
122 122
             } else {
123
-                $in = '(' . $_POST['filetokeep'] . ')';
123
+                $in = '('.$_POST['filetokeep'].')';
124 124
             }
125 125
             $criteria->add(new \Criteria('file_id', $in, 'NOT IN'));
126 126
         }
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
     public function formatFileSize(&$file)
158 158
     {
159 159
         if ($file['file_size'] > 1000) {
160
-            $file['formated_file_size'] = round($file['file_size'] / 1000) . 'kb';
160
+            $file['formated_file_size'] = round($file['file_size'] / 1000).'kb';
161 161
         } else {
162 162
             $file['formated_file_size'] = '1kb';
163 163
         }
@@ -168,8 +168,8 @@  discard block
 block discarded – undo
168 168
      */
169 169
     public function _deleteFile(&$file)
170 170
     {
171
-        if (file_exists(XOOPS_ROOT_PATH . '/uploads/extcal/' . $file->getVar('file_name'))) {
172
-            unlink(XOOPS_ROOT_PATH . '/uploads/extcal/' . $file->getVar('file_name'));
171
+        if (file_exists(XOOPS_ROOT_PATH.'/uploads/extcal/'.$file->getVar('file_name'))) {
172
+            unlink(XOOPS_ROOT_PATH.'/uploads/extcal/'.$file->getVar('file_name'));
173 173
         }
174 174
     }
175 175
 }
Please login to merge, or discard this patch.
class/EventHandler.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 
24 24
 // defined('XOOPS_ROOT_PATH') || die('Restricted access');
25 25
 
26
-require_once  dirname(__DIR__) . '/include/constantes.php';
26
+require_once  dirname(__DIR__).'/include/constantes.php';
27 27
 
28 28
 /**
29 29
  * Class EventHandler.
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
 
336 336
         //        while (list($k, $v) = each($events)) {
337 337
         foreach ($events as $k => $v) {
338
-            $ordre[] = (int)$v['event_start'];
338
+            $ordre[] = (int) $v['event_start'];
339 339
             $this->formatEventDate($v, Extcal\Helper::getInstance()->getConfig('event_date_week'));
340 340
             //$v['cat']['cat_light_color'] = $v['cat']['cat_color'];
341 341
             $v['cat']['cat_light_color'] = Extcal\Utility::getLighterColor($v['cat']['cat_color'], _EXTCAL_INFOBULLE_RGB_MIN, _EXTCAL_INFOBULLE_RGB_MAX);
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
         $cat = 0;
362 362
         //        while (list($k, $v) = each($criteres)) {
363 363
         foreach ($criteres as $k => $v) {
364
-            ${$k} =$v;
364
+            ${$k} = $v;
365 365
         }
366 366
         if (!isset($nbDays)) {
367 367
             $nbDays = 7;
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
     {
443 443
         //        while (list($k, $v) = each($criteres)) {
444 444
         foreach ($criteres as $k => $v) {
445
-            ${$k} =$v;
445
+            ${$k} = $v;
446 446
         }
447 447
         if (!isset($nbDays)) {
448 448
             $nbDays = 7;
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
 
538 538
         reset($period);
539 539
         foreach ($period as $dt) {
540
-            echo $dt->format("l d-m-Y H:i:s\n") . '<br>';
540
+            echo $dt->format("l d-m-Y H:i:s\n").'<br>';
541 541
         }
542 542
     }
543 543
 
@@ -866,10 +866,10 @@  discard block
 block discarded – undo
866 866
         $authorizedAccessCats = $this->extcalPerm->getAuthorizedCat($user, 'extcal_cat_view');
867 867
         $count                = count($authorizedAccessCats);
868 868
         if ($count > 0) {
869
-            $in = '(' . $authorizedAccessCats[0];
869
+            $in = '('.$authorizedAccessCats[0];
870 870
             array_shift($authorizedAccessCats);
871 871
             foreach ($authorizedAccessCats as $authorizedAccessCat) {
872
-                $in .= ',' . $authorizedAccessCat;
872
+                $in .= ','.$authorizedAccessCat;
873 873
             }
874 874
             $in .= ')';
875 875
             $criteria->add(new \Criteria('cat_id', $in, 'IN'));
@@ -889,10 +889,10 @@  discard block
 block discarded – undo
889 889
         }
890 890
         if (is_array($cats)) {
891 891
             if (false === array_search(0, $cats)) {
892
-                $in = '(' . current($cats);
892
+                $in = '('.current($cats);
893 893
                 array_shift($cats);
894 894
                 foreach ($cats as $cat) {
895
-                    $in .= ',' . $cat;
895
+                    $in .= ','.$cat;
896 896
                 }
897 897
                 $in .= ')';
898 898
                 $criteria->add(new \Criteria('cat_id', $in, 'IN'));
@@ -933,7 +933,7 @@  discard block
 block discarded – undo
933 933
             if ('clone' === $mode) {
934 934
                 $data['event_id'] = 0;
935 935
                 $event->setVar('event_id', 0);
936
-                $newTitle = $event->getVar('event_title') . ' (' . _MD_EXTCAL_CLONE_OF . $data['event_id'] . ')';
936
+                $newTitle = $event->getVar('event_title').' ('._MD_EXTCAL_CLONE_OF.$data['event_id'].')';
937 937
                 $event->setVar('event_title', $newTitle);
938 938
             }
939 939
 
@@ -1117,7 +1117,7 @@  discard block
 block discarded – undo
1117 1117
         $form->addElement($catSelect, true);
1118 1118
         //-----------------------------------------------------------
1119 1119
 
1120
-        $file_path =  dirname(__DIR__) . '/assets/css/images';
1120
+        $file_path = dirname(__DIR__).'/assets/css/images';
1121 1121
         $tf        = \XoopsLists::getImgListAsArray($file_path);
1122 1122
         array_unshift($tf, _MD_EXTCAL_NONE);
1123 1123
         $xfIcones = new \XoopsFormSelect(_MD_EXTCAL_ICONE, 'event_icone', $event_icone, '');
@@ -1127,7 +1127,7 @@  discard block
 block discarded – undo
1127 1127
         //location
1128 1128
         $locationHandler = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_LOCATION);
1129 1129
         $location_select = new \XoopsFormSelect(_MD_EXTCAL_LOCATION, 'event_location', $event_location);
1130
-        $criteria             = new \CriteriaCompo();
1130
+        $criteria = new \CriteriaCompo();
1131 1131
         $criteria->setSort('nom');
1132 1132
         $criteria->setOrder('ASC');
1133 1133
 
@@ -1222,7 +1222,7 @@  discard block
 block discarded – undo
1222 1222
         if (count($files) > 0) {
1223 1223
             $eventFiles = new Extcal\Form\FormFileCheckBox('', 'filetokeep');
1224 1224
             foreach ($files as $file) {
1225
-                $name = $file['file_nicename'] . ' (<i>' . $file['file_mimetype'] . '</i>) ' . $file['formated_file_size'];
1225
+                $name = $file['file_nicename'].' (<i>'.$file['file_mimetype'].'</i>) '.$file['formated_file_size'];
1226 1226
                 $eventFiles->addOption($file['file_id'], $name);
1227 1227
             }
1228 1228
             $fileElmtTray->addElement($eventFiles);
@@ -1238,7 +1238,7 @@  discard block
 block discarded – undo
1238 1238
         //Picture1
1239 1239
         $file_tray = new \XoopsFormElementTray(sprintf(_MD_EXTCAL_FORM_IMG, 1), '');
1240 1240
         if (!empty($event_picture1)) {
1241
-            $file_tray->addElement(new \XoopsFormLabel('', "<img src='" . XOOPS_URL . '/uploads/extcal/' . $event_picture1 . "' name='image' id='image' alt=''><br><br>"));
1241
+            $file_tray->addElement(new \XoopsFormLabel('', "<img src='".XOOPS_URL.'/uploads/extcal/'.$event_picture1."' name='image' id='image' alt=''><br><br>"));
1242 1242
             $check_del_img = new \XoopsFormCheckBox('', 'delimg_1');
1243 1243
             $check_del_img->addOption(1, _MD_EXTCAL_DEL_IMG);
1244 1244
             $file_tray->addElement($check_del_img);
@@ -1249,8 +1249,8 @@  discard block
 block discarded – undo
1249 1249
         }
1250 1250
         $file_img->setExtra("size ='40'");
1251 1251
         $file_tray->addElement($file_img);
1252
-        $msg        = sprintf(_MD_EXTCAL_IMG_CONFIG, (int)(400728 / 1000), 500, 500);
1253
-        $file_label = new \XoopsFormLabel('', '<br>' . $msg);
1252
+        $msg        = sprintf(_MD_EXTCAL_IMG_CONFIG, (int) (400728 / 1000), 500, 500);
1253
+        $file_label = new \XoopsFormLabel('', '<br>'.$msg);
1254 1254
         $file_tray->addElement($file_label);
1255 1255
         $form->addElement($file_tray);
1256 1256
         $form->addElement(new \XoopsFormHidden('file1', $event_picture1));
@@ -1258,7 +1258,7 @@  discard block
 block discarded – undo
1258 1258
         //Picture2
1259 1259
         $file_tray = new \XoopsFormElementTray(sprintf(_MD_EXTCAL_FORM_IMG, 2), '');
1260 1260
         if (!empty($event_picture2)) {
1261
-            $file_tray->addElement(new \XoopsFormLabel('', "<img src='" . XOOPS_URL . '/uploads/extcal/' . $event_picture2 . "' name='image' id='image' alt=''><br><br>"));
1261
+            $file_tray->addElement(new \XoopsFormLabel('', "<img src='".XOOPS_URL.'/uploads/extcal/'.$event_picture2."' name='image' id='image' alt=''><br><br>"));
1262 1262
             $check_del_img = new \XoopsFormCheckBox('', 'delimg_2');
1263 1263
             $check_del_img->addOption(1, _MD_EXTCAL_DEL_IMG);
1264 1264
             $file_tray->addElement($check_del_img);
@@ -1269,8 +1269,8 @@  discard block
 block discarded – undo
1269 1269
         }
1270 1270
         $file_img->setExtra("size ='40'");
1271 1271
         $file_tray->addElement($file_img);
1272
-        $msg        = sprintf(_MD_EXTCAL_IMG_CONFIG, (int)(400728 / 1000), 500, 500);
1273
-        $file_label = new \XoopsFormLabel('', '<br>' . $msg);
1272
+        $msg        = sprintf(_MD_EXTCAL_IMG_CONFIG, (int) (400728 / 1000), 500, 500);
1273
+        $file_label = new \XoopsFormLabel('', '<br>'.$msg);
1274 1274
         $file_tray->addElement($file_label);
1275 1275
         $form->addElement($file_tray);
1276 1276
         $form->addElement(new \XoopsFormHidden('file2', $event_picture2));
@@ -1337,7 +1337,7 @@  discard block
 block discarded – undo
1337 1337
                 $recurRules = 'weekly|';
1338 1338
                 $recurRules .= $parm['rrule_weekly_interval'];
1339 1339
                 foreach ($parm['rrule_weekly_bydays'] as $day) {
1340
-                    $recurRules .= '|' . $day;
1340
+                    $recurRules .= '|'.$day;
1341 1341
                 }
1342 1342
 
1343 1343
                 break;
@@ -1347,11 +1347,11 @@  discard block
 block discarded – undo
1347 1347
                     $parm['rrule_monthly_interval'] = 0;
1348 1348
                 }
1349 1349
                 $recurRules = 'monthly|';
1350
-                $recurRules .= $parm['rrule_monthly_interval'] . '|';
1350
+                $recurRules .= $parm['rrule_monthly_interval'].'|';
1351 1351
                 if ('' != $parm['rrule_monthly_byday']) {
1352 1352
                     $recurRules .= $parm['rrule_monthly_byday'];
1353 1353
                 } else {
1354
-                    $recurRules .= 'MD' . $parm['rrule_bymonthday'];
1354
+                    $recurRules .= 'MD'.$parm['rrule_bymonthday'];
1355 1355
                 }
1356 1356
 
1357 1357
                 break;
@@ -1385,9 +1385,9 @@  discard block
 block discarded – undo
1385 1385
 
1386 1386
                 $recurRules = 'yearly|';
1387 1387
                 $recurRules .= $parm['rrule_yearly_interval'];
1388
-                $recurRules .= '|' . $parm['rrule_yearly_byday'];
1388
+                $recurRules .= '|'.$parm['rrule_yearly_byday'];
1389 1389
                 foreach ($parm['rrule_yearly_bymonths'] as $month) {
1390
-                    $recurRules .= '|' . $month;
1390
+                    $recurRules .= '|'.$month;
1391 1391
                 }
1392 1392
 
1393 1393
                 break;
@@ -2312,10 +2312,10 @@  discard block
 block discarded – undo
2312 2312
         global $xoopsDB;
2313 2313
 
2314 2314
         //echo "<hr>{$andor}-{$limit}-{$offset}-{$userId}-{$user}<br>{$criteresPlus}";
2315
-        $tEvent = $xoopsDB->prefix('extcal_event') . ' AS te';
2316
-        $tCat   = $xoopsDB->prefix('extcal_cat') . ' AS tc';
2315
+        $tEvent = $xoopsDB->prefix('extcal_event').' AS te';
2316
+        $tCat   = $xoopsDB->prefix('extcal_cat').' AS tc';
2317 2317
 
2318
-        $sql = 'SELECT te.*, tc.cat_name , tc.cat_color, ' . 'year(FROM_UNIXTIME(event_start)) AS year,' . 'month(FROM_UNIXTIME(event_start)) AS month,' . 'day(FROM_UNIXTIME(event_start)) AS day' . " FROM {$tEvent}, {$tCat}";
2318
+        $sql = 'SELECT te.*, tc.cat_name , tc.cat_color, '.'year(FROM_UNIXTIME(event_start)) AS year,'.'month(FROM_UNIXTIME(event_start)) AS month,'.'day(FROM_UNIXTIME(event_start)) AS day'." FROM {$tEvent}, {$tCat}";
2319 2319
         //---------------------------------------------------
2320 2320
         $tw   = [];
2321 2321
         $tw[] = 'te.cat_id = tc.cat_id';
@@ -2324,7 +2324,7 @@  discard block
 block discarded – undo
2324 2324
         $authorizedAccessCats = $this->extcalPerm->getAuthorizedCat($user, 'extcal_cat_view');
2325 2325
         $inCat                = 'te.cat_id IN (0)';
2326 2326
         if (count($authorizedAccessCats) > 0) {
2327
-            $inCat = 'te.cat_id IN (' . implode(',', $authorizedAccessCats) . ')';
2327
+            $inCat = 'te.cat_id IN ('.implode(',', $authorizedAccessCats).')';
2328 2328
         }
2329 2329
         //echo $tw[count($tw)-1];
2330 2330
 
@@ -2360,12 +2360,12 @@  discard block
 block discarded – undo
2360 2360
                 'te.event_address',
2361 2361
                 'tc.cat_name',
2362 2362
             ];
2363
-            $t       = [];
2363
+            $t = [];
2364 2364
             foreach ($queryarray as $i => $iValue) {
2365 2365
                 $t1[] = " %1\$s LIKE '#{$queryarray[$i]}#' ";
2366 2366
             }
2367 2367
 
2368
-            $flt = '(' . implode(" {$andor} ", $t1) . ')';
2368
+            $flt = '('.implode(" {$andor} ", $t1).')';
2369 2369
 
2370 2370
             $t = [];
2371 2371
             foreach ($tFields as $h => $hValue) {
@@ -2374,10 +2374,10 @@  discard block
 block discarded – undo
2374 2374
 
2375 2375
             $filtre = implode(' OR ', $t);
2376 2376
             $filtre = str_replace('#', '%', $filtre);
2377
-            $tw[]   = '(' . $filtre . ')';
2377
+            $tw[]   = '('.$filtre.')';
2378 2378
         }
2379 2379
 
2380
-        $sql .= ' WHERE ' . implode(' AND ', $tw);
2380
+        $sql .= ' WHERE '.implode(' AND ', $tw);
2381 2381
         //------------------------------------------------------------
2382 2382
         if (count($orderBy) > 0) {
2383 2383
             $t = [];
@@ -2387,7 +2387,7 @@  discard block
 block discarded – undo
2387 2387
                 }
2388 2388
             }
2389 2389
             if (count($t) > 0) {
2390
-                $sql .= ' ORDER BY ' . implode(',', $t);
2390
+                $sql .= ' ORDER BY '.implode(',', $t);
2391 2391
             }
2392 2392
         }
2393 2393
 
@@ -2420,7 +2420,7 @@  discard block
 block discarded – undo
2420 2420
         $i = 0;
2421 2421
         while (false !== ($myrow = $xoopsDB->fetchArray($result))) {
2422 2422
             $ret[$i]['image'] = 'assets/images/icons/extcal.gif';
2423
-            $ret[$i]['link']  = 'event.php?event=' . $myrow['event_id'];
2423
+            $ret[$i]['link']  = 'event.php?event='.$myrow['event_id'];
2424 2424
             $ret[$i]['title'] = $myrow['event_title'];
2425 2425
             $ret[$i]['time']  = $myrow['event_submitdate'];
2426 2426
             $ret[$i]['uid']   = $myrow['event_submitter'];
@@ -2460,23 +2460,23 @@  discard block
 block discarded – undo
2460 2460
         //        }
2461 2461
         $tEvent = $xoopsDB->prefix('extcal_event');
2462 2462
         $tCat   = $xoopsDB->prefix('extcal_cat');
2463
-        $sql    = "SELECT {$tEvent}.*, {$tCat}.cat_name AS categorie, {$tCat}.cat_color " . " FROM {$tEvent}, {$tCat}" . " WHERE {$tEvent}.cat_id = {$tCat}.cat_id AND event_approved = '1'";
2463
+        $sql    = "SELECT {$tEvent}.*, {$tCat}.cat_name AS categorie, {$tCat}.cat_color "." FROM {$tEvent}, {$tCat}"." WHERE {$tEvent}.cat_id = {$tCat}.cat_id AND event_approved = '1'";
2464 2464
 
2465 2465
         $authorizedAccessCats = $this->extcalPerm->getAuthorizedCat($user, 'extcal_cat_view');
2466 2466
         $count                = count($authorizedAccessCats);
2467 2467
         if ($count > 0) {
2468
-            $in = '(' . $authorizedAccessCats[0];
2468
+            $in = '('.$authorizedAccessCats[0];
2469 2469
             array_shift($authorizedAccessCats);
2470 2470
             foreach ($authorizedAccessCats as $authorizedAccessCat) {
2471
-                $in .= ',' . $authorizedAccessCat;
2471
+                $in .= ','.$authorizedAccessCat;
2472 2472
             }
2473 2473
             $in .= ')';
2474 2474
         } else {
2475 2475
             $in = '(0)';
2476 2476
         }
2477
-        $sql .= " AND {$tEvent}.cat_id IN " . $in . '';
2477
+        $sql .= " AND {$tEvent}.cat_id IN ".$in.'';
2478 2478
         if (0 != $userId) {
2479
-            $sql .= " AND event_submitter = '" . $userId . "'";
2479
+            $sql .= " AND event_submitter = '".$userId."'";
2480 2480
         }
2481 2481
 
2482 2482
         //echoArray($queryarray,false);
@@ -2496,7 +2496,7 @@  discard block
 block discarded – undo
2496 2496
                 $t1[] = " %1\$s LIKE '#{$queryarray[$i]}#' ";
2497 2497
             }
2498 2498
 
2499
-            $flt = '(' . implode(" {$andor} ", $t1) . ')';
2499
+            $flt = '('.implode(" {$andor} ", $t1).')';
2500 2500
 
2501 2501
             $t = [];
2502 2502
             foreach ($tFields as $h => $hValue) {
@@ -2505,11 +2505,11 @@  discard block
 block discarded – undo
2505 2505
 
2506 2506
             $filtre = implode(' OR ', $t);
2507 2507
             $filtre = str_replace('#', '%', $filtre);
2508
-            $sql    .= " AND ($filtre)";
2508
+            $sql .= " AND ($filtre)";
2509 2509
         }
2510 2510
 
2511 2511
         if ('' != $criteresPlus) {
2512
-            $sql .= ' AND ' . $criteresPlus;
2512
+            $sql .= ' AND '.$criteresPlus;
2513 2513
         }
2514 2514
         $sql .= ' ORDER BY event_id DESC';
2515 2515
 
@@ -2519,7 +2519,7 @@  discard block
 block discarded – undo
2519 2519
         if ($xoopsSearch) {
2520 2520
             while (false !== ($myrow = $xoopsDB->fetchArray($result))) {
2521 2521
                 $ret[$i]['image'] = 'assets/images/icons/extcal.gif';
2522
-                $ret[$i]['link']  = 'event.php?event=' . $myrow['event_id'];
2522
+                $ret[$i]['link']  = 'event.php?event='.$myrow['event_id'];
2523 2523
                 $ret[$i]['title'] = $myrow['event_title'];
2524 2524
                 $ret[$i]['time']  = $myrow['event_submitdate'];
2525 2525
                 $ret[$i]['uid']   = $myrow['event_submitter'];
Please login to merge, or discard this patch.
class/Helper.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,8 +34,8 @@
 block discarded – undo
34 34
     public function __construct($debug = false)
35 35
     {
36 36
         $this->debug   = $debug;
37
-       $moduleDirName = basename(dirname(__DIR__));
38
-       parent::__construct($moduleDirName);
37
+        $moduleDirName = basename(dirname(__DIR__));
38
+        parent::__construct($moduleDirName);
39 39
     }
40 40
 
41 41
     /**
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      */
34 34
     public function __construct($debug = false)
35 35
     {
36
-        $this->debug   = $debug;
36
+        $this->debug = $debug;
37 37
        $moduleDirName = basename(dirname(__DIR__));
38 38
        parent::__construct($moduleDirName);
39 39
     }
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     {
73 73
         $ret   = false;
74 74
         $db    = \XoopsDatabaseFactory::getDatabaseConnection();
75
-        $class = '\\XoopsModules\\' . ucfirst(strtolower(basename(dirname(__DIR__)))) . '\\' . $name . 'Handler';
75
+        $class = '\\XoopsModules\\'.ucfirst(strtolower(basename(dirname(__DIR__)))).'\\'.$name.'Handler';
76 76
         $ret   = new $class($db);
77 77
         return $ret;
78 78
     }
Please login to merge, or discard this patch.