Created
September 9, 2013 07:36
-
-
Save bystrano/6492523 to your computer and use it in GitHub Desktop.
Calculer les sous-rubriques récursivement
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[(#REM) ce squelette retourne un tableau serializé contenant les | |
sous-rubriques de la rubrique définie par l'id_rubrique passé en | |
#ENV. | |
exemple d'appel : | |
[(#SET{rubriques_agenda, #INCLURE{fond=calculer/sous_rubriques, | |
id_rubrique=37} | |
|unserialize} | |
)] | |
] | |
#SET{ids_rubriques_filles, #ARRAY{0, #ENV{id_rubrique}}} | |
<BOUCLE_rubs(RUBRIQUES){id_parent=#ENV{id_rubrique}}> | |
#SET{ids_rubriques_filles, #GET{ids_rubriques_filles}|push{#ID_RUBRIQUE}} | |
<BOUCLE_sous_rubs(RUBRIQUES){id_parent}> | |
#SET{ids_rubriques_filles, #GET{ids_rubriques_filles}|push{#ID_RUBRIQUE}} | |
<BOUCLE_sous_sous_rubs(BOUCLE_sous_rubs) /> | |
</BOUCLE_sous_rubs> | |
</BOUCLE_rubs> | |
[(#GET{ids_rubriques_filles}|serialize)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment