Beispiel #1
0
function create_list_item($type, $data, $label)
{
    $html = '';
    if ($type == 'promo') {
        $html = "<li class='promotion' data-id='{$data}'><span class='label'>{$label}</span><ul class='vins vins-promotion-liste'>" . print_vins_promotion($data) . "</ul>";
    } else {
        if ($type == 'vins-au-verre') {
            $html = "<li class='vins-au-verre' data-id='{$data}'><span class='label'>{$label}</span><ul class='vins vins-au-verre-liste'>" . print_vins_au_verre($data) . "</ul>";
        } else {
            if ($type == 'demi-bouteilles') {
                $html = "<li class='demi-bouteilles' data-id='{$data}'><span class='label'>{$label}</span><ul class='vins demi-bouteilles-liste'>" . print_demi_bouteilles($data) . "</ul>";
            } else {
                $html = "<li data-type='{$type}' data-id='{$data}' class='{$type}'><span class='label'>{$label}</span>";
            }
        }
    }
    return $html;
}
Beispiel #2
0
function create_list_item($child)
{
    $id = slug($child->label);
    switch ($child->type) {
        // case 'region-monde': return '';
        case 'pays':
            // return start_table('h3')."<tr><th class='h3' colspan='2'>$child->label</th></tr>";
            return $child->category == 1 && ($child->label == "Italie" || $child->label == "Canada") ? start_table('h3 breaker') . "<tr><th class='h3' colspan='2'>{$child->label}</th></tr>" : start_table('h3') . "<tr><th class='h3' colspan='2'>{$child->label}</th></tr>";
        case 'region':
            return start_table('h4') . "<tr><th class='h4' colspan='2'>{$child->label}</th></tr>";
        case 'sous-region':
            return start_table('h5') . "<tr><th class='h5' colspan='2'>{$child->label}</th></tr>";
        case 'promo':
            return create_promo_wines($child->id);
        case 'vins-au-verre':
            return print_vins_au_verre($child->id);
        case 'demi-bouteilles':
            return print_demi_bouteilles($child->id);
        default:
            return '';
    }
}
Beispiel #3
0
function create_list_item($child)
{
    $id = slug($child->label);
    if ($child->type == 'region-monde') {
        return "<div id='{$id}' class='{$child->type}'>";
    }
    if ($child->type == 'pays') {
        return "<div id='{$id}' class='{$child->type}'><h2>{$child->label}</h2>";
    }
    if ($child->type == 'region') {
        return "<div id='{$id}'><h3>{$child->label}</h3>";
    }
    if ($child->type == 'sous-region') {
        return "<div id='{$id}'><h4>{$child->label}</h4>";
    }
    if ($child->type == 'promo') {
        return "<div>" . create_promo_wines($child->id);
    }
    if ($child->type == 'vins-au-verre') {
        return "<div>" . print_vins_au_verre($child->id);
    }
    if ($child->type == 'demi-bouteilles') {
        return "<div>" . print_demi_bouteilles($child->id);
    } else {
        return "";
    }
}