[ Index ] |
PHP Cross Reference of phpwcms V1.4.7 _r403 (01.11.10) |
[Summary view] [Print] [Text view]
1 <?php 2 /************************************************************************************* 3 Copyright notice 4 5 (c) 2002-2010 Oliver Georgi (oliver@phpwcms.de) // All rights reserved. 6 7 This script is part of PHPWCMS. The PHPWCMS web content management system is 8 free software; you can redistribute it and/or modify it under the terms of 9 the GNU General Public License as published by the Free Software Foundation; 10 either version 2 of the License, or (at your option) any later version. 11 12 The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html 13 A copy is found in the textfile GPL.txt and important notices to the license 14 from the author is found in LICENSE.txt distributed with these scripts. 15 16 This script is distributed in the hope that it will be useful, but WITHOUT ANY 17 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 18 PARTICULAR PURPOSE. See the GNU General Public License for more details. 19 20 This copyright notice MUST APPEAR in all copies of the script! 21 *************************************************************************************/ 22 23 // wysiwyg editor 24 25 if(!isset($wysiwyg_editor['value'])) $wysiwyg_editor['value'] = ''; 26 if(!isset($wysiwyg_editor['field'])) $wysiwyg_editor['field'] = 'wysiwyg_editor'; 27 if(!isset($wysiwyg_editor['height'])) $wysiwyg_editor['height'] = '350px'; 28 if(!isset($wysiwyg_editor['width'])) $wysiwyg_editor['width'] = '440px'; 29 if(!isset($wysiwyg_editor['rows'])) $wysiwyg_editor['rows'] = '15'; 30 if(!isset($wysiwyg_editor['editor'])){ 31 $wysiwyg_editor['editor'] = 1; 32 if(isset($_SESSION["WYSIWYG_EDITOR"])) $wysiwyg_editor['editor'] = $_SESSION["WYSIWYG_EDITOR"]; 33 } 34 $wysiwyg_editor['lang'] = isset($_SESSION["wcs_user_lang"]) ? $_SESSION["wcs_user_lang"] : 'en'; 35 36 if($wysiwyg_editor['editor'] == 2) { 37 38 //load FCKeditor 39 include_once (PHPWCMS_ROOT.'/include/inc_ext/fckeditor/fckeditor.php'); 40 41 $oFCKeditor = new FCKeditor($wysiwyg_editor['field']); 42 $oFCKeditor->BasePath = PHPWCMS_URL.'include/inc_ext/fckeditor/'; 43 $oFCKeditor->Config['CustomConfigurationsPath'] = PHPWCMS_URL.'include/inc_ext/fckeditor/fckeditor_config.js.php' ; 44 45 $oFCKeditor->Value = $wysiwyg_editor['value']; 46 $oFCKeditor->Width = str_replace('px', '', $wysiwyg_editor['width']); 47 $oFCKeditor->Height = str_replace('px', '', $wysiwyg_editor['height']); 48 $oFCKeditor->ToolbarSet = $_SESSION['WYSIWYG_TEMPLATE']; 49 $oFCKeditor->Create(); 50 51 } elseif($wysiwyg_editor['editor'] == 1) { 52 53 $BE['HEADER']['ckeditor.js'] = getJavaScriptSourceLink('include/inc_ext/ckeditor/ckeditor.js'); 54 $BE['HEADER']['ckeditor.styles.default.js'] = getJavaScriptSourceLink(TEMPLATE_PATH.'config/ckeditor/ckeditor.styles.default.js'); 55 56 $wysiwyg_editor['template'] = 'Basic'; 57 switch(strtolower($_SESSION['WYSIWYG_TEMPLATE'])) { 58 case 'phpwcms': 59 $wysiwyg_editor['template'] = 'phpwcms'; 60 break; 61 case 'default': 62 case 'full': 63 $wysiwyg_editor['template'] = 'Full'; 64 break; 65 } 66 67 // simple textarea - no WYSIWYG editor 68 echo '<textarea name="'.$wysiwyg_editor['field'].'" rows="'.$wysiwyg_editor['rows']; 69 echo '" class="v12" id="'.$wysiwyg_editor['field'].'" '; 70 echo 'style="width:'.$wysiwyg_editor['width'].';height:'.$wysiwyg_editor['height'].';">'; 71 echo html_specialchars($wysiwyg_editor['value']).'</textarea>'; 72 echo LF; 73 echo ' <script type="text/javascript"> 74 var phpwcms_ckeditor_config = "'.PHPWCMS_URL.TEMPLATE_PATH.'config/ckeditor/"; 75 CKEDITOR.replace("'.$wysiwyg_editor['field'].'", { 76 customConfig: phpwcms_ckeditor_config+"ckeditor.config.js", 77 language: "'.$wysiwyg_editor['lang'].'", 78 toolbar: "'.$wysiwyg_editor['template'].'" 79 }); 80 </script>'; 81 82 } else { 83 84 // simple textarea - no WYSIWYG editor 85 echo '<textarea name="'.$wysiwyg_editor['field'].'" rows="'.$wysiwyg_editor['rows']; 86 echo '" class="v12" id="'.$wysiwyg_editor['field'].'" '; 87 echo 'style="width:'.$wysiwyg_editor['width'].';height:'.$wysiwyg_editor['height'].';">'; 88 echo html_specialchars($wysiwyg_editor['value']).'</textarea>'; 89 90 } 91 92 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Tue Nov 16 22:51:00 2010 | Cross-referenced by PHPXref 0.7 |