Changeset 93641 in spip-zone for _core_/plugins/grenier/inc/presenter_liste.php
- Timestamp:
- Dec 13, 2015, 2:41:19 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
_core_/plugins/grenier/inc/presenter_liste.php
r89285 r93641 21 21 22 22 // http://code.spip.net/@inc_presenter_liste_dist 23 function inc_presenter_liste_dist($requete, $fonc, &$prims, $own, $force, $styles, $idom ='', $title='', $icone='', $url='', $cpt=NULL)23 function inc_presenter_liste_dist($requete, $fonc, &$prims, $own, $force, $styles, $idom = '', $title = '', $icone = '', $url = '', $cpt = null) 24 24 { 25 25 global $spip_display, $spip_lang_left; 26 26 27 27 // $requete est passe par reference, pour modifier l'index LIMIT 28 if ($idom AND$spip_display != 4)28 if ($idom and $spip_display != 4) 29 29 $tranches = affiche_tranche_bandeau($requete, $idom, $url, $cpt, _TRANCHES); 30 30 else $tranches = ''; … … 46 46 $th = 0; 47 47 foreach ($result as $r) { 48 if ($prim) $prims[] = $r[$prim];48 if ($prim) $prims[] = $r[$prim]; 49 49 if ($vals = $fonc($r, $own)) { 50 50 reset($styles); … … 52 52 foreach ($vals as $t) { 53 53 $style = $largeur = $nom = ""; 54 list(, $s) = each($styles);54 list(, $s) = each($styles); 55 55 if (count($s)) $style = array_shift($s); 56 56 if (count($s)) $largeur = array_shift($s); … … 68 68 } 69 69 } 70 if (!$th) $head = '';70 if (!$th) $head = ''; 71 71 $tranches .= "<table width='100%' cellpadding='2' border='0'>$head$table</table>"; 72 72 } else { 73 73 foreach ($result as $r) { 74 if ($prim) $prims[] = $r[$prim];74 if ($prim) $prims[] = $r[$prim]; 75 75 if ($t = $fonc($r, $own)) { 76 76 $tranches = '<li>' . join('</li><li>', $t) . '</li>'; … … 83 83 } 84 84 85 $id = 't'.substr(md5(join('', $requete)),0,8);85 $id = 't'.substr(md5(join('', $requete)), 0, 8); 86 86 $bouton = !$icone ? '' : bouton_block_depliable($title, true, $id); 87 87 … … 94 94 95 95 // http://code.spip.net/@afficher_tranches_requete 96 function afficher_tranches_requete($num_rows, $idom, $url ='', $nb_aff = 10, $old_arg=NULL) {96 function afficher_tranches_requete($num_rows, $idom, $url = '', $nb_aff = 10, $old_arg = null) { 97 97 static $ancre = 0; 98 98 global $browser_name, $spip_lang_right, $spip_display; 99 if ($old_arg !==NULL){ // eviter de casser la compat des vieux appels $cols_span ayant disparu ...100 $idom = $url; $url = $nb_aff; $nb_aff =$old_arg;99 if ($old_arg !== null){ // eviter de casser la compat des vieux appels $cols_span ayant disparu ... 100 $idom = $url; $url = $nb_aff; $nb_aff = $old_arg; 101 101 } 102 102 … … 105 105 $ie_style = ($browser_name == "MSIE") ? "height:1%" : ''; 106 106 $style = "style='visibility: hidden; float: $spip_lang_right'"; 107 $nav = navigation_pagination($num_rows, $nb_aff, $url, _request($idom), $idom, true);107 $nav = navigation_pagination($num_rows, $nb_aff, $url, _request($idom), $idom, true); 108 108 $script = parametre_url($self, $idom, -1); 109 109 $l = htmlentities(_T('lien_tout_afficher')); … … 113 113 . $nav 114 114 . "<a href='$script#a$ancre' class='plus'" 115 . (!$url ? '' : generer_onclic_ajax($url, $idom, -1))115 . (!$url ? '' : generer_onclic_ajax($url, $idom, -1)) 116 116 . "><img title=\"$l\" alt=\"$l\"\nsrc=\"" 117 117 . chemin_image("plus-16.png") … … 120 120 121 121 // http://code.spip.net/@affiche_tranche_bandeau 122 function affiche_tranche_bandeau(&$requete, $idom, $url ='', $cpt=NULL, $pas=10)122 function affiche_tranche_bandeau(&$requete, $idom, $url = '', $cpt = null, $pas = 10) 123 123 { 124 124 if (!isset($requete['GROUP BY'])) $requete['GROUP BY'] = ''; 125 125 126 if ($cpt === NULL)126 if ($cpt === null) 127 127 $cpt = sql_countsel($requete['FROM'], $requete['WHERE'], $requete['GROUP BY']); 128 128 129 129 $deb_aff = intval(_request($idom)); 130 $nb_aff = $pas + ($pas >>1);130 $nb_aff = $pas + ($pas >> 1); 131 131 132 132 if (isset($requete['LIMIT'])) $cpt = min($requete['LIMIT'], $cpt); … … 137 137 } else $res = ''; 138 138 139 if (!isset($requete['LIMIT']) AND$deb_aff <> -1)139 if (!isset($requete['LIMIT']) and $deb_aff <> -1) 140 140 $requete['LIMIT'] = "$deb_aff, $nb_aff"; 141 141 142 142 return $res; 143 143 } 144 ?>
Note: See TracChangeset
for help on using the changeset viewer.