Changeset 110358 in spip-zone
- Timestamp:
- May 23, 2018, 9:18:15 PM (3 years ago)
- Location:
- _plugins_/chapitres/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/chapitres/trunk/chapitres_pipelines.php
r110356 r110358 155 155 156 156 /** 157 * Agir après l'enregistrement des données lors de l'édition d'un contenu 158 * 159 * => Quand on dépublie un chapitre, dépublier aussi tous ses enfants (la branche) 160 * 161 * @pipeline pre_insertion 162 * @param array $flux Données du pipeline 163 * @return array Données du pipeline 164 */ 165 function chapitres_post_edition($flux) { 166 167 // Si on institue un chapitre 168 if ($flux['args']['action'] == 'instituer' 169 and $flux['args']['table'] == 'spip_chapitres' 170 and $statut = $flux['data']['statut'] 171 and $statut_ancien = $flux['args']['statut_ancien'] 172 and $id_chapitre = intval($flux['args']['id_objet']) 173 ) { 174 175 // Récupérer les statuts de publication 176 include_spip('base/objets'); 177 $info_statut = array_shift(objet_info('chapitre', 'statut')); 178 $statuts_publie = explode(',', $info_statut['publie']); 179 180 // Si on dépublie, poser le même statut à toute la branche 181 if (in_array($statut_ancien, $statuts_publie) 182 and !in_array($statut, $statuts_publie) 183 and count($ids_branche = array_map('intval', explode(',', calcul_branche_in_chapitres($id_chapitre)))) 184 ) { 185 // Enlever le chapitre parent, qui a déjà été institué 186 if (($k = array_search($id_chapitre, $ids_branche)) !== false) { 187 unset($ids_branche[$k]); 188 } 189 // Dépublier 190 sql_updateq( 191 'spip_chapitres', 192 array('statut' => $statut), 193 sql_in('id_chapitre', $ids_branche) 194 ); 195 } 196 197 } 198 199 return $flux; 200 } 201 202 203 /** 157 204 * Optimiser la base de données 158 205 * -
_plugins_/chapitres/trunk/paquet.xml
r110356 r110358 2 2 prefix="chapitres" 3 3 categorie="edition" 4 version="1.0. 6"4 version="1.0.7" 5 5 etat="dev" 6 6 compatibilite="[3.2.0;3.2.*]" … … 28 28 <pipeline nom="afficher_config_objet" inclure="chapitres_pipelines.php" /> 29 29 <pipeline nom="pre_insertion" inclure="chapitres_pipelines.php" /> 30 <pipeline nom="post_edition" inclure="chapitres_pipelines.php" /> 30 31 <pipeline nom="optimiser_base_disparus" inclure="chapitres_pipelines.php" /> 31 32 -
_plugins_/chapitres/trunk/prive/themes/spip/images/arbo-corner.svg
r110351 r110358 1 <svg xmlns="http://www.w3.org/2000/svg" width="16" height=" 32" viewBox="0 0 16 31.999998"><path d="M15.493 15.5H.5V.507" fill="none" stroke="#999" stroke-linecap="round" stroke-linejoin="round" paint-order="fill markers stroke"/></svg>1 <svg xmlns="http://www.w3.org/2000/svg" width="16" height="64" viewBox="0 0 16 63.999996"><path d="M15.493 32H.5" fill="none" stroke="#999" stroke-linecap="round" stroke-linejoin="round" paint-order="fill markers stroke"/><path d="M.5 31.5V.507" fill="none" stroke="#999" stroke-linecap="square" stroke-linejoin="round" paint-order="fill markers stroke"/></svg> -
_plugins_/chapitres/trunk/prive/themes/spip/images/arbo-left.svg
r110351 r110358 1 <svg xmlns="http://www.w3.org/2000/svg" width="16" height=" 32" viewBox="0 0 15.999999 31.999998"><path d="M.5.507v31" fill="none" stroke="#999" stroke-linecap="round" stroke-linejoin="round"/></svg>1 <svg xmlns="http://www.w3.org/2000/svg" width="16" height="64" viewBox="0 0 15.999999 63.999995"><path d="M.5.5v63" fill="none" stroke="#999" stroke-linecap="square" stroke-linejoin="round"/></svg> -
_plugins_/chapitres/trunk/prive/themes/spip/images/arbo-node.svg
r110351 r110358 1 <svg xmlns="http://www.w3.org/2000/svg" width="16" height=" 32" viewBox="0 0 15.999999 31.999998"><path d="M.5.507v14.996h14.993m-14.993 0zm0 15.993V15.503" fill="none" stroke="#999" stroke-linecap="round" stroke-linejoin="round"/></svg>1 <svg xmlns="http://www.w3.org/2000/svg" width="16" height="64" viewBox="0 0 15.999999 63.999996"><path d="M.5.5v63" fill="none" stroke="#999" stroke-linecap="square" stroke-linejoin="round"/><path d="M.5 31.502h14.993" fill="none" stroke="#999" stroke-linecap="round" stroke-linejoin="round"/></svg>
Note: See TracChangeset
for help on using the changeset viewer.