Last active
August 29, 2015 13:59
-
-
Save tarto-dev/10891622 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| <?php | |
| $aAccordeonsTexts = array( | |
| 'origin' => array( | |
| array( | |
| 'title' => "J'observe mon comportement alimentaire", | |
| 'content' => "Je définis : « trop manger » <br /> | |
| Je remplis mon carnet découverte <br /> | |
| J'apprends la respiration en pleine conscience<br />" | |
| ), | |
| // [...] | |
| array( | |
| 'title' => "Je stabilise mon comportement alimentaire", | |
| 'content' => "Je stabilise mon comportement alimentaire", | |
| ), | |
| ) | |
| ); | |
| $accordeonsDatas = array( | |
| 'rationnel' => '0;1;2;3;4;5;6;7;8', | |
| 'intermediaire' => '0;2;1;3;4;5;6;7;8', | |
| 'emotionnel' => '0;5;1;2;6;4;3;7;8' | |
| ); | |
| $accordeonsPattern = '<li class="item"> | |
| <span class="title">#itemTitle#<span class="pca_fold_switch">+</span></span> | |
| <div class="content">#itemContent#</div> | |
| </li>'; | |
| $typeAlimentation = 'rationnel'; | |
| $datasToUse = explode(';', $accordeonsDatas[$typeAlimentation]); | |
| $accordeonHTML = "<script>$('li').click(function() { | |
| $('div.content').each(function() { | |
| $(this).hide('fast'); | |
| $('.pca_fold_switch', this).text('+'); | |
| }) | |
| if($('div.content', this).is(':visible')) { | |
| $('div.content', this).hide('fast'); | |
| } else { | |
| $('div.content', this).show('fast'); | |
| $('.pca_fold_switch', this).text('-'); | |
| } | |
| })</script><ul class='bilan_gratuit_accor'>"; | |
| foreach($datasToUse as $data) { | |
| $accordeonHTML .= strtr($accordeonsPattern, | |
| array( '#itemTitle#' => $aAccordeonsTexts['origin'][$data]['title'], | |
| '#itemContent#' => $aAccordeonsTexts['origin'][$data]['content'] | |
| ) | |
| ); | |
| } | |
| $accordeonHTML .= "</ul>"; | |
| /* HTML Output (RAW DATAS) | |
| <script>$('li').click(function() { $('div.content').each(function() { $(this).hide('fast'); $('.pca_fold_switch', this).text('+'); }) if($('div.content', this).is(':visible')) { $('div.content', this).hide('fast'); } else { $('div.content', this).show('fast'); $('.pca_fold_switch', this).text('-'); } })</script><ul><li class="item"> <span class="title">J'observe mon comportement alimentaire<span class="pca_fold_switch">+</span></span> <div class="content">Je définis : « trop manger » <br /> Je remplis mon carnet découverte <br /> J'apprends la respiration en pleine conscience<br /></div> </li><li class="item"> <span class="title">Je découvre la faim<span class="pca_fold_switch">+</span></span> <div class="content">J'expérimente la faim<br /> Je découvre les causes de mes excès alimentaires<br /> Je remplis mon carnet de la faim et j'identifie mes excès alimentaires<br /> La méthode de la pleine conscience appliquée à la sensation de faim<br /> Je découvre la bonne faim<br /> Attendre la faim augmente le plaisir de manger<br /></div> </li><li class="item"> <span class="title">Je découvre la dégustation<span class="pca_fold_switch">+</span></span> <div class="content">J'apprends la dégustation en pleine conscience<br /> Je déguste les trois premières bouchées<br /> Je remplis mon carnet dégustation<br /></div> </li><li class="item"> <span class="title">Je découvre la satiété<span class="pca_fold_switch">+</span></span> <div class="content">Je mange -> un peu? beaucoup? passionnement?<br /> Activité: Je teste ma satiété</div> </li><li class="item"> <span class="title">J'apprends à déguster les aliments très caloriques<span class="pca_fold_switch">+</span></span> <div class="content">J'établis la liste des aliments tabous <br /> Je déguste trois aliments très caloriques en pleine conscience<br /> Je décris mon aliment idéal<br /> Je réapprends à manger pour me réconforter<br /></div> </li><li class="item"> <span class="title">J'approfondis mes sensations et mes émotions<span class="pca_fold_switch">+</span></span> <div class="content">Je note mes envies de manger émotionnelles<br /> J'apprends le body scan<br /> J'apprends à gérer mes EME<br /></div> </li><li class="item"> <span class="title">Je gère mieux mes fins de journée<span class="pca_fold_switch">+</span></span> <div class="content">J'identifie mes excès alimentaires de fin de journée<br /> J'observe et analyse mes fins de journée<br /> J'apprends à mieux gérer ma fin de journée<br /></div> </li><li class="item"> <span class="title">Je découvre la satisfaction alimentaire<span class="pca_fold_switch">+</span></span> <div class="content">Je remplace mon déjeuner par un aliment très calorique -version salée!<br /> J'ajuste ma consommation journalière à mes besoins et mon appétit prévisionnel<br /> Je remplace mon déjeuner par un aliment très calorique -version sucrée!<br /> J'apprends à maîtriser ma consommation des aliments très caloriques<br /></div> </li><li class="item"> <span class="title">Je stabilise mon comportement alimentaire<span class="pca_fold_switch">+</span></span> <div class="content">Je stabilise mon comportement alimentaire</div> </li></ul> | |
| */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment