Changeset 50216 in spip-zone
- Timestamp:
- Aug 3, 2011, 3:12:07 PM (10 years ago)
- Location:
- _core_/plugins/vertebres
- Files:
-
- 7 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
_core_/plugins/vertebres/paquet.xml
r50132 r50216 2 2 prefix="vertebres" 3 3 categorie="outil" 4 version="1. 1.0"4 version="1.2.0" 5 5 etat="stable" 6 6 compatibilite="[3.0.0-alpha2;[" -
_core_/plugins/vertebres/public/vertebrer.php
r46328 r50216 32 32 $res = ''; 33 33 foreach($fields as $n => $t) { 34 $tri = $direction 35 . ((sql_test_int($t) OR sql_test_date($r)) ? 'tri_n' : 'tri'); 36 37 $url = vertebrer_sanstri($tri) 38 . "|parametre_url{" . $tri . ",'" . $n . "'}"; 39 40 $res .= "\n\t\t<th style='text-align: center'>" 41 . "\n\t\t\t<a href='[(#SELF$url)]'>$n</a>" 42 . "\n\t\t</th>"; 34 $res .= "\n\t\t<th scope='col'>[(#TRI{"."$n,$n,ajax})]</th>"; 43 35 } 44 36 return $res; 45 37 } 46 38 47 // http://doc.spip.org/@vertebrer_sanstri48 function vertebrer_sanstri($sauf='')49 {50 $url ="";51 foreach (array('tri', 'tri_n', '_tri', '_tri_n') as $c) {52 if ($sauf != $c) $url .= "|$c";53 }54 return '|parametre_url{"' . substr($url,1) .'",""}';55 }56 57 39 // Autant de formulaire que de champs (pour les criteres conditionnels) 58 59 40 // http://doc.spip.org/@vertebrer_form 60 41 function vertebrer_form($fields) … … 67 48 : (preg_match('/char\s*\((\d)\)/i', $t, $r) ? $r[1] : ''); 68 49 69 $res .= "\n\t\t<td><form action='./' method='get'>" 70 . "<div style='text-align: center;' >" 50 $res .= "\n\t\t<td> 51 [(#ENV{".$n."}|non) 52 <a href='#' onclick=\"jQuery(this).toggle('fast').siblings('form').toggle('fast');return false;\">[(#CHEMIN_IMAGE{rechercher-20.png}|balise_img)]</a> 53 ] 54 <form class='[(#ENV{".$n."}|non)none-js]' action='./' method='get'>" 55 . "<div>" 71 56 . "\n\t\t\t<input name='$n'" 72 57 . ($s ? " size='$s'" : '') 58 . "value=\"[(#ENV{".$n."}|entites_html)]\"" 73 59 . " />\n\t\t\t[($url|\n\t\t\tform_hidden)]" 74 60 . "\n\t\t</div></form></td>"; … … 125 111 $key = $desc['key']; 126 112 127 ksort($field); 113 $defaut_tri = reset(array_keys($field)); 114 115 //ksort($field); 128 116 129 117 $form = vertebrer_form($field); … … 131 119 $cell = vertebrer_cell($field); 132 120 $sort = vertebrer_sort($field,''); 133 $tros = vertebrer_sort($field,'_');134 121 $distant = !$connexion ? '' : "&connect=$connexion"; 135 122 $skel = "./?"._SPIP_PAGE."=table:$surnom$distant&var_mode=debug&var_mode_affiche=squelette#debug_boucle"; 136 123 137 124 return 138 125 "#CACHE{0} 139 <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>140 <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='#LANG' lang='#LANG' dir='#LANG_DIR'>141 <head>142 <title>[(#NOM_SITE_SPIP|textebrut)] - #ENV{page}</title>143 <INCLURE{fond=inc-head} />144 </head>145 <body class='page_rubrique'><div id='page'>146 <INCLURE{fond=inc-entete} />147 <div id='contenu'>148 <h1 style='text-align:center'>#ENV{page}</h1><br />149 126 <B1> 127 <h2>[(#GRAND_TOTAL|singulier_ou_pluriel{vertebres:1_donnee,vertebres:nb_donnees})]</h2> 150 128 [<p class='pagination'>(#PAGINATION)</p>] 151 <table class='spip' border='1' width='90%'> 152 <tr> 153 <th><:info_numero_abbreviation:></th>$sort 129 <div style='overflow: scroll;overflow-y: auto'> 130 <table class='spip'> 131 <thead> 132 <tr class='row_first'> 133 <th> 134 <p class='tri'>#TRI{'>',#CHEMIN_IMAGE{tri-asc-16.png}|balise_img{up},ajax} #TRI{'<',#CHEMIN_IMAGE{tri-desc-16.png}|balise_img{desc},ajax}</p> 135 </th> 136 $sort 154 137 </tr> 155 138 <tr> 156 139 <td></td>$form 157 140 </tr> 158 <BOUCLE1($surnom){pagination} 159 {par #ENV{tri}}{!par #ENV{_tri}}{par num #ENV{tri_n}}{!par num #ENV{_tri_n}}$crit> 141 </thead> 142 <tbody> 143 <BOUCLE1($surnom){pagination} 144 {tri $defaut_tri, direct}$crit> 160 145 <tr class='[row_(#COMPTEUR_BOUCLE|alterner{'odd','even'})]'> 161 146 <td style='text-align: right;'>#COMPTEUR_BOUCLE</td>$cell 162 147 </tr> 163 148 </BOUCLE1> 149 </tbody> 150 <tfoot> 164 151 <tr> 165 <th><:info_numero_abbreviation:></th>$tros 152 <th> 153 <p class='tri'>#TRI{'>',#CHEMIN_IMAGE{tri-asc-16.png}|balise_img{up},ajax} #TRI{'<',#CHEMIN_IMAGE{tri-desc-16.png}|balise_img{desc},ajax}</p> 154 </th> 155 $sort 166 156 </tr> 157 </tfoot> 167 158 </table> 168 </B1>\n<h2 style='text-align:center'><:texte_vide:></h2> 169 <//B1></div> 170 <INCLURE{fond=inc-pied, skel='$skel'} /> 159 </B1> 160 <div style='overflow: scroll;overflow-y: auto'> 161 <h2><:texte_vide:></h2> 162 <table class='spip'> 163 <thead> 164 <tr class='row_first'> 165 <th> 166 <p class='tri'>#TRI{'>',#CHEMIN_IMAGE{tri-asc-16.png}|balise_img{up},ajax} #TRI{'<',#CHEMIN_IMAGE{tri-desc-16.png}|balise_img{desc},ajax}</p> 167 </th> 168 $sort 169 </tr> 170 <tr> 171 <td></td>$form 172 </tr> 173 </thead> 174 </table> 175 <//B1> 171 176 </div> 172 </body> 173 </html>"; 177 "; 174 178 } 175 179 ?> -
_core_/plugins/vertebres/vertebres_pipelines.php
r43499 r50216 9 9 // si pas de squelette trouve, 10 10 // on verifie si on demande une vue de table 11 if (!$squelette = $flux['data']) { 12 11 if (!$squelette = $flux['data'] 12 AND $fond = $flux['args']['fond'] 13 AND strncmp($fond,'prive/vertebres:',16)==0 14 AND $table = substr($fond,16) 15 AND include_spip('inc/autoriser') 16 AND autoriser('webmestre')) { 17 13 18 $ext = $flux['args']['ext']; 14 $fond = $flux['args']['fond'];15 19 $connect = $flux['args']['connect']; 16 20 … … 18 22 // et si l'on a la permission de l'afficher 19 23 $trouver_table = charger_fonction('trouver_table', 'base'); 20 if (preg_match('/^table:(.*)$/', $fond, $r) 21 AND $table = $trouver_table($r[1], $connect) 22 AND include_spip('inc/autoriser') 23 AND autoriser('webmestre') 24 ) { 25 $fond = $r[1]; 24 if ($desc= $trouver_table($table, $connect)) { 25 $fond = $table; 26 26 $base = _DIR_TMP . 'table_' . $fond . ".$ext"; 27 27 if (!file_exists($base) 28 28 OR (defined('_VAR_MODE') AND _VAR_MODE)) { 29 29 $vertebrer = charger_fonction('vertebrer', 'public'); 30 ecrire_fichier($base, $vertebrer($ table));30 ecrire_fichier($base, $vertebrer($desc)); 31 31 } 32 32
Note: See TracChangeset
for help on using the changeset viewer.