function compositions_decomposer_nom($nom){
$reg = ",^([a-z][^-.]*)("._COMPOSITIONS_MATCH.")?$,i";
if (
- // recuperer le type et la composition
+ /* recuperer le type et la composition */
preg_match($reg,$nom,$matches)
- // il y a bien un type
+ /* il y a bien un type */
AND $type=$matches[1]
){
$composition = isset($matches[3])?$matches[3]:'';
* @return array|string
*/
function compositions_charger_infos($nom,$info=""){
- // on peut appeller avec le nom du squelette
+ /* on peut appeller avec le nom du squelette */
$nom = preg_replace(',[.]html$,i','',$nom).".xml";
include_spip('inc/xml');
$composition = array();
$composition['description'] = isset($xml['description'])?_T_ou_typo(spip_xml_aplatit($xml['description'])):'';
if (isset($xml['icon'])) {
$icon = chemin_image(reset($xml['icon']));
- if (!$icon)
+ if (!$icon) {
$icon = find_in_path(reset($xml['icon']));
- } else
+ }
+ } else {
$icon = '';
+ }
+ $composition['image_exemple'] = isset($xml['image_exemple']) ? find_in_path(reset($xml['image_exemple'])) : '';
$composition['icon'] = $icon;
- $composition['class'] = isset($xml['class'])?trim(reset($xml['class'])):'';
- $composition['configuration'] = isset($xml['configuration'])?spip_xml_aplatit($xml['configuration']):'';
+ $composition['class'] = isset($xml['class']) ? trim(reset($xml['class'])) : '';
+ $composition['configuration'] = isset($xml['configuration']) ? spip_xml_aplatit($xml['configuration']) : '';
$composition['branche'] = array();
if (spip_xml_match_nodes(',^branche,', $xml, $branches)){
foreach (array_keys($branches) as $branche){
}
if (!$info)
return $composition;
- else
+ else
return isset($composition[$info])?$composition[$info]:"";
}
* @param array $liste
*/
function compositions_cacher($liste=null){
- // lister les compositions vraiment utilisees
+ /* lister les compositions vraiment utilisees */
if (!is_array($liste)){
include_spip('compositions_fonctions');
$liste = compositions_lister_disponibles('',false);
}
- // lister les objets dont on a active la composition dans la configuration
+ /* lister les objets dont on a active la composition dans la configuration */
$config = compositions_objets_actives();
$liste = array_intersect($config,array_keys($liste));
spip_log('compositions: maj des compositions_types ['.$GLOBALS['meta']['compositions_types'].']');
}
-?>
\ No newline at end of file
+?>