Esempio n. 1
0
/**
 * 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;
}
Esempio n. 2
0
/**
 * 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;
}
Esempio n. 3
0
 $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);
 $xoopsTpl->assign('disc_product_id_selected', $item->getVar('disc_product_id'));
Esempio n. 4
0
    $criteria->setLimit($limit);
    $products = array();
    $products = $oledrion_handlers->h_oledrion_products->getObjects($criteria);
    $javascriptSearch = array("'", '"');
    $javascriptReplace = array(' ', ' ');
    if (count($products) > 0) {
        foreach ($products as $product) {
            $productData = $product->toArray();
            $productData['product_title_javascript'] = str_replace($javascriptSearch, $javascriptReplace, $product->getVar('product_title', 'n'));
            //$productData['product_title_javascript'] = $product->getVar('product_title', 'n');
            $xoopsTpl->append('products', $productData);
        }
    }
}
oledrion_utils::loadLanguageFile('modinfo.php');
oledrion_utils::loadLanguageFile('main.php');
$categoriesSelect = $mytree->makeSelBox('product_cid', 'cat_title', '-', $selectedCategory, '---', 0, "class='selectLists'");
$xoopsTpl->assign('callerName', $callerName);
$xoopsTpl->assign('sart', $start);
$xoopsTpl->assign('theme_set', xoops_getcss($xoopsConfig['theme_set']));
$xoopsTpl->assign('xoopsConfig', $xoopsConfig);
$xoopsTpl->assign('mutipleSelect', $mutipleSelect);
$xoopsTpl->assign('searchVendorSelected', $searchVendorSelected);
$xoopsTpl->assign('baseurl', OLEDRION_URL . 'admin/' . basename(__FILE__));
// URL de ce script
$xoopsTpl->assign('searchVendor', $vendors);
$xoopsTpl->assign('searchCriteria', $searchCriterias);
$xoopsTpl->assign('searchField', $searchFields);
$xoopsTpl->assign('searchCategory', $categoriesSelect);
$xoopsTpl->assign('searchFieldSelected', $selectedSearchField);
echo $xoopsTpl->fetch('db:oledrion_productsselector.html');
Esempio n. 5
0
 // ****************************************************************************************************************
 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';
 break;
/**
 * 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;
}