PageRenderTime 37ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/_squelettes_/eva-web/4_2/eva_habillage/formulaires/evahabillage_auteur.html

https://bitbucket.org/pombredanne/spip-zone-treemap
HTML | 288 lines | 282 code | 6 blank | 0 comment | 0 complexity | 5ad4b97a236e59ba81ecf834bc9def45 MD5 | raw file
  1. <?php
  2. $test_3cols=sql_select('habillage','spip_eva_habillage',"sauvegarde='Defaut'");
  3. $tab_3cols=sql_fetch($test_3cols);
  4. if (strpos($tab_3cols['habillage'],'3colonnes')) {
  5. $test_3_colonnes=true;
  6. $eva_gauche=120;
  7. $eva_centre=249;
  8. $eva_droite=120;
  9. }
  10. else {
  11. $test_3_colonnes=false;
  12. if (strpos($tab_3cols['habillage'],'droite')) {
  13. $test_droite=true;
  14. $eva_gauche=false;
  15. $eva_centre=309;
  16. $eva_droite=180;
  17. }
  18. else {
  19. $eva_centre=309;
  20. $eva_gauche=180;
  21. $eva_droite=false;
  22. }
  23. }
  24. include_spip("inc/eva_habillage_definition_themes");
  25. $les_blocs_array = EVA_les_blocs();
  26. $mes_blocs=$les_blocs_array['auteur'];
  27. ?>
  28. <div class="formulaire_spip formulaire_configurer formulaire_#FORM formulaire_#FORM-#ENV{id,nouveau}">
  29. <h3 class='titrem'><img src="#CHEMIN_IMAGE{blocs.png}" class="cadre-icone" /><center>Gestion des blocs dans les pages de type <em>auteur</em></center></h3>
  30. [<p class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok})</p>]
  31. [<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]
  32. <form method='post' action='#ENV{action}' name ="formvignette">
  33. [(#REM) declarer les hidden qui declencheront le service du formulaire
  34. parametre : url d'action ]
  35. #ACTION_FORMULAIRE{#ENV{action}}
  36. <table style="margin-top:-30px; margin-bottom:-10px;"><tr valign="top">
  37. <?php
  38. if ($eva_gauche) {
  39. echo "<th width=$eva_gauche>";
  40. echo '<div class="formulaire_spip formulaire_configurer formulaire_#FORM formulaire_#FORM-#ENV{id,nouveau}">';
  41. echo "<h3 class='titrem'>Colonne de gauche</h3>";
  42. $test_noisettes=sql_select('*','spip_eva_habillage_images',"type='bloc' AND nom_habillage='Defaut' AND attach='auteur' AND nom_image='gauche'",'','pos_x');
  43. while ($tab_noisettes=sql_fetch($test_noisettes)) {
  44. if ($tab_noisettes['repetition']=='perso') {$eva_nom_du_bloc='Squelette '.$tab_noisettes['nom_div'].'.html';}
  45. else {$eva_nom_du_bloc=_T('evahabillage:'.$tab_noisettes['nom_div']);}
  46. echo '<div class="formulaire_spip formulaire_configurer formulaire_#FORM formulaire_#FORM-#ENV{id,nouveau}" style="padding-bottom:4px;">';
  47. echo "<h3 class='titrem'>$eva_nom_du_bloc</h3>";
  48. echo 'Passer &agrave;<br />';
  49. echo '<input type="hidden" name="'.$tab_noisettes['nom_div'].'_nom_bloc'.'" value="'.$tab_noisettes['nom_div'].'">';
  50. echo "<select name='".$tab_noisettes['nom_div']."'>
  51. <option value='gauche' selected>gauche</option>
  52. <option value='centre'>centre</option>";
  53. if ($eva_droite) {echo "<option value='droite'>droite</option>";}
  54. echo "<option value='non'>Non affich&eacute;</option>";
  55. echo '</select><br />';
  56. echo 'Ordre';
  57. echo "<select name='".$tab_noisettes['nom_div']."_pos_x'>";
  58. for ($i=1;$i<=9;$i++) {
  59. echo '<option value="'.$i.'" ';
  60. if ($i==$tab_noisettes['pos_x']) {echo 'selected';}
  61. echo '>'.$i.'</option>';
  62. }
  63. echo '</select>';
  64. echo '</div>';
  65. }
  66. echo '</div>';
  67. echo '</th>';
  68. }
  69. if ($eva_centre) {
  70. echo "<th width=$eva_centre>";
  71. echo '<div class="formulaire_spip formulaire_configurer formulaire_#FORM formulaire_#FORM-#ENV{id,nouveau}">';
  72. echo "<h3 class='titrem'>Colonne centrale</h3>";
  73. $test_noisettes=sql_select('*','spip_eva_habillage_images',"type='bloc' AND nom_habillage='Defaut' AND attach='auteur' AND nom_image='centre'",'','pos_x ASC');
  74. while ($tab_noisettes=sql_fetch($test_noisettes)) {
  75. if ($tab_noisettes['repetition']=='perso') {$eva_nom_du_bloc='Squelette '.$tab_noisettes['nom_div'].'.html';}
  76. else {$eva_nom_du_bloc=_T('evahabillage:'.$tab_noisettes['nom_div']);}
  77. echo '<div class="formulaire_spip formulaire_configurer formulaire_#FORM formulaire_#FORM-#ENV{id,nouveau}" style="padding-bottom:4px;">';
  78. echo "<h3 class='titrem'>$eva_nom_du_bloc</h3>";
  79. echo 'Passer &agrave;<br />';
  80. echo '<input type="hidden" name="'.$tab_noisettes['nom_div'].'_nom_bloc'.'" value="'.$tab_noisettes['nom_div'].'">';
  81. echo "<select name='".$tab_noisettes['nom_div']."'>";
  82. if ($eva_gauche) {echo "<option value='gauche'>gauche</option>";}
  83. echo "<option value='centre' selected>centre</option>";
  84. if (($eva_droite) AND (!$eva_gauche)) {echo "<option value='gauche'>droite</option>";}
  85. elseif ($eva_droite) {echo "<option value='droite'>droite</option>";}
  86. echo "<option value='non'>Non affich&eacute;</option>";
  87. echo '</select><br />';
  88. echo 'Ordre';
  89. echo "<select name='".$tab_noisettes['nom_div']."_pos_x'>";
  90. for ($i=1;$i<=9;$i++) {
  91. echo '<option value="'.$i.'" ';
  92. if ($i==$tab_noisettes['pos_x']) {echo 'selected';}
  93. echo '>'.$i.'</option>';
  94. }
  95. echo '</select>';
  96. echo '</div>';
  97. }
  98. echo "</div>";
  99. echo '</th>';
  100. }
  101. if ($eva_droite) {
  102. echo "<th width=$eva_droite>";
  103. echo '<div class="formulaire_spip formulaire_configurer formulaire_#FORM formulaire_#FORM-#ENV{id,nouveau}">';
  104. echo "<h3 class='titrem'>Colonne de droite</h3>";
  105. if (!$eva_gauche) {$eva_colonne_test='gauche';} else {$eva_colonne_test='droite';}
  106. $test_noisettes=sql_select('*','spip_eva_habillage_images',"type='bloc' AND nom_habillage='Defaut' AND attach='auteur' AND nom_image='$eva_colonne_test'",'','pos_x ASC');
  107. while ($tab_noisettes=sql_fetch($test_noisettes)) {
  108. if ($tab_noisettes['repetition']=='perso') {$eva_nom_du_bloc='Squelette '.$tab_noisettes['nom_div'].'.html';}
  109. else {$eva_nom_du_bloc=_T('evahabillage:'.$tab_noisettes['nom_div']);}
  110. echo '<div class="formulaire_spip formulaire_configurer formulaire_#FORM formulaire_#FORM-#ENV{id,nouveau}" style="padding-bottom:4px;">';
  111. echo "<h3 class='titrem'>$eva_nom_du_bloc</h3>";
  112. echo 'Passer &agrave;<br />';
  113. echo '<input type="hidden" name="'.$tab_noisettes['nom_div'].'_nom_bloc'.'" value="'.$tab_noisettes['nom_div'].'">';
  114. echo "<select name='".$tab_noisettes['nom_div']."'>";
  115. if ($eva_gauche) {echo "<option value='gauche'>gauche</option>";}
  116. echo "<option value='centre'>centre</option>";
  117. echo "<option value='".$eva_colonne_test."' selected>droite</option>";
  118. echo "<option value='non'>Non affich&eacute;</option>";
  119. echo '</select><br />';
  120. echo 'Ordre';
  121. echo "<select name='".$tab_noisettes['nom_div']."_pos_x'>";
  122. for ($i=1;$i<=9;$i++) {
  123. echo '<option value="'.$i.'" ';
  124. if ($i==$tab_noisettes['pos_x']) {echo 'selected';}
  125. echo '>'.$i.'</option>';
  126. }
  127. echo '</select>';
  128. echo '</div>';
  129. }
  130. echo '</div>';
  131. echo '</th>';
  132. }
  133. ?>
  134. </tr></table>
  135. <?php
  136. $texte_eva='<table><tr><th width=489>';
  137. $texte_eva.='<div class="formulaire_spip formulaire_configurer formulaire_#FORM formulaire_#FORM-#ENV{id,nouveau}">';
  138. $texte_eva.="<h3 class='titrem'>Squelettes actuellement non affich&eacute;s</h3>";
  139. $texte_eva.= "<table class='spip'><tr class='row_even'>";
  140. $texte_eva.= "<th>Squelette</th><th>Colonne</th><th>Ordre</th>";
  141. $texte_eva.= '</tr>';
  142. $test_affichage_eva=false;
  143. $test_noisettes=sql_select('*','spip_eva_habillage_images',"type='bloc' AND nom_habillage='Defaut' AND attach='auteur'",'','pos_x ASC');
  144. while ($tab_noisettes=sql_fetch($test_noisettes)) {
  145. if ((!$eva_droite) AND ($tab_noisettes['nom_image']=='droite')) {
  146. echo '<input type="hidden" name="'.$tab_noisettes['nom_div'].'_nom_bloc'.'" value="'.$tab_noisettes['nom_div'].'">';
  147. $test_affichage_eva=true;
  148. $texte_eva.="<tr class='row_odd'><th>";
  149. if ($tab_noisettes['repetition']) {
  150. $texte_eva.= 'Squelette '.$tab_noisettes['nom_div'].'.html';
  151. }
  152. else {
  153. $texte_eva.= _T('evahabillage:'.$tab_noisettes['nom_div']);
  154. }
  155. $texte_eva.= "</th><th><select name='".$tab_noisettes['nom_div']."'>";
  156. $texte_eva.= "<option value='gauche'>gauche</option>";
  157. $texte_eva.= "<option value='centre'>centre</option>";
  158. $texte_eva.= "<option value='droite' selected>droite</option>";
  159. $texte_eva.= "<option value='non'>Non affich&eacute;</option>";
  160. $texte_eva.= '</select></th><th>';
  161. $texte_eva.= "<select name='".$tab_noisettes['nom_div']."_pos_x'>";
  162. for ($i=1;$i<=9;$i++) {
  163. $texte_eva.= '<option value="'.$i.'" ';
  164. if ($i==$tab_noisettes['pos_x']) {$texte_eva.= 'selected';}
  165. $texte_eva.= '>'.$i.'</option>';
  166. }
  167. $texte_eva.= '</select></th>';
  168. $texte_eva.= '</tr>';
  169. }
  170. elseif ((!$eva_gauche) AND ($tab_noisettes['nom_image']=='droite')) {
  171. echo '<input type="hidden" name="'.$tab_noisettes['nom_div'].'_nom_bloc'.'" value="'.$tab_noisettes['nom_div'].'">';
  172. $test_affichage_eva=true;
  173. $texte_eva.="<tr class='row_odd'><th>";
  174. if ($tab_noisettes['repetition']) {
  175. $texte_eva.= 'Squelette '.$tab_noisettes['nom_div'].'.html';
  176. }
  177. else {
  178. $texte_eva.= _T('evahabillage:'.$tab_noisettes['nom_div']);
  179. }
  180. $texte_eva.= "</th><th><select name='".$tab_noisettes['nom_div']."'>";
  181. $texte_eva.= "<option value='gauche'>droite</option>";
  182. $texte_eva.= "<option value='centre'>centre</option>";
  183. $texte_eva.= "<option value='droite' selected>gauche</option>";
  184. $texte_eva.= "<option value='non'>Non affich&eacute;</option>";
  185. $texte_eva.= '</select></th><th>';
  186. $texte_eva.= "<select name='".$tab_noisettes['nom_div']."_pos_x'>";
  187. for ($i=1;$i<=9;$i++) {
  188. $texte_eva.= '<option value="'.$i.'" ';
  189. if ($i==$tab_noisettes['pos_x']) {$texte_eva.= 'selected';}
  190. $texte_eva.= '>'.$i.'</option>';
  191. }
  192. $texte_eva.= '</select></th>';
  193. $texte_eva.= '</tr>';
  194. }
  195. elseif (($tab_noisettes['nom_image']=='non')) {
  196. echo '<input type="hidden" name="'.$tab_noisettes['nom_div'].'_nom_bloc'.'" value="'.$tab_noisettes['nom_div'].'">';
  197. $test_affichage_eva=true;
  198. $texte_eva.="<tr class='row_odd'><th>";
  199. if ($tab_noisettes['repetition']) {
  200. $texte_eva.= 'Squelette '.$tab_noisettes['nom_div'].'.html';
  201. }
  202. else {
  203. $texte_eva.= _T('evahabillage:'.$tab_noisettes['nom_div']);
  204. }
  205. $texte_eva.= "</th><th><select name='".$tab_noisettes['nom_div']."'>";
  206. $texte_eva.= "<option value='non' selected='selected'>Non affich&eacute;</option>";
  207. $texte_eva.= "<option value='gauche'>";
  208. if (!$eva_gauche) {$texte_eva.='droite';} else {$texte_eva.='gauche';}
  209. $texte_eva.="</option>";
  210. $texte_eva.= "<option value='centre'>centre</option>";
  211. if (($tab_3cols['habillage']=='eva4_3colonnes.css') OR ($tab_3cols['habillage']=='eva4_basic_3colonnes.css')){
  212. $texte_eva.= "<option value='droite'>droite</option>";
  213. }
  214. $texte_eva.= '</select></th><th>';
  215. $texte_eva.= "<select name='".$tab_noisettes['nom_div']."_pos_x'>";
  216. for ($i=1;$i<=9;$i++) {
  217. $texte_eva.= '<option value="'.$i.'" ';
  218. if ($i==$tab_noisettes['pos_x']) {$texte_eva.= 'selected';}
  219. $texte_eva.= '>'.$i.'</option>';
  220. }
  221. $texte_eva.= '</select></th>';
  222. $texte_eva.= '</tr>';
  223. }
  224. }
  225. $texte_eva.= '</table>';
  226. $texte_eva.= '</div>';
  227. if ($test_affichage_eva) { echo $texte_eva;}
  228. ?>
  229. <div style="text-align:center;"><input type="submit" name="bloc_auteur_valider" value="<:evahabillage:eva_valider:>"></div>
  230. </th></tr></table><hr />
  231. <div class="formulaire_spip formulaire_configurer formulaire_#FORM formulaire_#FORM-#ENV{id,nouveau}">
  232. <h3 class='titrem'>Ins&eacute;rer un squelette personnel de type bloc dans les pages des auteurs ?</h3>
  233. <:evahabillage:eva_choisir_squelette1_auteur:><br />&nbsp;<br />
  234. <:evahabillage:eva_choisir_squelette2:><br />&nbsp;<br />
  235. <table class="spip"><tr class="row_odd"><th>Nom du squelette</th><th>Dans la colonne</th><th>Ordre</th></tr>
  236. <tr class="row_even"><th><input type="text" name="eva_mon_bloc_perso_nom_auteur" size="30" /></th>
  237. <th><select name="eva_mon_bloc_perso_skel_auteur">
  238. <?php
  239. if ($test_3_colonnes) {
  240. echo '<option label="position du bloc" value="gauche">gauche</option>
  241. <option label="position du bloc" value="centre" selected="selected">centre</option>
  242. <option label="position du bloc" value="droite">droite</option>';
  243. }
  244. elseif (!$eva_gauche) {
  245. echo '<option label="position du bloc" value="centre" selected="selected">centre</option>
  246. <option label="position du bloc" value="gauche">droite</option>';
  247. }
  248. elseif (!$eva_droite) {
  249. echo '<option label="position du bloc" value="gauche">gauche</option>
  250. <option label="position du bloc" value="centre" selected="selected">centre</option>';
  251. }
  252. ?>
  253. </select></th>
  254. <th><select name="eva_mon_bloc_perso_pos_x_auteur">
  255. <?php
  256. for ($i=1;$i<=9;$i++) {
  257. echo '<option label="ordre du bloc" value="'.$i.'" >'.$i.'</option>';
  258. }
  259. ?>
  260. </select></th>
  261. </tr>
  262. </table>
  263. <div style="text-align:center;"><input type="submit" name="skel_perso_auteur" value="Ins&eacute;rer"></div>
  264. <br />
  265. </div>
  266. <?php
  267. $test_suppr=false;
  268. $texte_suppr="<hr /><div class='formulaire_spip formulaire_configurer formulaire_#FORM formulaire_#FORM-#ENV{id,nouveau}'>
  269. <h3 class='titrem'>Supprimer l'entr&eacute;e d'un squelette personnel dans les pages des auteurs ?</h3>";
  270. $texte_suppr.="<select name='eva_suppr_skel_perso_auteur'>";
  271. $supp_skel_perso=sql_select('*','spip_eva_habillage_images',"type='bloc' AND nom_habillage='Defaut' AND repetition='perso' AND attach='auteur'");
  272. while ($tab_supp_skel_perso=sql_fetch($supp_skel_perso)) {
  273. $test_suppr=true;
  274. $texte_suppr.= '<option value="'.$tab_supp_skel_perso['id'].'">'.$tab_supp_skel_perso['nom_div'].'.html</option>';
  275. }
  276. $texte_suppr.="</select>";
  277. $texte_suppr.= '<div style="text-align:center; margin:5px;"><input type="submit" name ="submit_supprime_skel_perso_auteur" value="'._T('evahabillage:eva_suppression').'"></div>';
  278. $texte_suppr.="</div>";
  279. if ($test_suppr) echo $texte_suppr;
  280. ?>
  281. </form>
  282. </div>