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 | * ExtGallery Block settings |
||||
4 | * Manage all Blocks |
||||
5 | * |
||||
6 | * You may not change or alter any portion of this comment or credits |
||||
7 | * of supporting developers from this source code or any supporting source code |
||||
8 | * which is considered copyrighted (c) material of the original comment or credit authors. |
||||
9 | * This program is distributed in the hope that it will be useful, |
||||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
||||
12 | * |
||||
13 | * @copyright {@link https://xoops.org/ XOOPS Project} |
||||
14 | * @license GNU GPL 2 (https://www.gnu.org/licenses/old-licenses/gpl-2.0.html) |
||||
15 | * @author Zoullou (http://www.zoullou.net) |
||||
16 | * @package ExtGallery |
||||
17 | * @param array $options |
||||
18 | * @return array |
||||
19 | */ |
||||
20 | |||||
21 | use XoopsModules\Extgallery; |
||||
22 | |||||
23 | // Manage photo blocks |
||||
24 | /** |
||||
25 | * @param array $options |
||||
26 | * @return array |
||||
27 | */ |
||||
28 | function extgalleryPhotoShow($options) |
||||
29 | { |
||||
30 | global $xoopsConfig; |
||||
31 | $photos = []; |
||||
32 | |||||
33 | /** @var Extgallery\PhotoHandler $photoHandler */ |
||||
34 | $photoHandler = Extgallery\Helper::getInstance()->getHandler('PublicPhoto'); |
||||
35 | |||||
36 | $param = ['limit' => $options[0]]; |
||||
37 | $direction = $options[1]; |
||||
38 | $title = $options[2]; |
||||
39 | $photoHandlertype = $options[3]; |
||||
40 | $jquery = $options[4]; |
||||
41 | $ajaxeffect = $options[5]; |
||||
42 | $overlyabg = $options[6]; |
||||
43 | $overlyaw = $options[7]; |
||||
44 | $overlyah = $options[8]; |
||||
45 | $tooltipw = $options[9]; |
||||
46 | $tooltipbw = $options[10]; |
||||
47 | $tooltipbbg = $options[11]; |
||||
48 | $fancyboxbg = $options[12]; |
||||
49 | $fancyboxop = $options[13]; |
||||
50 | $fancyboxtin = $options[14]; |
||||
51 | $fancyboxtout = $options[15]; |
||||
52 | $fancyboxtp = $options[16]; |
||||
53 | $fancyboxshow = $options[17]; |
||||
54 | $prettyphotospeed = $options[18]; |
||||
55 | $prettyphototheme = $options[19]; |
||||
56 | $prettyphotoslidspeed = $options[20]; |
||||
57 | $prettyphotoautoplay = $options[21]; |
||||
58 | $jcarouselhwidth = $options[22]; |
||||
59 | $jcarouselvwidth = $options[23]; |
||||
60 | $jcarouselvheight = $options[24]; |
||||
61 | $column = $options[25]; |
||||
62 | |||||
63 | array_shift($options); |
||||
64 | array_shift($options); |
||||
65 | array_shift($options); |
||||
66 | array_shift($options); |
||||
67 | array_shift($options); |
||||
68 | array_shift($options); |
||||
69 | array_shift($options); |
||||
70 | array_shift($options); |
||||
71 | array_shift($options); |
||||
72 | array_shift($options); |
||||
73 | array_shift($options); |
||||
74 | array_shift($options); |
||||
75 | array_shift($options); |
||||
76 | array_shift($options); |
||||
77 | array_shift($options); |
||||
78 | array_shift($options); |
||||
79 | array_shift($options); |
||||
80 | array_shift($options); |
||||
81 | array_shift($options); |
||||
82 | array_shift($options); |
||||
83 | array_shift($options); |
||||
84 | array_shift($options); |
||||
85 | array_shift($options); |
||||
86 | array_shift($options); |
||||
87 | array_shift($options); |
||||
88 | array_shift($options); |
||||
89 | |||||
90 | $categories = []; |
||||
91 | foreach ($options as $cat) { |
||||
92 | if (0 == $cat) { |
||||
93 | $categories = []; |
||||
94 | break; |
||||
95 | } |
||||
96 | $categories[] = $cat; |
||||
97 | } |
||||
98 | $param['cat'] = $categories; |
||||
99 | |||||
100 | switch ($photoHandlertype) { |
||||
101 | case 'RandomPhoto': |
||||
102 | |||||
103 | $photos = $photoHandler->objectToArray($photoHandler->getRandomPhoto($param)); |
||||
104 | |||||
105 | break; |
||||
106 | case 'LastPhoto': |
||||
107 | |||||
108 | $photos = $photoHandler->objectToArray($photoHandler->getLastPhoto($param)); |
||||
109 | |||||
110 | break; |
||||
111 | case 'TopViewPhoto': |
||||
112 | |||||
113 | $photos = $photoHandler->objectToArray($photoHandler->getTopViewPhoto($param)); |
||||
114 | |||||
115 | break; |
||||
116 | case 'TopRatedPhoto': |
||||
117 | |||||
118 | $photos = $photoHandler->objectToArray($photoHandler->getTopRatedPhoto($param)); |
||||
119 | |||||
120 | break; |
||||
121 | case 'TopEcardPhoto': |
||||
122 | |||||
123 | $photos = $photoHandler->objectToArray($photoHandler->getTopEcardPhoto($param)); |
||||
124 | |||||
125 | break; |
||||
126 | } |
||||
127 | |||||
128 | if ('true' === $jquery && 'none' !== $ajaxeffect) { |
||||
129 | global $xoTheme; |
||||
130 | $xoTheme->addScript('browse.php?Frameworks/jquery/jquery.js'); |
||||
131 | |||||
132 | switch ($ajaxeffect) { |
||||
133 | case 'lightbox': |
||||
134 | |||||
135 | $xoTheme->addScript('browse.php?Frameworks/jquery/plugins/jquery.lightbox.js'); |
||||
136 | $xoTheme->addStylesheet('browse.php?modules/system/css/lightbox.css'); |
||||
137 | |||||
138 | break; |
||||
139 | case 'tooltip': |
||||
140 | |||||
141 | $xoTheme->addScript('browse.php?modules/extgallery/assets/js/tooltip/image.tooltip.js'); |
||||
142 | $xoTheme->addStylesheet('browse.php?modules/extgallery/assets/js/tooltip/image.tooltip.css'); |
||||
143 | |||||
144 | break; |
||||
145 | case 'overlay': |
||||
146 | |||||
147 | $xoTheme->addScript('browse.php?modules/extgallery/assets/js/overlay/overlay.jquery.tools.min.js'); |
||||
148 | $xoTheme->addStylesheet('browse.php?modules/extgallery/assets/js/overlay/overlay.css'); |
||||
149 | |||||
150 | break; |
||||
151 | case 'fancybox': |
||||
152 | |||||
153 | $xoTheme->addScript('browse.php?modules/extgallery/assets/js/fancybox/mousewheel.js'); |
||||
154 | $xoTheme->addScript('browse.php?modules/extgallery/assets/js/fancybox/fancybox.pack.js'); |
||||
155 | $xoTheme->addStylesheet('browse.php?modules/extgallery/assets/js/fancybox/fancybox.css'); |
||||
156 | |||||
157 | break; |
||||
158 | case 'prettyphoto': |
||||
159 | |||||
160 | $xoTheme->addScript('browse.php?modules/extgallery/assets/js/prettyphoto/jquery.prettyPhoto.js'); |
||||
161 | $xoTheme->addStylesheet('browse.php?modules/extgallery/assets/js/prettyphoto/prettyPhoto.css'); |
||||
162 | |||||
163 | break; |
||||
164 | case 'jcarousel': |
||||
165 | |||||
166 | $xoTheme->addScript('browse.php?modules/extgallery/assets/js/jcarousel/jquery.jcarousel.min.js'); |
||||
167 | $xoTheme->addStylesheet('browse.php?modules/extgallery/assets/js/jcarousel/skin.css'); |
||||
168 | |||||
169 | break; |
||||
170 | case 'TosRUs': |
||||
171 | |||||
172 | $xoTheme->addScript('browse.php?modules/extgallery/assets/js/TosRUs/src/js/jquery.tosrus.js'); |
||||
173 | $xoTheme->addStylesheet('browse.php?modules/extgallery/assets/js/TosRUs/src/css/jquery.tosrus.css'); |
||||
174 | $xoTheme->addScript('browse.php?modules/extgallery/assets/js/TosRUs/lib/jquery.hammer.min.js'); |
||||
175 | $xoTheme->addScript('browse.php?modules/extgallery/assets/js/TosRUs/lib/FlameViewportScale.js'); |
||||
176 | |||||
177 | break; |
||||
178 | } |
||||
179 | } |
||||
180 | |||||
181 | if (0 == count($photos)) { |
||||
182 | return []; |
||||
183 | } |
||||
184 | |||||
185 | $ret = [ |
||||
186 | 'photos' => $photos, |
||||
187 | 'column' => $column, |
||||
188 | 'direction' => $direction, |
||||
189 | 'title' => $title, |
||||
190 | 'jquery' => $jquery, |
||||
191 | 'ajaxeffect' => $ajaxeffect, |
||||
192 | 'overlyabg' => $overlyabg, |
||||
193 | 'overlyaw' => $overlyaw, |
||||
194 | 'overlyah' => $overlyah, |
||||
195 | 'tooltipw' => $tooltipw, |
||||
196 | 'tooltipbw' => $tooltipbw, |
||||
197 | 'tooltipbbg' => $tooltipbbg, |
||||
198 | 'fancyboxbg' => $fancyboxbg, |
||||
199 | 'fancyboxop' => $fancyboxop, |
||||
200 | 'fancyboxtin' => $fancyboxtin, |
||||
201 | 'fancyboxtout' => $fancyboxtout, |
||||
202 | 'fancyboxtp' => $fancyboxtp, |
||||
203 | 'fancyboxshow' => $fancyboxshow, |
||||
204 | 'prettyphotospeed' => $prettyphotospeed, |
||||
205 | 'prettyphototheme' => $prettyphototheme, |
||||
206 | 'prettyphotoslidspeed' => $prettyphotoslidspeed, |
||||
207 | 'prettyphotoautoplay' => $prettyphotoautoplay, |
||||
208 | 'jcarouselhwidth' => $jcarouselhwidth, |
||||
209 | 'jcarouselvwidth' => $jcarouselvwidth, |
||||
210 | 'jcarouselvheight' => $jcarouselvheight, |
||||
211 | ]; |
||||
212 | |||||
213 | return $ret; |
||||
214 | } |
||||
215 | |||||
216 | // converts a 2D array in a comma separated list (or separator of our choice) |
||||
217 | /** |
||||
218 | * @param $sep |
||||
219 | * @param array $array |
||||
220 | * |
||||
221 | * @return string |
||||
222 | */ |
||||
223 | function implodeArray2Dextgallery($sep, $array) |
||||
224 | { |
||||
225 | $num = count($array); |
||||
0 ignored issues
–
show
Unused Code
introduced
by
![]() |
|||||
226 | $str = ''; |
||||
227 | foreach ($array as $i => $iValue) { |
||||
228 | if ($i) { |
||||
229 | $str .= $sep; |
||||
230 | } |
||||
231 | $str .= $array[$i]; |
||||
232 | } |
||||
233 | |||||
234 | return $str; |
||||
235 | } |
||||
236 | |||||
237 | // Manage Top Submitter blocks |
||||
238 | /** |
||||
239 | * @param array $options |
||||
240 | * |
||||
241 | * @return string|array |
||||
242 | */ |
||||
243 | function extgalleryTopSubmitterShow($options) |
||||
244 | { |
||||
245 | global $xoopsDB, $xoopsConfig; |
||||
246 | $catauth = ''; |
||||
247 | $block = []; |
||||
248 | if (0 != $options[1]) { |
||||
249 | $cat = array_slice($options, 1); //Get information about categories to display |
||||
250 | $catauth = implodeArray2Dextgallery(',', $cat); //Creation of categories list to use - separated by a coma |
||||
251 | } |
||||
252 | $sql = 'SELECT uid, count(photo_id) AS countphoto FROM ' . $xoopsDB->prefix('extgallery_publicphoto'); |
||||
253 | $sql .= ' WHERE (uid>0)'; |
||||
254 | if (0 != $options[1]) { |
||||
255 | $sql .= ' AND cat_id IN (' . $catauth . ')'; |
||||
256 | } |
||||
257 | $sql .= ' GROUP BY uid ORDER BY countphoto DESC'; |
||||
258 | if ((int)$options[0] > 0) { |
||||
259 | $sql .= ' LIMIT ' . (int)$options[0]; |
||||
260 | } |
||||
261 | $result = $xoopsDB->query($sql); |
||||
262 | if (!$result) { |
||||
263 | return ''; |
||||
264 | } |
||||
265 | while (false !== ($myrow = $xoopsDB->fetchArray($result))) { |
||||
266 | $uid = $myrow['uid']; |
||||
267 | $countphoto = $myrow['countphoto']; |
||||
268 | $uname = \XoopsUser::getUnameFromId($myrow['uid']); |
||||
269 | $block['designers'][] = ['uid' => $uid, 'uname' => $uname, 'countphoto' => $countphoto]; |
||||
270 | } |
||||
271 | |||||
272 | return $block; |
||||
273 | } |
||||
274 | |||||
275 | // Manage Ajax photos |
||||
276 | /** |
||||
277 | * @param array $options |
||||
278 | * |
||||
279 | * @return array |
||||
280 | */ |
||||
281 | function extgalleryAjax($options) |
||||
282 | { |
||||
283 | $photos = []; |
||||
284 | /** @var Extgallery\PhotoHandler $photoHandler */ |
||||
285 | $photoHandler = Extgallery\Helper::getInstance()->getHandler('PublicPhoto'); |
||||
286 | $param = ['limit' => $options[0]]; |
||||
287 | $photoHandlertype = $options[1]; |
||||
288 | $jquery = $options[2]; |
||||
289 | $ajaxeffect = $options[3]; |
||||
290 | $panel_width = $options[4]; |
||||
291 | $panel_height = $options[5]; |
||||
292 | $frame_width = $options[6]; |
||||
293 | $frame_height = $options[7]; |
||||
294 | $background_color = $options[8]; |
||||
295 | $transition_speed = $options[9]; |
||||
296 | $ransition_interval = $options[10]; |
||||
297 | $overlay_height = $options[11]; |
||||
298 | $overlay_color = $options[12]; |
||||
299 | $overlay_text_color = $options[13]; |
||||
300 | $caption_text_color = $options[14]; |
||||
301 | $border = $options[15]; |
||||
302 | $overlay_opacity = $options[16]; |
||||
303 | $overlay_font_size = $options[17]; |
||||
304 | $nav_theme = $options[18]; |
||||
305 | $position = $options[19]; |
||||
306 | $easing = $options[20]; |
||||
307 | $gria_panelwidth = $options[21]; |
||||
308 | $gria_height = $options[22]; |
||||
309 | $gria_bgcolor = $options[23]; |
||||
310 | $gria_bcolor = $options[24]; |
||||
311 | $gria_bgimg = $options[25]; |
||||
312 | $gria_autoplay = $options[26]; |
||||
313 | $gria_transition = $options[27]; |
||||
314 | $gria_tspeed = $options[28]; |
||||
315 | $micro_size = $options[29]; |
||||
316 | |||||
317 | array_shift($options); |
||||
318 | array_shift($options); |
||||
319 | array_shift($options); |
||||
320 | array_shift($options); |
||||
321 | array_shift($options); |
||||
322 | array_shift($options); |
||||
323 | array_shift($options); |
||||
324 | array_shift($options); |
||||
325 | array_shift($options); |
||||
326 | array_shift($options); |
||||
327 | array_shift($options); |
||||
328 | array_shift($options); |
||||
329 | array_shift($options); |
||||
330 | array_shift($options); |
||||
331 | array_shift($options); |
||||
332 | array_shift($options); |
||||
333 | array_shift($options); |
||||
334 | array_shift($options); |
||||
335 | array_shift($options); |
||||
336 | array_shift($options); |
||||
337 | array_shift($options); |
||||
338 | array_shift($options); |
||||
339 | array_shift($options); |
||||
340 | array_shift($options); |
||||
341 | array_shift($options); |
||||
342 | array_shift($options); |
||||
343 | array_shift($options); |
||||
344 | array_shift($options); |
||||
345 | array_shift($options); |
||||
346 | array_shift($options); |
||||
347 | |||||
348 | $categories = []; |
||||
349 | foreach ($options as $cat) { |
||||
350 | if (0 == $cat) { |
||||
351 | $categories = []; |
||||
352 | break; |
||||
353 | } |
||||
354 | $categories[] = $cat; |
||||
355 | } |
||||
356 | |||||
357 | $param['cat'] = $categories; |
||||
358 | |||||
359 | switch ($photoHandlertype) { |
||||
360 | case 'RandomPhoto': |
||||
361 | |||||
362 | $photos = $photoHandler->objectToArray($photoHandler->getRandomPhoto($param)); |
||||
363 | |||||
364 | break; |
||||
365 | case 'LastPhoto': |
||||
366 | |||||
367 | $photos = $photoHandler->objectToArray($photoHandler->getLastPhoto($param)); |
||||
368 | |||||
369 | break; |
||||
370 | case 'TopViewPhoto': |
||||
371 | |||||
372 | $photos = $photoHandler->objectToArray($photoHandler->getTopViewPhoto($param)); |
||||
373 | |||||
374 | break; |
||||
375 | case 'TopRatedPhoto': |
||||
376 | |||||
377 | $photos = $photoHandler->objectToArray($photoHandler->getTopRatedPhoto($param)); |
||||
378 | |||||
379 | break; |
||||
380 | case 'TopEcardPhoto': |
||||
381 | |||||
382 | $photos = $photoHandler->objectToArray($photoHandler->getTopEcardPhoto($param)); |
||||
383 | |||||
384 | break; |
||||
385 | } |
||||
386 | |||||
387 | if ('true' === $jquery) { |
||||
388 | global $xoTheme; |
||||
389 | $xoTheme->addScript('browse.php?Frameworks/jquery/jquery.js'); |
||||
390 | |||||
391 | switch ($ajaxeffect) { |
||||
392 | case 'galleryview': |
||||
393 | |||||
394 | $xoTheme->addScript('browse.php?modules/extgallery/assets/js/galleryview/galleryview.js'); |
||||
395 | $xoTheme->addScript('browse.php?modules/extgallery/assets/js/galleryview/timers.js'); |
||||
396 | $xoTheme->addScript('browse.php?modules/extgallery/assets/js/galleryview/easing.js'); |
||||
397 | $xoTheme->addStylesheet('browse.php?modules/extgallery/assets/js/galleryview/galleryview.css'); |
||||
398 | |||||
399 | break; |
||||
400 | case 'galleria': |
||||
401 | |||||
402 | $xoTheme->addScript('browse.php?modules/extgallery/assets/js/galleria/galleria.js'); |
||||
403 | |||||
404 | break; |
||||
405 | case 'microgallery': |
||||
406 | |||||
407 | $xoTheme->addScript('browse.php?modules/extgallery/assets/js/microgallery/jquery.microgallery.js'); |
||||
408 | $xoTheme->addStylesheet('browse.php?modules/extgallery/assets/js/microgallery/style.css'); |
||||
409 | |||||
410 | break; |
||||
411 | } |
||||
412 | } |
||||
413 | |||||
414 | if (0 == count($photos)) { |
||||
415 | return []; |
||||
416 | } |
||||
417 | |||||
418 | $ret = [ |
||||
419 | 'photos' => $photos, |
||||
420 | 'jquery' => $jquery, |
||||
421 | 'ajaxeffect' => $ajaxeffect, |
||||
422 | 'panel_width' => $panel_width, |
||||
423 | 'panel_height' => $panel_height, |
||||
424 | 'frame_width' => $frame_width, |
||||
425 | 'frame_height' => $frame_height, |
||||
426 | 'background_color' => $background_color, |
||||
427 | 'transition_speed' => $transition_speed, |
||||
428 | 'transition_interval' => $ransition_interval, |
||||
429 | 'overlay_height' => $overlay_height, |
||||
430 | 'overlay_color' => $overlay_color, |
||||
431 | 'overlay_text_color' => $overlay_text_color, |
||||
432 | 'caption_text_color' => $caption_text_color, |
||||
433 | 'border' => $border, |
||||
434 | 'overlay_opacity' => $overlay_opacity, |
||||
435 | 'overlay_font_size' => $overlay_font_size, |
||||
436 | 'nav_theme' => $nav_theme, |
||||
437 | 'position' => $position, |
||||
438 | 'easing' => $easing, |
||||
439 | 'galleria_panelwidth' => $gria_panelwidth, |
||||
440 | 'galleria_height' => $gria_height, |
||||
441 | 'galleria_bgcolor' => $gria_bgcolor, |
||||
442 | 'galleria_bcolor' => $gria_bcolor, |
||||
443 | 'galleria_bgimg' => $gria_bgimg, |
||||
444 | 'galleria_autoplay' => $gria_autoplay, |
||||
445 | 'galleria_transition' => $gria_transition, |
||||
446 | 'galleria_tspeed' => $gria_tspeed, |
||||
447 | 'micro_size' => $micro_size, |
||||
448 | ]; |
||||
449 | |||||
450 | return $ret; |
||||
451 | } |
||||
452 | |||||
453 | // Options photo blocks |
||||
454 | /** |
||||
455 | * @param array $options |
||||
456 | * |
||||
457 | * @return string |
||||
458 | */ |
||||
459 | function extgalleryBlockEdit($options) |
||||
460 | { |
||||
461 | /** @var Extgallery\Category $catHandler */ |
||||
462 | $catHandler = Extgallery\Helper::getInstance()->getHandler('PublicCategory'); |
||||
463 | |||||
464 | $form = _MB_EXTGALLERY_PHOTO_NUMBER . ' : <input name="options[]" size="5" maxlength="255" value="' . $options[0] . '" type="text"><br>'; |
||||
465 | |||||
466 | $Selected = new \XoopsFormSelect(_MB_EXTGALLERY_DIRECTION, 'options[]', $options[1]); |
||||
467 | $Selected->addOption('0', _MB_EXTGALLERY_HORIZONTALLY); |
||||
468 | $Selected->addOption('1', _MB_EXTGALLERY_VERTICALLY); |
||||
469 | $Selected->addOption('2', _MB_EXTGALLERY_TABLE); |
||||
470 | $form .= _MB_EXTGALLERY_DIRECTION . ' : ' . $Selected->render() . '<br>'; |
||||
471 | |||||
472 | $yChecked = ''; |
||||
473 | $nChecked = ''; |
||||
474 | if (1 == $options[2]) { |
||||
475 | $yChecked = ' checked'; |
||||
476 | } else { |
||||
477 | $nChecked = ' checked'; |
||||
478 | } |
||||
479 | |||||
480 | $form .= _MB_EXTGALLERY_DISPLAY_TITLE . ' : <input type="radio" name="options[]" value="1"' . $yChecked . '> ' . _YES . ' <input type="radio" name="options[]" value="0"' . $nChecked . '>' . _NO . '<br>'; |
||||
481 | |||||
482 | $effectTypeSelect = new \XoopsFormSelect(_MB_EXTGALLERY_SHOW_TYPE, 'options[]', $options[3]); |
||||
483 | $effectTypeSelect->addOption('RandomPhoto', _MB_EXTGALLERY_TYPE_OP1); |
||||
484 | $effectTypeSelect->addOption('LastPhoto', _MB_EXTGALLERY_TYPE_OP2); |
||||
485 | $effectTypeSelect->addOption('TopViewPhoto', _MB_EXTGALLERY_TYPE_OP3); |
||||
486 | $effectTypeSelect->addOption('TopRatedPhoto', _MB_EXTGALLERY_TYPE_OP4); |
||||
487 | $effectTypeSelect->addOption('TopEcardPhoto', _MB_EXTGALLERY_TYPE_OP5); |
||||
488 | $form .= _MB_EXTGALLERY_SHOW_TYPE . ' : ' . $effectTypeSelect->render() . '<br>'; |
||||
489 | |||||
490 | $jqSelect = new \XoopsFormSelect(_MB_EXTGALLERY_JQUERY, 'options[]', $options[4]); |
||||
491 | $jqSelect->addOption('true', _MB_EXTGALLERY_TRUE); |
||||
492 | $jqSelect->addOption('false', _MB_EXTGALLERY_FALSE); |
||||
493 | $form .= _MB_EXTGALLERY_JQUERY . ' : ' . $jqSelect->render() . '<br>'; |
||||
494 | |||||
495 | //select option |
||||
496 | $form .= "<fieldset><legend style='font-weight:bold; color:#990000;'>" . _MB_EXTGALLERY_USE_AJAX_EFFECTS . '</legend>'; |
||||
497 | $ajaxeffectSelect = new \XoopsFormSelect(_MB_EXTGALLERY_USE_AJAX_EFFECTS, 'options[]', $options[5]); |
||||
498 | $ajaxeffectSelect->addOption('none', _MB_EXTGALLERY_AJAX_NONE); |
||||
499 | $ajaxeffectSelect->addOption('lightbox', _MB_EXTGALLERY_AJAX_LIGHTBOX); |
||||
500 | $ajaxeffectSelect->addOption('overlay', _MB_EXTGALLERY_AJAX_OVERLAY); |
||||
501 | $ajaxeffectSelect->addOption('tooltip', _MB_EXTGALLERY_AJAX_TOOLTIP); |
||||
502 | $ajaxeffectSelect->addOption('fancybox', _MB_EXTGALLERY_AJAX_FANCYBOX); |
||||
503 | $ajaxeffectSelect->addOption('prettyphoto', _MB_EXTGALLERY_AJAX_PRETTPHOTO); |
||||
504 | $ajaxeffectSelect->addOption('jcarousel', _MB_EXTGALLERY_AJAX_JCAROUSEL); |
||||
505 | $ajaxeffectSelect->addOption('TosRUs', _MB_EXTGALLERY_AJAX_TOSRUS); |
||||
506 | $form .= _MB_EXTGALLERY_USE_AJAX_EFFECTS . ' : ' . $ajaxeffectSelect->render() . '<br>'; |
||||
507 | $form .= '</fieldset><br>'; |
||||
508 | |||||
509 | //for overlay |
||||
510 | $form .= "<fieldset><legend style='font-weight:bold; color:#990000;'>" . _MB_EXTGALLERY_AJAX_OVERLAY . '</legend>'; |
||||
511 | $form .= _MB_EXTGALLERY_OVERLAY_BG . ' : <input name="options[]" size="7" maxlength="7" value="' . $options[6] . '" type="text"><br>'; |
||||
512 | $form .= _MB_EXTGALLERY_OVERLAY_WIDTH . ' : <input name="options[]" size="5" maxlength="5" value="' . $options[7] . '" type="text"><br>'; |
||||
513 | $form .= _MB_EXTGALLERY_OVERLAY_HEIGHT . ' : <input name="options[]" size="5" maxlength="5" value="' . $options[8] . '" type="text"><br>'; |
||||
514 | $form .= '</fieldset><br>'; |
||||
515 | |||||
516 | //for tooltip |
||||
517 | $form .= "<fieldset><legend style='font-weight:bold; color:#990000;'>" . _MB_EXTGALLERY_AJAX_TOOLTIP . '</legend>'; |
||||
518 | $form .= _MB_EXTGALLERY_TOOLTIP_WIDTH . ' : <input name="options[]" size="5" maxlength="5" value="' . $options[9] . '" type="text"><br>'; |
||||
519 | $form .= _MB_EXTGALLERY_TOOLTIP_BORDER_WIDTH . ' : <input name="options[]" size="5" maxlength="5" value="' . $options[10] . '" type="text"><br>'; |
||||
520 | $form .= _MB_EXTGALLERY_TOOLTIP_BORDERCOLOR . ' : <input name="options[]" size="7" maxlength="7" value="' . $options[11] . '" type="text"><br>'; |
||||
521 | $form .= '</fieldset><br>'; |
||||
522 | |||||
523 | //for fancybox |
||||
524 | $form .= "<fieldset><legend style='font-weight:bold; color:#990000;'>" . _MB_EXTGALLERY_AJAX_FANCYBOX . '</legend>'; |
||||
525 | $form .= _MB_EXTGALLERY_FANCYBOX_BGCOLOR . ' : <input name="options[]" size="7" maxlength="7" value="' . $options[12] . '" type="text"><br>'; |
||||
526 | $form .= _MB_EXTGALLERY_FANCYBOX_OPACITY . ' : <input name="options[]" size="5" maxlength="5" value="' . $options[13] . '" type="text"><br>'; |
||||
527 | $fancyboxtinSelect = new \XoopsFormSelect(_MB_EXTGALLERY_FANCYBOX_TIN, 'options[]', $options[14]); |
||||
528 | $fancyboxtinSelect->addOption('none', _MB_EXTGALLERY_FANCYBOX_NONE); |
||||
529 | $fancyboxtinSelect->addOption('elastic', _MB_EXTGALLERY_FANCYBOX_ELASTIC); |
||||
530 | $form .= _MB_EXTGALLERY_FANCYBOX_TIN . ' : ' . $fancyboxtinSelect->render() . '<br>'; |
||||
531 | $fancyboxtoutSelect = new \XoopsFormSelect(_MB_EXTGALLERY_FANCYBOX_TOUT, 'options[]', $options[15]); |
||||
532 | $fancyboxtoutSelect->addOption('none', _MB_EXTGALLERY_FANCYBOX_NONE); |
||||
533 | $fancyboxtoutSelect->addOption('elastic', _MB_EXTGALLERY_FANCYBOX_ELASTIC); |
||||
534 | $form .= _MB_EXTGALLERY_FANCYBOX_TOUT . ' : ' . $fancyboxtoutSelect->render() . '<br>'; |
||||
535 | $fancyboxtpSelect = new \XoopsFormSelect(_MB_EXTGALLERY_FANCYBOX_TITLEPOSITION, 'options[]', $options[16]); |
||||
536 | $fancyboxtpSelect->addOption('over', _MB_EXTGALLERY_FANCYBOX_OVER); |
||||
537 | $fancyboxtpSelect->addOption('inside', _MB_EXTGALLERY_FANCYBOX_INSIDE); |
||||
538 | $fancyboxtpSelect->addOption('outside', _MB_EXTGALLERY_FANCYBOX_OUTSIDE); |
||||
539 | $form .= _MB_EXTGALLERY_FANCYBOX_TITLEPOSITION . ' : ' . $fancyboxtpSelect->render() . '<br>'; |
||||
540 | $fancyboxshowSelect = new \XoopsFormSelect(_MB_EXTGALLERY_FANCYBOX_SHOWTYPE, 'options[]', $options[17]); |
||||
541 | $fancyboxshowSelect->addOption('single', _MB_EXTGALLERY_FANCYBOX_SINGLE); |
||||
542 | $fancyboxshowSelect->addOption('group', _MB_EXTGALLERY_FANCYBOX_GROUP); |
||||
543 | $form .= _MB_EXTGALLERY_FANCYBOX_SHOWTYPE . ' : ' . $fancyboxshowSelect->render() . '<br>'; |
||||
544 | $form .= '</fieldset><br>'; |
||||
545 | |||||
546 | //for prettyphoto |
||||
547 | $form .= "<fieldset><legend style='font-weight:bold; color:#990000;'>" . _MB_EXTGALLERY_AJAX_PRETTPHOTO . '</legend>'; |
||||
548 | $prettyspeedSelect = new \XoopsFormSelect(_MB_EXTGALLERY_PRETTPHOTO_SPEED, 'options[]', $options[18]); |
||||
549 | $prettyspeedSelect->addOption('fast', _MB_EXTGALLERY_PRETTPHOTO_FAST); |
||||
550 | $prettyspeedSelect->addOption('slow', _MB_EXTGALLERY_PRETTPHOTO_SLOW); |
||||
551 | $form .= _MB_EXTGALLERY_PRETTPHOTO_SPEED . ' : ' . $prettyspeedSelect->render() . '<br>'; |
||||
552 | $prettythemeSelect = new \XoopsFormSelect(_MB_EXTGALLERY_PRETTPHOTO_THEME, 'options[]', $options[19]); |
||||
553 | $prettythemeSelect->addOption('dark_rounded', _MB_EXTGALLERY_PRETTPHOTO_THEME1); |
||||
554 | $prettythemeSelect->addOption('dark_square', _MB_EXTGALLERY_PRETTPHOTO_THEME2); |
||||
555 | $prettythemeSelect->addOption('facebook', _MB_EXTGALLERY_PRETTPHOTO_THEME3); |
||||
556 | $prettythemeSelect->addOption('light_rounded', _MB_EXTGALLERY_PRETTPHOTO_THEME4); |
||||
557 | $prettythemeSelect->addOption('light_square', _MB_EXTGALLERY_PRETTPHOTO_THEME5); |
||||
558 | $form .= _MB_EXTGALLERY_PRETTPHOTO_THEME . ' : ' . $prettythemeSelect->render() . '<br>'; |
||||
559 | $form .= _MB_EXTGALLERY_PRETTPHOTO_SLIDESPEED . ' : <input name="options[]" size="5" maxlength="5" value="' . $options[20] . '" type="text"><br>'; |
||||
560 | $prettyautoplaySelect = new \XoopsFormSelect(_MB_EXTGALLERY_PRETTPHOTO_AUTOPLAY, 'options[]', $options[21]); |
||||
561 | $prettyautoplaySelect->addOption('true', _MB_EXTGALLERY_TRUE); |
||||
562 | $prettyautoplaySelect->addOption('false', _MB_EXTGALLERY_FALSE); |
||||
563 | $form .= _MB_EXTGALLERY_PRETTPHOTO_AUTOPLAY . ' : ' . $prettyautoplaySelect->render() . '<br>'; |
||||
564 | $form .= '</fieldset><br>'; |
||||
565 | |||||
566 | //for jcarousel |
||||
567 | $form .= "<fieldset><legend style='font-weight:bold; color:#990000;'>" . _MB_EXTGALLERY_AJAX_JCAROUSEL . '</legend>'; |
||||
568 | $form .= _MB_EXTGALLERY_JCAROUSEL_HWIDTH . ' : <input name="options[]" size="7" maxlength="7" value="' . $options[22] . '" type="text"><br>'; |
||||
569 | $form .= _MB_EXTGALLERY_JCAROUSEL_VWIDTH . ' : <input name="options[]" size="7" maxlength="7" value="' . $options[23] . '" type="text"><br>'; |
||||
570 | $form .= _MB_EXTGALLERY_JCAROUSEL_VHIGHT . ' : <input name="options[]" size="7" maxlength="7" value="' . $options[24] . '" type="text"><br>'; |
||||
571 | $form .= '</fieldset><br>'; |
||||
572 | |||||
573 | $form .= "<fieldset><legend style='font-weight:bold; color:#990000;'>" . _MB_EXTGALLERY_TABLE . '</legend>'; |
||||
574 | $form .= _MB_EXTGALLERY_PHOTO_NUMBER_TABLE . ' : <input name="options[]" size="5" maxlength="255" value="' . $options[25] . '" type="text"><br>'; |
||||
575 | $form .= '</fieldset><br>'; |
||||
576 | |||||
577 | array_shift($options); |
||||
578 | array_shift($options); |
||||
579 | array_shift($options); |
||||
580 | array_shift($options); |
||||
581 | array_shift($options); |
||||
582 | array_shift($options); |
||||
583 | array_shift($options); |
||||
584 | array_shift($options); |
||||
585 | array_shift($options); |
||||
586 | array_shift($options); |
||||
587 | array_shift($options); |
||||
588 | array_shift($options); |
||||
589 | array_shift($options); |
||||
590 | array_shift($options); |
||||
591 | array_shift($options); |
||||
592 | array_shift($options); |
||||
593 | array_shift($options); |
||||
594 | array_shift($options); |
||||
595 | array_shift($options); |
||||
596 | array_shift($options); |
||||
597 | array_shift($options); |
||||
598 | array_shift($options); |
||||
599 | array_shift($options); |
||||
600 | array_shift($options); |
||||
601 | array_shift($options); |
||||
602 | array_shift($options); |
||||
603 | |||||
604 | $form .= $catHandler->getBlockSelect($options); |
||||
0 ignored issues
–
show
The method
getBlockSelect() does not exist on XoopsModules\Extgallery\Category .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||||
605 | |||||
606 | return $form; |
||||
607 | } |
||||
608 | |||||
609 | // Options Ajax photos |
||||
610 | /** |
||||
611 | * @param array $options |
||||
612 | * |
||||
613 | * @return string |
||||
614 | */ |
||||
615 | function extgalleryAjaxEdit($options) |
||||
616 | { |
||||
617 | $catHandler = Extgallery\Helper::getInstance()->getHandler('PublicCategory'); |
||||
618 | |||||
619 | $form = _MB_EXTGALLERY_PHOTO_NUMBER . ' : <input name="options[]" size="5" maxlength="255" value="' . $options[0] . '" type="text"><br>'; |
||||
620 | |||||
621 | $showTypeSelect = new \XoopsFormSelect(_MB_EXTGALLERY_SHOW_TYPE, 'options[]', $options[1]); |
||||
622 | $showTypeSelect->addOption('RandomPhoto', _MB_EXTGALLERY_TYPE_OP1); |
||||
623 | $showTypeSelect->addOption('LastPhoto', _MB_EXTGALLERY_TYPE_OP2); |
||||
624 | $showTypeSelect->addOption('TopViewPhoto', _MB_EXTGALLERY_TYPE_OP3); |
||||
625 | $showTypeSelect->addOption('TopRatedPhoto', _MB_EXTGALLERY_TYPE_OP4); |
||||
626 | $showTypeSelect->addOption('TopEcardPhoto', _MB_EXTGALLERY_TYPE_OP5); |
||||
627 | $form .= _MB_EXTGALLERY_SHOW_TYPE . ' : ' . $showTypeSelect->render() . '<br>'; |
||||
628 | |||||
629 | $jqSelect = new \XoopsFormSelect(_MB_EXTGALLERY_JQUERY, 'options[]', $options[2]); |
||||
630 | $jqSelect->addOption('true', _MB_EXTGALLERY_TRUE); |
||||
631 | $jqSelect->addOption('false', _MB_EXTGALLERY_FALSE); |
||||
632 | $form .= _MB_EXTGALLERY_JQUERY . ' : ' . $jqSelect->render() . '<br>'; |
||||
633 | |||||
634 | //select option |
||||
635 | $form .= "<fieldset><legend style='font-weight:bold; color:#990000;'>" . _MB_EXTGALLERY_USE_AJAX_EFFECTS . '</legend>'; |
||||
636 | $ajaxeffectSelect = new \XoopsFormSelect(_MB_EXTGALLERY_USE_AJAX_EFFECTS, 'options[]', $options[3]); |
||||
637 | $ajaxeffectSelect->addOption('galleryview', _MB_EXTGALLERY_GVIEW); |
||||
638 | $ajaxeffectSelect->addOption('galleria', _MB_EXTGALLERY_GRIA); |
||||
639 | $ajaxeffectSelect->addOption('microgallery', _MB_EXTGALLERY_MICRO); |
||||
640 | $form .= _MB_EXTGALLERY_USE_AJAX_EFFECTS . ' : ' . $ajaxeffectSelect->render() . '<br>'; |
||||
641 | $form .= '</fieldset><br>'; |
||||
642 | |||||
643 | $form .= "<fieldset><legend style='font-weight:bold; color:#990000;'>" . _MB_EXTGALLERY_GVIEW . '</legend>'; |
||||
644 | $form .= _MB_EXTGALLERY_PANEL_WIDTH . ' : <input name="options[]" size="5" maxlength="255" value="' . $options[4] . '" type="text"><br>'; |
||||
645 | $form .= _MB_EXTGALLERY_PANEL_HEIGHT . ' : <input name="options[]" size="5" maxlength="255" value="' . $options[5] . '" type="text"><br>'; |
||||
646 | $form .= _MB_EXTGALLERY_FRAME_WIDTH . ' : <input name="options[]" size="5" maxlength="255" value="' . $options[6] . '" type="text"><br>'; |
||||
647 | $form .= _MB_EXTGALLERY_FRAME_HEIGHT . ' : <input name="options[]" size="5" maxlength="255" value="' . $options[7] . '" type="text"><br>'; |
||||
648 | $form .= _MB_EXTGALLERY_BACKGROUND . ' : <input name="options[]" size="6" maxlength="255" value="' . $options[8] . '" type="text"><br>'; |
||||
649 | $form .= _MB_EXTGALLERY_TRANSITION_SPEED . ' : <input name="options[]" size="6" maxlength="255" value="' . $options[9] . '" type="text"><br>'; |
||||
650 | $form .= _MB_EXTGALLERY_TRANSITION_INTERVAL . ' : <input name="options[]" size="6" maxlength="255" value="' . $options[10] . '" type="text"><br>'; |
||||
651 | $form .= _MB_EXTGALLERY_OVERLAY_HEIGHT . ' : <input name="options[]" size="6" maxlength="255" value="' . $options[11] . '" type="text"><br>'; |
||||
652 | $form .= _MB_EXTGALLERY_OVERLAY_COLOR . ' : <input name="options[]" size="6" maxlength="255" value="' . $options[12] . '" type="text"><br>'; |
||||
653 | $form .= _MB_EXTGALLERY_OVERLAY_TEXT_COLOR . ' : <input name="options[]" size="6" maxlength="255" value="' . $options[13] . '" type="text"><br>'; |
||||
654 | $form .= _MB_EXTGALLERY_CAPTION_TEXT_COLOR . ' : <input name="options[]" size="6" maxlength="255" value="' . $options[14] . '" type="text"><br>'; |
||||
655 | $form .= _MB_EXTGALLERY_BORDER . ' : <input name="options[]" size="20" maxlength="255" value="' . $options[15] . '" type="text"><br>'; |
||||
656 | $form .= _MB_EXTGALLERY_OVERLAY_OPACITY . ' : <input name="options[]" size="6" maxlength="255" value="' . $options[16] . '" type="text"><br>'; |
||||
657 | $form .= _MB_EXTGALLERY_OVERLAY_FONT_SIZE . ' : <input name="options[]" size="6" maxlength="255" value="' . $options[17] . '" type="text"><br>'; |
||||
658 | $themeSelect = new \XoopsFormSelect(_MB_EXTGALLERY_SELECT_THEME, 'options[]', $options[18]); |
||||
659 | $themeSelect->addOption('light', _MB_EXTGALLERY_LIGHT); |
||||
660 | $themeSelect->addOption('dark', _MB_EXTGALLERY_DARK); |
||||
661 | $themeSelect->addOption('custom', _MB_EXTGALLERY_CUSTOM); |
||||
662 | $form .= _MB_EXTGALLERY_SELECT_THEME . ' : ' . $themeSelect->render() . '<br>'; |
||||
663 | $positionSelect = new \XoopsFormSelect(_MB_EXTGALLERY_POSITION, 'options[]', $options[19]); |
||||
664 | $positionSelect->addOption('bottom', _MB_EXTGALLERY_BOTTOM); |
||||
665 | $positionSelect->addOption('top', _MB_EXTGALLERY_TOP); |
||||
666 | $form .= _MB_EXTGALLERY_POSITION . ' : ' . $positionSelect->render() . '<br>'; |
||||
667 | $easingSelect = new \XoopsFormSelect(_MB_EXTGALLERY_EASING, 'options[]', $options[20]); |
||||
668 | $easingSelect->addOption('swing', _MB_EXTGALLERY_EASING_OP1); |
||||
669 | $easingSelect->addOption('linear', _MB_EXTGALLERY_EASING_OP2); |
||||
670 | $easingSelect->addOption('easeInOutBack', _MB_EXTGALLERY_EASING_OP3); |
||||
671 | $easingSelect->addOption('easeInOutQuad', _MB_EXTGALLERY_EASING_OP4); |
||||
672 | $easingSelect->addOption('easeOutBounce', _MB_EXTGALLERY_EASING_OP5); |
||||
673 | $form .= _MB_EXTGALLERY_EASING . ' : ' . $easingSelect->render() . '<br>'; |
||||
674 | $form .= '</fieldset><br>'; |
||||
675 | |||||
676 | $form .= "<fieldset><legend style='font-weight:bold; color:#990000;'>" . _MB_EXTGALLERY_GRIA . '</legend>'; |
||||
677 | $form .= _MB_EXTGALLERY_GRIA_WIDTH . ' : <input name="options[]" size="5" maxlength="255" value="' . $options[21] . '" type="text"><br>'; |
||||
678 | $form .= _MB_EXTGALLERY_GRIA_HEIGHT . ' : <input name="options[]" size="5" maxlength="255" value="' . $options[22] . '" type="text"><br>'; |
||||
679 | $form .= _MB_EXTGALLERY_GRIA_BGCOLOR . ' : <input name="options[]" size="7" maxlength="255" value="' . $options[23] . '" type="text"><br>'; |
||||
680 | $form .= _MB_EXTGALLERY_GRIA_BCOLOR . ' : <input name="options[]" size="7" maxlength="255" value="' . $options[24] . '" type="text"><br>'; |
||||
681 | $bgimgSelect = new \XoopsFormSelect(_MB_EXTGALLERY_GRIA_BGIMG, 'options[]', $options[25]); |
||||
682 | $bgimgSelect->addOption('classic-map', _MB_EXTGALLERY_GRIA_BGIMG_OP1); |
||||
683 | $bgimgSelect->addOption('classic-map-b', _MB_EXTGALLERY_GRIA_BGIMG_OP2); |
||||
684 | $form .= _MB_EXTGALLERY_GRIA_BGIMG . ' : ' . $bgimgSelect->render() . '<br>'; |
||||
685 | |||||
686 | $autoplaySelect = new \XoopsFormSelect(_MB_EXTGALLERY_GRIA_AUTOPLAY, 'options[]', $options[26]); |
||||
687 | $autoplaySelect->addOption('true', _MB_EXTGALLERY_TRUE); |
||||
688 | $autoplaySelect->addOption('false', _MB_EXTGALLERY_FALSE); |
||||
689 | $form .= _MB_EXTGALLERY_GRIA_AUTOPLAY . ' : ' . $autoplaySelect->render() . '<br>'; |
||||
690 | $select_trans = new \XoopsFormSelect(_MB_EXTGALLERY_GRIA_TRANS, 'options[]', $options[27]); |
||||
691 | $select_trans->addOption('fade', _MB_EXTGALLERY_GRIA_TRANS_TYP1); |
||||
692 | $select_trans->addOption('flash', _MB_EXTGALLERY_GRIA_TRANS_TYP2); |
||||
693 | $select_trans->addOption('pulse', _MB_EXTGALLERY_GRIA_TRANS_TYP3); |
||||
694 | $select_trans->addOption('slide', _MB_EXTGALLERY_GRIA_TRANS_TYP4); |
||||
695 | $select_trans->addOption('fadeslide', _MB_EXTGALLERY_GRIA_TRANS_TYP5); |
||||
696 | $form .= _MB_EXTGALLERY_GRIA_TRANS . ' : ' . $select_trans->render() . '<br>'; |
||||
697 | $form .= _MB_EXTGALLERY_GRIA_TSPEED . ' : <input name="options[]" size="5" maxlength="255" value="' . $options[28] . '" type="text"><br>'; |
||||
698 | |||||
699 | $form .= '</fieldset><br>'; |
||||
700 | |||||
701 | $form .= "<fieldset><legend style='font-weight:bold; color:#990000;'>" . _MB_EXTGALLERY_MICRO . '</legend>'; |
||||
702 | $sizeSelect = new \XoopsFormSelect(_MB_EXTGALLERY_MICRO_SIZE, 'options[]', $options[29]); |
||||
703 | $sizeSelect->addOption('small', _MB_EXTGALLERY_MICRO_SIZE_OP1); |
||||
704 | $sizeSelect->addOption('medium', _MB_EXTGALLERY_MICRO_SIZE_OP2); |
||||
705 | $sizeSelect->addOption('large', _MB_EXTGALLERY_MICRO_SIZE_OP3); |
||||
706 | $form .= _MB_EXTGALLERY_MICRO_SIZE . ' : ' . $sizeSelect->render() . '<br>'; |
||||
707 | $form .= '</fieldset><br>'; |
||||
708 | |||||
709 | array_shift($options); |
||||
710 | array_shift($options); |
||||
711 | array_shift($options); |
||||
712 | array_shift($options); |
||||
713 | array_shift($options); |
||||
714 | array_shift($options); |
||||
715 | array_shift($options); |
||||
716 | array_shift($options); |
||||
717 | array_shift($options); |
||||
718 | array_shift($options); |
||||
719 | array_shift($options); |
||||
720 | array_shift($options); |
||||
721 | array_shift($options); |
||||
722 | array_shift($options); |
||||
723 | array_shift($options); |
||||
724 | array_shift($options); |
||||
725 | array_shift($options); |
||||
726 | array_shift($options); |
||||
727 | array_shift($options); |
||||
728 | array_shift($options); |
||||
729 | array_shift($options); |
||||
730 | array_shift($options); |
||||
731 | array_shift($options); |
||||
732 | array_shift($options); |
||||
733 | array_shift($options); |
||||
734 | array_shift($options); |
||||
735 | array_shift($options); |
||||
736 | array_shift($options); |
||||
737 | array_shift($options); |
||||
738 | array_shift($options); |
||||
739 | |||||
740 | $form .= $catHandler->getBlockSelect($options); |
||||
741 | |||||
742 | return $form; |
||||
743 | } |
||||
744 | |||||
745 | // Options TopSubmiter |
||||
746 | /** |
||||
747 | * @param array $options |
||||
748 | * |
||||
749 | * @return string |
||||
750 | */ |
||||
751 | function extgalleryTopSubmitterEdit($options) |
||||
752 | { |
||||
753 | $catHandler = Extgallery\Helper::getInstance()->getHandler('PublicCategory'); |
||||
754 | |||||
755 | $form = _MB_EXTGALLERY_USER_NUMBER . ' : <input name="options[]" size="5" maxlength="255" value="' . $options[0] . '" type="text"><br>'; |
||||
756 | |||||
757 | array_shift($options); |
||||
758 | |||||
759 | $form .= $catHandler->getBlockSelect($options); |
||||
760 | |||||
761 | return $form; |
||||
762 | } |
||||
763 | |||||
764 | /** |
||||
765 | * @param array $options |
||||
766 | * |
||||
767 | * @return array |
||||
768 | */ |
||||
769 | function extgalleryList($options) |
||||
770 | { |
||||
771 | global $xoopsConfig; |
||||
772 | |||||
773 | /** @var Extgallery\PhotoHandler $photoHandler */ |
||||
774 | $photoHandler = Extgallery\Helper::getInstance()->getHandler('PublicPhoto'); |
||||
775 | $param = ['limit' => $options[0]]; |
||||
776 | $date = $options[1]; |
||||
777 | $hits = $options[2]; |
||||
778 | $rate = $options[3]; |
||||
779 | $photoHandlertype = $options[4]; |
||||
780 | |||||
781 | array_shift($options); |
||||
782 | array_shift($options); |
||||
783 | array_shift($options); |
||||
784 | array_shift($options); |
||||
785 | array_shift($options); |
||||
786 | |||||
787 | $categories = []; |
||||
788 | foreach ($options as $cat) { |
||||
789 | if (0 == $cat) { |
||||
790 | $categories = []; |
||||
791 | break; |
||||
792 | } |
||||
793 | $categories[] = $cat; |
||||
794 | } |
||||
795 | $param['cat'] = $categories; |
||||
796 | |||||
797 | switch ($photoHandlertype) { |
||||
798 | case 'RandomPhoto': |
||||
799 | |||||
800 | $photos = $photoHandler->objectToArray($photoHandler->getRandomPhoto($param)); |
||||
801 | |||||
802 | break; |
||||
803 | case 'LastPhoto': |
||||
804 | |||||
805 | $photos = $photoHandler->objectToArray($photoHandler->getLastPhoto($param)); |
||||
806 | |||||
807 | break; |
||||
808 | case 'TopViewPhoto': |
||||
809 | |||||
810 | $photos = $photoHandler->objectToArray($photoHandler->getTopViewPhoto($param)); |
||||
811 | |||||
812 | break; |
||||
813 | case 'TopRatedPhoto': |
||||
814 | |||||
815 | $photos = $photoHandler->objectToArray($photoHandler->getTopRatedPhoto($param)); |
||||
816 | |||||
817 | break; |
||||
818 | case 'TopEcardPhoto': |
||||
819 | |||||
820 | $photos = $photoHandler->objectToArray($photoHandler->getTopEcardPhoto($param)); |
||||
821 | |||||
822 | break; |
||||
823 | } |
||||
824 | |||||
825 | if (0 == count($photos)) { |
||||
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
|
|||||
826 | return []; |
||||
827 | } |
||||
828 | |||||
829 | foreach (array_keys($photos) as $i) { |
||||
830 | if (isset($photos[$i]['photo_date'])) { |
||||
831 | $photos[$i]['photo_date'] = date(_SHORTDATESTRING, $photos[$i]['photo_date']); |
||||
832 | } |
||||
833 | } |
||||
834 | |||||
835 | $ret = [ |
||||
836 | 'photos' => $photos, |
||||
837 | 'date' => $date, |
||||
838 | 'hits' => $hits, |
||||
839 | 'rate' => $rate, |
||||
840 | ]; |
||||
841 | |||||
842 | return $ret; |
||||
843 | } |
||||
844 | |||||
845 | /** |
||||
846 | * @param array $options |
||||
847 | * |
||||
848 | * @return string |
||||
849 | */ |
||||
850 | function extgalleryListEdit($options) |
||||
851 | { |
||||
852 | $catHandler = Extgallery\Helper::getInstance()->getHandler('PublicCategory'); |
||||
853 | $form = _MB_EXTGALLERY_PHOTO_NUMBER . ' : <input name="options[]" size="5" maxlength="255" value="' . $options[0] . '" type="text"><br>'; |
||||
854 | //================================== |
||||
855 | $y2Checked = ''; |
||||
856 | $n2Checked = ''; |
||||
857 | if (1 == $options[1]) { |
||||
858 | $y2Checked = ' checked'; |
||||
859 | } else { |
||||
860 | $n2Checked = ' checked'; |
||||
861 | } |
||||
862 | $form .= _MB_EXTGALLERY_DISPLAY_DATE . ' : <input type="radio" name="options[1]" value="1"' . $y2Checked . '> ' . _YES . ' <input type="radio" name="options[1]" value="0"' . $n2Checked . '>' . _NO . '<br>'; |
||||
863 | //================================== |
||||
864 | $y3Checked = ''; |
||||
865 | $n3Checked = ''; |
||||
866 | if (1 == $options[2]) { |
||||
867 | $y3Checked = ' checked'; |
||||
868 | } else { |
||||
869 | $n3Checked = ' checked'; |
||||
870 | } |
||||
871 | $form .= _MB_EXTGALLERY_DISPLAY_HITS . ' : <input type="radio" name="options[2]" value="1"' . $y3Checked . '> ' . _YES . ' <input type="radio" name="options[2]" value="0"' . $n3Checked . '>' . _NO . '<br>'; |
||||
872 | //================================== |
||||
873 | $y4Checked = ''; |
||||
874 | $n4Checked = ''; |
||||
875 | if (1 == $options[3]) { |
||||
876 | $y4Checked = ' checked'; |
||||
877 | } else { |
||||
878 | $n4Checked = ' checked'; |
||||
879 | } |
||||
880 | $form .= _MB_EXTGALLERY_DISPLAY_RATE . ' : <input type="radio" name="options[3]" value="1"' . $y4Checked . '> ' . _YES . ' <input type="radio" name="options[3]" value="0"' . $n4Checked . '>' . _NO . '<br>'; |
||||
881 | //================================== |
||||
882 | $effectTypeSelect = new \XoopsFormSelect(_MB_EXTGALLERY_SHOW_TYPE, 'options[]', $options[4]); |
||||
883 | $effectTypeSelect->addOption('RandomPhoto', _MB_EXTGALLERY_TYPE_OP1); |
||||
884 | $effectTypeSelect->addOption('LastPhoto', _MB_EXTGALLERY_TYPE_OP2); |
||||
885 | $effectTypeSelect->addOption('TopViewPhoto', _MB_EXTGALLERY_TYPE_OP3); |
||||
886 | $effectTypeSelect->addOption('TopRatedPhoto', _MB_EXTGALLERY_TYPE_OP4); |
||||
887 | $effectTypeSelect->addOption('TopEcardPhoto', _MB_EXTGALLERY_TYPE_OP5); |
||||
888 | $form .= _MB_EXTGALLERY_SHOW_TYPE . ' : ' . $effectTypeSelect->render() . '<br>'; |
||||
889 | |||||
890 | array_shift($options); |
||||
891 | array_shift($options); |
||||
892 | array_shift($options); |
||||
893 | array_shift($options); |
||||
894 | array_shift($options); |
||||
895 | |||||
896 | $form .= $catHandler->getBlockSelect($options); |
||||
897 | |||||
898 | return $form; |
||||
899 | } |
||||
900 |