/_plugins_/porte_plume_extras/enluminures_typographiques_v3/enluminures_typo_pipelines.php

https://bitbucket.org/pombredanne/spip-zone-treemap · PHP · 213 lines · 188 code · 12 blank · 13 comment · 2 complexity · 75e085bab2ce749b8ab150549b46e8ed MD5 · raw file

  1. <?php
  2. if (!defined("_ECRIRE_INC_VERSION")) return;
  3. function typoenluminee_porte_plume_barre_pre_charger($barres){
  4. $barre = &$barres['edition'];
  5. $barre->cacher('stroke_through');
  6. $module_barre = "barre_outils";
  7. if (intval($GLOBALS['spip_version_branche'])>2)
  8. $module_barre = "barreoutils";
  9. $barre->set('header1', array(
  10. // groupe formatage paragraphe
  11. "dropMenu" => array(
  12. // bouton <cadre>
  13. array(
  14. "id" => 'intertitre',
  15. "name" => _T('barre_intertitre'),
  16. "className" => 'outil_intertitre1',
  17. "openWith" => "\n{{{",
  18. "closeWith" => "}}}\n",
  19. "display" => true,
  20. "selectionType" => "line",
  21. ),
  22. array(
  23. "id" => 'intertitre2',
  24. "name" => _T('enlumtypo:barre_intertitre2'),
  25. "className" => 'outil_intertitre2',
  26. "openWith" => "\n{{{**",
  27. "closeWith" => "}}}\n",
  28. "display" => true,
  29. "selectionType" => "line",
  30. ),
  31. array(
  32. "id" => 'intertitre3',
  33. "name" => _T('enlumtypo:barre_intertitre3'),
  34. "className" => 'outil_intertitre3',
  35. "openWith" => "\n{{{***",
  36. "closeWith" => "}}}\n",
  37. "display" => true,
  38. "selectionType" => "line",
  39. ),
  40. array(
  41. "id" => 'alignerdroite',
  42. "name" => _T('enlumtypo:barre_alignerdroite'),
  43. "className" => 'outil_alignerdroite',
  44. "openWith" => "\n[/",
  45. "closeWith" => "/]\n",
  46. "display" => true,
  47. "selectionType" => "line",
  48. ),
  49. array(
  50. "id" => 'alignergauche',
  51. "name" => _T('enlumtypo:barre_alignergauche'),
  52. "className" => 'outil_alignergauche',
  53. "openWith" => "\n[!",
  54. "closeWith" => "!]\n",
  55. "display" => true,
  56. "lang" => array('ar','fa'),
  57. "selectionType" => "line",
  58. ),
  59. array(
  60. "id" => 'cadretexte',
  61. "name" => _T('enlumtypo:barre_encadrer'),
  62. "className" => 'outil_cadretexte',
  63. "openWith" => "\n[(",
  64. "closeWith" => ")]\n",
  65. "display" => true,
  66. "selectionType" => "line",
  67. ),
  68. // code spip
  69. array(
  70. "id" => 'barre_cadre',
  71. "name" => _T($module_barre.':barre_cadre'),
  72. "className" => "outil_barre_cadre",
  73. "openWith" => "\n&lt;cadre&gt;",
  74. "closeWith" => "&lt;/cadre&gt;\n",
  75. "display" => true,
  76. "selectionType" => "line",
  77. ),
  78. ),
  79. ));
  80. $barre->set('bold', array(
  81. // groupe formatage texte
  82. "dropMenu" => array(
  83. // Mise en évidence (gras + couleur)
  84. array(
  85. "id" => 'miseenevidence',
  86. "name" => _T('enlumtypo:barre_miseenevidence'),
  87. "className" => "outil_miseenevidence",
  88. "openWith" => "[*",
  89. "closeWith" => "*]",
  90. "display" => true,
  91. "selectionType" => "word",
  92. ),
  93. // Mise en évidence2 (gras + autre couleur)
  94. array(
  95. "id" => 'miseenevidence2',
  96. "name" => _T('enlumtypo:barre_miseenevidence2'),
  97. "className" => "outil_miseenevidence2",
  98. "openWith" => "[**",
  99. "closeWith" => "*]",
  100. "display" => true,
  101. "selectionType" => "word",
  102. ),
  103. // montrer une suppression
  104. array(
  105. "id" => 'stroke_through_et',
  106. "name" => _T('enlumtypo:barre_barre'), // :-)
  107. "className" => "outil_stroke_through_et",
  108. "openWith" => "<del>",
  109. "closeWith" => "</del>",
  110. "display" => true,
  111. "selectionType" => "word",
  112. ),
  113. // Mise en exposant
  114. array(
  115. "id" => 'exposant',
  116. "name" => _T('enlumtypo:barre_exposant'),
  117. "className" => "outil_exposant",
  118. "openWith" => "<sup>",
  119. "closeWith" => "</sup>",
  120. "display" => true,
  121. "selectionType" => "word",
  122. ),
  123. // Mise en indice
  124. array(
  125. "id" => 'indice',
  126. "name" => _T('enlumtypo:barre_indice'),
  127. "className" => "outil_indice",
  128. "openWith" => "<sub>",
  129. "closeWith" => "</sub>",
  130. "display" => true,
  131. "selectionType" => "word",
  132. ),
  133. // cadre spip
  134. array(
  135. "id" => 'barre_code',
  136. "name" => _T($module_barre.':barre_code'),
  137. "className" => "outil_barre_code",
  138. "openWith" => "&lt;code&gt;",
  139. "closeWith" => "&lt;/code&gt;",
  140. "display" => true,
  141. "selectionType" => "word",
  142. ),
  143. ),
  144. ));
  145. // Appel Tableau
  146. $barre->ajouterApres('notes', array(
  147. "id" => 'barre_tableau',
  148. "name" => _T('enlumtypo:barre_tableau'),
  149. "className" => "outil_barre_tableau",
  150. "replaceWith" => 'function(markitup) { zone_selection = markitup.textarea; window.open("?exec=tableau_edit", "","scrollbars=yes,resizable=yes,width=700,height=600") }',
  151. "display" => true,
  152. "selectionType" => "line",
  153. ));
  154. $barre->set('quote', array(
  155. "dropMenu" => array(
  156. // poesie spip
  157. array(
  158. "id" => 'barre_poesie',
  159. "name" => _T($module_barre.':barre_poesie'),
  160. "className" => "outil_barre_poesie",
  161. "openWith" => "\n&lt;poesie&gt;",
  162. "closeWith" => "&lt;/poesie&gt;\n",
  163. "display" => true,
  164. "selectionType" => "line",
  165. ),
  166. ),
  167. ));
  168. // Petites capitales
  169. $barre->ajouterApres('italic', array(
  170. "id" => 'petitescapitales',
  171. "name" => _T('enlumtypo:barre_petitescapitales'),
  172. "className" => "outil_petitescapitales",
  173. "openWith" => "<sc>",
  174. "closeWith" => "</sc>",
  175. "display" => true,
  176. "selectionType" => "word",
  177. ));
  178. return $barres;
  179. }
  180. function typoenluminee_porte_plume_lien_classe_vers_icone($flux){
  181. return array_merge($flux, array(
  182. 'outil_intertitre1' => array('spt-v1.png','-10px -226px'), //'intertitre.png'
  183. 'outil_intertitre2' => array('intertitre2.png','0'),
  184. 'outil_intertitre3' => array('intertitre3.png','0'),
  185. 'outil_alignerdroite' => array('right.png','0'),
  186. 'outil_alignergauche' => array('left.png','0'),
  187. 'outil_stroke_through_et' => array('spt-v1.png','-10px -946px'), //'text_strikethrough.png'
  188. 'outil_cadretexte' => array('cadretexte.png','0'),
  189. 'outil_speciaux' => array('tag.png','0'),
  190. 'outil_barre_code' => array('page_white_code_red.png','0'),
  191. 'outil_barre_cadre' => array('page_white_code.png','0'),
  192. 'outil_miseenevidence' => array('miseenevidence.png','0'),
  193. 'outil_miseenevidence2' => array('miseenevidence2.png','0'),
  194. 'outil_exposant' => array('exposant.png','0'),
  195. 'outil_indice' => array('indice.png','0'),
  196. 'outil_petitescapitales' => array('petitescapitales.png','0'),
  197. 'outil_barre_poesie' => array('poesie.png','0'),
  198. 'outil_barre_tableau' => array('barre-tableau.png','0'),
  199. ));
  200. }
  201. ?>