| [ Index ] |
|
Code source de Plume CMS 1.2.2 |
1 <?php 2 /* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 3 /* 4 # ***** BEGIN LICENSE BLOCK ***** 5 # This file is part of Plume CMS, a website management application. 6 # Copyright (C) 2001-2006 Loic d'Anterroches and contributors. 7 # 8 # Credits: Olivier Meunier. 9 # 10 # Plume CMS is free software; you can redistribute it and/or modify 11 # it under the terms of the GNU General Public License as published by 12 # the Free Software Foundation; either version 2 of the License, or 13 # (at your option) any later version. 14 # 15 # Plume CMS is distributed in the hope that it will be useful, 16 # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 # GNU General Public License for more details. 19 # 20 # You should have received a copy of the GNU General Public License 21 # along with this program; if not, write to the Free Software 22 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 23 # 24 # ***** END LICENSE BLOCK ***** */ 25 26 class VisualEdit 27 { 28 function onPrintHeader($name, $p) 29 { 30 $p['m']->l10n->loadPlugin($p['m']->user->lang, 'visualedit'); 31 $_px_ptheme = $p['m']->user->getPluginTheme('visualedit'); 32 $i = strlen($p['m']->user->wdata[$p['m']->user->website]['website_reurl']); 33 $base = substr($p['m']->user->wdata[$p['m']->user->website]['website_url'], 0, -$i); 34 echo '<script type="text/javascript" src="tools/visualedit/js/common.js"></script>'; 35 echo '<link rel="stylesheet" type="text/css" href="tools/visualedit/themes/'.$_px_ptheme.'/jsToolBar.css" />'; 36 37 echo '<script type="text/javascript" src="tools/visualedit/js/jsToolBar.js"></script>'; 38 echo '<script type="text/javascript" src="tools/visualedit/js/jsToolBar.wysiwyg.js"></script>'; 39 echo '<script type="text/javascript" src="tools/visualedit/js/jsToolBar.dotclear.js"></script>'; 40 41 echo '<script type="text/javascript"> jsToolBar.prototype.dialog_url = \'popup.php\'; '; 42 echo 'jsToolBar.prototype.iframe_css = \'body{font: x-small/1.5em Verdana,Geneva,sans-serif;color : #000;background: #eef3f5; margin: 0;padding : 2px;border: none;}pre, code, kbd, samp {font-family:"Courier New",Courier,monospace;font-size : 1.1em;}code {color : #666;font-weight : bold;}body > p:first-child {margin-top: 0;}\'; '; 43 echo 'jsToolBar.prototype.base_url = \''.$base.'\';'; 44 echo 'jsToolBar.prototype.switcher_visual_title = \''.addslashes(__('visual')).'\'; '; 45 echo 'jsToolBar.prototype.switcher_source_title = \''.addslashes(__('source')).'\'; '; 46 echo 'jsToolBar.prototype.legend_msg = \''.addslashes(__('You can use the following shortcuts to format your text.')).'\'; '; 47 echo 'jsToolBar.prototype.elements.strong.title = \''.addslashes(__('Strong emphasis')).'\'; '; 48 echo 'jsToolBar.prototype.elements.em.title = \''.addslashes(__('Emphasis')).'\'; '; 49 echo 'jsToolBar.prototype.elements.ins.title = \''.addslashes(__('Inserted')).'\'; '; 50 echo 'jsToolBar.prototype.elements.del.title = \''.addslashes(__('Deleted')).'\'; '; 51 echo 'jsToolBar.prototype.elements.quote.title = \''.addslashes(__('Inline quote')).'\'; '; 52 echo 'jsToolBar.prototype.elements.code.title = \''.addslashes(__('Code')).'\'; '; 53 echo 'jsToolBar.prototype.elements.br.title = \''.addslashes(__('Line break')).'\'; '; 54 echo 'jsToolBar.prototype.elements.blockquote.title = \''.addslashes(__('Blockquote')).'\'; '; 55 echo 'jsToolBar.prototype.elements.pre.title = \''.addslashes(__('Preformated text')).'\'; '; 56 echo 'jsToolBar.prototype.elements.ul.title = \''.addslashes(__('Unordered list')).'\'; '; 57 echo 'jsToolBar.prototype.elements.ol.title = \''.addslashes(__('Ordered list')).'\'; '; 58 echo 'jsToolBar.prototype.elements.link.title = \''.addslashes(__('Link')).'\'; '; 59 echo 'jsToolBar.prototype.elements.link.href_prompt = \''.addslashes(__('URL?')).'\'; '; 60 echo 'jsToolBar.prototype.elements.link.hreflang_prompt = \''.addslashes(__('Language?')).'\'; '; 61 echo 'jsToolBar.prototype.elements.img.title = \''.addslashes(__('External image')).'\'; '; 62 echo 'jsToolBar.prototype.elements.img.src_prompt = \''.addslashes(__('URL?')).'\'; '; 63 echo 'jsToolBar.prototype.elements.img_select.title = \''.addslashes(__('Image chooser')).'\'; </script>'; 64 echo ' 65 <script type="text/javascript"> 66 addLoadEvent(function() { 67 if (window.opener && window.opener.the_toolbar) 68 tb = window.opener.the_toolbar; 69 form = document.getElementById(\'formPost\'); 70 if (form) { 71 var formatField = null; 72 if (form.n_content_format) { 73 excerptTb = new jsToolBar(document.getElementById(\'n_content\')); 74 formatField = document.getElementById(\'n_content_format\'); 75 } else if (form.a_description_format) { 76 excerptTb = new jsToolBar(document.getElementById(\'a_description\')); 77 formatField = document.getElementById(\'a_description_format\'); 78 } else if (form.a_page_content_format) { 79 excerptTb = new jsToolBar(document.getElementById(\'a_page_content\')); 80 formatField = document.getElementById(\'a_page_content_format\'); 81 } else if (form.c_format) { 82 excerptTb = new jsToolBar(document.getElementById(\'c_description\')); 83 formatField = document.getElementById(\'c_format\'); 84 } 85 elt = document.getElementById(\'insert-img\'); 86 if (elt) elt.style.display = \'none\'; 87 if (formatField) { 88 formatField.onchange = function() { 89 if (this.value == \'wiki\') { 90 excerptTb.switchMode(this.value); 91 } else { 92 excerptTb.switchMode(\'xhtml\'); 93 } 94 }; 95 excerptTb.draw(); 96 if (formatField.value == \'wiki\') { 97 excerptTb.switchMode(\'wiki\'); 98 } 99 } 100 } 101 }); 102 </script>'; 103 } 104 } 105 106 Hook::register('onPrintHeaderManagerPage', 'VisualEdit', 'onPrintHeader'); 107 Hook::register('onPrintHeaderManagerPopUpPage', 'VisualEdit', 'onPrintHeader'); 108 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
| Généré le : Mon Nov 26 11:57:01 2007 | par Balluche grâce à PHPXref 0.7 |
|