mambax7 /
extcal
This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include, or for example
via PHP's auto-loading mechanism.
| 1 | <?php |
||||||||
| 2 | /* |
||||||||
| 3 | * You may not change or alter any portion of this comment or credits |
||||||||
| 4 | * of supporting developers from this source code or any supporting source code |
||||||||
| 5 | * which is considered copyrighted (c) material of the original comment or credit authors. |
||||||||
| 6 | * |
||||||||
| 7 | * This program is distributed in the hope that it will be useful, |
||||||||
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||||
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
||||||||
| 10 | */ |
||||||||
| 11 | |||||||||
| 12 | /** |
||||||||
| 13 | * @copyright {@link https://xoops.org/ XOOPS Project} |
||||||||
| 14 | * @license {@link https://www.gnu.org/licenses/gpl-2.0.html GNU GPL 2 or later} |
||||||||
| 15 | * @package extcal |
||||||||
| 16 | * @since |
||||||||
| 17 | * @author XOOPS Development Team, |
||||||||
| 18 | */ |
||||||||
| 19 | |||||||||
| 20 | use XoopsModules\Extcal\{Helper, |
||||||||
| 21 | EventHandler, |
||||||||
| 22 | CategoryHandler |
||||||||
| 23 | }; |
||||||||
| 24 | |||||||||
| 25 | require_once dirname(__DIR__) . '/include/constantes.php'; |
||||||||
| 26 | |||||||||
| 27 | /******************************************************/ |
||||||||
| 28 | /* Ajour JJD - Evenements par categries */ |
||||||||
| 29 | /******************************************************/ |
||||||||
| 30 | /** |
||||||||
| 31 | * @param $options |
||||||||
| 32 | * |
||||||||
| 33 | * @return array|bool |
||||||||
| 34 | */ |
||||||||
| 35 | function bExtcalUpcomingByCategoryShow($options) |
||||||||
| 36 | { |
||||||||
| 37 | global $xoopsUser; |
||||||||
| 38 | |||||||||
| 39 | /** @var Helper $helper */ |
||||||||
| 40 | if (!class_exists(Helper::class)) { |
||||||||
| 41 | return false; |
||||||||
| 42 | } |
||||||||
| 43 | |||||||||
| 44 | $helper = Helper::getInstance(); |
||||||||
| 45 | $helper->loadLanguage('main'); |
||||||||
| 46 | |||||||||
| 47 | $eventHandler = $helper->getHandler(_EXTCAL_CLN_EVENT); |
||||||||
| 48 | |||||||||
| 49 | $nbEvent = $options[0]; |
||||||||
| 50 | $titleLenght = $options[1]; |
||||||||
|
0 ignored issues
–
show
Unused Code
introduced
by
Loading history...
|
|||||||||
| 51 | array_shift($options); |
||||||||
| 52 | array_shift($options); |
||||||||
| 53 | |||||||||
| 54 | // Checking if no cat is selected |
||||||||
| 55 | if (isset($options[0]) && 0 == $options[0] && 1 == count($options)) { |
||||||||
| 56 | $options = 0; |
||||||||
| 57 | } |
||||||||
| 58 | |||||||||
| 59 | $events = $eventHandler->objectToArray($eventHandler->getUpcommingEvent($nbEvent, $options)); |
||||||||
|
0 ignored issues
–
show
The method
objectToArray() does not exist on XoopsObjectHandler. It seems like you code against a sub-type of XoopsObjectHandler such as XoopsPersistableObjectHandler.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
The method
getUpcommingEvent() does not exist on XoopsObjectHandler. It seems like you code against a sub-type of XoopsObjectHandler such as XoopsPersistableObjectHandler.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||||
| 60 | $eventHandler->serverTimeToUserTimes($events); |
||||||||
|
0 ignored issues
–
show
The method
serverTimeToUserTimes() does not exist on XoopsObjectHandler. It seems like you code against a sub-type of XoopsObjectHandler such as XoopsPersistableObjectHandler.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||||
| 61 | $eventHandler->formatEventsDate($events, $helper->getConfig('event_date_month')); |
||||||||
|
0 ignored issues
–
show
The method
formatEventsDate() does not exist on XoopsObjectHandler. It seems like you code against a sub-type of XoopsObjectHandler such as XoopsPersistableObjectHandler.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||||
| 62 | |||||||||
| 63 | /***********************************************************/ |
||||||||
| 64 | $categoryHandler = $helper->getHandler(_EXTCAL_CLN_CAT); |
||||||||
| 65 | $t = $categoryHandler->objectToArray($categoryHandler->getAllCat($xoopsUser, 'all')); |
||||||||
|
0 ignored issues
–
show
The method
getAllCat() does not exist on XoopsObjectHandler. It seems like you code against a sub-type of XoopsObjectHandler such as XoopsPersistableObjectHandler.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||||
| 66 | $tCats = []; |
||||||||
| 67 | foreach ($t as $h => $hValue) { |
||||||||
| 68 | $tCats[$t[$h]['cat_id']] = $hValue; |
||||||||
| 69 | } |
||||||||
| 70 | |||||||||
| 71 | $te = []; |
||||||||
| 72 | |||||||||
| 73 | foreach ($events as $h => $hValue) { |
||||||||
| 74 | $catId = $events[$h]['cat_id']; |
||||||||
| 75 | if (!isset($te[$catId])) { |
||||||||
| 76 | $te[$catId] = $tCats[$catId]; |
||||||||
| 77 | $te[$catId]['events'] = []; |
||||||||
| 78 | } |
||||||||
| 79 | $te[$catId]['events'][] = $hValue; |
||||||||
| 80 | } |
||||||||
| 81 | |||||||||
| 82 | return $te; |
||||||||
| 83 | } |
||||||||
| 84 | |||||||||
| 85 | /** |
||||||||
| 86 | * @param $options |
||||||||
| 87 | * |
||||||||
| 88 | * @return string |
||||||||
| 89 | */ |
||||||||
| 90 | function bExtcalUpcomingByCategoryEdit($options) |
||||||||
| 91 | { |
||||||||
| 92 | global $xoopsUser; |
||||||||
| 93 | |||||||||
| 94 | $helper = Helper::getInstance(); |
||||||||
| 95 | $categoryHandler = $helper->getHandler(_EXTCAL_CLN_CAT); |
||||||||
| 96 | |||||||||
| 97 | $cats = $categoryHandler->getAllCat($xoopsUser, 'extcal_cat_view'); |
||||||||
| 98 | |||||||||
| 99 | $form = _MB_EXTCAL_DISPLAY . " \n"; |
||||||||
| 100 | $form .= '<input name="options[0]" size="5" maxlength="255" value="' . $options[0] . '" type="text"> ' . _MB_EXTCAL_EVENT . '<br>'; |
||||||||
| 101 | $form .= _MB_EXTCAL_TITLE_LENGTH . ' : <input name="options[1]" size="5" maxlength="255" value="' . $options[1] . '" type="text"><br>'; |
||||||||
| 102 | array_shift($options); |
||||||||
| 103 | array_shift($options); |
||||||||
| 104 | $form .= _MB_EXTCAL_CAT_TO_USE . '<br><select name="options[]" multiple="multiple" size="5">'; |
||||||||
| 105 | if (false === array_search(0, $options, true)) { |
||||||||
| 106 | $form .= '<option value="0">' . _MB_EXTCAL_ALL_CAT . '</option>'; |
||||||||
| 107 | } else { |
||||||||
| 108 | $form .= '<option value="0" selected="selected">' . _MB_EXTCAL_ALL_CAT . '</option>'; |
||||||||
| 109 | } |
||||||||
| 110 | foreach ($cats as $cat) { |
||||||||
| 111 | if (false === array_search($cat->getVar('cat_id'), $options, true)) { |
||||||||
| 112 | $form .= '<option value="' . $cat->getVar('cat_id') . '">' . $cat->getVar('cat_name') . '</option>'; |
||||||||
| 113 | } else { |
||||||||
| 114 | $form .= '<option value="' . $cat->getVar('cat_id') . '" selected="selected">' . $cat->getVar('cat_name') . '</option>'; |
||||||||
| 115 | } |
||||||||
| 116 | } |
||||||||
| 117 | $form .= '</select>'; |
||||||||
| 118 | |||||||||
| 119 | return $form; |
||||||||
| 120 | } |
||||||||
| 121 |