Changeset 96952 in spip-zone
- Timestamp:
- May 2, 2016, 9:58:19 AM (5 years ago)
- Location:
- _plugins_/projets_sites/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/projets_sites/trunk/prive/objets/contenu/projets_site.html
r96951 r96952 104 104 </thead> 105 105 <tbody> 106 <BOUCLE_plugins (DATA) {source table, (#LOGICIEL_PLUGINS**|formater_tableau)} {si (#LOGICIEL_PLUGINS|match{"\|"})} {par valeur}> 107 <tr> 108 <td>[(#VALEUR{prefixe}|trim)]</td> 109 <td>[(#VALEUR{version}|trim)]</td> 110 <td>[(#VALEUR{version_base}|trim)]</td> 111 <td>[(#VALEUR{titre}|trim)]</td> 112 <td class="[ 113 (#REM|test_espace_prive|non)[(#GET{plugin_statut_class}|table_valeur{#VALEUR{3}|trim})]]">[(#VALEUR{statut}|trim)]</td> 106 <BOUCLE_plugins (DATA) {source table, (#LOGICIEL_PLUGINS**|formater_tableau{'plugins'})} {si (#LOGICIEL_PLUGINS|match{"\|"})} {par valeur}>[(#SET{class_statut,[(#REM|test_espace_prive|non)[(#GET{plugin_statut_class}|table_valeur{#VALEUR{statut}|trim})]]})] 107 <tr class="[(#GET{class_statut}|trim)]"> 108 <td class="prefixe">[(#VALEUR{prefixe}|trim)]</td> 109 <td class="version">[(#VALEUR{version}|trim)]</td> 110 <td class="version_base">[(#VALEUR{version_base}|trim)]</td> 111 <td class="titre">[(#VALEUR{titre}|trim)]</td> 112 <td class="statut[ (#GET{class_statut})]">[(#VALEUR{statut}|trim)]</td> 114 113 </tr> 115 114 </BOUCLE_plugins> … … 401 400 402 401 </BOUCLE_projets_site> 403 [(#REM|test_espace_prive|non)404 <script type="text/javascript">405 $('.contenu_logiciel_plugins table.liste tbody tr td:last-child').each(function(index, el) {406 var class_tableau = $(this).attr("class");407 $(this).parent('tr').addClass( class_tableau + " text-" + class_tableau );408 });409 </script>410 ]411 -
_plugins_/projets_sites/trunk/projets_sites_fonctions.php
r96951 r96952 14 14 } 15 15 16 function formater_tableau($chaine ) {16 function formater_tableau($chaine, $format = 'auteur') { 17 17 $listing = array(); 18 18 if (preg_match("/\n/", $chaine)) { … … 20 20 if (is_array($listing) and count($listing) > 0) { 21 21 foreach ($listing as $cle => $valeur) { 22 $listing[$cle] = formater_valeur($valeur );22 $listing[$cle] = formater_valeur($valeur, $format); 23 23 } 24 24 } 25 25 } else { 26 26 if (preg_match("/\|/", $chaine)) { 27 $listing[] = formater_valeur($chaine );27 $listing[] = formater_valeur($chaine, $format); 28 28 } 29 29 } … … 32 32 } 33 33 34 function formater_valeur($valeur ) {34 function formater_valeur($valeur, $format = 'auteur') { 35 35 $tableau = explode("|", $valeur); 36 if (count($tableau) == 4) { 37 $tableau['prefixe'] = trim($tableau[0]); 38 $tableau['version'] = trim($tableau[1]); 39 $tableau['version_base'] = '-'; 40 $tableau['titre'] = trim($tableau[2]); 41 $tableau['statut'] = trim($tableau[3]); 42 } elseif (count($tableau) == 5) { 43 $tableau['prefixe'] = trim($tableau[0]); 44 $tableau['version'] = trim($tableau[1]); 45 $tableau['version_base'] = trim($tableau[2]); 46 $tableau['titre'] = trim($tableau[3]); 47 $tableau['statut'] = trim($tableau[4]); 48 } else { 49 foreach ($tableau as $key => $value) { 50 $tableau[$key] = trim($value); 36 foreach ($tableau as $key => $value) { 37 $tableau[$key] = trim($value); 38 } 39 if ($format == 'plugins') { 40 if (count($tableau) == 4) { 41 $tableau['prefixe'] = trim($tableau[0]); 42 $tableau['version'] = trim($tableau[1]); 43 $tableau['version_base'] = '-'; 44 $tableau['titre'] = trim($tableau[2]); 45 $tableau['statut'] = trim($tableau[3]); 46 } elseif (count($tableau) == 5) { 47 $tableau['prefixe'] = trim($tableau[0]); 48 $tableau['version'] = trim($tableau[1]); 49 $tableau['version_base'] = trim($tableau[2]); 50 $tableau['titre'] = trim($tableau[3]); 51 $tableau['statut'] = trim($tableau[4]); 51 52 } 52 53 }
Note: See TracChangeset
for help on using the changeset viewer.