예제 #1
0
/**
 *Retrieve content for the current category
 *
 *param $categoryid - id of the current category
 *return array of content for the current category
 */
function get_cat_content($every_categories_array, $categoryObj, $level)
{
    $category = array();
    $decalage = '';
    /*for($i=0;$i<$level;$i++){
          $decalage .= '--';
      }*/
    $decalage .= ' ';
    $category['title'] = $decalage . '' . $categoryObj->name();
    $category['categoryid'] = $categoryObj->categoryid();
    $category['description'] = $categoryObj->description();
    $category['link_view'] = $categoryObj->getCategoryUrl();
    $category['partners'] = get_partners_array($categoryObj->categoryid());
    $category['image_url'] = $categoryObj->getImageUrl(true);
    $category['subcats'] = get_subcats($every_categories_array, $categoryObj->categoryid(), $level);
    return $category;
}
예제 #2
0
        $tpl->set_var('p_nom', $nom);
        $tpl->set_var('p_menu', $menu);
        $tpl->set_var('p_mail', $data['AEP_EMAIL']);
        $tpl->set_var('p_tel', $data['AEP_TEL']);
        $tpl->set_var('p_mobile', $data['AEP_MOBILE']);
        $tpl->set_var('p_fonction', $data['AEP_FONCTION']);
        $tpl->parse('personnes_block', 'personnes', true);
    }
}
// ------------------------------------------------
// ------------------------------------------------
// suppression -------------------------------
if ($_GET['action'] == 'supprimer') {
    if ($_GET['cat_id']) {
        $tabcat = array();
        $where = get_subcats($_GET['cat_id']);
        $db->query('DELETE FROM `CATEGORIES` WHERE `CAT_ID` IN ' . $where);
    } elseif ($_GET['ent_id']) {
        $tabent = array();
        $where = get_subents($_GET['ent_id']);
        $db->query('DELETE FROM `ENTITES` WHERE `ENT_ID` IN ' . $where);
    }
}
// -------------------------------------------
$tabcat = array();
$tabent = array();
// ON NAVIGUE DANS LES CATEGORIE
if ($_GET['cat']) {
    // fonction permettant de récuperer tout les id des cats parents
    $tabcat = chemin_categorie($_GET['cat']);
    // on cache la partie "personne"
예제 #3
0
function get_subcats($cat_id = 0, $cid = 0)
{
    global $sub_cat_cache, $cat_cache, $cats;
    if (!isset($sub_cat_cache[$cid])) {
        return "";
    }
    foreach ($sub_cat_cache[$cid] as $key => $category_id) {
        $cats[] = $category_id;
        get_subcats($cat_id, $category_id);
    }
    unset($sub_cat_cache[$cid]);
}
예제 #4
0
파일: left_div.php 프로젝트: mrj0909/sf
    </div><!--mans_cata-->
    <?php 
}
?>
    <?php 
if (isset($cat_info['level']) && $cat_info['level'] > 1 || !$cat_id) {
    if (isset($cat_info['level']) && $cat_info['level'] > 1) {
        $other_cats = get_subcats($parents[0]['cat_id']);
    } else {
        $other_cats = get_subcats(0);
    }
    foreach ($other_cats as $other_cat) {
        if (isset($parents[1]['cat_id']) && $parents[1]['cat_id'] == $other_cat['cat_id']) {
            continue;
        }
        $other_subcats = get_subcats($other_cat['cat_id']);
        if (!$other_subcats) {
            $other_subcats = array();
        }
        ?>
        <div class="mans_cata">
            <h4><?php 
        echo $other_cat['cat_title'];
        ?>
</h4>
            <ul class="treeMenu">
                <?php 
        foreach ($other_subcats as $other_subcat) {
            ?>
                <li>
                    <span class="opened"></span>
예제 #5
0
function get_ent_from_cat($cat_id)
{
    // on r�cup�re d'abord tous les ids des entit�s qui sont dans la cat�gorie (et sous cat�gorie)
    $tabcat = array();
    $where = get_subcats($cat_id);
    $db->query('SELECT `ENT_ID` FROM `ENTITES` WHERE `CATEGORIES_CAT_ID` IN ' . $where);
    // on constitue le where avec les ids des entit�s
    while ($data = $db->fetch_array()) {
        $where2 .= ',' . $data['ENT_ID'];
    }
    $where2 = substr($where2, 1);
    $where2 = '(' . $where2 . ')';
    return $where2;
}