Changeset 57701 in spip-zone for _plugins_/compositions/trunk/compositions_pipeline.php
- Timestamp:
- Jan 25, 2012, 3:46:21 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/compositions/trunk/compositions_pipeline.php
r56922 r57701 60 60 function compositions_styliser($flux){ 61 61 include_spip('compositions_fonctions'); 62 if (compositions_styliser_auto()){63 if (!defined('_DIR_PLUGIN_Z') AND !defined('_DIR_PLUGIN_ZCORE')){64 65 66 67 68 62 // en contexte Z, c'est Z ou Z-core qui stylise (on ne n'en occupe donc pas ici) 63 if (compositions_styliser_auto() AND !defined('_DIR_PLUGIN_Z') AND !defined('_DIR_PLUGIN_ZCORE')){ 64 $type = $flux['args']['fond']; // on fait l'approximation fond=type 65 // si le type n'est pas l'objet d'une composition, ne rien faire 66 if (in_array($type,compositions_types())){ 67 $contexte = isset($flux['args']['contexte'])?$flux['args']['contexte']:$GLOBALS['contexte']; 68 $serveur = $flux['args']['connect']; 69 69 70 71 70 $ext = $flux['args']['ext']; 71 $_id_table = id_table_objet($type); 72 72 73 if ($id = $contexte[$_id_table] AND $composition = compositions_determiner($type,$id,$serveur)){ 74 if ($fond = compositions_selectionner($composition, $type, '', $ext, true, "")){ 75 $flux['data'] = substr($fond, 0, - strlen(".$ext")); 76 } 77 } 78 } 79 } 80 else { 81 $contexte = isset($flux['args']['contexte'])?$flux['args']['contexte']:$GLOBALS['contexte']; 82 $z_contenu = (isset($GLOBALS['z_blocs'])?reset($GLOBALS['z_blocs']):'contenu'); 83 if (!test_espace_prive() 84 AND strncmp($flux['args']['fond'], "$z_contenu/", strlen($z_contenu)+1)==0 85 AND $type = substr($flux['args']['fond'],strlen($z_contenu)+1) 86 AND in_array($type,compositions_types())){ 87 $serveur = $flux['args']['connect']; 88 89 $ext = $flux['args']['ext']; 90 $_id_table = id_table_objet($type); 91 92 if ($id = $contexte[$_id_table] AND $composition = compositions_determiner($type,$id,$serveur)){ 93 if ($fond = compositions_selectionner($composition, $type, '', $ext, true, "")){ 94 $flux['data'] = substr($fond, 0, - strlen(".$ext")); 95 } 73 if ($id = $contexte[$_id_table] AND $composition = compositions_determiner($type,$id,$serveur)){ 74 if ($fond = compositions_selectionner($composition, $type, '', $ext, true, "")){ 75 $flux['data'] = substr($fond, 0, - strlen(".$ext")); 96 76 } 97 77 }
Note: See TracChangeset
for help on using the changeset viewer.