@@ -1,10 +1,10 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | // |
| 3 | 3 | |
| 4 | -require_once __DIR__ . '/simple_include.php'; |
|
| 5 | -require_once __DIR__ . '/calendar_include.php'; |
|
| 4 | +require_once __DIR__.'/simple_include.php'; |
|
| 5 | +require_once __DIR__.'/calendar_include.php'; |
|
| 6 | 6 | |
| 7 | -require_once __DIR__ . '/./calendar_test.php'; |
|
| 7 | +require_once __DIR__.'/./calendar_test.php'; |
|
| 8 | 8 | |
| 9 | 9 | /** |
| 10 | 10 | * Class TestOfMonth. |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | |
| 152 | 152 | public function testSelection() |
| 153 | 153 | { |
| 154 | - require_once CALENDAR_ROOT . 'Day.php'; |
|
| 154 | + require_once CALENDAR_ROOT.'Day.php'; |
|
| 155 | 155 | $selection = [new Calendar_Day(2003, 10, 25)]; |
| 156 | 156 | $this->cal->build($selection); |
| 157 | 157 | $i = 1; |
@@ -32,13 +32,13 @@ |
||
| 32 | 32 | public function testPrevDay_Array() |
| 33 | 33 | { |
| 34 | 34 | $this->assertEqual([ |
| 35 | - 'year' => 2003, |
|
| 36 | - 'month' => 9, |
|
| 37 | - 'day' => 30, |
|
| 38 | - 'hour' => 0, |
|
| 39 | - 'minute' => 0, |
|
| 40 | - 'second' => 0, |
|
| 41 | - ], $this->cal->prevDay('array')); |
|
| 35 | + 'year' => 2003, |
|
| 36 | + 'month' => 9, |
|
| 37 | + 'day' => 30, |
|
| 38 | + 'hour' => 0, |
|
| 39 | + 'minute' => 0, |
|
| 40 | + 'second' => 0, |
|
| 41 | + ], $this->cal->prevDay('array')); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | public function testThisDay() |
@@ -1,10 +1,10 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | // |
| 3 | 3 | |
| 4 | -require_once __DIR__ . '/simple_include.php'; |
|
| 5 | -require_once __DIR__ . '/calendar_include.php'; |
|
| 4 | +require_once __DIR__.'/simple_include.php'; |
|
| 5 | +require_once __DIR__.'/calendar_include.php'; |
|
| 6 | 6 | |
| 7 | -require_once __DIR__ . '/./calendar_test.php'; |
|
| 7 | +require_once __DIR__.'/./calendar_test.php'; |
|
| 8 | 8 | |
| 9 | 9 | /** |
| 10 | 10 | * Class TestOfMonthWeekdays. |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | |
| 147 | 147 | public function testSelection() |
| 148 | 148 | { |
| 149 | - require_once CALENDAR_ROOT . 'Day.php'; |
|
| 149 | + require_once CALENDAR_ROOT.'Day.php'; |
|
| 150 | 150 | $selection = [new Calendar_Day(2003, 10, 25)]; |
| 151 | 151 | $this->cal->build($selection); |
| 152 | 152 | $daysInPrevMonth = (0 == CALENDAR_FIRST_DAY_OF_WEEK) ? 3 : 2; |
@@ -32,13 +32,13 @@ |
||
| 32 | 32 | public function testPrevDay_Array() |
| 33 | 33 | { |
| 34 | 34 | $this->assertEqual([ |
| 35 | - 'year' => 2003, |
|
| 36 | - 'month' => 9, |
|
| 37 | - 'day' => 30, |
|
| 38 | - 'hour' => 0, |
|
| 39 | - 'minute' => 0, |
|
| 40 | - 'second' => 0, |
|
| 41 | - ], $this->cal->prevDay('array')); |
|
| 35 | + 'year' => 2003, |
|
| 36 | + 'month' => 9, |
|
| 37 | + 'day' => 30, |
|
| 38 | + 'hour' => 0, |
|
| 39 | + 'minute' => 0, |
|
| 40 | + 'second' => 0, |
|
| 41 | + ], $this->cal->prevDay('array')); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | public function testThisDay() |
@@ -27,13 +27,13 @@ |
||
| 27 | 27 | public function testPrevDay_Array() |
| 28 | 28 | { |
| 29 | 29 | $this->assertEqual([ |
| 30 | - 'year' => 2003, |
|
| 31 | - 'month' => 10, |
|
| 32 | - 'day' => 24, |
|
| 33 | - 'hour' => 0, |
|
| 34 | - 'minute' => 0, |
|
| 35 | - 'second' => 0, |
|
| 36 | - ], $this->cal->prevDay('array')); |
|
| 30 | + 'year' => 2003, |
|
| 31 | + 'month' => 10, |
|
| 32 | + 'day' => 24, |
|
| 33 | + 'hour' => 0, |
|
| 34 | + 'minute' => 0, |
|
| 35 | + 'second' => 0, |
|
| 36 | + ], $this->cal->prevDay('array')); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | public function testPrevHour() |
@@ -1,10 +1,10 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | // |
| 3 | 3 | |
| 4 | -require_once __DIR__ . '/simple_include.php'; |
|
| 5 | -require_once __DIR__ . '/calendar_include.php'; |
|
| 4 | +require_once __DIR__.'/simple_include.php'; |
|
| 5 | +require_once __DIR__.'/calendar_include.php'; |
|
| 6 | 6 | |
| 7 | -require_once __DIR__ . '/./calendar_test.php'; |
|
| 7 | +require_once __DIR__.'/./calendar_test.php'; |
|
| 8 | 8 | |
| 9 | 9 | /** |
| 10 | 10 | * Class TestOfDay. |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | |
| 132 | 132 | public function testSelection() |
| 133 | 133 | { |
| 134 | - require_once CALENDAR_ROOT . 'Hour.php'; |
|
| 134 | + require_once CALENDAR_ROOT.'Hour.php'; |
|
| 135 | 135 | $selection = [new Calendar_Hour(2003, 10, 25, 13)]; |
| 136 | 136 | $this->cal->build($selection); |
| 137 | 137 | $i = 0; |
@@ -58,9 +58,9 @@ |
||
| 58 | 58 | $rediredtMessage = _MD_EXTCAL_MAX_MEMBER_REACHED; |
| 59 | 59 | } else { |
| 60 | 60 | $eventMemberHandler->createEventmember([ |
| 61 | - 'event_id' => (int)$_POST['event'], |
|
| 62 | - 'uid' => $xoopsUser->getVar('uid'), |
|
| 63 | - ]); |
|
| 61 | + 'event_id' => (int)$_POST['event'], |
|
| 62 | + 'uid' => $xoopsUser->getVar('uid'), |
|
| 63 | + ]); |
|
| 64 | 64 | sendMail2member($mode, $event_id, $member_uid, _MD_EXTCAL_SUBJECT_1, _MD_EXTCAL_MSG_1); |
| 65 | 65 | $rediredtMessage = _MD_EXTCAL_WHOS_GOING_ADDED_TO_EVENT; |
| 66 | 66 | } |
@@ -2,10 +2,10 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | use XoopsModules\Extcal; |
| 4 | 4 | |
| 5 | -include __DIR__ . '/../../mainfile.php'; |
|
| 5 | +include __DIR__.'/../../mainfile.php'; |
|
| 6 | 6 | |
| 7 | -require_once __DIR__ . '/include/constantes.php'; |
|
| 8 | -require_once __DIR__ . '/include/mail_fnc.php'; |
|
| 7 | +require_once __DIR__.'/include/constantes.php'; |
|
| 8 | +require_once __DIR__.'/include/mail_fnc.php'; |
|
| 9 | 9 | |
| 10 | 10 | // $member_uid = 1; |
| 11 | 11 | // $event_id = 393; |
@@ -40,26 +40,26 @@ discard block |
||
| 40 | 40 | //echo "<hr>"; |
| 41 | 41 | |
| 42 | 42 | if (!$GLOBALS['xoopsSecurity']->check()) { |
| 43 | - redirect_header('index.php', 3, _NOPERM . '<br>' . implode('<br>', $GLOBALS['xoopsSecurity']->getErrors())); |
|
| 43 | + redirect_header('index.php', 3, _NOPERM.'<br>'.implode('<br>', $GLOBALS['xoopsSecurity']->getErrors())); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | if ($xoopsUser && $xoopsModuleConfig['whos_going']) { |
| 47 | 47 | // If param are right |
| 48 | - if ((int)$_POST['event'] > 0 && ('add' === $_POST['mode'] || 'remove' === $_POST['mode'])) { |
|
| 48 | + if ((int) $_POST['event'] > 0 && ('add' === $_POST['mode'] || 'remove' === $_POST['mode'])) { |
|
| 49 | 49 | $eventHandler = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_EVENT); |
| 50 | 50 | $eventMemberHandler = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_MEMBER); |
| 51 | 51 | |
| 52 | 52 | // If the user have to be added |
| 53 | 53 | if ('add' === $_POST['mode']) { |
| 54 | - $event = $eventHandler->getEvent((int)$_POST['event'], $xoopsUser); |
|
| 54 | + $event = $eventHandler->getEvent((int) $_POST['event'], $xoopsUser); |
|
| 55 | 55 | |
| 56 | 56 | if ($event->getVar('event_nbmember') > 0 |
| 57 | - && $eventMemberHandler->getNbMember((int)$_POST['event']) >= $event->getVar('event_nbmember')) { |
|
| 57 | + && $eventMemberHandler->getNbMember((int) $_POST['event']) >= $event->getVar('event_nbmember')) { |
|
| 58 | 58 | sendMail2member($mode, $event_id, $member_uid, _MD_EXTCAL_SUBJECT_0, _MD_EXTCAL_MSG_0); |
| 59 | 59 | $rediredtMessage = _MD_EXTCAL_MAX_MEMBER_REACHED; |
| 60 | 60 | } else { |
| 61 | 61 | $eventMemberHandler->createEventmember([ |
| 62 | - 'event_id' => (int)$_POST['event'], |
|
| 62 | + 'event_id' => (int) $_POST['event'], |
|
| 63 | 63 | 'uid' => $xoopsUser->getVar('uid'), |
| 64 | 64 | ]); |
| 65 | 65 | sendMail2member($mode, $event_id, $member_uid, _MD_EXTCAL_SUBJECT_1, _MD_EXTCAL_MSG_1); |
@@ -68,12 +68,12 @@ discard block |
||
| 68 | 68 | // If the user have to be remove |
| 69 | 69 | } else { |
| 70 | 70 | if ('remove' === $_POST['mode']) { |
| 71 | - $eventMemberHandler->deleteEventmember([(int)$_POST['event'], $xoopsUser->getVar('uid')]); |
|
| 71 | + $eventMemberHandler->deleteEventmember([(int) $_POST['event'], $xoopsUser->getVar('uid')]); |
|
| 72 | 72 | sendMail2member($mode, $event_id, $member_uid, _MD_EXTCAL_SUBJECT_2, _MD_EXTCAL_MSG_2); |
| 73 | 73 | $rediredtMessage = _MD_EXTCAL_WHOS_GOING_REMOVED_TO_EVENT; |
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | - redirect_header('event.php?event=' . $_POST['event'], 3, $rediredtMessage, false); |
|
| 76 | + redirect_header('event.php?event='.$_POST['event'], 3, $rediredtMessage, false); |
|
| 77 | 77 | } else { |
| 78 | 78 | redirect_header('index.php', 3, _NOPERM, false); |
| 79 | 79 | } |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | $basePath = explode('/', $_SERVER['SCRIPT_NAME']); |
| 16 | 16 | array_pop($basePath); |
| 17 | 17 | $basePath = implode('/', $basePath); |
| 18 | -$url = 'http://' . $_SERVER['SERVER_NAME'] . $basePath . '/7.php?wsdl'; |
|
| 18 | +$url = 'http://'.$_SERVER['SERVER_NAME'].$basePath.'/7.php?wsdl'; |
|
| 19 | 19 | |
| 20 | 20 | if (!isset($_GET['y'])) { |
| 21 | 21 | $_GET['y'] = date('Y'); |
@@ -26,11 +26,11 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | $wsdl = new SOAP_WSDL($url); |
| 28 | 28 | |
| 29 | -echo '<pre>' . $wsdl->generateProxyCode() . '</pre>'; |
|
| 29 | +echo '<pre>'.$wsdl->generateProxyCode().'</pre>'; |
|
| 30 | 30 | |
| 31 | 31 | $calendarClient = $wsdl->getProxy(); |
| 32 | 32 | |
| 33 | -$month = $calendarClient->getMonth((int)$_GET['y'], (int)$_GET['m']); |
|
| 33 | +$month = $calendarClient->getMonth((int) $_GET['y'], (int) $_GET['m']); |
|
| 34 | 34 | |
| 35 | 35 | if (PEAR::isError($month)) { |
| 36 | 36 | die($month->toString()); |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | if (1 === $day->isEmpty) { |
| 63 | 63 | echo '<td></td>'; |
| 64 | 64 | } else { |
| 65 | - echo '<td>' . $day->day . '</td>'; |
|
| 65 | + echo '<td>'.$day->day.'</td>'; |
|
| 66 | 66 | } |
| 67 | 67 | if (1 === $day->isLast) { |
| 68 | 68 | echo "</tr>\n"; |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | } |
| 98 | 98 | if (!$engine) { |
| 99 | 99 | if (!class_exists($class)) { |
| 100 | - require_once CALENDAR_ROOT . 'Engine' . '/' . CALENDAR_ENGINE . '.php'; |
|
| 100 | + require_once CALENDAR_ROOT.'Engine'.'/'.CALENDAR_ENGINE.'.php'; |
|
| 101 | 101 | } |
| 102 | 102 | $engine = new $class(); |
| 103 | 103 | } |
@@ -209,13 +209,13 @@ discard block |
||
| 209 | 209 | if (!isset($cE)) { |
| 210 | 210 | $cE = Calendar_Engine_Factory::getEngine(); |
| 211 | 211 | } |
| 212 | - $this->cE =& $cE; |
|
| 213 | - $this->year = (int)$y; |
|
| 214 | - $this->month = (int)$m; |
|
| 215 | - $this->day = (int)$d; |
|
| 216 | - $this->hour = (int)$h; |
|
| 217 | - $this->minute = (int)$i; |
|
| 218 | - $this->second = (int)$s; |
|
| 212 | + $this->cE = & $cE; |
|
| 213 | + $this->year = (int) $y; |
|
| 214 | + $this->month = (int) $m; |
|
| 215 | + $this->day = (int) $d; |
|
| 216 | + $this->hour = (int) $h; |
|
| 217 | + $this->minute = (int) $i; |
|
| 218 | + $this->second = (int) $s; |
|
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | /** |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | return $this->toArray($stamp); |
| 332 | 332 | break; |
| 333 | 333 | case 'object': |
| 334 | - require_once CALENDAR_ROOT . 'Factory.php'; |
|
| 334 | + require_once CALENDAR_ROOT.'Factory.php'; |
|
| 335 | 335 | |
| 336 | 336 | return Calendar_Factory::createByTimestamp($returnType, $stamp); |
| 337 | 337 | break; |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | */ |
| 354 | 354 | public function build($sDates = []) |
| 355 | 355 | { |
| 356 | - require_once __DIR__ . '/PEAR.php'; |
|
| 356 | + require_once __DIR__.'/PEAR.php'; |
|
| 357 | 357 | PEAR::raiseError('Calendar::build is abstract', null, PEAR_ERROR_TRIGGER, E_USER_NOTICE, 'Calendar::build()'); |
| 358 | 358 | |
| 359 | 359 | return false; |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | */ |
| 370 | 370 | public function setSelection($sDates) |
| 371 | 371 | { |
| 372 | - require_once __DIR__ . '/PEAR.php'; |
|
| 372 | + require_once __DIR__.'/PEAR.php'; |
|
| 373 | 373 | PEAR::raiseError('Calendar::setSelection is abstract', null, PEAR_ERROR_TRIGGER, E_USER_NOTICE, 'Calendar::setSelection()'); |
| 374 | 374 | |
| 375 | 375 | return false; |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | public function &getValidator() |
| 437 | 437 | { |
| 438 | 438 | if (!isset($this->validator)) { |
| 439 | - require_once CALENDAR_ROOT . 'Validator.php'; |
|
| 439 | + require_once CALENDAR_ROOT.'Validator.php'; |
|
| 440 | 440 | $this->validator = new Calendar_Validator($this); |
| 441 | 441 | } |
| 442 | 442 | |
@@ -470,7 +470,7 @@ discard block |
||
| 470 | 470 | { |
| 471 | 471 | if (defined('CALENDAR_FIRST_DAY_OF_WEEK')) { |
| 472 | 472 | if ((CALENDAR_FIRST_DAY_OF_WEEK != $firstDay) && !is_null($firstDay)) { |
| 473 | - $msg = 'CALENDAR_FIRST_DAY_OF_WEEK constant already defined.' . ' The $firstDay parameter will be ignored.'; |
|
| 473 | + $msg = 'CALENDAR_FIRST_DAY_OF_WEEK constant already defined.'.' The $firstDay parameter will be ignored.'; |
|
| 474 | 474 | trigger_error($msg, E_USER_WARNING); |
| 475 | 475 | } |
| 476 | 476 | |
@@ -34,9 +34,9 @@ |
||
| 34 | 34 | if ('add' === $_POST['mode']) { |
| 35 | 35 | $event = $eventHandler->getEvent((int)$_POST['event'], $xoopsUser); |
| 36 | 36 | $eventNotMemberHandler->createEventNotMember([ |
| 37 | - 'event_id' => (int)$_POST['event'], |
|
| 38 | - 'uid' => $xoopsUser->getVar('uid'), |
|
| 39 | - ]); |
|
| 37 | + 'event_id' => (int)$_POST['event'], |
|
| 38 | + 'uid' => $xoopsUser->getVar('uid'), |
|
| 39 | + ]); |
|
| 40 | 40 | sendMail2member($mode, $event_id, $member_uid, _MD_EXTCAL_SUBJECT_3, _MD_EXTCAL_MSG_3); |
| 41 | 41 | $rediredtMessage = _MD_EXTCAL_WHOSNOT_GOING_ADDED_TO_EVENT; |
| 42 | 42 | |
@@ -2,10 +2,10 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | use XoopsModules\Extcal; |
| 4 | 4 | |
| 5 | -include __DIR__ . '/../../mainfile.php'; |
|
| 5 | +include __DIR__.'/../../mainfile.php'; |
|
| 6 | 6 | |
| 7 | -require_once __DIR__ . '/include/constantes.php'; |
|
| 8 | -require_once __DIR__ . '/include/mail_fnc.php'; |
|
| 7 | +require_once __DIR__.'/include/constantes.php'; |
|
| 8 | +require_once __DIR__.'/include/mail_fnc.php'; |
|
| 9 | 9 | |
| 10 | 10 | /* |
| 11 | 11 | Extcal\Utility::echoArray($_POST); |
@@ -22,20 +22,20 @@ discard block |
||
| 22 | 22 | $member_uid = $xoopsUser->getVar('uid'); |
| 23 | 23 | |
| 24 | 24 | if (!$GLOBALS['xoopsSecurity']->check()) { |
| 25 | - redirect_header('index.php', 3, _NOPERM . '<br>' . implode('<br>', $GLOBALS['xoopsSecurity']->getErrors())); |
|
| 25 | + redirect_header('index.php', 3, _NOPERM.'<br>'.implode('<br>', $GLOBALS['xoopsSecurity']->getErrors())); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | if ($xoopsUser && $xoopsModuleConfig['whosnot_going']) { |
| 29 | 29 | // If param are right |
| 30 | - if ((int)$_POST['event'] > 0 && ('add' === $_POST['mode'] || 'remove' === $_POST['mode'])) { |
|
| 30 | + if ((int) $_POST['event'] > 0 && ('add' === $_POST['mode'] || 'remove' === $_POST['mode'])) { |
|
| 31 | 31 | $eventHandler = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_EVENT); |
| 32 | 32 | $eventNotMemberHandler = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_NOT_MEMBER); |
| 33 | 33 | |
| 34 | 34 | // If the user have to be added |
| 35 | 35 | if ('add' === $_POST['mode']) { |
| 36 | - $event = $eventHandler->getEvent((int)$_POST['event'], $xoopsUser); |
|
| 36 | + $event = $eventHandler->getEvent((int) $_POST['event'], $xoopsUser); |
|
| 37 | 37 | $eventNotMemberHandler->createEventNotMember([ |
| 38 | - 'event_id' => (int)$_POST['event'], |
|
| 38 | + 'event_id' => (int) $_POST['event'], |
|
| 39 | 39 | 'uid' => $xoopsUser->getVar('uid'), |
| 40 | 40 | ]); |
| 41 | 41 | sendMail2member($mode, $event_id, $member_uid, _MD_EXTCAL_SUBJECT_3, _MD_EXTCAL_MSG_3); |
@@ -44,12 +44,12 @@ discard block |
||
| 44 | 44 | // If the user have to be remove |
| 45 | 45 | } else { |
| 46 | 46 | if ('remove' === $_POST['mode']) { |
| 47 | - $eventNotMemberHandler->deleteEventNotMember([(int)$_POST['event'], $xoopsUser->getVar('uid')]); |
|
| 47 | + $eventNotMemberHandler->deleteEventNotMember([(int) $_POST['event'], $xoopsUser->getVar('uid')]); |
|
| 48 | 48 | sendMail2member($mode, $event_id, $member_uid, _MD_EXTCAL_SUBJECT_4, _MD_EXTCAL_MSG_4); |
| 49 | 49 | $rediredtMessage = _MD_EXTCAL_WHOSNOT_GOING_REMOVED_TO_EVENT; |
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | - redirect_header('event.php?event=' . $_POST['event'], 3, $rediredtMessage, false); |
|
| 52 | + redirect_header('event.php?event='.$_POST['event'], 3, $rediredtMessage, false); |
|
| 53 | 53 | } else { |
| 54 | 54 | redirect_header('index.php', 3, _NOPERM, false); |
| 55 | 55 | } |
@@ -5,8 +5,8 @@ discard block |
||
| 5 | 5 | $step = $_POST['step']; |
| 6 | 6 | } |
| 7 | 7 | |
| 8 | -require_once __DIR__ . '/../../../include/cp_header.php'; |
|
| 9 | -include __DIR__ . '/function.php'; |
|
| 8 | +require_once __DIR__.'/../../../include/cp_header.php'; |
|
| 9 | +include __DIR__.'/function.php'; |
|
| 10 | 10 | |
| 11 | 11 | // Change this variable if you use a cloned version of eXtGallery |
| 12 | 12 | $localModuleDir = 'extcal'; |
@@ -16,9 +16,9 @@ discard block |
||
| 16 | 16 | $downloadServer = 'http://downloads.sourceforge.net/zoullou/'; |
| 17 | 17 | |
| 18 | 18 | $lastVersion = @file_get_contents($versionFile); |
| 19 | -$lastVersionString = substr($lastVersion, 0, 1) . '.' . substr($lastVersion, 1, 1) . '.' . substr($lastVersion, 2, 1); |
|
| 20 | -$moduleFileName = $moduleName . '-' . $lastVersionString . '.tar.gz'; |
|
| 21 | -$langFileName = $moduleName . '-lang-' . $lastVersionString . '_' . $xoopsConfig['language'] . '.tar.gz'; |
|
| 19 | +$lastVersionString = substr($lastVersion, 0, 1).'.'.substr($lastVersion, 1, 1).'.'.substr($lastVersion, 2, 1); |
|
| 20 | +$moduleFileName = $moduleName.'-'.$lastVersionString.'.tar.gz'; |
|
| 21 | +$langFileName = $moduleName.'-lang-'.$lastVersionString.'_'.$xoopsConfig['language'].'.tar.gz'; |
|
| 22 | 22 | |
| 23 | 23 | switch ($step) { |
| 24 | 24 | case 'download': |
@@ -30,12 +30,12 @@ discard block |
||
| 30 | 30 | break; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - if (!$handle = @fopen($downloadServer . $moduleFileName, 'r')) { |
|
| 33 | + if (!$handle = @fopen($downloadServer.$moduleFileName, 'r')) { |
|
| 34 | 34 | printf(_AM_EXTCAL_MD_FILE_DONT_EXIST, $downloadServer, $moduleFileName); |
| 35 | 35 | xoops_cp_footer(); |
| 36 | 36 | break; |
| 37 | 37 | } |
| 38 | - $localHandle = @fopen(XOOPS_ROOT_PATH . '/uploads/' . $moduleFileName, 'w+'); |
|
| 38 | + $localHandle = @fopen(XOOPS_ROOT_PATH.'/uploads/'.$moduleFileName, 'w+'); |
|
| 39 | 39 | |
| 40 | 40 | // Downlad module archive |
| 41 | 41 | if ($handle) { |
@@ -49,10 +49,10 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | // English file are included on module package |
| 51 | 51 | if ('english' !== $xoopsConfig['language']) { |
| 52 | - if (!$handle = @fopen($downloadServer . $langFileName, 'r')) { |
|
| 52 | + if (!$handle = @fopen($downloadServer.$langFileName, 'r')) { |
|
| 53 | 53 | printf(_AM_EXTCAL_LG_FILE_DONT_EXIST, $downloadServer, $langFileName); |
| 54 | 54 | } else { |
| 55 | - $localHandle = @fopen(XOOPS_ROOT_PATH . '/uploads/' . $langFileName, 'w+'); |
|
| 55 | + $localHandle = @fopen(XOOPS_ROOT_PATH.'/uploads/'.$langFileName, 'w+'); |
|
| 56 | 56 | // Download language archive |
| 57 | 57 | if ($handle) { |
| 58 | 58 | while (!feof($handle)) { |
@@ -75,35 +75,35 @@ discard block |
||
| 75 | 75 | xoops_cp_header(); |
| 76 | 76 | adminMenu(); |
| 77 | 77 | |
| 78 | - if (!file_exists(XOOPS_ROOT_PATH . '/uploads/' . $moduleFileName)) { |
|
| 78 | + if (!file_exists(XOOPS_ROOT_PATH.'/uploads/'.$moduleFileName)) { |
|
| 79 | 79 | echo _AM_EXTCAL_MD_FILE_DONT_EXIST_SHORT; |
| 80 | 80 | xoops_cp_footer(); |
| 81 | 81 | |
| 82 | 82 | break; |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | - $gPcltarLibDir = XOOPS_ROOT_PATH . '/modules/' . $localModuleDir . '/class'; |
|
| 86 | - include __DIR__ . '/../class/pcltar.lib.php'; |
|
| 85 | + $gPcltarLibDir = XOOPS_ROOT_PATH.'/modules/'.$localModuleDir.'/class'; |
|
| 86 | + include __DIR__.'/../class/pcltar.lib.php'; |
|
| 87 | 87 | |
| 88 | 88 | //TrOn(5); |
| 89 | 89 | |
| 90 | 90 | // Extract module files |
| 91 | - PclTarExtract(XOOPS_ROOT_PATH . '/uploads/' . $moduleFileName, XOOPS_ROOT_PATH . '/modules/' . $localModuleDir . '/', 'modules/' . $moduleName . '/'); |
|
| 91 | + PclTarExtract(XOOPS_ROOT_PATH.'/uploads/'.$moduleFileName, XOOPS_ROOT_PATH.'/modules/'.$localModuleDir.'/', 'modules/'.$moduleName.'/'); |
|
| 92 | 92 | // Delete downloaded module's files |
| 93 | - unlink(XOOPS_ROOT_PATH . '/uploads/' . $moduleFileName); |
|
| 93 | + unlink(XOOPS_ROOT_PATH.'/uploads/'.$moduleFileName); |
|
| 94 | 94 | |
| 95 | - if (file_exists(XOOPS_ROOT_PATH . '/uploads/' . $langFileName)) { |
|
| 95 | + if (file_exists(XOOPS_ROOT_PATH.'/uploads/'.$langFileName)) { |
|
| 96 | 96 | // Extract language files |
| 97 | - PclTarExtract(XOOPS_ROOT_PATH . '/uploads/' . $langFileName, XOOPS_ROOT_PATH . '/modules/' . $localModuleDir . '/', 'modules/' . $moduleName . '/'); |
|
| 97 | + PclTarExtract(XOOPS_ROOT_PATH.'/uploads/'.$langFileName, XOOPS_ROOT_PATH.'/modules/'.$localModuleDir.'/', 'modules/'.$moduleName.'/'); |
|
| 98 | 98 | // Delete downloaded module's files |
| 99 | - unlink(XOOPS_ROOT_PATH . '/uploads/' . $langFileName); |
|
| 99 | + unlink(XOOPS_ROOT_PATH.'/uploads/'.$langFileName); |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | // Delete template_c file |
| 103 | - if ($handle = opendir(XOOPS_ROOT_PATH . '/templates_c')) { |
|
| 103 | + if ($handle = opendir(XOOPS_ROOT_PATH.'/templates_c')) { |
|
| 104 | 104 | while (false !== ($file = readdir($handle))) { |
| 105 | 105 | if ('.' !== $file && '..' !== $file && 'index.html' !== $file) { |
| 106 | - unlink(XOOPS_ROOT_PATH . '/templates_c/' . $file); |
|
| 106 | + unlink(XOOPS_ROOT_PATH.'/templates_c/'.$file); |
|
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | 109 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | } |
| 112 | 112 | //TrDisplay(); |
| 113 | 113 | |
| 114 | - xoops_confirm(['dirname' => $localModuleDir, 'op' => 'update_ok', 'fct' => 'modulesadmin'], XOOPS_URL . '/modules/system/admin.php', _AM_EXTCAL_INSTALL_DONE, _AM_EXTCAL_UPDATE); |
|
| 114 | + xoops_confirm(['dirname' => $localModuleDir, 'op' => 'update_ok', 'fct' => 'modulesadmin'], XOOPS_URL.'/modules/system/admin.php', _AM_EXTCAL_INSTALL_DONE, _AM_EXTCAL_UPDATE); |
|
| 115 | 115 | |
| 116 | 116 | xoops_cp_footer(); |
| 117 | 117 | |
@@ -255,6 +255,10 @@ |
||
| 255 | 255 | * @param $max |
| 256 | 256 | * @return mixed |
| 257 | 257 | */ |
| 258 | + |
|
| 259 | + /** |
|
| 260 | + * @param integer $min |
|
| 261 | + */ |
|
| 258 | 262 | public static function bornerValeur($val, $min, $max) |
| 259 | 263 | { |
| 260 | 264 | if ($val < $min) { |
@@ -170,9 +170,9 @@ |
||
| 170 | 170 | $tHex = ['', '', '', '']; |
| 171 | 171 | |
| 172 | 172 | $tHex[0] = $aColors[0]; |
| 173 | - $tHex[1] = substr('00' . dechex($aColors[1]), -2); |
|
| 174 | - $tHex[2] = substr('00' . dechex($aColors[2]), -2); |
|
| 175 | - $tHex[3] = substr('00' . dechex($aColors[3]), -2); |
|
| 173 | + $tHex[1] = substr('00'.dechex($aColors[1]), -2); |
|
| 174 | + $tHex[2] = substr('00'.dechex($aColors[2]), -2); |
|
| 175 | + $tHex[3] = substr('00'.dechex($aColors[3]), -2); |
|
| 176 | 176 | |
| 177 | 177 | $colorHexa = implode('', $tHex); |
| 178 | 178 | |