/** * Paramètres du bloc */ function b_oledrion_bestsales_edit($options) { // '10|0'; // Voir 10 produits, pour toutes les catégories require XOOPS_ROOT_PATH . '/modules/oledrion/include/common.php'; require_once OLEDRION_PATH . 'class/tree.php'; $categories = array(); $categories = $h_oledrion_cat->getAllCategories(new oledrion_parameters()); $mytree = new Oledrion_XoopsObjectTree($categories, 'cat_cid', 'cat_pid'); $form = ''; $checkeds = array('', ''); $checkeds[$options[1]] = 'checked'; $form .= "<table border='0'>"; $form .= '<tr><td>' . _MB_OLEDRION_PRODUCTS_CNT . "</td><td><input type='text' name='options[]' id='options' value='" . $options[0] . "' /></td></tr>"; $select = $mytree->makeSelBox('options[]', 'cat_title', '-', $options[1], _MB_OLEDRION_ALL_CATEGORIES); $form .= '<tr><td>' . _MB_OLEDRION_CATEGORY . '</td><td>' . $select . '</td></tr>'; $form .= '</table>'; return $form; }
/** * Paramètres du bloc */ function b_oledrion_new_edit($options) { // '10|0|0'; // Voir 10 produits, pour toutes les catégories, uniquement les produits du mois ? global $xoopsConfig; include XOOPS_ROOT_PATH . '/modules/oledrion/include/common.php'; include_once OLEDRION_PATH . 'class/tree.php'; $tblCategories = array(); $tblCategories = $h_oledrion_cat->getAllCategories(new oledrion_parameters()); $mytree = new Oledrion_XoopsObjectTree($tblCategories, 'cat_cid', 'cat_pid'); $form = ''; $form .= "<table border='0'>"; $form .= '<tr><td>' . _MB_OLEDRION_PRODUCTS_CNT . "</td><td><input type='text' name='options[]' id='options' value='" . $options[0] . "' /></td></tr>"; $select = $mytree->makeSelBox('options[]', 'cat_title', '-', $options[1], _MB_OLEDRION_ALL_CATEGORIES); $form .= '<tr><td>' . _MB_OLEDRION_CATEGORY . '</td><td>' . $select . '</td></tr>'; $checked = array('', ''); $checked[$options[2]] = "checked='checked'"; $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>"; $form .= '</table>'; return $form; }
* * Version : $Id: * **************************************************************************** */ /** * Plan des catégories */ require 'header.php'; $GLOBALS['current_category'] = -1; $xoopsOption['template_main'] = 'oledrion_map.html'; require_once XOOPS_ROOT_PATH . '/header.php'; require_once OLEDRION_PATH . 'class/tree.php'; $xoopsTpl->assign('mod_pref', $mod_pref); // Préférences du module $categories = array(); $categories = $h_oledrion_cat->getAllCategories(new oledrion_parameters()); $mytree = new Oledrion_XoopsObjectTree($categories, 'cat_cid', 'cat_pid'); $tree = $mytree->makeTreeAsArray('cat_title', '-'); foreach ($tree as $key => $value) { if (isset($categories[$key])) { $category = $categories[$key]; $xoopsTpl->append('categories', array('cat_url_rewrited' => $category->getLink(), 'cat_href_title' => $category->getHrefTitle(), 'cat_title' => $value)); } } oledrion_utils::setCSS(); oledrion_utils::loadLanguageFile('modinfo.php'); $xoopsTpl->assign('global_advert', oledrion_utils::getModuleOption('advertisement')); $xoopsTpl->assign('breadcrumb', oledrion_utils::breadcrumb(array(OLEDRION_URL . basename(__FILE__) => _MI_OLEDRION_SMNAME4))); $title = _MI_OLEDRION_SMNAME4 . ' - ' . oledrion_utils::getModuleName(); oledrion_utils::setMetas($title, $title); require_once XOOPS_ROOT_PATH . '/footer.php';
} $discountForTemplate['disc_shipping_type_checked1'] = $disc_shipping_type_checked1; $discountForTemplate['disc_shipping_type_checked2'] = $disc_shipping_type_checked2; $discountForTemplate['disc_shipping_type_checked3'] = $disc_shipping_type_checked3; $discountForTemplate['disc_shipping_type_checked4'] = $disc_shipping_type_checked4; // Groupes $xoopsTpl->assign('disc_groups_selected', $item->getVar('disc_group')); $member_handler =& xoops_gethandler('member'); $groups = array(); $groups = $member_handler->getGroupList(); $groups[0] = _ALL; ksort($groups); $xoopsTpl->assign('disc_groups_options', $groups); // Catégories $categories = $h_oledrion_cat->getAllCategories(new oledrion_parameters()); $mytree = new Oledrion_XoopsObjectTree($categories, 'cat_cid', 'cat_pid'); $categoriesSelect = $mytree->makeSelBox('disc_cat_cid', 'cat_title', '-', $item->getVar('disc_cat_cid'), _ALL); $discountForTemplate['disc_cat_cid_select'] = $categoriesSelect; // Fabricants $vendors = $h_oledrion_vendors->getList(); $vendors[0] = _ALL; ksort($vendors); $xoopsTpl->assign('disc_vendor_id_options', $vendors); $xoopsTpl->assign('disc_vendor_id_selected', $item->getVar('disc_vendor_id')); // Catégorie $xoopsTpl->assign('disc_cat_cid_options', $categoriesSelect); // Produits $products = $h_oledrion_products->getList(); $products[0] = _ALL; ksort($products); $xoopsTpl->assign('disc_product_id_options', $products);
if (!oledrion_utils::isAdmin()) { exit; } $xoopsTpl = new XoopsTpl(); $ts =& MyTextSanitizer::getInstance(); $limit = oledrion_utils::getModuleOption('items_count'); // Nombre maximum d'éléments à afficher dans l'admin $oledrion_handlers = oledrion_handler::getInstance(); $searchFields = array('product_title' => _OLEDRION_TITLE, 'product_summary' => _OLEDRION_SUMMARY, 'product_description' => _OLEDRION_DESCRIPTION, 'product_id' => _AM_OLEDRION_ID, 'product_sku' => _OLEDRION_NUMBER, 'product_extraid' => _OLEDRION_EXTRA_ID); $searchCriterias = array(XOOPS_MATCH_START => _STARTSWITH, XOOPS_MATCH_END => _ENDSWITH, XOOPS_MATCH_EQUAL => _MATCHES, XOOPS_MATCH_CONTAIN => _CONTAINS); $vendors = array(); $vendors = $oledrion_handlers->h_oledrion_vendors->getList(); $vendors[0] = '---'; sort($vendors); $categories = $oledrion_handlers->h_oledrion_cat->getAllCategories(new oledrion_parameters()); $mytree = new Oledrion_XoopsObjectTree($categories, 'cat_cid', 'cat_pid'); $searchVendorSelected = $selectedCategory = $selectedSearchField = 0; $start = isset($_REQUEST['start']) ? intval($_REQUEST['start']) : 0; $mutipleSelect = isset($_REQUEST['mutipleSelect']) ? intval($_REQUEST['mutipleSelect']) : 0; $callerName = isset($_REQUEST['callerName']) ? $_REQUEST['callerName'] : ''; if (isset($_REQUEST['op']) && $_REQUEST['op'] == 'search') { $searchField = isset($_REQUEST['searchField']) ? $_REQUEST['searchField'] : ''; $searchCriteria = isset($_REQUEST['searchCriteria']) ? intval($_REQUEST['searchCriteria']) : ''; $searchText = isset($_REQUEST['searchText']) ? trim($_REQUEST['searchText']) : ''; $searchVendor = isset($_REQUEST['searchVendor']) ? intval($_REQUEST['searchVendor']) : 0; $product_cid = isset($_REQUEST['product_cid']) ? intval($_REQUEST['product_cid']) : 0; $selectedSearchField = $searchField; $xoopsTpl->assign('searchCriteriaSelected', $searchCriteria); $searchVendorSelected = $searchVendor; $selectedCategory = $product_cid; $additionnalParameters = array();
// Création de la newsletter // **************************************************************************************************************** xoops_cp_header(); oledrion_utils::htitle(_MI_OLEDRION_ADMENU7, 4); require_once OLEDRION_PATH . 'class/tree.php'; $sform = new XoopsThemeForm(_MI_OLEDRION_ADMENU7, 'frmnewsletter', $baseurl); $datesTray = new XoopsFormElementTray(_AM_OLEDRION_NEWSLETTER_BETWEEN); $minDate = $maxDate = 0; $h_oledrion_products->getMinMaxPublishedDate($minDate, $maxDate); $date1 = new XoopsFormTextDateSelect('', 'date1', 15, $minDate); $date2 = new XoopsFormTextDateSelect(_AM_OLEDRION_EXPORT_AND, 'date2', 15, $maxDate); $datesTray->addElement($date1); $datesTray->addElement($date2); $sform->addElement($datesTray); $categories = $h_oledrion_cat->getAllCategories(new oledrion_parameters()); $mytree = new Oledrion_XoopsObjectTree($categories, 'cat_cid', 'cat_pid'); $htmlSelect = $mytree->makeSelBox('cat_cid', 'cat_title', '-', 0, _AM_OLEDRION_ALL); $sform->addElement(new XoopsFormLabel(_AM_OLEDRION_IN_CATEGORY, $htmlSelect), true); $sform->addElement(new XoopsFormHidden('op', 'newsletter'), false); $sform->addElement(new XoopsFormHidden('action', 'launch'), false); $sform->addElement(new XoopsFormRadioYN(_AM_OLEDRION_REMOVE_BR, 'removebr', 1), false); $sform->addElement(new XoopsFormRadioYN(_AM_OLEDRION_NEWSLETTER_HTML_TAGS, 'removehtml', 0), false); $sform->addElement(new XoopsFormTextArea(_AM_OLEDRION_NEWSLETTER_HEADER, 'header', '', 4, 70), false); $sform->addElement(new XoopsFormTextArea(_AM_OLEDRION_NEWSLETTER_FOOTER, 'footer', '', 4, 70), false); $button_tray = new XoopsFormElementTray('', ''); $submit_btn = new XoopsFormButton('', 'post', _SUBMIT, 'submit'); $button_tray->addElement($submit_btn); $sform->addElement($button_tray); $sform = oledrion_utils::formMarkRequiredFields($sform); $sform->display(); include_once OLEDRION_ADMIN_PATH . 'admin_footer.php';
/** * Affiche le bloc des catégories en fonction de la catégorie en cours (fonctionne de paire avec les pages du module) */ function b_oledrion_category_show($options) { global $xoopsTpl; $block = array(); include XOOPS_ROOT_PATH . '/modules/oledrion/include/common.php'; $url = OLEDRION_URL . 'include/oledrion.css'; $xoopsTpl->assign("xoops_module_header", "<link rel=\"stylesheet\" type=\"text/css\" href=\"{$url}\" />"); $block['nostock_msg'] = oledrion_utils::getModuleOption('nostock_msg'); if (intval($options[0]) == 0) { // Catégories selon la page en cours $block['block_option'] = 0; if (!isset($GLOBALS['current_category']) || $GLOBALS['current_category'] == -1) { return false; } $cat_cid = intval($GLOBALS['current_category']); include XOOPS_ROOT_PATH . '/modules/oledrion/include/common.php'; if ($cat_cid > 0) { include_once XOOPS_ROOT_PATH . '/class/tree.php'; $tbl_categories = $tblChilds = $tbl_tmp = array(); $tbl_categories = $h_oledrion_cat->getAllCategories(new oledrion_parameters()); $mytree = new XoopsObjectTree($tbl_categories, 'cat_cid', 'cat_pid'); $tblChilds = $mytree->getAllChild($cat_cid); //$tblChilds = array_reverse($tblChilds); foreach ($tblChilds as $item) { $tbl_tmp[] = "<a href='" . $item->getLink() . "' title='" . oledrion_utils::makeHrefTitle($item->getVar('cat_title')) . "'>" . $item->getVar('cat_title') . "</a>"; } $block['block_categories'] = $tbl_tmp; $category = null; if ($cat_cid > 0) { $category = $h_oledrion_cat->get($cat_cid); if (is_object($category)) { $block['block_current_category'] = $category->toArray(); } } } else { // On est à la racine, on n'affiche donc que les catégories mères $tbl_categories = array(); $criteria = new Criteria('cat_pid', 0, '='); $criteria->setSort('cat_title'); $tbl_categories = $h_oledrion_cat->getObjects($criteria, true); foreach ($tbl_categories as $item) { $tbl_tmp[] = "<a href='" . $item->getLink() . "' title='" . oledrion_utils::makeHrefTitle($item->getVar('cat_title')) . "'>" . $item->getVar('cat_title') . "</a>"; } $block['block_categories'] = $tbl_tmp; } } elseif (intval($options[0]) == 1) { // Affichage classique $block['block_option'] = 1; include XOOPS_ROOT_PATH . '/modules/oledrion/include/common.php'; include_once OLEDRION_PATH . 'class/tree.php'; $tbl_categories = $h_oledrion_cat->getAllCategories(new oledrion_parameters()); $mytree = new Oledrion_XoopsObjectTree($tbl_categories, 'cat_cid', 'cat_pid'); $jump = OLEDRION_URL . "category.php?cat_cid="; $additional = "onchange='location=\"" . $jump . "\"+this.options[this.selectedIndex].value'"; if (isset($GLOBALS['current_category']) && $GLOBALS['current_category'] != -1) { $cat_cid = intval($GLOBALS['current_category']); } else { $cat_cid = 0; } $htmlSelect = $mytree->makeSelBox('cat_cid', 'cat_title', '-', $cat_cid, false, 0, $additional); $block['htmlSelect'] = $htmlSelect; } else { // Affichage de toute l'arborescence, dépliée $block['block_option'] = 2; $block['liMenu'] = $h_oledrion_cat->getUlMenu('category_title'); } return $block; }
* **************************************************************************** */ /** * Recherche avancée dans les produits, formulaire de sélection des critères */ if (!defined('XOOPS_ROOT_PATH')) { die('XOOPS root path not defined'); } require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; require_once OLEDRION_PATH . 'class/tree.php'; $sform = new XoopsThemeForm(oledrion_utils::getModuleName() . ' - ' . _OLEDRION_SEARCHFOR, 'productsSearchForm', OLEDRION_URL . 'search.php', 'post'); $sform->addElement(new XoopsFormText(_OLEDRION_TEXT, 'product_text', 50, 255, ''), false); $sform->addElement(new XoopsFormSelectMatchOption(_OLEDRION_TYPE, 'search_type', 3), false); // Sélecteur de catégories **************************************************** $categorySelect = new XoopsFormSelect(_OLEDRION_CATEGORY, 'product_category', 0); $treeObject = new Oledrion_XoopsObjectTree($categories, 'cat_cid', 'cat_pid'); $tree = $treeObject->makeTreeAsArray('cat_title', '-', 0, _OLEDRION_ALL_CATEGORIES); $categorySelect->addOptionArray($tree); $sform->addElement($categorySelect, false); // Sélecteur pour les fabricants ************************************************* $authorSelect = new XoopsFormSelect(_OLEDRION_MANUFACTURER, 'product_manufacturers', 0, 5, true); $tblTmp = array(); $tblTmp[0] = _OLEDRION_ALL_MANUFACTURERS; foreach ($manufacturers as $item) { $tblTmp[$item->getVar('manu_id')] = $item->getVar('manu_commercialname') . ' ' . $item->getVar('manu_name'); } $authorSelect->addOptionArray($tblTmp); $sform->addElement($authorSelect, false); // Sélecteur pour les vendeurs ************************************************* $languageSelect = new XoopsFormSelect(_OLEDRION_VENDOR, 'product_vendors', 0, 1, false); $tblTmp = array();
// On peut afficher les blocs ********************************************************************* $xoopsOption['template_main'] = 'oledrion_category.html'; require_once XOOPS_ROOT_PATH . '/header.php'; $vatArray = $tbl_categories = array(); $limit = oledrion_utils::getModuleOption('perpage'); // Lecture des TVA ******************************************************************************** $vatArray = $h_oledrion_vat->getAllVats(new oledrion_parameters()); // Lecture des catégories ************************************************************************* $categories = $h_oledrion_cat->getAllCategories(new oledrion_parameters()); // Options pour le template *********************************************************************** $xoopsTpl->assign('mod_pref', $mod_pref); // Préférences du module $xoopsTpl->assign('columnsCount', oledrion_utils::getModuleOption('catagory_colums')); require_once OLEDRION_PATH . 'class/tree.php'; $tbl_tmp = array(); $mytree = new Oledrion_XoopsObjectTree($categories, 'cat_cid', 'cat_pid'); $subCategoriesSearched = false; // Si on est sur une catégorie mère ou si on n'a pas spécifié de catégorie if (is_object($category) && $category->getVar('cat_pid') == 0 || $cat_cid == 0) { // On affiche les 4 blocs $xoopsTpl->assign('case', 1); $tblChildsO = $tblChilds = array(); if ($cat_cid != 0) { $tblChilds[] = $cat_cid; } if ($cat_cid > 0) { $tblChildsO = $mytree->getAllChild($cat_cid); foreach ($tblChildsO as $item) { $tblChilds[] = $item->getVar('cat_cid'); } }