XoopsModules25x /
oledrion
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 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 | * oledrion |
||
| 14 | * |
||
| 15 | * @copyright {@link https://xoops.org/ XOOPS Project} |
||
| 16 | * @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license} |
||
| 17 | * @author Hervé Thouzard (http://www.herve-thouzard.com/) |
||
| 18 | */ |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Affiche x produit(s) au hasard |
||
| 22 | * @param $options |
||
| 23 | * @return array|bool |
||
| 24 | */ |
||
| 25 | View Code Duplication | function b_oledrion_random_show($options) |
|
| 26 | { |
||
| 27 | // '10|0|0'; // Voir 10 produits, pour toutes les catégories ou une catégorie particulière, et pour ce mois-ci ou pour tout le temps ? |
||
| 28 | global $xoopsConfig, $xoTheme; |
||
| 29 | include XOOPS_ROOT_PATH . '/modules/oledrion/include/common.php'; |
||
| 30 | $products = $block = array(); |
||
| 31 | $start = 0; |
||
| 32 | $limit = $options[0]; |
||
| 33 | $categoryId = $options[1]; |
||
| 34 | $thisMonthOnly = (int)$options[2]; |
||
| 35 | |||
| 36 | $oledrion_shelf_parameters->resetDefaultValues()->setProductsType('random')->setStart($start)->setLimit($limit)->setSort('RAND()')->setCategory($categoryId)->setThisMonthOnly($thisMonthOnly); |
||
| 37 | $products = $oledrion_shelf->getProducts($oledrion_shelf_parameters); |
||
| 38 | |||
| 39 | if (isset($products['lastTitle'])) { |
||
| 40 | unset($products['lastTitle']); |
||
| 41 | } |
||
| 42 | if (count($products) > 0) { |
||
| 43 | $block['nostock_msg'] = OledrionUtility::getModuleOption('nostock_msg'); |
||
| 44 | $block['block_products'] = $products; |
||
| 45 | $xoTheme->addStylesheet(OLEDRION_URL . 'assets/css/oledrion.css'); |
||
| 46 | |||
| 47 | return $block; |
||
| 48 | } else { |
||
| 49 | return false; |
||
| 50 | } |
||
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * Paramètres du bloc |
||
| 55 | * @param $options |
||
| 56 | * @return string |
||
| 57 | */ |
||
| 58 | function b_oledrion_random_edit($options) |
||
| 59 | { |
||
| 60 | // '10|0|0'; // Voir 10 produits, pour toutes les catégories, pour ce mois-ci ou pour toute la période |
||
| 61 | global $xoopsConfig; |
||
| 62 | include XOOPS_ROOT_PATH . '/modules/oledrion/include/common.php'; |
||
| 63 | require_once OLEDRION_PATH . 'class/tree.php'; |
||
| 64 | $tblCategories = array(); |
||
| 65 | $tblCategories = $h_oledrion_cat->getAllCategories(new Oledrion_parameters()); |
||
| 66 | $mytree = new Oledrion_XoopsObjectTree($tblCategories, 'cat_cid', 'cat_pid'); |
||
| 67 | $form = ''; |
||
| 68 | $checkeds = array('', ''); |
||
| 69 | $checkeds[$options[1]] = 'checked'; |
||
| 70 | $form .= "<table border='0'>"; |
||
| 71 | $form .= '<tr><td>' . _MB_OLEDRION_PRODUCTS_CNT . "</td><td><input type='text' name='options[]' id='options' value='" . $options[0] . "'></td></tr>"; |
||
| 72 | $select = $mytree->makeSelBox('options[]', 'cat_title', '-', $options[1], _MB_OLEDRION_ALL_CATEGORIES); |
||
|
0 ignored issues
–
show
|
|||
| 73 | $form .= '<tr><td>' . _MB_OLEDRION_CATEGORY . '</td><td>' . $select . '</td></tr>'; |
||
| 74 | |||
| 75 | $checked = array('', ''); |
||
| 76 | $checked[$options[2]] = 'checked'; |
||
| 77 | $form .= '<tr><td>' . _MB_OLEDRION_THIS_MONTH . "</td><td><input type='radio' name='options[]' id='options' value='1'" . $checked[1] . '>' . _YES . " <input type='radio' name='options[]' id='options' value='0'" . $checked[0] . '>' . _NO . '</td></tr>'; |
||
| 78 | $form .= '</table>'; |
||
| 79 | |||
| 80 | return $form; |
||
| 81 | } |
||
| 82 | |||
| 83 | /** |
||
| 84 | * Bloc à la volée |
||
| 85 | * @param $options |
||
| 86 | */ |
||
| 87 | View Code Duplication | function b_oledrion_random_show_duplicatable($options) |
|
| 88 | { |
||
| 89 | $options = explode('|', $options); |
||
| 90 | $block = b_oledrion_random_show($options); |
||
| 91 | |||
| 92 | $tpl = new XoopsTpl(); |
||
| 93 | $tpl->assign('block', $block); |
||
| 94 | $tpl->display('db:oledrion_block_random.tpl'); |
||
| 95 | } |
||
| 96 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.