Completed
Push — master ( ee7aee...d2520f )
by Michael
03:20
created
class/EventHandler.php 2 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
      * @param int $cat
572 572
      * @param int $nbDays
573 573
      *
574
-     * @return \CriteriaCompo
574
+     * @return null|\CriteriaElement
575 575
      */
576 576
     public function getEventWeekCriteria($day, $month, $year, $cat = 0, $nbDays = 7)
577 577
     {
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
      * @param     $year
594 594
      * @param int $cat
595 595
      *
596
-     * @return \CriteriaCompo
596
+     * @return null|\CriteriaElement
597 597
      */
598 598
     public function getEventMonthCriteria($month, $year, $cat = 0)
599 599
     {
@@ -614,7 +614,7 @@  discard block
 block discarded – undo
614 614
      * @param     $year
615 615
      * @param int $cat
616 616
      *
617
-     * @return \CriteriaCompo
617
+     * @return null|\CriteriaElement
618 618
      */
619 619
     public function getEventYearCriteria($year, $cat = 0)
620 620
     {
@@ -880,7 +880,7 @@  discard block
 block discarded – undo
880 880
 
881 881
     /**
882 882
      * @param $criteria
883
-     * @param $cats
883
+     * @param integer $cats
884 884
      */
885 885
     public function addCatSelectCriteria(&$criteria, $cats = null)
886 886
     {
Please login to merge, or discard this patch.
Spacing   +40 added lines, -40 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') || exit('Restricted access.');
25 25
 
26
-require_once __DIR__ . '/../include/constantes.php';
26
+require_once __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);
@@ -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 = __DIR__ . '/../assets/css/images';
1120
+        $file_path = __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, '');
@@ -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;
@@ -2313,10 +2313,10 @@  discard block
 block discarded – undo
2313 2313
         global $xoopsDB;
2314 2314
 
2315 2315
         //echo "<hr>{$andor}-{$limit}-{$offset}-{$userId}-{$user}<br>{$criteresPlus}";
2316
-        $tEvent = $xoopsDB->prefix('extcal_event') . ' AS te';
2317
-        $tCat   = $xoopsDB->prefix('extcal_cat') . ' AS tc';
2316
+        $tEvent = $xoopsDB->prefix('extcal_event').' AS te';
2317
+        $tCat   = $xoopsDB->prefix('extcal_cat').' AS tc';
2318 2318
 
2319
-        $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
+        $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}";
2320 2320
         //---------------------------------------------------
2321 2321
         $tw   = [];
2322 2322
         $tw[] = 'te.cat_id = tc.cat_id';
@@ -2325,7 +2325,7 @@  discard block
 block discarded – undo
2325 2325
         $authorizedAccessCats = $this->extcalPerm->getAuthorizedCat($user, 'extcal_cat_view');
2326 2326
         $inCat                = 'te.cat_id IN (0)';
2327 2327
         if (count($authorizedAccessCats) > 0) {
2328
-            $inCat = 'te.cat_id IN (' . implode(',', $authorizedAccessCats) . ')';
2328
+            $inCat = 'te.cat_id IN ('.implode(',', $authorizedAccessCats).')';
2329 2329
         }
2330 2330
         //echo $tw[count($tw)-1];
2331 2331
 
@@ -2361,12 +2361,12 @@  discard block
 block discarded – undo
2361 2361
                 'te.event_address',
2362 2362
                 'tc.cat_name',
2363 2363
             ];
2364
-            $t       = [];
2364
+            $t = [];
2365 2365
             foreach ($queryarray as $i => $iValue) {
2366 2366
                 $t1[] = " %1\$s LIKE '#{$queryarray[$i]}#' ";
2367 2367
             }
2368 2368
 
2369
-            $flt = '(' . implode(" {$andor} ", $t1) . ')';
2369
+            $flt = '('.implode(" {$andor} ", $t1).')';
2370 2370
 
2371 2371
             $t = [];
2372 2372
             foreach ($tFields as $h => $hValue) {
@@ -2375,10 +2375,10 @@  discard block
 block discarded – undo
2375 2375
 
2376 2376
             $filtre = implode(' OR ', $t);
2377 2377
             $filtre = str_replace('#', '%', $filtre);
2378
-            $tw[]   = '(' . $filtre . ')';
2378
+            $tw[]   = '('.$filtre.')';
2379 2379
         }
2380 2380
 
2381
-        $sql .= ' WHERE ' . implode(' AND ', $tw);
2381
+        $sql .= ' WHERE '.implode(' AND ', $tw);
2382 2382
         //------------------------------------------------------------
2383 2383
         if (count($orderBy) > 0) {
2384 2384
             $t = [];
@@ -2388,7 +2388,7 @@  discard block
 block discarded – undo
2388 2388
                 }
2389 2389
             }
2390 2390
             if (count($t) > 0) {
2391
-                $sql .= ' ORDER BY ' . implode(',', $t);
2391
+                $sql .= ' ORDER BY '.implode(',', $t);
2392 2392
             }
2393 2393
         }
2394 2394
 
@@ -2421,7 +2421,7 @@  discard block
 block discarded – undo
2421 2421
         $i = 0;
2422 2422
         while ($myrow = $xoopsDB->fetchArray($result)) {
2423 2423
             $ret[$i]['image'] = 'assets/images/icons/extcal.gif';
2424
-            $ret[$i]['link']  = 'event.php?event=' . $myrow['event_id'];
2424
+            $ret[$i]['link']  = 'event.php?event='.$myrow['event_id'];
2425 2425
             $ret[$i]['title'] = $myrow['event_title'];
2426 2426
             $ret[$i]['time']  = $myrow['event_submitdate'];
2427 2427
             $ret[$i]['uid']   = $myrow['event_submitter'];
@@ -2461,23 +2461,23 @@  discard block
 block discarded – undo
2461 2461
         //        }
2462 2462
         $tEvent = $xoopsDB->prefix('extcal_event');
2463 2463
         $tCat   = $xoopsDB->prefix('extcal_cat');
2464
-        $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
+        $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'";
2465 2465
 
2466 2466
         $authorizedAccessCats = $this->extcalPerm->getAuthorizedCat($user, 'extcal_cat_view');
2467 2467
         $count                = count($authorizedAccessCats);
2468 2468
         if ($count > 0) {
2469
-            $in = '(' . $authorizedAccessCats[0];
2469
+            $in = '('.$authorizedAccessCats[0];
2470 2470
             array_shift($authorizedAccessCats);
2471 2471
             foreach ($authorizedAccessCats as $authorizedAccessCat) {
2472
-                $in .= ',' . $authorizedAccessCat;
2472
+                $in .= ','.$authorizedAccessCat;
2473 2473
             }
2474 2474
             $in .= ')';
2475 2475
         } else {
2476 2476
             $in = '(0)';
2477 2477
         }
2478
-        $sql .= " AND {$tEvent}.cat_id IN " . $in . '';
2478
+        $sql .= " AND {$tEvent}.cat_id IN ".$in.'';
2479 2479
         if (0 != $userId) {
2480
-            $sql .= " AND event_submitter = '" . $userId . "'";
2480
+            $sql .= " AND event_submitter = '".$userId."'";
2481 2481
         }
2482 2482
 
2483 2483
         //echoArray($queryarray,false);
@@ -2497,7 +2497,7 @@  discard block
 block discarded – undo
2497 2497
                 $t1[] = " %1\$s LIKE '#{$queryarray[$i]}#' ";
2498 2498
             }
2499 2499
 
2500
-            $flt = '(' . implode(" {$andor} ", $t1) . ')';
2500
+            $flt = '('.implode(" {$andor} ", $t1).')';
2501 2501
 
2502 2502
             $t = [];
2503 2503
             foreach ($tFields as $h => $hValue) {
@@ -2506,11 +2506,11 @@  discard block
 block discarded – undo
2506 2506
 
2507 2507
             $filtre = implode(' OR ', $t);
2508 2508
             $filtre = str_replace('#', '%', $filtre);
2509
-            $sql    .= " AND ($filtre)";
2509
+            $sql .= " AND ($filtre)";
2510 2510
         }
2511 2511
 
2512 2512
         if ('' != $criteresPlus) {
2513
-            $sql .= ' AND ' . $criteresPlus;
2513
+            $sql .= ' AND '.$criteresPlus;
2514 2514
         }
2515 2515
         $sql .= ' ORDER BY event_id DESC';
2516 2516
 
@@ -2520,7 +2520,7 @@  discard block
 block discarded – undo
2520 2520
         if ($xoopsSearch) {
2521 2521
             while ($myrow = $xoopsDB->fetchArray($result)) {
2522 2522
                 $ret[$i]['image'] = 'assets/images/icons/extcal.gif';
2523
-                $ret[$i]['link']  = 'event.php?event=' . $myrow['event_id'];
2523
+                $ret[$i]['link']  = 'event.php?event='.$myrow['event_id'];
2524 2524
                 $ret[$i]['title'] = $myrow['event_title'];
2525 2525
                 $ret[$i]['time']  = $myrow['event_submitdate'];
2526 2526
                 $ret[$i]['uid']   = $myrow['event_submitter'];
Please login to merge, or discard this patch.
blocks/minical.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -166,7 +166,7 @@
 block discarded – undo
166 166
     // Flag current day
167 167
     $selectedDays = [
168 168
         new Calendar_Day(date('Y', xoops_getUserTimestamp(time(), $timeHandler->getUserTimeZone($GLOBALS['xoopsUser']))), date('n', xoops_getUserTimestamp(time(), $timeHandler->getUserTimeZone($GLOBALS['xoopsUser']))),
169
-                         date('j', xoops_getUserTimestamp(time(), $timeHandler->getUserTimeZone($GLOBALS['xoopsUser'])))),
169
+                            date('j', xoops_getUserTimestamp(time(), $timeHandler->getUserTimeZone($GLOBALS['xoopsUser'])))),
170 170
     ];
171 171
 
172 172
     // Build calendar object
Please login to merge, or discard this patch.