function afficher_boutons_tri($url, $tmp_var) { static $monter = ''; static $descendre = ''; if (!$monter) { $monter = http_img_pack('monter-16.png', '<'); $descendre = http_img_pack('descendre-16.png', '>'); } $url_d = generer_onclic_ajax($url ."&order=desc", $tmp_var, 0); $url_a = generer_onclic_ajax($url ."&order=asc", $tmp_var, 0); return "<a href='$url'$url_d>$monter</a><a href='$url'$url_a>$descendre</a>"; }
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<div style='$ie_style;' class='arial1 tranches' id='a$ancre'>" . $nav . "<a href='$script#a$ancre' class='plus'" . (!$url ? '' : generer_onclic_ajax($url, $idom,-1)) . "><img title=\"$l\" alt=\"$l\"\nsrc=\"" . chemin_image("plus.gif") . "\" /></a></div>\n"; }
function navigation_pagination($num_rows, $nb_aff=10, $href=null, $debut, $tmp_var=null, $on='') { $texte = ''; $self = parametre_url(self(), 'date', ''); $deb_aff = intval($debut); for ($i = 0; $i < $num_rows; $i += $nb_aff){ $deb = $i + 1; // Pagination : si on est trop loin, on met des '...' if (abs($deb-$deb_aff)>101) { if ($deb<$deb_aff) { if (!isset($premiere)) { $premiere = '0 ... '; $texte .= $premiere; } } else { $derniere = ' | ... '.$num_rows; $texte .= $derniere; break; } } else { $fin = $i + $nb_aff; if ($fin > $num_rows) $fin = $num_rows; if ($deb > 1) $texte .= " |\n"; if ($deb_aff + 1 >= $deb AND $deb_aff + 1 <= $fin) { $texte .= "<b>$deb</b>"; } else { $script = parametre_url($self, $tmp_var, $deb-1); if ($on) $on = generer_onclic_ajax($href, $tmp_var, $deb-1); $texte .= "<a href=\"$script\"$on>$deb</a>"; } } } return $texte; }