mambax7 /
extcal
| 1 | <?php |
||
| 2 | |||
| 3 | use XoopsModules\Extcal\Locale; |
||
|
0 ignored issues
–
show
The type
XoopsModules\Extcal\Locale was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 4 | |||
| 5 | require_once __DIR__ . '/header.php'; |
||
| 6 | require_once __DIR__ . '/include/constantes.php'; |
||
| 7 | $params = ['view' => _EXTCAL_NAV_NEW_EVENT, 'file' => _EXTCAL_FILE_NEW_EVENT]; |
||
| 8 | $GLOBALS['xoopsOption']['template_main'] = "extcal_view_{$params['view']}.tpl"; |
||
| 9 | |||
| 10 | /* ========================================================================== */ |
||
| 11 | //Extcal\Utility::echoArray($_GET); |
||
| 12 | |||
| 13 | $eventId = (isset($_GET['event']) ? $_GET['event'] : 0); |
||
| 14 | $action = (isset($_GET['action']) ? $_GET['action'] : 'edit'); |
||
| 15 | |||
| 16 | //------------------------------------------------------------------------------ |
||
| 17 | |||
| 18 | //exit; |
||
| 19 | if (count($permHandler->getAuthorizedCat($xoopsUser, 'extcal_cat_submit')) > 0) { |
||
| 20 | require_once XOOPS_ROOT_PATH . '/header.php'; |
||
| 21 | |||
| 22 | // Title of the page |
||
| 23 | $xoopsTpl->assign('xoops_pagetitle', _MI_EXTCAL_SUBMIT_EVENT); |
||
| 24 | |||
| 25 | // Display the submit form |
||
| 26 | if (0 == $eventId) { |
||
| 27 | $form = $eventHandler->getEventForm(); |
||
| 28 | } else { |
||
| 29 | $form = $eventHandler->getEventForm('user', $action, ['event_id' => $eventId]); |
||
| 30 | } |
||
| 31 | $xoopsTpl->assign('formEdit', $form->render()); |
||
| 32 | |||
| 33 | //----------------------------------------------- |
||
| 34 | $xoopsTpl->assign('params', $params); |
||
| 35 | |||
| 36 | $tNavBar = getNavBarTabs($params['view']); |
||
| 37 | $xoopsTpl->assign('tNavBar', $tNavBar); |
||
| 38 | $xoopsTpl->assign('list_position', -1); |
||
| 39 | //----------------------------------------------- |
||
| 40 | |||
| 41 | //$form->display(); |
||
| 42 | |||
| 43 | //mb missing for xBootstrap templates by Angelo |
||
| 44 | $lang = [ |
||
| 45 | 'start' => _MD_EXTCAL_START, |
||
| 46 | 'end' => _MD_EXTCAL_END, |
||
| 47 | 'calmonth' => _MD_EXTCAL_NAV_CALMONTH, |
||
| 48 | 'calweek' => _MD_EXTCAL_NAV_CALWEEK, |
||
| 49 | 'year' => _MD_EXTCAL_NAV_YEAR, |
||
| 50 | 'month' => _MD_EXTCAL_NAV_MONTH, |
||
| 51 | 'week' => _MD_EXTCAL_NAV_WEEK, |
||
| 52 | 'day' => _MD_EXTCAL_NAV_DAY, |
||
| 53 | 'agendaweek' => _MD_EXTCAL_NAV_AGENDA_WEEK, |
||
| 54 | 'agendaday' => _MD_EXTCAL_NAV_AGENDA_DAY, |
||
| 55 | 'search' => _MD_EXTCAL_NAV_SEARCH, |
||
| 56 | 'newevent' => _MD_EXTCAL_NAV_NEW_EVENT, |
||
| 57 | ]; |
||
| 58 | |||
| 59 | // Assigning language data to the template |
||
| 60 | $xoopsTpl->assign('lang', $lang); |
||
| 61 | $xoopsTpl->assign('view', 'newevent'); |
||
| 62 | |||
| 63 | require_once XOOPS_ROOT_PATH . '/footer.php'; |
||
| 64 | } else { |
||
| 65 | redirect_header('index.php', 3); |
||
| 66 | } |
||
| 67 |
Let?s assume that you have a directory layout like this:
. |-- OtherDir | |-- Bar.php | `-- Foo.php `-- SomeDir `-- Foo.phpand let?s assume the following content of
Bar.php:If both files
OtherDir/Foo.phpandSomeDir/Foo.phpare loaded in the same runtime, you will see a PHP error such as the following:PHP Fatal error: Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.phpHowever, as
OtherDir/Foo.phpdoes not necessarily have to be loaded and the error is only triggered if it is loaded beforeOtherDir/Bar.php, this problem might go unnoticed for a while. In order to prevent this error from surfacing, you must import the namespace with a different alias: