3 * Editing toolbar functions
5 * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
6 * @author Andreas Gohr <andi@splitbrain.org>
9 if(!defined('DOKU_INC')) die('meh.');
12 * Prepares and prints an JavaScript array with all toolbar buttons
14 * @emits TOOLBAR_DEFINE
15 * @param string $varname Name of the JS variable to fill
16 * @author Andreas Gohr <andi@splitbrain.org>
18 function toolbar_JSdefines($varname){
23 $evt = new Doku_Event('TOOLBAR_DEFINE', $menu);
24 if ($evt->advise_before()){
27 $menu = array_merge($menu, array(
30 'title' => $lang['qb_bold'],
39 'title' => $lang['qb_italic'],
40 'icon' => 'italic.png',
48 'title' => $lang['qb_underl'],
49 'icon' => 'underline.png',
57 'title' => $lang['qb_code'],
66 'title' => $lang['qb_strike'],
67 'icon' => 'strike.png',
76 'title' => $lang['qb_hequal'],
77 'icon' => 'hequal.png',
79 'text' => $lang['qb_h'],
85 'title' => $lang['qb_hminus'],
86 'icon' => 'hminus.png',
88 'text' => $lang['qb_h'],
94 'title' => $lang['qb_hplus'],
95 'icon' => 'hplus.png',
97 'text' => $lang['qb_h'],
104 'title' => $lang['qb_hs'],
110 'title' => $lang['qb_h1'],
114 'close' => ' ======\n',
118 'title' => $lang['qb_h2'],
122 'close' => ' =====\n',
126 'title' => $lang['qb_h3'],
130 'close' => ' ====\n',
134 'title' => $lang['qb_h4'],
142 'title' => $lang['qb_h5'],
154 'title' => $lang['qb_link'],
155 'icon' => 'link.png',
163 'title' => $lang['qb_extlink'],
164 'icon' => 'linkextern.png',
167 'sample' => 'http://example.com|'.$lang['qb_extlink'],
171 'type' => 'formatln',
172 'title' => $lang['qb_ol'],
180 'type' => 'formatln',
181 'title' => $lang['qb_ul'],
190 'title' => $lang['qb_hr'],
192 'insert' => '\n----\n',
196 'type' => 'mediapopup',
197 'title' => $lang['qb_media'],
198 'icon' => 'image.png',
199 'url' => 'lib/exe/mediamanager.php?ns=',
200 'name' => 'mediaselect',
201 'options'=> 'width=750,height=500,left=20,top=20,scrollbars=yes,resizable=yes',
206 'title' => $lang['qb_smileys'],
207 'icon' => 'smiley.png',
208 'list' => getSmileys(),
209 'icobase'=> 'smileys',
214 'title' => $lang['qb_chars'],
215 'icon' => 'chars.png',
216 'list' => explode(' ','À à Á á  â à ã Ä ä Ǎ ǎ Ă ă Å å Ā ā Ą ą Æ æ Ć ć Ç ç Č č Ĉ ĉ Ċ ċ Ð đ ð Ď ď È è É é Ê ê Ë ë Ě ě Ē ē Ė ė Ę ę Ģ ģ Ĝ ĝ Ğ ğ Ġ ġ Ĥ ĥ Ì ì Í í Î î Ï ï Ǐ ǐ Ī ī İ ı Į į Ĵ ĵ Ķ ķ Ĺ ĺ Ļ ļ Ľ ľ Ł ł Ŀ ŀ Ń ń Ñ ñ Ņ ņ Ň ň Ò ò Ó ó Ô ô Õ õ Ö ö Ǒ ǒ Ō ō Ő ő Œ œ Ø ø Ŕ ŕ Ŗ ŗ Ř ř Ś ś Ş ş Š š Ŝ ŝ Ţ ţ Ť ť Ù ù Ú ú Û û Ü ü Ǔ ǔ Ŭ ŭ Ū ū Ů ů ǖ ǘ ǚ ǜ Ų ų Ű ű Ŵ ŵ Ý ý Ÿ ÿ Ŷ ŷ Ź ź Ž ž Ż ż Þ þ ß Ħ ħ ¿ ¡ ¢ £ ¤ ¥ € ¦ § ª ¬ ¯ ° ± ÷ ‰ ¼ ½ ¾ ¹ ² ³ µ ¶ † ‡ · • º ∀ ∂ ∃ Ə ə ∅ ∇ ∈ ∉ ∋ ∏ ∑ ‾ − ∗ × ⁄ √ ∝ ∞ ∠ ∧ ∨ ∩ ∪ ∫ ∴ ∼ ≅ ≈ ≠ ≡ ≤ ≥ ⊂ ⊃ ⊄ ⊆ ⊇ ⊕ ⊗ ⊥ ⋅ ◊ ℘ ℑ ℜ ℵ ♠ ♣ ♥ ♦ α β Γ γ Δ δ ε ζ η Θ θ ι κ Λ λ μ Ξ ξ Π π ρ Σ σ Τ τ υ Φ φ χ Ψ ψ Ω ω ★ ☆ ☎ ☚ ☛ ☜ ☝ ☞ ☟ ☹ ☺ ✔ ✘ „ “ ” ‚ ‘ ’ « » ‹ › — – … ← ↑ → ↓ ↔ ⇐ ⇑ ⇒ ⇓ ⇔ © ™ ® ′ ″ [ ] { } ~ ( ) % § $ # | @'),
220 'type' => 'signature',
221 'title' => $lang['qb_sig'],
227 } // end event TOOLBAR_DEFINE default action
228 $evt->advise_after();
231 // use JSON to build the JavaScript array
233 print "var $varname = ".$json->encode($menu).";\n";
237 * prepares the signature string as configured in the config
239 * @author Andreas Gohr <andi@splitbrain.org>
241 function toolbar_signature(){
244 /** @var Input $INPUT */
247 $sig = $conf['signature'];
248 $sig = dformat(null,$sig);
249 $sig = str_replace('@USER@',$INPUT->server
->str('REMOTE_USER'),$sig);
250 $sig = str_replace('@NAME@',$INFO['userinfo']['name'],$sig);
251 $sig = str_replace('@MAIL@',$INFO['userinfo']['mail'],$sig);
252 $sig = str_replace('@DATE@',dformat(),$sig);
253 $sig = str_replace('\\\\n','\\n',addslashes($sig));
257 //Setup VIM: ex: et ts=4 :