@@ -3,12 +3,12 @@ discard block |
||
| 3 | 3 | /** |
| 4 | 4 | * @see http://www.php-fig.org/psr/psr-4/examples/ |
| 5 | 5 | */ |
| 6 | -spl_autoload_register(function ($class) { |
|
| 6 | +spl_autoload_register(function($class) { |
|
| 7 | 7 | // project-specific namespace prefix |
| 8 | - $prefix = 'XoopsModules\\' . ucfirst(basename(dirname(__DIR__))); |
|
| 8 | + $prefix = 'XoopsModules\\'.ucfirst(basename(dirname(__DIR__))); |
|
| 9 | 9 | |
| 10 | 10 | // base directory for the namespace prefix |
| 11 | - $base_dir = __DIR__ . '/../class/'; |
|
| 11 | + $base_dir = __DIR__.'/../class/'; |
|
| 12 | 12 | |
| 13 | 13 | // does the class use the namespace prefix? |
| 14 | 14 | $len = strlen($prefix); |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | // replace the namespace prefix with the base directory, replace namespace |
| 24 | 24 | // separators with directory separators in the relative class name, append |
| 25 | 25 | // with .php |
| 26 | - $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php'; |
|
| 26 | + $file = $base_dir.str_replace('\\', '/', $relative_class).'.php'; |
|
| 27 | 27 | |
| 28 | 28 | // if the file exists, require it |
| 29 | 29 | if (file_exists($file)) { |
@@ -19,17 +19,17 @@ discard block |
||
| 19 | 19 | * @author XOOPS Development Team, |
| 20 | 20 | */ |
| 21 | 21 | |
| 22 | -include __DIR__ . '/../../mainfile.php'; |
|
| 23 | -require_once __DIR__ . '/include/constantes.php'; |
|
| 22 | +include __DIR__.'/../../mainfile.php'; |
|
| 23 | +require_once __DIR__.'/include/constantes.php'; |
|
| 24 | 24 | $params = ['view' => _EXTCAL_NAV_WEEK, 'file' => _EXTCAL_FILE_WEEK]; |
| 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 | /* ========================================================================== */ |
| 29 | -$year = isset($_GET['year']) ? (int)$_GET['year'] : date('Y'); |
|
| 30 | -$month = isset($_GET['month']) ? (int)$_GET['month'] : date('n'); |
|
| 31 | -$day = isset($_GET['day']) ? (int)$_GET['day'] : date('j'); |
|
| 32 | -$cat = isset($_GET['cat']) ? (int)$_GET['cat'] : 0; |
|
| 29 | +$year = isset($_GET['year']) ? (int) $_GET['year'] : date('Y'); |
|
| 30 | +$month = isset($_GET['month']) ? (int) $_GET['month'] : date('n'); |
|
| 31 | +$day = isset($_GET['day']) ? (int) $_GET['day'] : date('j'); |
|
| 32 | +$cat = isset($_GET['cat']) ? (int) $_GET['cat'] : 0; |
|
| 33 | 33 | /* ========================================================================== */ |
| 34 | 34 | |
| 35 | 35 | // Validate the date (day, month and year) |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | 'cat' => $cat, |
| 65 | 65 | 'externalKeys' => 'cat_id', |
| 66 | 66 | ]; |
| 67 | -$events = $eventHandler->getEventsOnPeriode($criteres); |
|
| 67 | +$events = $eventHandler->getEventsOnPeriode($criteres); |
|
| 68 | 68 | /**********************************************************************/ |
| 69 | 69 | $eventsArray = $events; |
| 70 | 70 | // Formating date |
@@ -105,21 +105,21 @@ discard block |
||
| 105 | 105 | $nWeekCalObj = $weekCalObj->nextWeek('object'); |
| 106 | 106 | $navig = [ |
| 107 | 107 | 'prev' => [ |
| 108 | - 'uri' => 'year=' . $pWeekCalObj->thisYear() . '&month=' . $pWeekCalObj->thisMonth() . '&day=' . $pWeekCalObj->thisDay(), |
|
| 108 | + 'uri' => 'year='.$pWeekCalObj->thisYear().'&month='.$pWeekCalObj->thisMonth().'&day='.$pWeekCalObj->thisDay(), |
|
| 109 | 109 | 'name' => $timeHandler->getFormatedDate($extcalConfig['nav_date_week'], $pWeekCalObj->getTimestamp()), |
| 110 | 110 | ], |
| 111 | 111 | 'this' => [ |
| 112 | - 'uri' => 'year=' . $weekCalObj->thisYear() . '&month=' . $weekCalObj->thisMonth() . '&day=' . $weekCalObj->thisDay(), |
|
| 112 | + 'uri' => 'year='.$weekCalObj->thisYear().'&month='.$weekCalObj->thisMonth().'&day='.$weekCalObj->thisDay(), |
|
| 113 | 113 | 'name' => $timeHandler->getFormatedDate($extcalConfig['nav_date_week'], $weekCalObj->getTimestamp()), |
| 114 | 114 | ], |
| 115 | 115 | 'next' => [ |
| 116 | - 'uri' => 'year=' . $nWeekCalObj->thisYear() . '&month=' . $nWeekCalObj->thisMonth() . '&day=' . $nWeekCalObj->thisDay(), |
|
| 116 | + 'uri' => 'year='.$nWeekCalObj->thisYear().'&month='.$nWeekCalObj->thisMonth().'&day='.$nWeekCalObj->thisDay(), |
|
| 117 | 117 | 'name' => $timeHandler->getFormatedDate($extcalConfig['nav_date_week'], $nWeekCalObj->getTimestamp()), |
| 118 | 118 | ], |
| 119 | 119 | ]; |
| 120 | 120 | |
| 121 | 121 | // Title of the page |
| 122 | -$xoopsTpl->assign('xoops_pagetitle', $xoopsModule->getVar('name') . ' ' . $navig['this']['name']); |
|
| 122 | +$xoopsTpl->assign('xoops_pagetitle', $xoopsModule->getVar('name').' '.$navig['this']['name']); |
|
| 123 | 123 | |
| 124 | 124 | // Assigning navig data to the template |
| 125 | 125 | $xoopsTpl->assign('navig', $navig); |
@@ -179,4 +179,4 @@ discard block |
||
| 179 | 179 | $xoopsTpl->assign('lang', $lang); |
| 180 | 180 | $xoopsTpl->assign('view', 'week'); |
| 181 | 181 | |
| 182 | -include XOOPS_ROOT_PATH . '/footer.php'; |
|
| 182 | +include XOOPS_ROOT_PATH.'/footer.php'; |
|
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | //Kraven 30 |
| 22 | 22 | // defined('XOOPS_ROOT_PATH') || exit('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 | /** |
| 27 | 27 | * Class EtablissementHandler. |
@@ -40,13 +40,13 @@ discard block |
||
| 40 | 40 | //check for minimum XOOPS version |
| 41 | 41 | $currentVer = substr(XOOPS_VERSION, 6); // get the numeric part of string |
| 42 | 42 | if (null === $requiredVer) { |
| 43 | - $requiredVer = '' . $module->getInfo('min_xoops'); //making sure it's a string |
|
| 43 | + $requiredVer = ''.$module->getInfo('min_xoops'); //making sure it's a string |
|
| 44 | 44 | } |
| 45 | 45 | $success = true; |
| 46 | 46 | |
| 47 | 47 | if (version_compare($currentVer, $requiredVer, '<')) { |
| 48 | 48 | $success = false; |
| 49 | - $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_XOOPS'), $requiredVer, $currentVer)); |
|
| 49 | + $module->setErrors(sprintf(constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_XOOPS'), $requiredVer, $currentVer)); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | return $success; |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | $reqVer = $module->getInfo('min_php'); |
| 71 | 71 | if (false !== $reqVer && '' !== $reqVer) { |
| 72 | 72 | if (version_compare($verNum, $reqVer, '<')) { |
| 73 | - $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_PHP'), $reqVer, $verNum)); |
|
| 73 | + $module->setErrors(sprintf(constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_PHP'), $reqVer, $verNum)); |
|
| 74 | 74 | $success = false; |
| 75 | 75 | } |
| 76 | 76 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | throw new \RuntimeException(sprintf('Unable to create the %s directory', $folder)); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - file_put_contents($folder . '/index.html', '<script>history.go(-1);</script>'); |
|
| 36 | + file_put_contents($folder.'/index.html', '<script>history.go(-1);</script>'); |
|
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | catch (\Exception $e) { |
@@ -62,10 +62,10 @@ discard block |
||
| 62 | 62 | if (!mkdir($dst) && !is_dir($dst)) { |
| 63 | 63 | while (false !== ($file = readdir($dir))) { |
| 64 | 64 | if (('.' !== $file) && ('..' !== $file)) { |
| 65 | - if (is_dir($src . '/' . $file)) { |
|
| 66 | - self::recurseCopy($src . '/' . $file, $dst . '/' . $file); |
|
| 65 | + if (is_dir($src.'/'.$file)) { |
|
| 66 | + self::recurseCopy($src.'/'.$file, $dst.'/'.$file); |
|
| 67 | 67 | } else { |
| 68 | - copy($src . '/' . $file, $dst . '/' . $file); |
|
| 68 | + copy($src.'/'.$file, $dst.'/'.$file); |
|
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | } |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | self::rrmdir($fObj->getPathname()); |
| 161 | 161 | } |
| 162 | 162 | } |
| 163 | - $iterator = null; // clear iterator Obj to close file/directory |
|
| 163 | + $iterator = null; // clear iterator Obj to close file/directory |
|
| 164 | 164 | return rmdir($src); // remove the directory & return results |
| 165 | 165 | } |
| 166 | 166 | |
@@ -193,14 +193,14 @@ discard block |
||
| 193 | 193 | $iterator = new \DirectoryIterator($src); |
| 194 | 194 | foreach ($iterator as $fObj) { |
| 195 | 195 | if ($fObj->isFile()) { |
| 196 | - rename($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
|
| 196 | + rename($fObj->getPathname(), "{$dest}/".$fObj->getFilename()); |
|
| 197 | 197 | } elseif (!$fObj->isDot() && $fObj->isDir()) { |
| 198 | 198 | // Try recursively on directory |
| 199 | - self::rmove($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
|
| 199 | + self::rmove($fObj->getPathname(), "{$dest}/".$fObj->getFilename()); |
|
| 200 | 200 | // rmdir($fObj->getPath()); // now delete the directory |
| 201 | 201 | } |
| 202 | 202 | } |
| 203 | - $iterator = null; // clear iterator Obj to close file/directory |
|
| 203 | + $iterator = null; // clear iterator Obj to close file/directory |
|
| 204 | 204 | return rmdir($src); // remove the directory & return results |
| 205 | 205 | } |
| 206 | 206 | |
@@ -236,9 +236,9 @@ discard block |
||
| 236 | 236 | $iterator = new \DirectoryIterator($src); |
| 237 | 237 | foreach ($iterator as $fObj) { |
| 238 | 238 | if ($fObj->isFile()) { |
| 239 | - copy($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
|
| 239 | + copy($fObj->getPathname(), "{$dest}/".$fObj->getFilename()); |
|
| 240 | 240 | } elseif (!$fObj->isDot() && $fObj->isDir()) { |
| 241 | - self::rcopy($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
|
| 241 | + self::rcopy($fObj->getPathname(), "{$dest}/".$fObj->getFilename()); |
|
| 242 | 242 | } |
| 243 | 243 | } |
| 244 | 244 | return true; |
@@ -35,8 +35,7 @@ |
||
| 35 | 35 | |
| 36 | 36 | file_put_contents($folder . '/index.html', '<script>history.go(-1);</script>'); |
| 37 | 37 | } |
| 38 | - } |
|
| 39 | - catch (\Exception $e) { |
|
| 38 | + } catch (\Exception $e) { |
|
| 40 | 39 | echo 'Caught exception: ', $e->getMessage(), "\n", '<br>'; |
| 41 | 40 | } |
| 42 | 41 | } |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | require_once $GLOBALS['xoops']->path('class/template.php'); |
| 71 | 71 | $breadcrumbTpl = new \XoopsTpl(); |
| 72 | 72 | $breadcrumbTpl->assign('breadcrumb', $this->bread); |
| 73 | - $html = $breadcrumbTpl->fetch('db:' . $this->dirname . '_common_breadcrumb.tpl'); |
|
| 73 | + $html = $breadcrumbTpl->fetch('db:'.$this->dirname.'_common_breadcrumb.tpl'); |
|
| 74 | 74 | unset($breadcrumbTpl); |
| 75 | 75 | |
| 76 | 76 | return $html; |
@@ -16,11 +16,11 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | public function __construct($form, $startTS = 0, $endTS = 0) |
| 18 | 18 | { |
| 19 | - $startTS = (int)$startTS; |
|
| 19 | + $startTS = (int) $startTS; |
|
| 20 | 20 | $startTS = ($startTS > 0) ? $startTS : time(); |
| 21 | 21 | $startDatetime = getdate($startTS); |
| 22 | 22 | |
| 23 | - $endTS = (int)$endTS; |
|
| 23 | + $endTS = (int) $endTS; |
|
| 24 | 24 | $endTS = ($endTS > 0) ? $endTS : time(); |
| 25 | 25 | $endDatetime = getdate($endTS); |
| 26 | 26 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | for ($i = 0; $i < 24; ++$i) { |
| 29 | 29 | for ($j = 0; $j < _EXTCAL_TS_MINUTE; $j += 15) { |
| 30 | 30 | $key = ($i * _EXTCAL_TS_HOUR) + ($j * _EXTCAL_TS_MINUTE); |
| 31 | - $timearray[$key] = (0 != $j) ? $i . ':' . $j : $i . ':0' . $j; |
|
| 31 | + $timearray[$key] = (0 != $j) ? $i.':'.$j : $i.':0'.$j; |
|
| 32 | 32 | } |
| 33 | 33 | } |
| 34 | 34 | ksort($timearray); |
@@ -72,12 +72,12 @@ |
||
| 72 | 72 | $eventNotMember = $this->getObjects(new \Criteria('event_id', $eventId)); |
| 73 | 73 | $count = count($eventNotMember); |
| 74 | 74 | if ($count > 0) { |
| 75 | - $in = '(' . $eventNotMember[0]->getVar('uid'); |
|
| 75 | + $in = '('.$eventNotMember[0]->getVar('uid'); |
|
| 76 | 76 | array_shift($eventNotMember); |
| 77 | 77 | foreach ($eventNotMember as $member) { |
| 78 | - $in .= ',' . $member->getVar('uid'); |
|
| 78 | + $in .= ','.$member->getVar('uid'); |
|
| 79 | 79 | } |
| 80 | - $in .= ')'; |
|
| 80 | + $in .= ')'; |
|
| 81 | 81 | $criteria = new \Criteria('uid', $in, 'IN'); |
| 82 | 82 | } else { |
| 83 | 83 | $criteria = new \Criteria('uid', '(0)', 'IN'); |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | // defined('XOOPS_ROOT_PATH') || exit('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 |
||
| 46 | 46 | $userId = $GLOBALS['xoopsUser'] ? $GLOBALS['xoopsUser']->getVar('uid') : 0; |
| 47 | 47 | |
| 48 | 48 | $allowedMimeType = []; |
| 49 | - $mimeType = include XOOPS_ROOT_PATH . '/include/mimetypes.inc.php'; |
|
| 49 | + $mimeType = include 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 |
||
| 113 | 113 | if (isset($_POST['filetokeep'])) { |
| 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 |
||
| 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 |
||
| 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 | } |