@@ -149,11 +149,11 @@ |
||
| 149 | 149 | $cat_color = $catList->getVar('cat_color'); |
| 150 | 150 | $checked = in_array($cat_id, $cat) ? 'checked' : ''; |
| 151 | 151 | $cat = '' |
| 152 | - . "<div style='float:left; margin-left:5px;'>" |
|
| 153 | - . "<input type='checkbox' name='{$name}[{$cat_id}]' value='1' {$checked}>" |
|
| 154 | - . "<div style='absolute:left;height:12px; width:6px; background-color:#{$cat_color}; border:1px solid black; float:left; margin-right:5px;' ></div>" |
|
| 155 | - . " {$name}" |
|
| 156 | - . '</div>'; |
|
| 152 | + . "<div style='float:left; margin-left:5px;'>" |
|
| 153 | + . "<input type='checkbox' name='{$name}[{$cat_id}]' value='1' {$checked}>" |
|
| 154 | + . "<div style='absolute:left;height:12px; width:6px; background-color:#{$cat_color}; border:1px solid black; float:left; margin-right:5px;' ></div>" |
|
| 155 | + . " {$name}" |
|
| 156 | + . '</div>'; |
|
| 157 | 157 | |
| 158 | 158 | $t[] = $cat; |
| 159 | 159 | } |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | use XoopsModules\Extcal; |
| 20 | 20 | |
| 21 | -require_once XOOPS_ROOT_PATH . '/class/uploader.php'; |
|
| 21 | +require_once XOOPS_ROOT_PATH.'/class/uploader.php'; |
|
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | 24 | * @param $eventId |
@@ -47,12 +47,12 @@ discard block |
||
| 47 | 47 | function extcal_loadImg(&$REQUEST, &$event_picture1, &$event_picture2) |
| 48 | 48 | { |
| 49 | 49 | /////////////////////////////////////////////////////////////////////////////// |
| 50 | - $uploaddir_event = XOOPS_ROOT_PATH . '/uploads/extcal/'; |
|
| 51 | - $uploadurl_event = XOOPS_URL . '/uploads/extcal/'; |
|
| 50 | + $uploaddir_event = XOOPS_ROOT_PATH.'/uploads/extcal/'; |
|
| 51 | + $uploadurl_event = XOOPS_URL.'/uploads/extcal/'; |
|
| 52 | 52 | //$picture = ''; |
| 53 | 53 | for ($j = 1; $j < 3; ++$j) { |
| 54 | - $delimg = @$REQUEST['delimg_' . $j . '']; |
|
| 55 | - $delimg = isset($delimg) ? (int)$delimg : 0; |
|
| 54 | + $delimg = @$REQUEST['delimg_'.$j.'']; |
|
| 55 | + $delimg = isset($delimg) ? (int) $delimg : 0; |
|
| 56 | 56 | if (0 == $delimg && !empty($REQUEST['xoops_upload_file'][$j])) { |
| 57 | 57 | $upload = new \XoopsMediaUploader($uploaddir_event, [ |
| 58 | 58 | 'image/gif', |
@@ -75,15 +75,15 @@ discard block |
||
| 75 | 75 | $event_picture2 = $upload->getSavedFileName(); |
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | - } elseif (!empty($REQUEST['file' . $j])) { |
|
| 78 | + } elseif (!empty($REQUEST['file'.$j])) { |
|
| 79 | 79 | if (1 == $j) { |
| 80 | - $event_picture1 = $REQUEST['file' . $j]; |
|
| 80 | + $event_picture1 = $REQUEST['file'.$j]; |
|
| 81 | 81 | } elseif (2 == $j) { |
| 82 | - $event_picture2 = $REQUEST['file' . $j]; |
|
| 82 | + $event_picture2 = $REQUEST['file'.$j]; |
|
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | 85 | } else { |
| 86 | - $url_event = XOOPS_ROOT_PATH . '/uploads/extcal/' . $REQUEST['file' . $j]; |
|
| 86 | + $url_event = XOOPS_ROOT_PATH.'/uploads/extcal/'.$REQUEST['file'.$j]; |
|
| 87 | 87 | if (1 == $j) { |
| 88 | 88 | $event_picture1 = ''; |
| 89 | 89 | } elseif (2 == $j) { |
@@ -179,17 +179,17 @@ discard block |
||
| 179 | 179 | $select->addOption('', ''); |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | - $select->addOption('year ASC', _MD_EXTCAL_YEAR . ' ' . _MD_EXTCAL_ORDER_BY_ASC); |
|
| 183 | - $select->addOption('year DESC', _MD_EXTCAL_YEAR . ' ' . _MD_EXTCAL_ORDER_BY_DESC); |
|
| 182 | + $select->addOption('year ASC', _MD_EXTCAL_YEAR.' '._MD_EXTCAL_ORDER_BY_ASC); |
|
| 183 | + $select->addOption('year DESC', _MD_EXTCAL_YEAR.' '._MD_EXTCAL_ORDER_BY_DESC); |
|
| 184 | 184 | |
| 185 | - $select->addOption('month ASC', _MD_EXTCAL_MONTH . ' ' . _MD_EXTCAL_ORDER_BY_ASC); |
|
| 186 | - $select->addOption('month DESC', _MD_EXTCAL_MONTH . ' ' . _MD_EXTCAL_ORDER_BY_DESC); |
|
| 185 | + $select->addOption('month ASC', _MD_EXTCAL_MONTH.' '._MD_EXTCAL_ORDER_BY_ASC); |
|
| 186 | + $select->addOption('month DESC', _MD_EXTCAL_MONTH.' '._MD_EXTCAL_ORDER_BY_DESC); |
|
| 187 | 187 | |
| 188 | - $select->addOption('event_title ASC', _MD_EXTCAL_ALPHA . ' ' . _MD_EXTCAL_ORDER_BY_ASC); |
|
| 189 | - $select->addOption('event_title DESC', _MD_EXTCAL_ALPHA . ' ' . _MD_EXTCAL_ORDER_BY_DESC); |
|
| 188 | + $select->addOption('event_title ASC', _MD_EXTCAL_ALPHA.' '._MD_EXTCAL_ORDER_BY_ASC); |
|
| 189 | + $select->addOption('event_title DESC', _MD_EXTCAL_ALPHA.' '._MD_EXTCAL_ORDER_BY_DESC); |
|
| 190 | 190 | |
| 191 | - $select->addOption('cat_name ASC', _MD_EXTCAL_CATEGORY . ' ' . _MD_EXTCAL_ORDER_BY_ASC); |
|
| 192 | - $select->addOption('cat_name DESC', _MD_EXTCAL_CATEGORY . ' ' . _MD_EXTCAL_ORDER_BY_DESC); |
|
| 191 | + $select->addOption('cat_name ASC', _MD_EXTCAL_CATEGORY.' '._MD_EXTCAL_ORDER_BY_ASC); |
|
| 192 | + $select->addOption('cat_name DESC', _MD_EXTCAL_CATEGORY.' '._MD_EXTCAL_ORDER_BY_DESC); |
|
| 193 | 193 | |
| 194 | 194 | return $select; |
| 195 | 195 | } |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | function echoDateArray($period) |
| 304 | 304 | { |
| 305 | 305 | foreach ($period as $dt) { |
| 306 | - echo $dt->format("l Y-m-d H:i:s\n") . '<br>'; |
|
| 306 | + echo $dt->format("l Y-m-d H:i:s\n").'<br>'; |
|
| 307 | 307 | } |
| 308 | 308 | } |
| 309 | 309 | |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | $txt = print_r($t, true); |
| 322 | - echo '<pre>Number of items: ' . count($t) . "<br>{$txt}</pre>"; |
|
| 322 | + echo '<pre>Number of items: '.count($t)."<br>{$txt}</pre>"; |
|
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | /*****************************************************************/ |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | if ('' != $msg) { |
| 333 | 333 | echo "<hr>{$msg}<hr>"; |
| 334 | 334 | } |
| 335 | - echo $line . '<br>'; |
|
| 335 | + echo $line.'<br>'; |
|
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | /*****************************************************************/ |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | echo "<hr>{$msg}<hr>"; |
| 360 | 360 | } |
| 361 | 361 | |
| 362 | - echo 'date --->' . $tsName . ' = ' . $ts . ' - ' . date('d-m-Y H:m:s', $ts) . '<br>'; |
|
| 362 | + echo 'date --->'.$tsName.' = '.$ts.' - '.date('d-m-Y H:m:s', $ts).'<br>'; |
|
| 363 | 363 | } |
| 364 | 364 | |
| 365 | 365 | /*****************************************************************/ |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | if ((!defined('XOOPS_ROOT_PATH')) || !($GLOBALS['xoopsUser'] instanceof XoopsUser) |
| 24 | 24 | || !$GLOBALS['xoopsUser']->IsAdmin()) { |
| 25 | - exit('Restricted access' . PHP_EOL); |
|
| 25 | + exit('Restricted access'.PHP_EOL); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | /** |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | return true; |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - $fld = XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname') . '/versions/'; |
|
| 78 | + $fld = XOOPS_ROOT_PATH.'/modules/'.$module->getVar('dirname').'/versions/'; |
|
| 79 | 79 | $cls = 'Extcal_%1$s'; |
| 80 | 80 | |
| 81 | 81 | $version = [ |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | foreach ($version as $key => $val) { |
| 95 | 95 | if ($previousVersion < $val) { |
| 96 | 96 | $name = sprintf($cls, $key); |
| 97 | - $f = $fld . $name . '.php'; |
|
| 97 | + $f = $fld.$name.'.php'; |
|
| 98 | 98 | //ext_echo ("<hr>{$f}<hr>"); |
| 99 | 99 | if (is_readable($f)) { |
| 100 | 100 | echo "mise à jour version : {$key} = {$val}<br>"; |
@@ -118,14 +118,14 @@ discard block |
||
| 118 | 118 | //delete old HTML templates |
| 119 | 119 | if (count($configurator['templateFolders']) > 0) { |
| 120 | 120 | foreach ($configurator['templateFolders'] as $folder) { |
| 121 | - $templateFolder = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $folder); |
|
| 121 | + $templateFolder = $GLOBALS['xoops']->path('modules/'.$moduleDirName.$folder); |
|
| 122 | 122 | if (is_dir($templateFolder)) { |
| 123 | 123 | $templateList = array_diff(scandir($templateFolder, SCANDIR_SORT_NONE), ['..', '.']); |
| 124 | 124 | foreach ($templateList as $k => $v) { |
| 125 | - $fileInfo = new SplFileInfo($templateFolder . $v); |
|
| 125 | + $fileInfo = new SplFileInfo($templateFolder.$v); |
|
| 126 | 126 | if ('html' === $fileInfo->getExtension() && 'index.html' !== $fileInfo->getFilename()) { |
| 127 | - if (file_exists($templateFolder . $v)) { |
|
| 128 | - unlink($templateFolder . $v); |
|
| 127 | + if (file_exists($templateFolder.$v)) { |
|
| 128 | + unlink($templateFolder.$v); |
|
| 129 | 129 | } |
| 130 | 130 | } |
| 131 | 131 | } |
@@ -135,9 +135,9 @@ discard block |
||
| 135 | 135 | |
| 136 | 136 | // --- COPY blank.png FILES --------------- |
| 137 | 137 | if (count($configurator['copyFiles']) > 0) { |
| 138 | - $file = __DIR__ . '/../assets/images/blank.png'; |
|
| 138 | + $file = __DIR__.'/../assets/images/blank.png'; |
|
| 139 | 139 | foreach (array_keys($configurator['copyFiles']) as $i) { |
| 140 | - $dest = $configurator['copyFiles'][$i] . '/blank.png'; |
|
| 140 | + $dest = $configurator['copyFiles'][$i].'/blank.png'; |
|
| 141 | 141 | $utilityClass::copyFile($file, $dest); |
| 142 | 142 | } |
| 143 | 143 | } |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | if (count($configurator['oldFiles']) > 0) { |
| 147 | 147 | // foreach (array_keys($GLOBALS['uploadFolders']) as $i) { |
| 148 | 148 | foreach (array_keys($configurator['oldFiles']) as $i) { |
| 149 | - $tempFile = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $configurator['oldFiles'][$i]); |
|
| 149 | + $tempFile = $GLOBALS['xoops']->path('modules/'.$moduleDirName.$configurator['oldFiles'][$i]); |
|
| 150 | 150 | if (is_file($tempFile)) { |
| 151 | 151 | unlink($tempFile); |
| 152 | 152 | } |
@@ -156,14 +156,14 @@ discard block |
||
| 156 | 156 | //--------------------- |
| 157 | 157 | |
| 158 | 158 | //delete .html entries from the tpl table |
| 159 | - $sql = 'DELETE FROM ' . $xoopsDB->prefix('tplfile') . " WHERE `tpl_module` = '" . $module->getVar('dirname', 'n') . "' AND `tpl_file` LIKE '%.html%'"; |
|
| 159 | + $sql = 'DELETE FROM '.$xoopsDB->prefix('tplfile')." WHERE `tpl_module` = '".$module->getVar('dirname', 'n')."' AND `tpl_file` LIKE '%.html%'"; |
|
| 160 | 160 | $xoopsDB->queryF($sql); |
| 161 | 161 | |
| 162 | 162 | // Load class XoopsFile ==================== |
| 163 | 163 | xoops_load('XoopsFile'); |
| 164 | 164 | |
| 165 | 165 | //delete /images directory ============ |
| 166 | - $imagesDirectory = $GLOBALS['xoops']->path('modules/' . $module->getVar('dirname', 'n') . '/images/'); |
|
| 166 | + $imagesDirectory = $GLOBALS['xoops']->path('modules/'.$module->getVar('dirname', 'n').'/images/'); |
|
| 167 | 167 | $folderHandler = \XoopsFile::getHandler('folder', $imagesDirectory); |
| 168 | 168 | $folderHandler->delete($imagesDirectory); |
| 169 | 169 | } |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | define('_EXTCAL_FORMAT_AGENDA_KEYD', 'Y-m-d'); |
| 22 | 22 | define('_EXTCAL_FORMAT_AGENDA_KEYT', 'H:i'); |
| 23 | 23 | |
| 24 | -require_once __DIR__ . '/constantes.php'; |
|
| 24 | +require_once __DIR__.'/constantes.php'; |
|
| 25 | 25 | //require_once __DIR__ . '/../class/Utility.php'; |
| 26 | 26 | |
| 27 | 27 | $moduleDirName = basename(dirname(__DIR__)); |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | $tj[$kj]['dayWeek'] = date('w', $tsj); |
| 75 | 75 | $tj[$kj]['jour'] = $jName[$tj[$kj]['dayWeek']]; //date('l', $tsj); |
| 76 | 76 | if (0 == $tj[$kj]['dayWeek']) { |
| 77 | - $tj[$kj]['bg'] = "background='" . XOOPS_URL . "/modules/extcal/assets/images/trame.png'"; |
|
| 77 | + $tj[$kj]['bg'] = "background='".XOOPS_URL."/modules/extcal/assets/images/trame.png'"; |
|
| 78 | 78 | } else { |
| 79 | 79 | $tj[$kj]['bg'] = ''; |
| 80 | 80 | } |
@@ -154,16 +154,16 @@ discard block |
||
| 154 | 154 | $kd = date(_EXTCAL_FORMAT_AGENDA_KEYD, $ts); |
| 155 | 155 | $hour = date('H', $ts); |
| 156 | 156 | $minute = date('i', $ts); |
| 157 | - $m = (int)($minute / $mPlage) * $mPlage; |
|
| 157 | + $m = (int) ($minute / $mPlage) * $mPlage; |
|
| 158 | 158 | // echo "--->{$minute} / {$mPlage} = {$m}<br>"; |
| 159 | - $sMinute = (($m < 10) ? '0' . $m : $m); |
|
| 159 | + $sMinute = (($m < 10) ? '0'.$m : $m); |
|
| 160 | 160 | //$kt = date(_EXTCAL_FORMAT_AGENDA_KEYT, $ts); |
| 161 | 161 | if ($hour < $hStart) { |
| 162 | 162 | $kt = $tk0; |
| 163 | 163 | } elseif ($hour >= ($hEnd + 1)) { |
| 164 | 164 | $kt = $tk1; |
| 165 | 165 | } else { |
| 166 | - $kt = $hour . ':' . $sMinute; |
|
| 166 | + $kt = $hour.':'.$sMinute; |
|
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | $tAgenda[$kt]['jours'][$kd]['events'][] = $e; |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | return false; |
| 313 | 313 | } |
| 314 | 314 | |
| 315 | - $file = XOOPS_ROOT_PATH . '/language/' . $xoopsConfig['language'] . '/' . $f; |
|
| 315 | + $file = XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/'.$f; |
|
| 316 | 316 | $prefix = (defined($name) ? '_MI' : '_MD'); |
| 317 | 317 | require_once $file; |
| 318 | 318 | } |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | // while (list($k, $v) = each($tNavBar)) { |
| 453 | 453 | foreach ($tNavBar as $k => $v) { |
| 454 | 454 | if (isset($tWeight[$k])) { |
| 455 | - $ordre[] = (int)$tWeight[$k]; //ordre defini dans les option du module |
|
| 455 | + $ordre[] = (int) $tWeight[$k]; //ordre defini dans les option du module |
|
| 456 | 456 | } else { |
| 457 | 457 | $ordre[] = $v['weight']; // ordre par defaut ddefini dans le tableau $tNavBar |
| 458 | 458 | } |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | use XoopsModules\Extcal; |
| 21 | 21 | |
| 22 | -include __DIR__ . '/../preloads/autoloader.php'; |
|
| 22 | +include __DIR__.'/../preloads/autoloader.php'; |
|
| 23 | 23 | |
| 24 | 24 | $moduleDirName = basename(dirname(__DIR__)); |
| 25 | 25 | $moduleDirNameUpper = strtoupper($moduleDirName); |
@@ -39,23 +39,23 @@ discard block |
||
| 39 | 39 | ///** @var \XoopsPersistableObjectHandler $extcal_brokenHandler */ |
| 40 | 40 | //$extcal_brokenHandler = new Extcal\Extcal_brokenHandler($db); |
| 41 | 41 | |
| 42 | -if (!defined($moduleDirNameUpper . '_CONSTANTS_DEFINED')) { |
|
| 43 | - define($moduleDirNameUpper . '_DIRNAME', basename(dirname(__DIR__))); |
|
| 44 | - define($moduleDirNameUpper . '_ROOT_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/'); |
|
| 45 | - define($moduleDirNameUpper . '_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/'); |
|
| 46 | - define($moduleDirNameUpper . '_URL', XOOPS_URL . '/modules/' . $moduleDirName . '/'); |
|
| 47 | - define($moduleDirNameUpper . '_IMAGES_URL', constant($moduleDirNameUpper . '_URL') . '/assets/images/'); |
|
| 48 | - define($moduleDirNameUpper . '_IMAGES_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/assets/images/'); |
|
| 49 | - define($moduleDirNameUpper . '_ADMIN_URL', constant($moduleDirNameUpper . '_URL') . '/admin/'); |
|
| 50 | - define($moduleDirNameUpper . '_ADMIN_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/admin/'); |
|
| 51 | - define($moduleDirNameUpper . '_ADMIN', constant($moduleDirNameUpper . '_URL') . '/admin/index.php'); |
|
| 52 | - define($moduleDirNameUpper . '_AUTHOR_LOGOIMG', constant($moduleDirNameUpper . '_URL') . '/assets/images/logoModule.png'); |
|
| 53 | - define($moduleDirNameUpper . '_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . $moduleDirName); // WITHOUT Trailing slash |
|
| 54 | - define($moduleDirNameUpper . '_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . $moduleDirName); // WITHOUT Trailing slash |
|
| 55 | - define($moduleDirNameUpper . '_CAT_IMAGES_URL', XOOPS_UPLOAD_URL . ' / ' . constant($moduleDirNameUpper . '_DIRNAME') . '/images/category'); |
|
| 56 | - define($moduleDirNameUpper . '_CAT_IMAGES_PATH', XOOPS_UPLOAD_PATH . '/' . constant($moduleDirNameUpper . '_DIRNAME') . ' / images / category'); |
|
| 57 | - define($moduleDirNameUpper . '_CACHE_PATH', XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/'); |
|
| 58 | - define($moduleDirNameUpper . '_CONSTANTS_DEFINED', 1); |
|
| 42 | +if (!defined($moduleDirNameUpper.'_CONSTANTS_DEFINED')) { |
|
| 43 | + define($moduleDirNameUpper.'_DIRNAME', basename(dirname(__DIR__))); |
|
| 44 | + define($moduleDirNameUpper.'_ROOT_PATH', XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/'); |
|
| 45 | + define($moduleDirNameUpper.'_PATH', XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/'); |
|
| 46 | + define($moduleDirNameUpper.'_URL', XOOPS_URL.'/modules/'.$moduleDirName.'/'); |
|
| 47 | + define($moduleDirNameUpper.'_IMAGES_URL', constant($moduleDirNameUpper.'_URL').'/assets/images/'); |
|
| 48 | + define($moduleDirNameUpper.'_IMAGES_PATH', constant($moduleDirNameUpper.'_ROOT_PATH').'/assets/images/'); |
|
| 49 | + define($moduleDirNameUpper.'_ADMIN_URL', constant($moduleDirNameUpper.'_URL').'/admin/'); |
|
| 50 | + define($moduleDirNameUpper.'_ADMIN_PATH', constant($moduleDirNameUpper.'_ROOT_PATH').'/admin/'); |
|
| 51 | + define($moduleDirNameUpper.'_ADMIN', constant($moduleDirNameUpper.'_URL').'/admin/index.php'); |
|
| 52 | + define($moduleDirNameUpper.'_AUTHOR_LOGOIMG', constant($moduleDirNameUpper.'_URL').'/assets/images/logoModule.png'); |
|
| 53 | + define($moduleDirNameUpper.'_UPLOAD_URL', XOOPS_UPLOAD_URL.'/'.$moduleDirName); // WITHOUT Trailing slash |
|
| 54 | + define($moduleDirNameUpper.'_UPLOAD_PATH', XOOPS_UPLOAD_PATH.'/'.$moduleDirName); // WITHOUT Trailing slash |
|
| 55 | + define($moduleDirNameUpper.'_CAT_IMAGES_URL', XOOPS_UPLOAD_URL.' / '.constant($moduleDirNameUpper.'_DIRNAME').'/images/category'); |
|
| 56 | + define($moduleDirNameUpper.'_CAT_IMAGES_PATH', XOOPS_UPLOAD_PATH.'/'.constant($moduleDirNameUpper.'_DIRNAME').' / images / category'); |
|
| 57 | + define($moduleDirNameUpper.'_CACHE_PATH', XOOPS_UPLOAD_PATH.'/'.$moduleDirName.'/'); |
|
| 58 | + define($moduleDirNameUpper.'_CONSTANTS_DEFINED', 1); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | $pathIcon16 = Xmf\Module\Admin::iconUrl('', 16); |
@@ -64,15 +64,15 @@ discard block |
||
| 64 | 64 | //$pathModIcon32 = $helper->getModule()->getInfo('modicons32'); |
| 65 | 65 | |
| 66 | 66 | $icons = [ |
| 67 | - 'edit' => "<img src='" . $pathIcon16 . "/edit.png' alt=" . _EDIT . "' align='middle'>", |
|
| 68 | - 'delete' => "<img src='" . $pathIcon16 . "/delete.png' alt='" . _DELETE . "' align='middle'>", |
|
| 69 | - 'clone' => "<img src='" . $pathIcon16 . "/editcopy.png' alt='" . _CLONE . "' align='middle'>", |
|
| 70 | - 'preview' => "<img src='" . $pathIcon16 . "/view.png' alt='" . _PREVIEW . "' align='middle'>", |
|
| 71 | - 'print' => "<img src='" . $pathIcon16 . "/printer.png' alt='" . _CLONE . "' align='middle'>", |
|
| 72 | - 'pdf' => "<img src='" . $pathIcon16 . "/pdf.png' alt='" . _CLONE . "' align='middle'>", |
|
| 73 | - 'add' => "<img src='" . $pathIcon16 . "/add.png' alt='" . _ADD . "' align='middle'>", |
|
| 74 | - '0' => "<img src='" . $pathIcon16 . "/0.png' alt='" . 0 . "' align='middle'>", |
|
| 75 | - '1' => "<img src='" . $pathIcon16 . "/1.png' alt='" . 1 . "' align='middle'>", |
|
| 67 | + 'edit' => "<img src='".$pathIcon16."/edit.png' alt="._EDIT."' align='middle'>", |
|
| 68 | + 'delete' => "<img src='".$pathIcon16."/delete.png' alt='"._DELETE."' align='middle'>", |
|
| 69 | + 'clone' => "<img src='".$pathIcon16."/editcopy.png' alt='"._CLONE."' align='middle'>", |
|
| 70 | + 'preview' => "<img src='".$pathIcon16."/view.png' alt='"._PREVIEW."' align='middle'>", |
|
| 71 | + 'print' => "<img src='".$pathIcon16."/printer.png' alt='"._CLONE."' align='middle'>", |
|
| 72 | + 'pdf' => "<img src='".$pathIcon16."/pdf.png' alt='"._CLONE."' align='middle'>", |
|
| 73 | + 'add' => "<img src='".$pathIcon16."/add.png' alt='"._ADD."' align='middle'>", |
|
| 74 | + '0' => "<img src='".$pathIcon16."/0.png' alt='".0."' align='middle'>", |
|
| 75 | + '1' => "<img src='".$pathIcon16."/1.png' alt='".1."' align='middle'>", |
|
| 76 | 76 | ]; |
| 77 | 77 | |
| 78 | 78 | $debug = false; |
@@ -85,12 +85,12 @@ discard block |
||
| 85 | 85 | $GLOBALS['xoopsTpl'] = new \XoopsTpl(); |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | -$GLOBALS['xoopsTpl']->assign('mod_url', XOOPS_URL . '/modules/' . $moduleDirName); |
|
| 88 | +$GLOBALS['xoopsTpl']->assign('mod_url', XOOPS_URL.'/modules/'.$moduleDirName); |
|
| 89 | 89 | // Local icons path |
| 90 | 90 | if (is_object($helper->getModule())) { |
| 91 | 91 | $pathModIcon16 = $helper->getModule()->getInfo('modicons16'); |
| 92 | 92 | $pathModIcon32 = $helper->getModule()->getInfo('modicons32'); |
| 93 | 93 | |
| 94 | - $GLOBALS['xoopsTpl']->assign('pathModIcon16', XOOPS_URL . '/modules/' . $moduleDirName . '/' . $pathModIcon16); |
|
| 94 | + $GLOBALS['xoopsTpl']->assign('pathModIcon16', XOOPS_URL.'/modules/'.$moduleDirName.'/'.$pathModIcon16); |
|
| 95 | 95 | $GLOBALS['xoopsTpl']->assign('pathModIcon32', $pathModIcon32); |
| 96 | 96 | } |
@@ -21,34 +21,34 @@ discard block |
||
| 21 | 21 | $moduleDirNameUpper = strtoupper($moduleDirName); |
| 22 | 22 | |
| 23 | 23 | //Configurator |
| 24 | -return (object)[ |
|
| 25 | - 'name' => strtoupper($moduleDirName) . ' Module Configurator', |
|
| 24 | +return (object) [ |
|
| 25 | + 'name' => strtoupper($moduleDirName).' Module Configurator', |
|
| 26 | 26 | 'paths' => [ |
| 27 | 27 | 'dirname' => $moduleDirName, |
| 28 | - 'admin' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/admin', |
|
| 29 | - 'modPath' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName, |
|
| 30 | - 'modUrl' => XOOPS_URL . '/modules/' . $moduleDirName, |
|
| 31 | - 'uploadPath' => XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
| 32 | - 'uploadUrl' => XOOPS_UPLOAD_URL . '/' . $moduleDirName, |
|
| 28 | + 'admin' => XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/admin', |
|
| 29 | + 'modPath' => XOOPS_ROOT_PATH.'/modules/'.$moduleDirName, |
|
| 30 | + 'modUrl' => XOOPS_URL.'/modules/'.$moduleDirName, |
|
| 31 | + 'uploadPath' => XOOPS_UPLOAD_PATH.'/'.$moduleDirName, |
|
| 32 | + 'uploadUrl' => XOOPS_UPLOAD_URL.'/'.$moduleDirName, |
|
| 33 | 33 | ], |
| 34 | 34 | 'uploadFolders' => [ |
| 35 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
| 36 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/images', |
|
| 37 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/images/thumbnails' |
|
| 35 | + XOOPS_UPLOAD_PATH.'/'.$moduleDirName, |
|
| 36 | + XOOPS_UPLOAD_PATH.'/'.$moduleDirName.'/images', |
|
| 37 | + XOOPS_UPLOAD_PATH.'/'.$moduleDirName.'/images/thumbnails' |
|
| 38 | 38 | ], |
| 39 | 39 | 'copyBlankFiles' => [ |
| 40 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/images', |
|
| 41 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/images/thumbnails' |
|
| 40 | + XOOPS_UPLOAD_PATH.'/'.$moduleDirName.'/images', |
|
| 41 | + XOOPS_UPLOAD_PATH.'/'.$moduleDirName.'/images/thumbnails' |
|
| 42 | 42 | ], |
| 43 | 43 | |
| 44 | 44 | 'copyTestFolders' => [ |
| 45 | 45 | [ |
| 46 | - XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/testdata/images', |
|
| 47 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/images', |
|
| 46 | + XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/testdata/images', |
|
| 47 | + XOOPS_UPLOAD_PATH.'/'.$moduleDirName.'/images', |
|
| 48 | 48 | ], |
| 49 | 49 | [ |
| 50 | - XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/testdata/thumbs', |
|
| 51 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/thumbs', |
|
| 50 | + XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/testdata/thumbs', |
|
| 51 | + XOOPS_UPLOAD_PATH.'/'.$moduleDirName.'/thumbs', |
|
| 52 | 52 | ] |
| 53 | 53 | ], |
| 54 | 54 | |
@@ -70,6 +70,6 @@ discard block |
||
| 70 | 70 | '/images', |
| 71 | 71 | ], |
| 72 | 72 | 'modCopyright' => "<a href='https://xoops.org' title='XOOPS Project' target='_blank'> |
| 73 | - <img src='" . XOOPS_URL . '/modules/' . $moduleDirName . '_AUTHOR_LOGOIMG' . '\' alt=\'XOOPS Project\' /></a>', |
|
| 73 | + <img src='" . XOOPS_URL.'/modules/'.$moduleDirName.'_AUTHOR_LOGOIMG'.'\' alt=\'XOOPS Project\' /></a>', |
|
| 74 | 74 | |
| 75 | 75 | ]; |
@@ -1,10 +1,10 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -include __DIR__ . '/../../mainfile.php'; |
|
| 4 | -require_once __DIR__ . '/include/constantes.php'; |
|
| 3 | +include __DIR__.'/../../mainfile.php'; |
|
| 4 | +require_once __DIR__.'/include/constantes.php'; |
|
| 5 | 5 | $params = ['view' => _EXTCAL_NAV_NEW_EVENT, 'file' => _EXTCAL_FILE_NEW_EVENT]; |
| 6 | 6 | $GLOBALS['xoopsOption']['template_main'] = "extcal_view_{$params['view']}.tpl"; |
| 7 | -require_once __DIR__ . '/header.php'; |
|
| 7 | +require_once __DIR__.'/header.php'; |
|
| 8 | 8 | |
| 9 | 9 | /* ========================================================================== */ |
| 10 | 10 | //Extcal\Utility::echoArray($_GET); |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | //exit; |
| 18 | 18 | if (count($permHandler->getAuthorizedCat($xoopsUser, 'extcal_cat_submit')) > 0) { |
| 19 | - include XOOPS_ROOT_PATH . '/header.php'; |
|
| 19 | + include XOOPS_ROOT_PATH.'/header.php'; |
|
| 20 | 20 | |
| 21 | 21 | // Title of the page |
| 22 | 22 | $xoopsTpl->assign('xoops_pagetitle', _MI_EXTCAL_SUBMIT_EVENT); |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | $xoopsTpl->assign('lang', $lang); |
| 59 | 59 | $xoopsTpl->assign('view', 'newevent'); |
| 60 | 60 | |
| 61 | - include XOOPS_ROOT_PATH . '/footer.php'; |
|
| 61 | + include XOOPS_ROOT_PATH.'/footer.php'; |
|
| 62 | 62 | } else { |
| 63 | 63 | redirect_header('index.php', 3); |
| 64 | 64 | } |
@@ -19,10 +19,10 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | use XoopsModules\Extcal; |
| 21 | 21 | |
| 22 | -require_once __DIR__ . '/../../mainfile.php'; |
|
| 23 | -require_once __DIR__ . '/include/constantes.php'; |
|
| 22 | +require_once __DIR__.'/../../mainfile.php'; |
|
| 23 | +require_once __DIR__.'/include/constantes.php'; |
|
| 24 | 24 | $GLOBALS['xoopsOption']['template_main'] = 'extcal_etablissement.tpl'; |
| 25 | -require_once __DIR__ . '/header.php'; |
|
| 25 | +require_once __DIR__.'/header.php'; |
|
| 26 | 26 | |
| 27 | 27 | //require_once XOOPS_ROOT_PATH."/modules/extcal/class/etablissement.php"; |
| 28 | 28 | $etablissementHandler = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_ETABLISSEMENT); |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $etablissement_exist = $etablissementHandler->getCount($criteria); |
| 39 | 39 | |
| 40 | 40 | if (0 == $etablissement_exist) { |
| 41 | - redirect_header(XOOPS_URL . '/modules/extcal/index.php', 3, _NOPERM); |
|
| 41 | + redirect_header(XOOPS_URL.'/modules/extcal/index.php', 3, _NOPERM); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | $view_etablissement = $etablissementHandler->getEtablissement($etablissement_id, true); |
@@ -80,12 +80,12 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | $date = mktime(0, 0, 0, date('m'), date('d'), date('y')); |
| 82 | 82 | |
| 83 | -$requete = $xoopsDB->query('SELECT event_id, event_title, event_desc, event_picture1, event_start FROM ' . $xoopsDB->prefix('extcal_event') . " WHERE event_etablissement='" . $etablissement_id . "' AND event_start >='" . $date . "'"); |
|
| 83 | +$requete = $xoopsDB->query('SELECT event_id, event_title, event_desc, event_picture1, event_start FROM '.$xoopsDB->prefix('extcal_event')." WHERE event_etablissement='".$etablissement_id."' AND event_start >='".$date."'"); |
|
| 84 | 84 | while ($donnees = $xoopsDB->fetchArray($requete)) { |
| 85 | 85 | if ($donnees['event_desc'] > 210) { |
| 86 | 86 | $event_desc = $donnees['event_desc']; |
| 87 | 87 | } else { |
| 88 | - $event_desc = substr($donnees['event_desc'], 0, 210) . '...'; |
|
| 88 | + $event_desc = substr($donnees['event_desc'], 0, 210).'...'; |
|
| 89 | 89 | } |
| 90 | 90 | $xoopsTpl->append('events', [ |
| 91 | 91 | 'event_picture1' => $donnees['event_picture1'], |
@@ -98,4 +98,4 @@ discard block |
||
| 98 | 98 | /** @var xos_opal_Theme $xoTheme */ |
| 99 | 99 | $xoTheme->addScript('browse.php?modules/extcal/assets/js/highslide.js'); |
| 100 | 100 | $xoTheme->addStylesheet('browse.php?modules/extcal/assets/js/highslide.css'); |
| 101 | -require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
| 101 | +require_once XOOPS_ROOT_PATH.'/footer.php'; |
|
@@ -72,177 +72,195 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | switch ($op) { |
| 74 | 74 | |
| 75 | - case 'enreg': |
|
| 76 | - |
|
| 77 | - $eventHandler = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_EVENT); |
|
| 78 | - $fileHandler = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_FILE); |
|
| 79 | - // $t = print_r($_POST,true); |
|
| 80 | - // echo "<pre>{$t}</pre><br>"; |
|
| 81 | - // exit; |
|
| 82 | - // If the date format is wrong |
|
| 83 | - // if ( |
|
| 84 | - // !preg_match(_EXTCAL_MOTIF_DATE, $_POST['event_start']['date']) |
|
| 85 | - // || !preg_match(_EXTCAL_MOTIF_DATE, $_POST['event_end']['date']) |
|
| 86 | - // ) { |
|
| 87 | - // redirect_header( |
|
| 88 | - // 'event.php', 3, _MD_EXTCAL_WRONG_DATE_FORMAT . "<br>" |
|
| 89 | - // . implode('<br>', $GLOBALS['xoopsSecurity']->getErrors()) |
|
| 90 | - // ); |
|
| 91 | - // exit; |
|
| 92 | - // } |
|
| 93 | - |
|
| 94 | - //exit; |
|
| 95 | - /////////////////////////////////////////////////////////////////////////////// |
|
| 96 | - Extcal\Utility::loadImg($_REQUEST, $event_picture1, $event_picture2); |
|
| 97 | - /////////////////////////////////////////////////////////////////////////////// |
|
| 98 | - $data = [ |
|
| 99 | - 'event_title' => $_POST['event_title'], |
|
| 100 | - 'cat_id' => $_POST['cat_id'], |
|
| 101 | - 'event_desc' => $_POST['event_desc'], |
|
| 102 | - 'event_nbmember' => $_POST['event_nbmember'], |
|
| 103 | - 'event_organisateur' => $_POST['event_organisateur'], |
|
| 104 | - 'event_contact' => $_POST['event_contact'], |
|
| 105 | - 'event_url' => $_POST['event_url'], |
|
| 106 | - 'event_email' => $_POST['event_email'], |
|
| 107 | - 'event_address' => $_POST['event_address'], |
|
| 108 | - 'event_approved' => 1, |
|
| 109 | - 'event_start' => $_POST['event_start'], |
|
| 110 | - 'have_end' => $_POST['have_end'], |
|
| 111 | - 'event_end' => $_POST['event_end'], |
|
| 112 | - 'event_picture1' => @$event_picture1, |
|
| 113 | - 'event_picture2' => @$event_picture2, |
|
| 114 | - 'event_price' => @$_POST['event_price'], |
|
| 115 | - 'event_etablissement' => $_POST['event_etablissement'], |
|
| 116 | - 'dohtml' => $extcalConfig['allow_html'], |
|
| 117 | - 'event_icone' => $_POST['event_icone'], |
|
| 118 | - ]; |
|
| 119 | - |
|
| 120 | - // Event edited |
|
| 121 | - if (isset($_POST['event_id'])) { |
|
| 122 | - if (!$eventHandler->modifyEvent($_POST['event_id'], $data)) { |
|
| 123 | - redirect_header('event.php', 3, _AM_EXTCAL_EVENT_EDIT_FAILED, false); |
|
| 75 | + case 'enreg': |
|
| 76 | + |
|
| 77 | + $eventHandler = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_EVENT); |
|
| 78 | + $fileHandler = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_FILE); |
|
| 79 | + // $t = print_r($_POST,true); |
|
| 80 | + // echo "<pre>{$t}</pre><br>"; |
|
| 81 | + // exit; |
|
| 82 | + // If the date format is wrong |
|
| 83 | + // if ( |
|
| 84 | + // !preg_match(_EXTCAL_MOTIF_DATE, $_POST['event_start']['date']) |
|
| 85 | + // || !preg_match(_EXTCAL_MOTIF_DATE, $_POST['event_end']['date']) |
|
| 86 | + // ) { |
|
| 87 | + // redirect_header( |
|
| 88 | + // 'event.php', 3, _MD_EXTCAL_WRONG_DATE_FORMAT . "<br>" |
|
| 89 | + // . implode('<br>', $GLOBALS['xoopsSecurity']->getErrors()) |
|
| 90 | + // ); |
|
| 91 | + // exit; |
|
| 92 | + // } |
|
| 93 | + |
|
| 94 | + //exit; |
|
| 95 | + /////////////////////////////////////////////////////////////////////////////// |
|
| 96 | + Extcal\Utility::loadImg($_REQUEST, $event_picture1, $event_picture2); |
|
| 97 | + /////////////////////////////////////////////////////////////////////////////// |
|
| 98 | + $data = [ |
|
| 99 | + 'event_title' => $_POST['event_title'], |
|
| 100 | + 'cat_id' => $_POST['cat_id'], |
|
| 101 | + 'event_desc' => $_POST['event_desc'], |
|
| 102 | + 'event_nbmember' => $_POST['event_nbmember'], |
|
| 103 | + 'event_organisateur' => $_POST['event_organisateur'], |
|
| 104 | + 'event_contact' => $_POST['event_contact'], |
|
| 105 | + 'event_url' => $_POST['event_url'], |
|
| 106 | + 'event_email' => $_POST['event_email'], |
|
| 107 | + 'event_address' => $_POST['event_address'], |
|
| 108 | + 'event_approved' => 1, |
|
| 109 | + 'event_start' => $_POST['event_start'], |
|
| 110 | + 'have_end' => $_POST['have_end'], |
|
| 111 | + 'event_end' => $_POST['event_end'], |
|
| 112 | + 'event_picture1' => @$event_picture1, |
|
| 113 | + 'event_picture2' => @$event_picture2, |
|
| 114 | + 'event_price' => @$_POST['event_price'], |
|
| 115 | + 'event_etablissement' => $_POST['event_etablissement'], |
|
| 116 | + 'dohtml' => $extcalConfig['allow_html'], |
|
| 117 | + 'event_icone' => $_POST['event_icone'], |
|
| 118 | + ]; |
|
| 119 | + |
|
| 120 | + // Event edited |
|
| 121 | + if (isset($_POST['event_id'])) { |
|
| 122 | + if (!$eventHandler->modifyEvent($_POST['event_id'], $data)) { |
|
| 123 | + redirect_header('event.php', 3, _AM_EXTCAL_EVENT_EDIT_FAILED, false); |
|
| 124 | + } else { |
|
| 125 | + $fileHandler->createFile((int)$_POST['event_id']); |
|
| 126 | + redirect_header('event.php', 3, _AM_EXTCAL_EVENT_EDITED, false); |
|
| 127 | + } |
|
| 128 | + |
|
| 129 | + // New event |
|
| 124 | 130 | } else { |
| 125 | - $fileHandler->createFile((int)$_POST['event_id']); |
|
| 126 | - redirect_header('event.php', 3, _AM_EXTCAL_EVENT_EDITED, false); |
|
| 131 | + $notificationHandler = xoops_getHandler('notification'); |
|
| 132 | + /** @var Extcal\CategoryHandler $catHandler */ |
|
| 133 | + // $catHandler = xoops_getModuleHandler(_EXTCAL_CLS_CAT, _EXTCAL_MODULE); |
|
| 134 | + $catHandler = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_CAT); |
|
| 135 | + |
|
| 136 | + $data['event_submitter'] = $xoopsUser ? $xoopsUser->getVar('uid') : 0; |
|
| 137 | + $data['event_submitdate'] = time(); |
|
| 138 | + |
|
| 139 | + if ($eventHandler->createEvent($data, $_POST)) { |
|
| 140 | + $fileHandler->createFile($eventHandler->getInsertId()); |
|
| 141 | + $cat = $catHandler->getCat($_POST['cat_id'], $xoopsUser, 'all'); |
|
| 142 | + $notificationHandler->triggerEvent('global', 0, 'new_event', ['EVENT_TITLE' => $_POST['event_title']]); |
|
| 143 | + $notificationHandler->triggerEvent('category', $_POST['cat_id'], 'new_event_cat', [ |
|
| 144 | + 'EVENT_TITLE' => $_POST['event_title'], |
|
| 145 | + 'CAT_NAME' => $cat->getVar('cat_name'), |
|
| 146 | + ]); |
|
| 147 | + redirect_header('event.php', 3, _AM_EXTCAL_EVENT_CREATED, false); |
|
| 148 | + } else { |
|
| 149 | + redirect_header('event.php', 3, _AM_EXTCAL_EVENT_CREATE_FAILED, false); |
|
| 150 | + } |
|
| 127 | 151 | } |
| 152 | + break; |
|
| 128 | 153 | |
| 129 | - // New event |
|
| 130 | - } else { |
|
| 131 | - $notificationHandler = xoops_getHandler('notification'); |
|
| 132 | - /** @var Extcal\CategoryHandler $catHandler */ |
|
| 133 | - // $catHandler = xoops_getModuleHandler(_EXTCAL_CLS_CAT, _EXTCAL_MODULE); |
|
| 134 | - $catHandler = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_CAT); |
|
| 135 | - |
|
| 136 | - $data['event_submitter'] = $xoopsUser ? $xoopsUser->getVar('uid') : 0; |
|
| 137 | - $data['event_submitdate'] = time(); |
|
| 138 | - |
|
| 139 | - if ($eventHandler->createEvent($data, $_POST)) { |
|
| 140 | - $fileHandler->createFile($eventHandler->getInsertId()); |
|
| 141 | - $cat = $catHandler->getCat($_POST['cat_id'], $xoopsUser, 'all'); |
|
| 142 | - $notificationHandler->triggerEvent('global', 0, 'new_event', ['EVENT_TITLE' => $_POST['event_title']]); |
|
| 143 | - $notificationHandler->triggerEvent('category', $_POST['cat_id'], 'new_event_cat', [ |
|
| 144 | - 'EVENT_TITLE' => $_POST['event_title'], |
|
| 145 | - 'CAT_NAME' => $cat->getVar('cat_name'), |
|
| 146 | - ]); |
|
| 147 | - redirect_header('event.php', 3, _AM_EXTCAL_EVENT_CREATED, false); |
|
| 148 | - } else { |
|
| 149 | - redirect_header('event.php', 3, _AM_EXTCAL_EVENT_CREATE_FAILED, false); |
|
| 154 | + case 'clone': /* sur validation du formulaire */ |
|
| 155 | + case 'modify': |
|
| 156 | + $action = (('clone' === $op) ? 'clone' : 'edit'); |
|
| 157 | + xoops_cp_header(); |
|
| 158 | + //================================================ |
|
| 159 | + // require_once (XOOPS_ROOT_PATH . '/class/xoopsform/tc_calendar/formtccalendar.php'); |
|
| 160 | + // |
|
| 161 | + // // Call the calendar constructor - use the desired form and format, according to the instructions/samples provided on triconsole.com |
|
| 162 | + // $dateBirthday = new \XoopsTcCalendar("datez1", true, false); |
|
| 163 | + // //$dateBirthday->setIcon("/images/iconCalendar.gif"); |
|
| 164 | + // $dateBirthday->setIcon("/class/xoopsform/tc_calendar/images/iconCalendar.gif"); |
|
| 165 | + // //$dateBirthday->rtl=false; |
|
| 166 | + // $dateBirthday->setAutoHide(false); |
|
| 167 | + // |
|
| 168 | + // //$myCalendar->setDate(date('d'), date('m'), date('Y')); |
|
| 169 | + // //$dateBirthday->setDate($p['date1_day'], $p['date1_month'], $p['date1_year']); |
|
| 170 | + // $dateBirthday->setDate(date('d'), date('m'), date('Y')); |
|
| 171 | + // |
|
| 172 | + // $dateBirthday->setPath(XOOPS_URL . "/class/xoopsform/tc_calendar/"); |
|
| 173 | + // $dateBirthday->zindex = 150; //default 1 |
|
| 174 | + // $dateBirthday->setYearInterval(1995, date('Y')); |
|
| 175 | + // $dateBirthday->dateAllow('1960-03-01', date('Y-m-d')); |
|
| 176 | + // //$dateBirthday->autoSubmit(true, "calendar"); |
|
| 177 | + // $dateBirthday->disabledDay("sat"); |
|
| 178 | + // $dateBirthday->disabledDay("sun"); |
|
| 179 | + // $dateBirthday->setSpecificDate(array("2011-04-14", "2010-12-25"), 0, 'month'); |
|
| 180 | + // $dateBirthday->setSpecificDate(array("2011-04-01"), 0, 'year'); |
|
| 181 | + // $dateBirthday->setAlignment('right', 'bottom'); //optional |
|
| 182 | + // echo "<table><tr><td>zzzzz</td><td></td><td>"; |
|
| 183 | + // echo $dateBirthday->render(); |
|
| 184 | + // echo "</td></tr></table>"; |
|
| 185 | + //echo $dateBirthday->render(); |
|
| 186 | + //================================================ |
|
| 187 | + // @author Gregory Mage (Aka Mage) |
|
| 188 | + //*************************************************************************************** |
|
| 189 | + // require_once XOOPS_ROOT_PATH . "/modules/extcal/class/admin.php"; |
|
| 190 | + $adminObject = \Xmf\Module\Admin::getInstance(); |
|
| 191 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
| 192 | + //*************************************************************************************** |
|
| 193 | + |
|
| 194 | + $eventId = $_GET['event_id']; |
|
| 195 | + $eventHandler = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_EVENT); |
|
| 196 | + |
|
| 197 | + echo '<fieldset><legend style="font-weight:bold; color:#990000;">' . _MD_EXTCAL_EDIT_EVENT . '</legend>'; |
|
| 198 | + |
|
| 199 | + if ($form = $eventHandler->getEventForm('admin', $action, ['event_id' => $eventId])) { |
|
| 200 | + $form->display(); |
|
| 150 | 201 | } |
| 151 | - } |
|
| 152 | - break; |
|
| 153 | - |
|
| 154 | - case 'clone': /* sur validation du formulaire */ |
|
| 155 | - case 'modify': |
|
| 156 | - $action = (('clone' === $op) ? 'clone' : 'edit'); |
|
| 157 | - xoops_cp_header(); |
|
| 158 | - //================================================ |
|
| 159 | - // require_once (XOOPS_ROOT_PATH . '/class/xoopsform/tc_calendar/formtccalendar.php'); |
|
| 160 | - // |
|
| 161 | - // // Call the calendar constructor - use the desired form and format, according to the instructions/samples provided on triconsole.com |
|
| 162 | - // $dateBirthday = new \XoopsTcCalendar("datez1", true, false); |
|
| 163 | - // //$dateBirthday->setIcon("/images/iconCalendar.gif"); |
|
| 164 | - // $dateBirthday->setIcon("/class/xoopsform/tc_calendar/images/iconCalendar.gif"); |
|
| 165 | - // //$dateBirthday->rtl=false; |
|
| 166 | - // $dateBirthday->setAutoHide(false); |
|
| 167 | - // |
|
| 168 | - // //$myCalendar->setDate(date('d'), date('m'), date('Y')); |
|
| 169 | - // //$dateBirthday->setDate($p['date1_day'], $p['date1_month'], $p['date1_year']); |
|
| 170 | - // $dateBirthday->setDate(date('d'), date('m'), date('Y')); |
|
| 171 | - // |
|
| 172 | - // $dateBirthday->setPath(XOOPS_URL . "/class/xoopsform/tc_calendar/"); |
|
| 173 | - // $dateBirthday->zindex = 150; //default 1 |
|
| 174 | - // $dateBirthday->setYearInterval(1995, date('Y')); |
|
| 175 | - // $dateBirthday->dateAllow('1960-03-01', date('Y-m-d')); |
|
| 176 | - // //$dateBirthday->autoSubmit(true, "calendar"); |
|
| 177 | - // $dateBirthday->disabledDay("sat"); |
|
| 178 | - // $dateBirthday->disabledDay("sun"); |
|
| 179 | - // $dateBirthday->setSpecificDate(array("2011-04-14", "2010-12-25"), 0, 'month'); |
|
| 180 | - // $dateBirthday->setSpecificDate(array("2011-04-01"), 0, 'year'); |
|
| 181 | - // $dateBirthday->setAlignment('right', 'bottom'); //optional |
|
| 182 | - // echo "<table><tr><td>zzzzz</td><td></td><td>"; |
|
| 183 | - // echo $dateBirthday->render(); |
|
| 184 | - // echo "</td></tr></table>"; |
|
| 185 | - //echo $dateBirthday->render(); |
|
| 186 | - //================================================ |
|
| 187 | - // @author Gregory Mage (Aka Mage) |
|
| 188 | - //*************************************************************************************** |
|
| 189 | - // require_once XOOPS_ROOT_PATH . "/modules/extcal/class/admin.php"; |
|
| 190 | - $adminObject = \Xmf\Module\Admin::getInstance(); |
|
| 191 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
| 192 | - //*************************************************************************************** |
|
| 193 | - |
|
| 194 | - $eventId = $_GET['event_id']; |
|
| 195 | - $eventHandler = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_EVENT); |
|
| 196 | - |
|
| 197 | - echo '<fieldset><legend style="font-weight:bold; color:#990000;">' . _MD_EXTCAL_EDIT_EVENT . '</legend>'; |
|
| 198 | - |
|
| 199 | - if ($form = $eventHandler->getEventForm('admin', $action, ['event_id' => $eventId])) { |
|
| 200 | - $form->display(); |
|
| 201 | - } |
|
| 202 | 202 | |
| 203 | - echo '</fieldset><br>'; |
|
| 203 | + echo '</fieldset><br>'; |
|
| 204 | 204 | |
| 205 | - xoops_cp_footer(); |
|
| 205 | + xoops_cp_footer(); |
|
| 206 | 206 | |
| 207 | - break; |
|
| 207 | + break; |
|
| 208 | 208 | |
| 209 | - case 'clone2': /* sur clique de l'icone du formulaire*/ |
|
| 209 | + case 'clone2': /* sur clique de l'icone du formulaire*/ |
|
| 210 | 210 | |
| 211 | - //$newEventId = 1; |
|
| 212 | - $eventId = $_GET['event_id']; |
|
| 213 | - $eventHandler = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_EVENT); |
|
| 214 | - $event = $eventHandler->getEvent($eventId); |
|
| 215 | - $t = $event->getVars(); |
|
| 216 | - $data = []; |
|
| 217 | - // while (list($key, $val) = each($t)) { |
|
| 218 | - foreach ($t as $key => $val) { |
|
| 219 | - $data[$key] = $val['value']; |
|
| 220 | - } |
|
| 211 | + //$newEventId = 1; |
|
| 212 | + $eventId = $_GET['event_id']; |
|
| 213 | + $eventHandler = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_EVENT); |
|
| 214 | + $event = $eventHandler->getEvent($eventId); |
|
| 215 | + $t = $event->getVars(); |
|
| 216 | + $data = []; |
|
| 217 | + // while (list($key, $val) = each($t)) { |
|
| 218 | + foreach ($t as $key => $val) { |
|
| 219 | + $data[$key] = $val['value']; |
|
| 220 | + } |
|
| 221 | 221 | |
| 222 | - $data['event_id'] = 0; |
|
| 223 | - $data['event_title'] .= ' (' . _AM_EXTCAL_CLONE_OF . $eventId . ')'; |
|
| 222 | + $data['event_id'] = 0; |
|
| 223 | + $data['event_title'] .= ' (' . _AM_EXTCAL_CLONE_OF . $eventId . ')'; |
|
| 224 | 224 | |
| 225 | - $newEvent = $eventHandler->create(); |
|
| 226 | - $newEvent->setVars($data); |
|
| 227 | - $t = $eventHandler->insert($newEvent, true); |
|
| 225 | + $newEvent = $eventHandler->create(); |
|
| 226 | + $newEvent->setVars($data); |
|
| 227 | + $t = $eventHandler->insert($newEvent, true); |
|
| 228 | 228 | |
| 229 | - $newEventId = $newEvent->getVar('event_id'); |
|
| 230 | - $ts = print_r($newEventId, true); |
|
| 229 | + $newEventId = $newEvent->getVar('event_id'); |
|
| 230 | + $ts = print_r($newEventId, true); |
|
| 231 | 231 | |
| 232 | - redirect_header("event.php?op=modify&event_id={$newEventId}", 3, _AM_EXTCAL_EVENT_DELETED, false); |
|
| 233 | - break; |
|
| 232 | + redirect_header("event.php?op=modify&event_id={$newEventId}", 3, _AM_EXTCAL_EVENT_DELETED, false); |
|
| 233 | + break; |
|
| 234 | 234 | |
| 235 | - case 'delete': |
|
| 235 | + case 'delete': |
|
| 236 | 236 | |
| 237 | - if (isset($_POST['confirm'])) { |
|
| 238 | - if (!$GLOBALS['xoopsSecurity']->check()) { |
|
| 239 | - redirect_header('index.php', 3, _NOPERM . '<br>' . implode('<br>', $GLOBALS['xoopsSecurity']->getErrors())); |
|
| 237 | + if (isset($_POST['confirm'])) { |
|
| 238 | + if (!$GLOBALS['xoopsSecurity']->check()) { |
|
| 239 | + redirect_header('index.php', 3, _NOPERM . '<br>' . implode('<br>', $GLOBALS['xoopsSecurity']->getErrors())); |
|
| 240 | + } |
|
| 241 | + // $eventHandler = xoops_getModuleHandler(_EXTCAL_CLS_EVENT, _EXTCAL_MODULE); |
|
| 242 | + // $eventHandler->deleteEvent($_POST['event_id']); |
|
| 243 | + deleteEvents($_POST['event_id']); |
|
| 244 | + redirect_header('event.php', 3, _AM_EXTCAL_EVENT_DELETED, false); |
|
| 245 | + } else { |
|
| 246 | + xoops_cp_header(); |
|
| 247 | + // @author Gregory Mage (Aka Mage) |
|
| 248 | + //*************************************************************************************** |
|
| 249 | + //require_once XOOPS_ROOT_PATH . "/modules/extcal/class/admin.php"; |
|
| 250 | + $adminObject = \Xmf\Module\Admin::getInstance(); |
|
| 251 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
| 252 | + //*************************************************************************************** |
|
| 253 | + |
|
| 254 | + $hiddens = ['event_id' => $_GET['event_id'], 'form_delete' => '', 'confirm' => 1]; |
|
| 255 | + xoops_confirm($hiddens, 'event.php?op=delete', _AM_EXTCAL_CONFIRM_DELETE_EVENT, _DELETE, 'event.php'); |
|
| 256 | + |
|
| 257 | + xoops_cp_footer(); |
|
| 240 | 258 | } |
| 241 | - // $eventHandler = xoops_getModuleHandler(_EXTCAL_CLS_EVENT, _EXTCAL_MODULE); |
|
| 242 | - // $eventHandler->deleteEvent($_POST['event_id']); |
|
| 243 | - deleteEvents($_POST['event_id']); |
|
| 244 | - redirect_header('event.php', 3, _AM_EXTCAL_EVENT_DELETED, false); |
|
| 245 | - } else { |
|
| 259 | + |
|
| 260 | + break; |
|
| 261 | + |
|
| 262 | + case 'deleteSelection': |
|
| 263 | + |
|
| 246 | 264 | xoops_cp_header(); |
| 247 | 265 | // @author Gregory Mage (Aka Mage) |
| 248 | 266 | //*************************************************************************************** |
@@ -250,185 +268,167 @@ discard block |
||
| 250 | 268 | $adminObject = \Xmf\Module\Admin::getInstance(); |
| 251 | 269 | $adminObject->displayNavigation(basename(__FILE__)); |
| 252 | 270 | //*************************************************************************************** |
| 271 | + if (isset($_POST['deleteSelection'][0])) { |
|
| 272 | + $msg = _AM_EXTCAL_CONFIRM_DELETE_ALL; |
|
| 273 | + $ids = array_keys($_POST['deleteAllEvents']); |
|
| 274 | + } else { |
|
| 275 | + $msg = _AM_EXTCAL_CONFIRM_DELETE_SELECTION; |
|
| 276 | + $ids = array_keys($_POST['deleteEvents']); |
|
| 277 | + } |
|
| 253 | 278 | |
| 254 | - $hiddens = ['event_id' => $_GET['event_id'], 'form_delete' => '', 'confirm' => 1]; |
|
| 255 | - xoops_confirm($hiddens, 'event.php?op=delete', _AM_EXTCAL_CONFIRM_DELETE_EVENT, _DELETE, 'event.php'); |
|
| 279 | + // $msg = ((isset($_POST['deleteSelection'][0])) ? _AM_EXTCAL_CONFIRM_DELETE_ALL : _AM_EXTCAL_CONFIRM_DELETE_SELECTION); |
|
| 280 | + // $ids = array_keys($_POST['deleteEvents']); |
|
| 281 | + $ids = implode(',', $ids); |
|
| 282 | + //echo $ids.'<br>'; |
|
| 283 | + $hiddens = ['event_ids' => $ids, 'form_delete' => '', 'confirm' => 1]; |
|
| 284 | + //$hiddens = array('event_ids' => $_POST['deleteEvents'], 'form_delete' => '', 'confirm' => 1); |
|
| 285 | + xoops_confirm($hiddens, 'event.php?op=deleteSelectionOK', $msg, _DELETE, 'event.php'); |
|
| 256 | 286 | |
| 257 | 287 | xoops_cp_footer(); |
| 258 | - } |
|
| 259 | 288 | |
| 260 | - break; |
|
| 261 | - |
|
| 262 | - case 'deleteSelection': |
|
| 263 | - |
|
| 264 | - xoops_cp_header(); |
|
| 265 | - // @author Gregory Mage (Aka Mage) |
|
| 266 | - //*************************************************************************************** |
|
| 267 | - //require_once XOOPS_ROOT_PATH . "/modules/extcal/class/admin.php"; |
|
| 268 | - $adminObject = \Xmf\Module\Admin::getInstance(); |
|
| 269 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
| 270 | - //*************************************************************************************** |
|
| 271 | - if (isset($_POST['deleteSelection'][0])) { |
|
| 272 | - $msg = _AM_EXTCAL_CONFIRM_DELETE_ALL; |
|
| 273 | - $ids = array_keys($_POST['deleteAllEvents']); |
|
| 274 | - } else { |
|
| 275 | - $msg = _AM_EXTCAL_CONFIRM_DELETE_SELECTION; |
|
| 276 | - $ids = array_keys($_POST['deleteEvents']); |
|
| 277 | - } |
|
| 289 | + break; |
|
| 278 | 290 | |
| 279 | - // $msg = ((isset($_POST['deleteSelection'][0])) ? _AM_EXTCAL_CONFIRM_DELETE_ALL : _AM_EXTCAL_CONFIRM_DELETE_SELECTION); |
|
| 280 | - // $ids = array_keys($_POST['deleteEvents']); |
|
| 281 | - $ids = implode(',', $ids); |
|
| 282 | - //echo $ids.'<br>'; |
|
| 283 | - $hiddens = ['event_ids' => $ids, 'form_delete' => '', 'confirm' => 1]; |
|
| 284 | - //$hiddens = array('event_ids' => $_POST['deleteEvents'], 'form_delete' => '', 'confirm' => 1); |
|
| 285 | - xoops_confirm($hiddens, 'event.php?op=deleteSelectionOK', $msg, _DELETE, 'event.php'); |
|
| 286 | - |
|
| 287 | - xoops_cp_footer(); |
|
| 288 | - |
|
| 289 | - break; |
|
| 290 | - |
|
| 291 | - case 'deleteSelectionOK': |
|
| 292 | - //----------------------------------------- |
|
| 293 | - // $t = print_r($_GET,true); |
|
| 294 | - // echo "<hr><pre>{$t}</pre><hr>"; |
|
| 295 | - // |
|
| 296 | - // $t = print_r($_POST,true); |
|
| 297 | - // echo "<hr><pre>{$t}</pre><hr>"; |
|
| 298 | - // exit; |
|
| 299 | - //----------------------------------------- |
|
| 300 | - |
|
| 301 | - if (isset($_POST['deleteSelection'][0])) { |
|
| 302 | - } else { |
|
| 303 | - if (!$GLOBALS['xoopsSecurity']->check()) { |
|
| 304 | - redirect_header('index.php', 3, _NOPERM . '<br>' . implode('<br>', $GLOBALS['xoopsSecurity']->getErrors())); |
|
| 305 | - } |
|
| 291 | + case 'deleteSelectionOK': |
|
| 292 | + //----------------------------------------- |
|
| 293 | + // $t = print_r($_GET,true); |
|
| 294 | + // echo "<hr><pre>{$t}</pre><hr>"; |
|
| 295 | + // |
|
| 296 | + // $t = print_r($_POST,true); |
|
| 297 | + // echo "<hr><pre>{$t}</pre><hr>"; |
|
| 298 | + // exit; |
|
| 299 | + //----------------------------------------- |
|
| 306 | 300 | |
| 307 | - deleteEvents($_POST['event_ids']); |
|
| 301 | + if (isset($_POST['deleteSelection'][0])) { |
|
| 302 | + } else { |
|
| 303 | + if (!$GLOBALS['xoopsSecurity']->check()) { |
|
| 304 | + redirect_header('index.php', 3, _NOPERM . '<br>' . implode('<br>', $GLOBALS['xoopsSecurity']->getErrors())); |
|
| 305 | + } |
|
| 308 | 306 | |
| 309 | - redirect_header('event.php', 3, _AM_EXTCAL_EVENTS_DELETED, false); |
|
| 310 | - } |
|
| 307 | + deleteEvents($_POST['event_ids']); |
|
| 311 | 308 | |
| 312 | - break; |
|
| 309 | + redirect_header('event.php', 3, _AM_EXTCAL_EVENTS_DELETED, false); |
|
| 310 | + } |
|
| 313 | 311 | |
| 314 | - case 'default': |
|
| 315 | - default: |
|
| 312 | + break; |
|
| 316 | 313 | |
| 317 | - //global $extcalConfig; |
|
| 318 | - $extcalConfig = Extcal\Config::getHandler(); |
|
| 319 | - $xoopsModuleConfig = $extcalConfig->getModuleConfig(); |
|
| 314 | + case 'default': |
|
| 315 | + default: |
|
| 320 | 316 | |
| 321 | - $start = isset($_GET['start']) ? $_GET['start'] : 0; |
|
| 322 | - $nbEventsByPage = $xoopsModuleConfig['nbEventsByPage']; |
|
| 317 | + //global $extcalConfig; |
|
| 318 | + $extcalConfig = Extcal\Config::getHandler(); |
|
| 319 | + $xoopsModuleConfig = $extcalConfig->getModuleConfig(); |
|
| 323 | 320 | |
| 324 | - xoops_cp_header(); |
|
| 325 | - // @author Gregory Mage (Aka Mage) |
|
| 326 | - //*************************************************************************************** |
|
| 321 | + $start = isset($_GET['start']) ? $_GET['start'] : 0; |
|
| 322 | + $nbEventsByPage = $xoopsModuleConfig['nbEventsByPage']; |
|
| 327 | 323 | |
| 328 | - $adminObject = \Xmf\Module\Admin::getInstance(); |
|
| 329 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
| 330 | - //*************************************************************************************** |
|
| 324 | + xoops_cp_header(); |
|
| 325 | + // @author Gregory Mage (Aka Mage) |
|
| 326 | + //*************************************************************************************** |
|
| 331 | 327 | |
| 332 | - $eventHandler = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_EVENT); |
|
| 333 | - $events = $eventHandler->objectToArray($eventHandler->getNewEvent($start, $nbEventsByPage, 0, true), ['cat_id']); |
|
| 334 | - $eventHandler->formatEventsDate($events, _SHORTDATESTRING); |
|
| 328 | + $adminObject = \Xmf\Module\Admin::getInstance(); |
|
| 329 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
| 330 | + //*************************************************************************************** |
|
| 335 | 331 | |
| 336 | - echo '<fieldset><legend style="font-weight:bold; color:#990000;">' . _AM_EXTCAL_APPROVED_EVENT . '</legend>'; |
|
| 337 | - echo '<fieldset><legend style="font-weight:bold; color:#0A3760;">' . _AM_EXTCAL_INFORMATION . '</legend>'; |
|
| 338 | - //echo'<img src='. XOOPS_URL .'/'. $moduleInfo->getInfo('dirmoduleadmin').'/assets/images/action/edit.png' .' '.'style=vertical-align:middle;> ' . _AM_EXTCAL_INFO_EDIT . '<br>'; |
|
| 339 | - //echo'<img src='. XOOPS_URL .'/'. $moduleInfo->getInfo('dirmoduleadmin').'/assets/images/action/delete.png'. ' '."style=vertical-align:middle;> ". _AM_EXTCAL_INFO_DELETE; |
|
| 332 | + $eventHandler = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_EVENT); |
|
| 333 | + $events = $eventHandler->objectToArray($eventHandler->getNewEvent($start, $nbEventsByPage, 0, true), ['cat_id']); |
|
| 334 | + $eventHandler->formatEventsDate($events, _SHORTDATESTRING); |
|
| 340 | 335 | |
| 341 | - echo '<img src=' . $pathIcon16 . '/edit.png' . ' ' . 'style=vertical-align:middle;> ' . _AM_EXTCAL_INFO_EDIT . '<br>'; |
|
| 342 | - echo '<img src=' . $pathIcon16 . '/delete.png' . ' ' . 'style=vertical-align:middle;> ' . _AM_EXTCAL_INFO_DELETE . '<br>'; |
|
| 336 | + echo '<fieldset><legend style="font-weight:bold; color:#990000;">' . _AM_EXTCAL_APPROVED_EVENT . '</legend>'; |
|
| 337 | + echo '<fieldset><legend style="font-weight:bold; color:#0A3760;">' . _AM_EXTCAL_INFORMATION . '</legend>'; |
|
| 338 | + //echo'<img src='. XOOPS_URL .'/'. $moduleInfo->getInfo('dirmoduleadmin').'/assets/images/action/edit.png' .' '.'style=vertical-align:middle;> ' . _AM_EXTCAL_INFO_EDIT . '<br>'; |
|
| 339 | + //echo'<img src='. XOOPS_URL .'/'. $moduleInfo->getInfo('dirmoduleadmin').'/assets/images/action/delete.png'. ' '."style=vertical-align:middle;> ". _AM_EXTCAL_INFO_DELETE; |
|
| 343 | 340 | |
| 344 | - echo '</fieldset><br>'; |
|
| 341 | + echo '<img src=' . $pathIcon16 . '/edit.png' . ' ' . 'style=vertical-align:middle;> ' . _AM_EXTCAL_INFO_EDIT . '<br>'; |
|
| 342 | + echo '<img src=' . $pathIcon16 . '/delete.png' . ' ' . 'style=vertical-align:middle;> ' . _AM_EXTCAL_INFO_DELETE . '<br>'; |
|
| 345 | 343 | |
| 346 | - echo '<fieldset><legend style="font-weight:bold; color:#0A3760;">' . _MD_EXTCAL_SUBMITED_EVENT . '</legend>'; |
|
| 344 | + echo '</fieldset><br>'; |
|
| 347 | 345 | |
| 348 | - echo '<form method="POST" action="event.php">'; |
|
| 349 | - echo '<input type="hidden" name="op" value="deleteSelection">'; |
|
| 346 | + echo '<fieldset><legend style="font-weight:bold; color:#0A3760;">' . _MD_EXTCAL_SUBMITED_EVENT . '</legend>'; |
|
| 350 | 347 | |
| 351 | - echo '<table class="outer" style="width:100%;">'; |
|
| 352 | - echo '<tr style="text-align:center;">'; |
|
| 353 | - echo '<th>' . _AM_EXTCAL_DELETE . '</th>'; |
|
| 354 | - echo '<th>#</th>'; |
|
| 355 | - echo '<th>' . _AM_EXTCAL_CATEGORY . '</th>'; |
|
| 356 | - echo '<th>' . _AM_EXTCAL_TITLE . '</th>'; |
|
| 357 | - echo '<th>' . _AM_EXTCAL_START_DATE . '</th>'; |
|
| 358 | - echo '<th>' . _AM_EXTCAL_END_DATE . '</th>'; |
|
| 359 | - echo '<th>' . _AM_EXTCAL_RECURRENT . '</th>'; |
|
| 360 | - echo '<th>' . _AM_EXTCAL_START_RULES . '</th>'; |
|
| 361 | - echo '<th>' . _AM_EXTCAL_ACTION . '</th>'; |
|
| 348 | + echo '<form method="POST" action="event.php">'; |
|
| 349 | + echo '<input type="hidden" name="op" value="deleteSelection">'; |
|
| 362 | 350 | |
| 363 | - echo '</tr>'; |
|
| 351 | + echo '<table class="outer" style="width:100%;">'; |
|
| 352 | + echo '<tr style="text-align:center;">'; |
|
| 353 | + echo '<th>' . _AM_EXTCAL_DELETE . '</th>'; |
|
| 354 | + echo '<th>#</th>'; |
|
| 355 | + echo '<th>' . _AM_EXTCAL_CATEGORY . '</th>'; |
|
| 356 | + echo '<th>' . _AM_EXTCAL_TITLE . '</th>'; |
|
| 357 | + echo '<th>' . _AM_EXTCAL_START_DATE . '</th>'; |
|
| 358 | + echo '<th>' . _AM_EXTCAL_END_DATE . '</th>'; |
|
| 359 | + echo '<th>' . _AM_EXTCAL_RECURRENT . '</th>'; |
|
| 360 | + echo '<th>' . _AM_EXTCAL_START_RULES . '</th>'; |
|
| 361 | + echo '<th>' . _AM_EXTCAL_ACTION . '</th>'; |
|
| 364 | 362 | |
| 365 | - if (count($events) > 0) { |
|
| 366 | - $i = 0; |
|
| 367 | - foreach ($events as $event) { |
|
| 368 | - $class = (0 == ++$i % 2) ? 'even' : 'odd'; |
|
| 369 | - echo '<tr style="text-align:left;" class="' . $class . '">'; |
|
| 370 | - echo "<td width='10%' align='center'>"; |
|
| 371 | - echo "<input type='checkbox' name='deleteEvents[{$event['event_id']}]' value='1' >"; |
|
| 372 | - echo "<input type='hidden' name='deleteAllEvents[{$event['event_id']}]' value='1'>"; |
|
| 373 | - echo '</td>'; |
|
| 374 | - echo "<td align = 'center' width='5%'>" . $event['event_id'] . '</td>'; |
|
| 375 | - echo "<td width='10%'>" . '<a href=cat.php?op=modify&cat_id=' . $event['Category']['cat_id'] . '&form_modify' . '>' . $event['Category']['cat_name'] . '</a>' . '</td>'; |
|
| 376 | - |
|
| 377 | - echo '<td>' . '<a href=event.php?op=modify&event_id=' . $event['event_id'] . '>' . $event['event_title'] . '</a>' . '</td>'; |
|
| 378 | - |
|
| 379 | - // if ($event['event_isrecur']) { |
|
| 380 | - // echo '<td>' . $event['formated_reccur_rule'] . '</td>'; |
|
| 381 | - // } else { |
|
| 382 | - // echo '<td>' . $event['formated_event_start'] . '</td>'; |
|
| 383 | - // } |
|
| 384 | - |
|
| 385 | - echo "<td align = 'center' width='10%'>" . $event['formated_event_start'] . '</td>'; |
|
| 386 | - echo "<td align = 'center' width='10%'>" . $event['formated_event_end'] . '</td>'; |
|
| 387 | - echo '<td align="center">' . ((1 == $event['event_isrecur']) ? _YES : _NO) . '</td>'; |
|
| 388 | - if (!isset($event['formated_reccur_rule'])) { |
|
| 389 | - $event['formated_reccur_rule'] = ''; |
|
| 363 | + echo '</tr>'; |
|
| 364 | + |
|
| 365 | + if (count($events) > 0) { |
|
| 366 | + $i = 0; |
|
| 367 | + foreach ($events as $event) { |
|
| 368 | + $class = (0 == ++$i % 2) ? 'even' : 'odd'; |
|
| 369 | + echo '<tr style="text-align:left;" class="' . $class . '">'; |
|
| 370 | + echo "<td width='10%' align='center'>"; |
|
| 371 | + echo "<input type='checkbox' name='deleteEvents[{$event['event_id']}]' value='1' >"; |
|
| 372 | + echo "<input type='hidden' name='deleteAllEvents[{$event['event_id']}]' value='1'>"; |
|
| 373 | + echo '</td>'; |
|
| 374 | + echo "<td align = 'center' width='5%'>" . $event['event_id'] . '</td>'; |
|
| 375 | + echo "<td width='10%'>" . '<a href=cat.php?op=modify&cat_id=' . $event['Category']['cat_id'] . '&form_modify' . '>' . $event['Category']['cat_name'] . '</a>' . '</td>'; |
|
| 376 | + |
|
| 377 | + echo '<td>' . '<a href=event.php?op=modify&event_id=' . $event['event_id'] . '>' . $event['event_title'] . '</a>' . '</td>'; |
|
| 378 | + |
|
| 379 | + // if ($event['event_isrecur']) { |
|
| 380 | + // echo '<td>' . $event['formated_reccur_rule'] . '</td>'; |
|
| 381 | + // } else { |
|
| 382 | + // echo '<td>' . $event['formated_event_start'] . '</td>'; |
|
| 383 | + // } |
|
| 384 | + |
|
| 385 | + echo "<td align = 'center' width='10%'>" . $event['formated_event_start'] . '</td>'; |
|
| 386 | + echo "<td align = 'center' width='10%'>" . $event['formated_event_end'] . '</td>'; |
|
| 387 | + echo '<td align="center">' . ((1 == $event['event_isrecur']) ? _YES : _NO) . '</td>'; |
|
| 388 | + if (!isset($event['formated_reccur_rule'])) { |
|
| 389 | + $event['formated_reccur_rule'] = ''; |
|
| 390 | + } |
|
| 391 | + echo '<td>' . $event['formated_reccur_rule'] . '</td>'; |
|
| 392 | + |
|
| 393 | + echo '<td style="width:10%; text-align:center;">'; |
|
| 394 | + echo '<a href=event.php?op=modify&event_id=' . $event['event_id'] . "><img src='" . $pathIcon16 . "/edit.png' title='" . _AM_EXTCAL_ICONE_EDIT . "'></a> "; |
|
| 395 | + echo '<a href=event.php?op=delete&event_id=' . $event['event_id'] . "><img src='" . $pathIcon16 . "/delete.png' title='" . _AM_EXTCAL_ICONE_DELETE . "'></a> "; |
|
| 396 | + echo '<a href=event.php?op=clone&event_id=' . $event['event_id'] . "><img src='" . $pathIcon16 . "/editcopy.png' title='" . _AM_EXTCAL_ICONE_CLONE . "'></a>"; |
|
| 397 | + echo '</td>'; |
|
| 398 | + |
|
| 399 | + echo '</tr>'; |
|
| 390 | 400 | } |
| 391 | - echo '<td>' . $event['formated_reccur_rule'] . '</td>'; |
|
| 401 | + //--------------------------------------------------------- |
|
| 402 | + $pageNav = new \XoopsPageNav($eventHandler->getCountNewEvent(), $nbEventsByPage, $start); |
|
| 392 | 403 | |
| 393 | - echo '<td style="width:10%; text-align:center;">'; |
|
| 394 | - echo '<a href=event.php?op=modify&event_id=' . $event['event_id'] . "><img src='" . $pathIcon16 . "/edit.png' title='" . _AM_EXTCAL_ICONE_EDIT . "'></a> "; |
|
| 395 | - echo '<a href=event.php?op=delete&event_id=' . $event['event_id'] . "><img src='" . $pathIcon16 . "/delete.png' title='" . _AM_EXTCAL_ICONE_DELETE . "'></a> "; |
|
| 396 | - echo '<a href=event.php?op=clone&event_id=' . $event['event_id'] . "><img src='" . $pathIcon16 . "/editcopy.png' title='" . _AM_EXTCAL_ICONE_CLONE . "'></a>"; |
|
| 404 | + echo '<tr><td colspan="2" style="text-align: right;">'; |
|
| 405 | + echo $pageNav->renderNav(2); |
|
| 397 | 406 | echo '</td>'; |
| 398 | 407 | |
| 399 | - echo '</tr>'; |
|
| 400 | - } |
|
| 401 | - //--------------------------------------------------------- |
|
| 402 | - $pageNav = new \XoopsPageNav($eventHandler->getCountNewEvent(), $nbEventsByPage, $start); |
|
| 408 | + echo '<td colspan="2" style="text-align: right;">'; |
|
| 403 | 409 | |
| 404 | - echo '<tr><td colspan="2" style="text-align: right;">'; |
|
| 405 | - echo $pageNav->renderNav(2); |
|
| 406 | - echo '</td>'; |
|
| 410 | + echo '<input type="submit" value="' . _AM_EXTCAL_DELETE_ALL . '" name="deleteSelection[0]">'; |
|
| 411 | + echo '<input type="submit" value="' . _AM_EXTCAL_DELETE_SELECTION . '" name="deleteSelection[1]">'; |
|
| 407 | 412 | |
| 408 | - echo '<td colspan="2" style="text-align: right;">'; |
|
| 409 | - |
|
| 410 | - echo '<input type="submit" value="' . _AM_EXTCAL_DELETE_ALL . '" name="deleteSelection[0]">'; |
|
| 411 | - echo '<input type="submit" value="' . _AM_EXTCAL_DELETE_SELECTION . '" name="deleteSelection[1]">'; |
|
| 412 | - |
|
| 413 | - echo '</td>'; |
|
| 414 | - echo '</tr>'; |
|
| 415 | - } else { |
|
| 416 | - echo '<tr><td colspan="5">' . _AM_EXTCAL_NO_PENDING_EVENT . '</td></tr>'; |
|
| 417 | - } |
|
| 418 | - echo '</table>'; |
|
| 419 | - echo '</form>'; |
|
| 413 | + echo '</td>'; |
|
| 414 | + echo '</tr>'; |
|
| 415 | + } else { |
|
| 416 | + echo '<tr><td colspan="5">' . _AM_EXTCAL_NO_PENDING_EVENT . '</td></tr>'; |
|
| 417 | + } |
|
| 418 | + echo '</table>'; |
|
| 419 | + echo '</form>'; |
|
| 420 | 420 | |
| 421 | - echo '</fieldset>'; |
|
| 422 | - echo '</fieldset><br><br>'; |
|
| 423 | - //Fin de la liste des evennement ------------------------------------- |
|
| 424 | - echo '<fieldset><legend style="font-weight:bold; color:#990000;">' . _MD_EXTCAL_SUBMIT_EVENT . '</legend>'; |
|
| 421 | + echo '</fieldset>'; |
|
| 422 | + echo '</fieldset><br><br>'; |
|
| 423 | + //Fin de la liste des evennement ------------------------------------- |
|
| 424 | + echo '<fieldset><legend style="font-weight:bold; color:#990000;">' . _MD_EXTCAL_SUBMIT_EVENT . '</legend>'; |
|
| 425 | 425 | |
| 426 | - $form = $eventHandler->getEventForm('admin'); |
|
| 427 | - $form->display(); |
|
| 426 | + $form = $eventHandler->getEventForm('admin'); |
|
| 427 | + $form->display(); |
|
| 428 | 428 | |
| 429 | - echo '</fieldset>'; |
|
| 429 | + echo '</fieldset>'; |
|
| 430 | 430 | |
| 431 | - require_once __DIR__ . '/admin_footer.php'; |
|
| 431 | + require_once __DIR__ . '/admin_footer.php'; |
|
| 432 | 432 | |
| 433 | - break; |
|
| 433 | + break; |
|
| 434 | 434 | } |
@@ -19,11 +19,11 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | use XoopsModules\Extcal; |
| 21 | 21 | |
| 22 | -require_once __DIR__ . '/../../../include/cp_header.php'; |
|
| 23 | -require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
| 24 | -require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 22 | +require_once __DIR__.'/../../../include/cp_header.php'; |
|
| 23 | +require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
| 24 | +require_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
| 25 | 25 | //require_once __DIR__ . '/../class/form/extcalform.php'; |
| 26 | -require_once __DIR__ . '/admin_header.php'; |
|
| 26 | +require_once __DIR__.'/admin_header.php'; |
|
| 27 | 27 | //require_once __DIR__ . '/../class/Utility.php'; |
| 28 | 28 | |
| 29 | 29 | $gepeto = array_merge($_GET, $_POST); |
@@ -52,15 +52,15 @@ discard block |
||
| 52 | 52 | // while (list($k, $t) = each($rst)) { |
| 53 | 53 | foreach ($rst as $k => $t) { |
| 54 | 54 | if ('' != $t['event_picture1']) { |
| 55 | - $f = XOOPS_ROOT_PATH . '/uploads/extcal/' . $t['event_picture1']; |
|
| 55 | + $f = XOOPS_ROOT_PATH.'/uploads/extcal/'.$t['event_picture1']; |
|
| 56 | 56 | unlink($f); |
| 57 | - echo $f . '<br>'; |
|
| 57 | + echo $f.'<br>'; |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | if ('' != $t['event_picture2']) { |
| 61 | - $f = XOOPS_ROOT_PATH . '/uploads/extcal/' . $t['event_picture1']; |
|
| 61 | + $f = XOOPS_ROOT_PATH.'/uploads/extcal/'.$t['event_picture1']; |
|
| 62 | 62 | unlink($f); |
| 63 | - echo $f . '<br>'; |
|
| 63 | + echo $f.'<br>'; |
|
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | if (!$eventHandler->modifyEvent($_POST['event_id'], $data)) { |
| 123 | 123 | redirect_header('event.php', 3, _AM_EXTCAL_EVENT_EDIT_FAILED, false); |
| 124 | 124 | } else { |
| 125 | - $fileHandler->createFile((int)$_POST['event_id']); |
|
| 125 | + $fileHandler->createFile((int) $_POST['event_id']); |
|
| 126 | 126 | redirect_header('event.php', 3, _AM_EXTCAL_EVENT_EDITED, false); |
| 127 | 127 | } |
| 128 | 128 | |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | $eventId = $_GET['event_id']; |
| 195 | 195 | $eventHandler = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_EVENT); |
| 196 | 196 | |
| 197 | - echo '<fieldset><legend style="font-weight:bold; color:#990000;">' . _MD_EXTCAL_EDIT_EVENT . '</legend>'; |
|
| 197 | + echo '<fieldset><legend style="font-weight:bold; color:#990000;">'._MD_EXTCAL_EDIT_EVENT.'</legend>'; |
|
| 198 | 198 | |
| 199 | 199 | if ($form = $eventHandler->getEventForm('admin', $action, ['event_id' => $eventId])) { |
| 200 | 200 | $form->display(); |
@@ -219,8 +219,8 @@ discard block |
||
| 219 | 219 | $data[$key] = $val['value']; |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | - $data['event_id'] = 0; |
|
| 223 | - $data['event_title'] .= ' (' . _AM_EXTCAL_CLONE_OF . $eventId . ')'; |
|
| 222 | + $data['event_id'] = 0; |
|
| 223 | + $data['event_title'] .= ' ('._AM_EXTCAL_CLONE_OF.$eventId.')'; |
|
| 224 | 224 | |
| 225 | 225 | $newEvent = $eventHandler->create(); |
| 226 | 226 | $newEvent->setVars($data); |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | |
| 237 | 237 | if (isset($_POST['confirm'])) { |
| 238 | 238 | if (!$GLOBALS['xoopsSecurity']->check()) { |
| 239 | - redirect_header('index.php', 3, _NOPERM . '<br>' . implode('<br>', $GLOBALS['xoopsSecurity']->getErrors())); |
|
| 239 | + redirect_header('index.php', 3, _NOPERM.'<br>'.implode('<br>', $GLOBALS['xoopsSecurity']->getErrors())); |
|
| 240 | 240 | } |
| 241 | 241 | // $eventHandler = xoops_getModuleHandler(_EXTCAL_CLS_EVENT, _EXTCAL_MODULE); |
| 242 | 242 | // $eventHandler->deleteEvent($_POST['event_id']); |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | if (isset($_POST['deleteSelection'][0])) { |
| 302 | 302 | } else { |
| 303 | 303 | if (!$GLOBALS['xoopsSecurity']->check()) { |
| 304 | - redirect_header('index.php', 3, _NOPERM . '<br>' . implode('<br>', $GLOBALS['xoopsSecurity']->getErrors())); |
|
| 304 | + redirect_header('index.php', 3, _NOPERM.'<br>'.implode('<br>', $GLOBALS['xoopsSecurity']->getErrors())); |
|
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | deleteEvents($_POST['event_ids']); |
@@ -333,32 +333,32 @@ discard block |
||
| 333 | 333 | $events = $eventHandler->objectToArray($eventHandler->getNewEvent($start, $nbEventsByPage, 0, true), ['cat_id']); |
| 334 | 334 | $eventHandler->formatEventsDate($events, _SHORTDATESTRING); |
| 335 | 335 | |
| 336 | - echo '<fieldset><legend style="font-weight:bold; color:#990000;">' . _AM_EXTCAL_APPROVED_EVENT . '</legend>'; |
|
| 337 | - echo '<fieldset><legend style="font-weight:bold; color:#0A3760;">' . _AM_EXTCAL_INFORMATION . '</legend>'; |
|
| 336 | + echo '<fieldset><legend style="font-weight:bold; color:#990000;">'._AM_EXTCAL_APPROVED_EVENT.'</legend>'; |
|
| 337 | + echo '<fieldset><legend style="font-weight:bold; color:#0A3760;">'._AM_EXTCAL_INFORMATION.'</legend>'; |
|
| 338 | 338 | //echo'<img src='. XOOPS_URL .'/'. $moduleInfo->getInfo('dirmoduleadmin').'/assets/images/action/edit.png' .' '.'style=vertical-align:middle;> ' . _AM_EXTCAL_INFO_EDIT . '<br>'; |
| 339 | 339 | //echo'<img src='. XOOPS_URL .'/'. $moduleInfo->getInfo('dirmoduleadmin').'/assets/images/action/delete.png'. ' '."style=vertical-align:middle;> ". _AM_EXTCAL_INFO_DELETE; |
| 340 | 340 | |
| 341 | - echo '<img src=' . $pathIcon16 . '/edit.png' . ' ' . 'style=vertical-align:middle;> ' . _AM_EXTCAL_INFO_EDIT . '<br>'; |
|
| 342 | - echo '<img src=' . $pathIcon16 . '/delete.png' . ' ' . 'style=vertical-align:middle;> ' . _AM_EXTCAL_INFO_DELETE . '<br>'; |
|
| 341 | + echo '<img src='.$pathIcon16.'/edit.png'.' '.'style=vertical-align:middle;> '._AM_EXTCAL_INFO_EDIT.'<br>'; |
|
| 342 | + echo '<img src='.$pathIcon16.'/delete.png'.' '.'style=vertical-align:middle;> '._AM_EXTCAL_INFO_DELETE.'<br>'; |
|
| 343 | 343 | |
| 344 | 344 | echo '</fieldset><br>'; |
| 345 | 345 | |
| 346 | - echo '<fieldset><legend style="font-weight:bold; color:#0A3760;">' . _MD_EXTCAL_SUBMITED_EVENT . '</legend>'; |
|
| 346 | + echo '<fieldset><legend style="font-weight:bold; color:#0A3760;">'._MD_EXTCAL_SUBMITED_EVENT.'</legend>'; |
|
| 347 | 347 | |
| 348 | 348 | echo '<form method="POST" action="event.php">'; |
| 349 | 349 | echo '<input type="hidden" name="op" value="deleteSelection">'; |
| 350 | 350 | |
| 351 | 351 | echo '<table class="outer" style="width:100%;">'; |
| 352 | 352 | echo '<tr style="text-align:center;">'; |
| 353 | - echo '<th>' . _AM_EXTCAL_DELETE . '</th>'; |
|
| 353 | + echo '<th>'._AM_EXTCAL_DELETE.'</th>'; |
|
| 354 | 354 | echo '<th>#</th>'; |
| 355 | - echo '<th>' . _AM_EXTCAL_CATEGORY . '</th>'; |
|
| 356 | - echo '<th>' . _AM_EXTCAL_TITLE . '</th>'; |
|
| 357 | - echo '<th>' . _AM_EXTCAL_START_DATE . '</th>'; |
|
| 358 | - echo '<th>' . _AM_EXTCAL_END_DATE . '</th>'; |
|
| 359 | - echo '<th>' . _AM_EXTCAL_RECURRENT . '</th>'; |
|
| 360 | - echo '<th>' . _AM_EXTCAL_START_RULES . '</th>'; |
|
| 361 | - echo '<th>' . _AM_EXTCAL_ACTION . '</th>'; |
|
| 355 | + echo '<th>'._AM_EXTCAL_CATEGORY.'</th>'; |
|
| 356 | + echo '<th>'._AM_EXTCAL_TITLE.'</th>'; |
|
| 357 | + echo '<th>'._AM_EXTCAL_START_DATE.'</th>'; |
|
| 358 | + echo '<th>'._AM_EXTCAL_END_DATE.'</th>'; |
|
| 359 | + echo '<th>'._AM_EXTCAL_RECURRENT.'</th>'; |
|
| 360 | + echo '<th>'._AM_EXTCAL_START_RULES.'</th>'; |
|
| 361 | + echo '<th>'._AM_EXTCAL_ACTION.'</th>'; |
|
| 362 | 362 | |
| 363 | 363 | echo '</tr>'; |
| 364 | 364 | |
@@ -366,15 +366,15 @@ discard block |
||
| 366 | 366 | $i = 0; |
| 367 | 367 | foreach ($events as $event) { |
| 368 | 368 | $class = (0 == ++$i % 2) ? 'even' : 'odd'; |
| 369 | - echo '<tr style="text-align:left;" class="' . $class . '">'; |
|
| 369 | + echo '<tr style="text-align:left;" class="'.$class.'">'; |
|
| 370 | 370 | echo "<td width='10%' align='center'>"; |
| 371 | 371 | echo "<input type='checkbox' name='deleteEvents[{$event['event_id']}]' value='1' >"; |
| 372 | 372 | echo "<input type='hidden' name='deleteAllEvents[{$event['event_id']}]' value='1'>"; |
| 373 | 373 | echo '</td>'; |
| 374 | - echo "<td align = 'center' width='5%'>" . $event['event_id'] . '</td>'; |
|
| 375 | - echo "<td width='10%'>" . '<a href=cat.php?op=modify&cat_id=' . $event['Category']['cat_id'] . '&form_modify' . '>' . $event['Category']['cat_name'] . '</a>' . '</td>'; |
|
| 374 | + echo "<td align = 'center' width='5%'>".$event['event_id'].'</td>'; |
|
| 375 | + echo "<td width='10%'>".'<a href=cat.php?op=modify&cat_id='.$event['Category']['cat_id'].'&form_modify'.'>'.$event['Category']['cat_name'].'</a>'.'</td>'; |
|
| 376 | 376 | |
| 377 | - echo '<td>' . '<a href=event.php?op=modify&event_id=' . $event['event_id'] . '>' . $event['event_title'] . '</a>' . '</td>'; |
|
| 377 | + echo '<td>'.'<a href=event.php?op=modify&event_id='.$event['event_id'].'>'.$event['event_title'].'</a>'.'</td>'; |
|
| 378 | 378 | |
| 379 | 379 | // if ($event['event_isrecur']) { |
| 380 | 380 | // echo '<td>' . $event['formated_reccur_rule'] . '</td>'; |
@@ -382,18 +382,18 @@ discard block |
||
| 382 | 382 | // echo '<td>' . $event['formated_event_start'] . '</td>'; |
| 383 | 383 | // } |
| 384 | 384 | |
| 385 | - echo "<td align = 'center' width='10%'>" . $event['formated_event_start'] . '</td>'; |
|
| 386 | - echo "<td align = 'center' width='10%'>" . $event['formated_event_end'] . '</td>'; |
|
| 387 | - echo '<td align="center">' . ((1 == $event['event_isrecur']) ? _YES : _NO) . '</td>'; |
|
| 385 | + echo "<td align = 'center' width='10%'>".$event['formated_event_start'].'</td>'; |
|
| 386 | + echo "<td align = 'center' width='10%'>".$event['formated_event_end'].'</td>'; |
|
| 387 | + echo '<td align="center">'.((1 == $event['event_isrecur']) ? _YES : _NO).'</td>'; |
|
| 388 | 388 | if (!isset($event['formated_reccur_rule'])) { |
| 389 | 389 | $event['formated_reccur_rule'] = ''; |
| 390 | 390 | } |
| 391 | - echo '<td>' . $event['formated_reccur_rule'] . '</td>'; |
|
| 391 | + echo '<td>'.$event['formated_reccur_rule'].'</td>'; |
|
| 392 | 392 | |
| 393 | 393 | echo '<td style="width:10%; text-align:center;">'; |
| 394 | - echo '<a href=event.php?op=modify&event_id=' . $event['event_id'] . "><img src='" . $pathIcon16 . "/edit.png' title='" . _AM_EXTCAL_ICONE_EDIT . "'></a> "; |
|
| 395 | - echo '<a href=event.php?op=delete&event_id=' . $event['event_id'] . "><img src='" . $pathIcon16 . "/delete.png' title='" . _AM_EXTCAL_ICONE_DELETE . "'></a> "; |
|
| 396 | - echo '<a href=event.php?op=clone&event_id=' . $event['event_id'] . "><img src='" . $pathIcon16 . "/editcopy.png' title='" . _AM_EXTCAL_ICONE_CLONE . "'></a>"; |
|
| 394 | + echo '<a href=event.php?op=modify&event_id='.$event['event_id']."><img src='".$pathIcon16."/edit.png' title='"._AM_EXTCAL_ICONE_EDIT."'></a> "; |
|
| 395 | + echo '<a href=event.php?op=delete&event_id='.$event['event_id']."><img src='".$pathIcon16."/delete.png' title='"._AM_EXTCAL_ICONE_DELETE."'></a> "; |
|
| 396 | + echo '<a href=event.php?op=clone&event_id='.$event['event_id']."><img src='".$pathIcon16."/editcopy.png' title='"._AM_EXTCAL_ICONE_CLONE."'></a>"; |
|
| 397 | 397 | echo '</td>'; |
| 398 | 398 | |
| 399 | 399 | echo '</tr>'; |
@@ -407,13 +407,13 @@ discard block |
||
| 407 | 407 | |
| 408 | 408 | echo '<td colspan="2" style="text-align: right;">'; |
| 409 | 409 | |
| 410 | - echo '<input type="submit" value="' . _AM_EXTCAL_DELETE_ALL . '" name="deleteSelection[0]">'; |
|
| 411 | - echo '<input type="submit" value="' . _AM_EXTCAL_DELETE_SELECTION . '" name="deleteSelection[1]">'; |
|
| 410 | + echo '<input type="submit" value="'._AM_EXTCAL_DELETE_ALL.'" name="deleteSelection[0]">'; |
|
| 411 | + echo '<input type="submit" value="'._AM_EXTCAL_DELETE_SELECTION.'" name="deleteSelection[1]">'; |
|
| 412 | 412 | |
| 413 | 413 | echo '</td>'; |
| 414 | 414 | echo '</tr>'; |
| 415 | 415 | } else { |
| 416 | - echo '<tr><td colspan="5">' . _AM_EXTCAL_NO_PENDING_EVENT . '</td></tr>'; |
|
| 416 | + echo '<tr><td colspan="5">'._AM_EXTCAL_NO_PENDING_EVENT.'</td></tr>'; |
|
| 417 | 417 | } |
| 418 | 418 | echo '</table>'; |
| 419 | 419 | echo '</form>'; |
@@ -421,14 +421,14 @@ discard block |
||
| 421 | 421 | echo '</fieldset>'; |
| 422 | 422 | echo '</fieldset><br><br>'; |
| 423 | 423 | //Fin de la liste des evennement ------------------------------------- |
| 424 | - echo '<fieldset><legend style="font-weight:bold; color:#990000;">' . _MD_EXTCAL_SUBMIT_EVENT . '</legend>'; |
|
| 424 | + echo '<fieldset><legend style="font-weight:bold; color:#990000;">'._MD_EXTCAL_SUBMIT_EVENT.'</legend>'; |
|
| 425 | 425 | |
| 426 | 426 | $form = $eventHandler->getEventForm('admin'); |
| 427 | 427 | $form->display(); |
| 428 | 428 | |
| 429 | 429 | echo '</fieldset>'; |
| 430 | 430 | |
| 431 | - require_once __DIR__ . '/admin_footer.php'; |
|
| 431 | + require_once __DIR__.'/admin_footer.php'; |
|
| 432 | 432 | |
| 433 | 433 | break; |
| 434 | 434 | } |
@@ -20,19 +20,19 @@ discard block |
||
| 20 | 20 | use XoopsModules\Extcal; |
| 21 | 21 | |
| 22 | 22 | // Include xoops admin header |
| 23 | -require_once __DIR__ . '/../../../include/cp_header.php'; |
|
| 23 | +require_once __DIR__.'/../../../include/cp_header.php'; |
|
| 24 | 24 | //require_once __DIR__ . '/../class/ExtcalPersistableObjectHandler.php'; |
| 25 | -require_once __DIR__ . '/../../../kernel/module.php'; |
|
| 26 | -require_once __DIR__ . '/../../../class/xoopsformloader.php'; |
|
| 27 | -require_once __DIR__ . '/../../../class/tree.php'; |
|
| 28 | -require_once __DIR__ . '/../../../class/xoopslists.php'; |
|
| 29 | -require_once __DIR__ . '/../../../class/pagenav.php'; |
|
| 30 | -require_once __DIR__ . '/../../../class/xoopsform/grouppermform.php'; |
|
| 31 | -require_once __DIR__ . '/../../../class/uploader.php'; |
|
| 25 | +require_once __DIR__.'/../../../kernel/module.php'; |
|
| 26 | +require_once __DIR__.'/../../../class/xoopsformloader.php'; |
|
| 27 | +require_once __DIR__.'/../../../class/tree.php'; |
|
| 28 | +require_once __DIR__.'/../../../class/xoopslists.php'; |
|
| 29 | +require_once __DIR__.'/../../../class/pagenav.php'; |
|
| 30 | +require_once __DIR__.'/../../../class/xoopsform/grouppermform.php'; |
|
| 31 | +require_once __DIR__.'/../../../class/uploader.php'; |
|
| 32 | 32 | //require_once __DIR__ . '/../class/etablissement.php'; |
| 33 | -require_once __DIR__ . '/../include/constantes.php'; |
|
| 33 | +require_once __DIR__.'/../include/constantes.php'; |
|
| 34 | 34 | |
| 35 | -require_once __DIR__ . '/admin_header.php'; |
|
| 35 | +require_once __DIR__.'/admin_header.php'; |
|
| 36 | 36 | |
| 37 | 37 | //include_once("functions.php"); |
| 38 | 38 | //include_once("../include/functions.php"); |
@@ -40,10 +40,10 @@ discard block |
||
| 40 | 40 | if ($xoopsUser) { |
| 41 | 41 | $xoopsModule = \XoopsModule::getByDirname('extcal'); |
| 42 | 42 | if (!$xoopsUser->isAdmin($xoopsModule->mid())) { |
| 43 | - redirect_header(XOOPS_URL . '/', 3, _NOPERM); |
|
| 43 | + redirect_header(XOOPS_URL.'/', 3, _NOPERM); |
|
| 44 | 44 | } |
| 45 | 45 | } else { |
| 46 | - redirect_header(XOOPS_URL . '/', 3, _NOPERM); |
|
| 46 | + redirect_header(XOOPS_URL.'/', 3, _NOPERM); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | // Include language file |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $etablissement_arr = $etablissementHandler->getObjects($criteria); |
| 101 | 101 | $numrows = $etablissementHandler->getCount($criteria); |
| 102 | 102 | if ($numrows > $limit) { |
| 103 | - $pagenav = new \XoopsPageNav($numrows, $limit, $start, 'start', 'op=liste&limit=' . $limit); |
|
| 103 | + $pagenav = new \XoopsPageNav($numrows, $limit, $start, 'start', 'op=liste&limit='.$limit); |
|
| 104 | 104 | $pagenav = $pagenav->renderNav(4); |
| 105 | 105 | } else { |
| 106 | 106 | $pagenav = ''; |
@@ -109,11 +109,11 @@ discard block |
||
| 109 | 109 | if ($numrows > 0) { |
| 110 | 110 | echo '<table width="100%" cellspacing="1" class="outer">'; |
| 111 | 111 | echo '<tr>'; |
| 112 | - echo '<th align="center">' . _AM_EXTCAL_ETABLISSEMENT_FORM_NOM . '</th>'; |
|
| 113 | - echo '<th align="center" width="20%">' . _AM_EXTCAL_ETABLISSEMENT_FORM_ADRESSE . '</th>'; |
|
| 114 | - echo '<th align="center" width="20%">' . _AM_EXTCAL_ETABLISSEMENT_FORM_CITY . '</th>'; |
|
| 115 | - echo '<th align="center" width="15%">' . _AM_EXTCAL_ETABLISSEMENT_FORM_TELEPHONE . '</th>'; |
|
| 116 | - echo '<th align="center" width="15%">' . _AM_EXTCAL_ETABLISSEMENT_FORM_ACTION . '</th>'; |
|
| 112 | + echo '<th align="center">'._AM_EXTCAL_ETABLISSEMENT_FORM_NOM.'</th>'; |
|
| 113 | + echo '<th align="center" width="20%">'._AM_EXTCAL_ETABLISSEMENT_FORM_ADRESSE.'</th>'; |
|
| 114 | + echo '<th align="center" width="20%">'._AM_EXTCAL_ETABLISSEMENT_FORM_CITY.'</th>'; |
|
| 115 | + echo '<th align="center" width="15%">'._AM_EXTCAL_ETABLISSEMENT_FORM_TELEPHONE.'</th>'; |
|
| 116 | + echo '<th align="center" width="15%">'._AM_EXTCAL_ETABLISSEMENT_FORM_ACTION.'</th>'; |
|
| 117 | 117 | echo '</tr>'; |
| 118 | 118 | $class = 'odd'; |
| 119 | 119 | foreach (array_keys($etablissement_arr) as $i) { |
@@ -123,21 +123,21 @@ discard block |
||
| 123 | 123 | $etablissement_adresse = $etablissement_arr[$i]->getVar('adresse'); |
| 124 | 124 | $etablissement_city = $etablissement_arr[$i]->getVar('ville'); |
| 125 | 125 | $etablissement_telephone = $etablissement_arr[$i]->getVar('tel_fixe'); |
| 126 | - echo '<tr class="' . $class . '">'; |
|
| 127 | - echo '<td align="left">' . '<a href="etablissement.php?op=edit_etablissement&etablissement_id=' . $etablissement_id . '">' . $etablissement_nom . '</a>' . '</td>'; |
|
| 126 | + echo '<tr class="'.$class.'">'; |
|
| 127 | + echo '<td align="left">'.'<a href="etablissement.php?op=edit_etablissement&etablissement_id='.$etablissement_id.'">'.$etablissement_nom.'</a>'.'</td>'; |
|
| 128 | 128 | |
| 129 | - echo '<td align="center"><b>' . $etablissement_adresse . '</td>'; |
|
| 130 | - echo '<td align="center"><b>' . $etablissement_city . '</td>'; |
|
| 131 | - echo '<td align="center"><b>' . $etablissement_telephone . '</td>'; |
|
| 129 | + echo '<td align="center"><b>'.$etablissement_adresse.'</td>'; |
|
| 130 | + echo '<td align="center"><b>'.$etablissement_city.'</td>'; |
|
| 131 | + echo '<td align="center"><b>'.$etablissement_telephone.'</td>'; |
|
| 132 | 132 | echo '<td align="center" width="15%">'; |
| 133 | - echo '<a href="etablissement.php?op=edit_etablissement&etablissement_id=' . $etablissement_id . '"><img src=' . $pathIcon16 . '/edit.png alt="' . _AM_EXTCAL_ETABLISSEMENT_FORM_EDIT . '" title="' . _AM_EXTCAL_ETABLISSEMENT_FORM_EDIT . '"></a> '; |
|
| 134 | - echo '<a href="etablissement.php?op=delete_etablissement&etablissement_id=' . $etablissement_id . '"><img src=' . $pathIcon16 . '/delete.png alt="' . _AM_EXTCAL_ETABLISSEMENT_FORM_DELETE . '" title="' . _AM_EXTCAL_ETABLISSEMENT_FORM_DELETE . '"></a> '; |
|
| 133 | + echo '<a href="etablissement.php?op=edit_etablissement&etablissement_id='.$etablissement_id.'"><img src='.$pathIcon16.'/edit.png alt="'._AM_EXTCAL_ETABLISSEMENT_FORM_EDIT.'" title="'._AM_EXTCAL_ETABLISSEMENT_FORM_EDIT.'"></a> '; |
|
| 134 | + echo '<a href="etablissement.php?op=delete_etablissement&etablissement_id='.$etablissement_id.'"><img src='.$pathIcon16.'/delete.png alt="'._AM_EXTCAL_ETABLISSEMENT_FORM_DELETE.'" title="'._AM_EXTCAL_ETABLISSEMENT_FORM_DELETE.'"></a> '; |
|
| 135 | 135 | echo '</td>'; |
| 136 | 136 | } |
| 137 | 137 | echo '</table><br>'; |
| 138 | - echo '<br><div align=right>' . $pagenav . '</div><br>'; |
|
| 138 | + echo '<br><div align=right>'.$pagenav.'</div><br>'; |
|
| 139 | 139 | } else { |
| 140 | - echo '<div class="errorMsg" style="text-align: center;">' . _AM_EXTCAL_ERREUR_NO_ETABLISSEMENT . '</div>'; |
|
| 140 | + echo '<div class="errorMsg" style="text-align: center;">'._AM_EXTCAL_ERREUR_NO_ETABLISSEMENT.'</div>'; |
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | // Affichage du formulaire |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | 'ok' => 1, |
| 161 | 161 | 'etablissement_id' => $_REQUEST['etablissement_id'], |
| 162 | 162 | 'op' => 'delete_etablissement', |
| 163 | - ], $_SERVER['REQUEST_URI'], _AM_EXTCAL_ETABLISSEMENT_SURDEL . '<br>'); |
|
| 163 | + ], $_SERVER['REQUEST_URI'], _AM_EXTCAL_ETABLISSEMENT_SURDEL.'<br>'); |
|
| 164 | 164 | } |
| 165 | 165 | break; |
| 166 | 166 | |
@@ -202,11 +202,11 @@ discard block |
||
| 202 | 202 | $obj->setVar('map', $_REQUEST['map']); |
| 203 | 203 | |
| 204 | 204 | //Logo |
| 205 | - $uploaddir_etablissement = XOOPS_ROOT_PATH . '/uploads/extcal/etablissement/'; |
|
| 206 | - $uploadurl_etablissement = XOOPS_URL . '/uploads/extcal/etablissement/'; |
|
| 205 | + $uploaddir_etablissement = XOOPS_ROOT_PATH.'/uploads/extcal/etablissement/'; |
|
| 206 | + $uploadurl_etablissement = XOOPS_URL.'/uploads/extcal/etablissement/'; |
|
| 207 | 207 | |
| 208 | 208 | $delimg = @$_REQUEST['delimg']; |
| 209 | - $delimg = isset($delimg) ? (int)$delimg : 0; |
|
| 209 | + $delimg = isset($delimg) ? (int) $delimg : 0; |
|
| 210 | 210 | if (0 == $delimg && !empty($_REQUEST['xoops_upload_file'][0])) { |
| 211 | 211 | $upload = new \XoopsMediaUploader($uploaddir_etablissement, [ |
| 212 | 212 | 'image/gif', |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | } |
| 230 | 230 | } else { |
| 231 | 231 | $logo = ''; |
| 232 | - $url_etablissement = XOOPS_ROOT_PATH . '/uploads/extcal/etablissement/' . $_REQUEST['file']; |
|
| 232 | + $url_etablissement = XOOPS_ROOT_PATH.'/uploads/extcal/etablissement/'.$_REQUEST['file']; |
|
| 233 | 233 | if (is_file($url_etablissement)) { |
| 234 | 234 | chmod($url_etablissement, 0777); |
| 235 | 235 | unlink($url_etablissement); |
@@ -249,4 +249,4 @@ discard block |
||
| 249 | 249 | break; |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | -require_once __DIR__ . '/admin_footer.php'; |
|
| 252 | +require_once __DIR__.'/admin_footer.php'; |
|