Changeset 49200 in spip-zone
- Timestamp:
- Jul 1, 2011, 10:12:40 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/spip-listes/spip-listes_1_9_3/inc/spiplistes_api.php
r48921 r49200 1261 1261 } 1262 1262 1263 function spiplistes_pied_page_assembler_patron ($id_liste, $lang = false) { 1264 1265 $result = array("", ""); 1266 1267 if(($id_liste = intval($id_liste)) > 0) 1263 /** 1264 * Construire le contenu à partir du patron 1265 * appartenant à la liste donnée, ou du patron nommé. 1266 * @version CP-20110701 1267 * @param bool|int $id_liste 1268 * @param bool|string $lang 1269 * @param string $pied_patron 1270 * @return array (version html, version texte) 1271 */ 1272 function spiplistes_pied_page_assembler_patron ($id_liste = FALSE, 1273 $lang = FALSE, 1274 $pied_patron = FALSE) 1275 { 1276 $result = array('', ''); 1277 1278 /** 1279 * Si l'id_liste > 0, prendre le pied patron de la liste 1280 * sauf si transmis en paramètre. 1281 */ 1282 if( 1283 (($id_liste = intval($id_liste)) > 0) 1284 && !$pied_patron) 1268 1285 { 1269 $pied_patron = sql_getfetsel('pied_page', 'spip_listes', "id_liste=".sql_quote($id_liste), '','',1); 1270 1271 $pied_patron = 1272 (!$pied_patron) 1273 // si patron vide (ancienne version de SPIP-Listes ?), appliquer le patron par defaut 1274 ? _SPIPLISTES_PATRONS_PIED_DEFAUT 1275 : $pied_patron 1276 ; 1286 $pied_patron = sql_getfetsel('pied_page', 'spip_listes', 1287 'id_liste='.sql_quote($id_liste), '','',1); 1288 /** 1289 * Si patron vide (ancienne version de SPIP-Listes ?), 1290 * appliquer le patron par defaut 1291 */ 1292 if (!$pied_patron) 1293 { 1294 $pied_patron = _SPIPLISTES_PATRONS_PIED_DEFAUT; 1295 } 1296 } 1297 if (!empty($pied_patron)) { 1298 /** 1299 * Dans les anciennes versions de SPIP-Listes, 1300 * (SPIP-Listes <= 1.9.2 ?) 1301 * le contenu du pied de page était dans le champ pied_page. 1302 * Rester compatible avec les anciennes versions de SPIP-Listes 1303 */ 1277 1304 if(strlen($pied_patron) > _SPIPLISTES_PATRON_FILENAMEMAX) 1278 1305 { 1279 // probablement le contenu du pied (SPIP-Listes <= 1.9.2 ?) 1280 // rester compatible avec les anciennes version de SPIP-Listes 1281 // qui stoquaient le patron assemble' en base 1282 $pied_texte = spiplistes_courrier_version_texte($pied_html = $pied_patron); 1283 $result = array($pied_html, $pied_texte); 1284 } 1285 else if(strlen($pied_patron) && ($pied_patron != _SPIPLISTES_PATRON_PIED_IGNORE)) { 1286 1287 if(!$lang) { 1288 $lang = spiplistes_listes_langue($id_liste) || $GLOBALS['spip_lang']; 1289 } 1290 $contexte = array('lang' => $lang); 1291 $result = spiplistes_assembler_patron ( 1306 $pied_html = $pied_patron; 1307 $pied_texte = spiplistes_courrier_version_texte ($pied_html); 1308 } 1309 /** 1310 * ou construire à partir du patron désigné 1311 */ 1312 else if ($pied_patron != _SPIPLISTES_PATRON_PIED_IGNORE) { 1313 list($pied_html, $pied_texte) = spiplistes_courriers_assembler_patron ( 1292 1314 _SPIPLISTES_PATRONS_PIED_DIR . $pied_patron 1293 , $contexte 1294 ); 1295 } 1296 } 1315 , array('lang'=>$lang)); 1316 } 1317 1318 $result = array($pied_html, $pied_texte); 1319 } 1320 1297 1321 return ($result); 1298 1322 } 1299 1323 1300 1324 function spiplistes_format_valide ($format) { 1301 return(in_array($format, array( "non", "texte", "html")) ? $format : false);1325 return(in_array($format, array('non', 'texte', 'html')) ? $format : false); 1302 1326 } 1303 1327
Note: See TracChangeset
for help on using the changeset viewer.