X-Git-Url: http://git.cyclocoop.org/?p=velocampus%2Fweb%2Fwww.git;a=blobdiff_plain;f=www%2Fecrire%2Finc%2Fpresenter_liste.php;fp=www%2Fecrire%2Finc%2Fpresenter_liste.php;h=ce0b83c0f1b7bd94d1264c4326c4a54a47e72c02;hp=0000000000000000000000000000000000000000;hb=80b4d3e85f78d402ed2e73f8f5d1bf4c19962eed;hpb=aaf970bf4cdaf76689ecc10609048e18d073820c diff --git a/www/ecrire/inc/presenter_liste.php b/www/ecrire/inc/presenter_liste.php new file mode 100644 index 0000000..ce0b83c --- /dev/null +++ b/www/ecrire/inc/presenter_liste.php @@ -0,0 +1,144 @@ +$t"; + if (!$table) { + $th |= $nom ? 1 : 0; + $head .= "\n$nom"; + } + } + $table .= "\n$res"; + } + } + if (!$th) $head= ''; + $tranches .= "$head$table
"; + } else { + foreach ($result as $r) { + if ($prim) $prims[]= $r[$prim]; + if ($t = $fonc($r, $own)) { + $tranches = '
  • ' . join('
  • ', $t) . '
  • '; + $tranches = "\n"; + } + } + } + } + + $id = 't'.substr(md5(join('',$requete)),0,8); + $bouton = !$icone ? '' : bouton_block_depliable($title, true, $id); + + return debut_cadre('liste', $icone, "", $bouton, "", "", false) + . debut_block_depliable(true, $id) + . $tranches + . fin_block() + . fin_cadre('liste'); +} + +// http://doc.spip.org/@afficher_tranches_requete +function afficher_tranches_requete($num_rows, $idom, $url='', $nb_aff = 10, $old_arg=NULL) { + static $ancre = 0; + global $browser_name, $spip_lang_right, $spip_display; + if ($old_arg!==NULL){ // eviter de casser la compat des vieux appels $cols_span ayant disparu ... + $idom = $url; $url = $nb_aff; $nb_aff=$old_arg; + } + + $ancre++; + $self = self(); + $ie_style = ($browser_name == "MSIE") ? "height:1%" : ''; + $style = "style='visibility: hidden; float: $spip_lang_right'"; + $nav= navigation_pagination($num_rows, $nb_aff, $url, _request($idom), $idom, true); + $script = parametre_url($self, $idom, -1); + $l = htmlentities(_T('lien_tout_afficher')); + + return http_img_pack("searching.gif", "*", "$style id='img_$idom'") + . "\n
    " + . $nav + . "\"$l\"\nsrc=\""
    \n"; +} + +// http://doc.spip.org/@affiche_tranche_bandeau +function affiche_tranche_bandeau(&$requete, $idom, $url='', $cpt=NULL, $pas=10) +{ + if (!isset($requete['GROUP BY'])) $requete['GROUP BY'] = ''; + + if ($cpt === NULL) + $cpt = sql_countsel($requete['FROM'], $requete['WHERE'], $requete['GROUP BY']); + + $deb_aff = intval(_request($idom)); + $nb_aff = $pas + ($pas>>1); + + if (isset($requete['LIMIT'])) $cpt = min($requete['LIMIT'], $cpt); + + if ($cpt > $nb_aff) { + $nb_aff = $pas; + $res = afficher_tranches_requete($cpt, $idom, $url, $nb_aff); + } else $res = ''; + + if (!isset($requete['LIMIT']) AND $deb_aff <> -1) + $requete['LIMIT'] = "$deb_aff, $nb_aff"; + + return $res; +} +?>