Esempio n. 1
0
// 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');
        }
    }
    if (is_object($category)) {
        // On est sur une catégorie particulière
        $xoopsTpl->assign('category', $category->toArray());
        $title = _OLEDRION_CATEGORYC . ' ' . $category->getVar('cat_title') . ' - ' . oledrion_utils::getModuleName();
        if (!oledrion_utils::getModuleOption('manual_meta')) {
            oledrion_utils::setMetas($title, $title);
        } else {
            $pageTitle = xoops_trim($category->getVar('cat_metatitle')) == '' ? $title : $category->getVar('cat_metatitle');
            $metaDescription = xoops_trim($category->getVar('cat_metadescription')) != '' ? $category->getVar('cat_metadescription') : $title;
            $metaKeywords = xoops_trim($category->getVar('cat_metakeywords'));
            oledrion_utils::setMetas($pageTitle, $metaDescription, $metaKeywords);