Переглянути джерело

[svn r10595] document and blog : reduce the height of FCKeditor
myconfig.js : add a survey toolbar
html_editor : add comment

For more informations about the use of FCKeditor, see http://www.dokeos.com/wiki/index.php/FCKeditor

Eric Marguin 18 роки тому
батько
коміт
fa54564204

+ 2 - 2
main/document/create_document.php

@@ -1,5 +1,5 @@
 <?php
-// $Id: create_document.php 10557 2006-12-26 15:36:59Z elixir_inter $
+// $Id: create_document.php 10595 2007-01-05 14:05:42Z elixir_inter $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -53,7 +53,7 @@ include (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
 $nameTools = get_lang('CreateDocument');
 
 $fck_attribute['Width'] = '100%';
-$fck_attribute['Height'] = '400';
+$fck_attribute['Height'] = '350';
 $fck_attribute['ToolbarSet'] = 'Full';
 
 /*

+ 2 - 2
main/inc/lib/blog.lib.php

@@ -1113,7 +1113,7 @@ class Blog
 						   <td>';
 									$oFCKeditor = new FCKeditor('post_full_text') ;
 									$oFCKeditor->BasePath	= api_get_path(WEB_PATH) . 'main/inc/lib/fckeditor/' ;
-									$oFCKeditor->Height		= '400';
+									$oFCKeditor->Height		= '350';
 									$oFCKeditor->Width		= '98%';
 									$oFCKeditor->Value		= isset($_POST['post_full_text'])?stripslashes($_POST['post_full_text']):'';
 									$oFCKeditor->Config['CustomConfigurationsPath'] = api_get_path(REL_PATH)."main/inc/lib/fckeditor/myconfig.js";
@@ -1178,7 +1178,7 @@ class Blog
 					   <td>';
 								$oFCKeditor = new FCKeditor('post_full_text') ;
 								$oFCKeditor->BasePath	= api_get_path(WEB_PATH) . 'main/inc/lib/fckeditor/' ;
-								$oFCKeditor->Height		= '400';
+								$oFCKeditor->Height		= '350';
 								$oFCKeditor->Width		= '98%';
 								$oFCKeditor->Value		= isset($_POST['post_full_text'])?stripslashes($_POST['post_full_text']):$blog_post_text;
 								$oFCKeditor->Config['CustomConfigurationsPath'] = api_get_path(REL_PATH)."main/inc/lib/fckeditor/myconfig.js";

+ 5 - 4
main/inc/lib/fckeditor/myconfig.js

@@ -1,6 +1,3 @@
-//FCKConfig.SmileyWindowWidth		= 500 ;
-//FCKConfig.SmileyWindowHeight	= 500 ;
-//FCKConfig.ImageUpload = false ;
 FCKConfig.IMUploadPath = '';
 FCKConfig.FlashUploadPath = '' ;
 FCKConfig.AudioUploadPath = '' ;
@@ -36,7 +33,7 @@ FCKConfig.ToolbarSets["Announcements"] = [
 ] ;
 
 FCKConfig.ToolbarSets["Full"] = [
-	['Templates','PasteWord','Link','-','ImageManager','Flash','Video','MP3','Table','Rule','-','Subscript', 'Superscript','-','OrderedList','UnorderedList','Outdent','Indent','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],'/',['FontName','FontSize','Bold','Italic','Underline','StrikeThrough','TextColor', 'BGColor','-','Source']
+	['Templates','PasteWord','Link','-','ImageManager','Flash','MP3','Table','Rule','-','Subscript', 'Superscript','-','OrderedList','UnorderedList','Outdent','Indent','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],'/',['FontName','FontSize','Bold','Italic','Underline','StrikeThrough','TextColor', 'BGColor','-','Source']
 ] ;
 
 FCKConfig.ToolbarSets["Comment"] = [
@@ -51,6 +48,10 @@ FCKConfig.ToolbarSets["NewTest"] = [
 	['Bold','Italic','Underline','StrikeThrough','Link','ImageManager','Flash','MP3','OrderedList','UnorderedList','Table']
 ] ;
 
+FCKConfig.ToolbarSets["Survey"] = [
+	['FontSize','Bold','Italic','TextColor','-','OrderedList','UnorderedList','-','Rule','Link','Table','-','ImageManager']
+] ;
+
 var sOtherPluginPath = FCKConfig.BasePath.substr(0, FCKConfig.BasePath.length - 7) + 'editor/plugins/' ;
 FCKConfig.Plugins.Add("MP3", "en,it", sOtherPluginPath ) ;
 FCKConfig.Plugins.Add("Video", "en,it", sOtherPluginPath ) ;

+ 5 - 21
main/inc/lib/formvalidator/Element/html_editor.php

@@ -1,5 +1,5 @@
 <?php
-// $Id: html_editor.php 10560 2006-12-28 15:28:08Z elixir_inter $
+// $Id: html_editor.php 10595 2007-01-05 14:05:42Z elixir_inter $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -109,10 +109,10 @@ class HTML_QuickForm_html_editor extends HTML_QuickForm_textarea
 		$fck_editor = new FCKeditor($name);
 		$fck_editor->BasePath = api_get_path(WEB_PATH).'main/inc/lib/fckeditor/';
 
-		//$fck_editor->Width = '990';
 		$fck_editor->Width = $fck_attribute['Width'] ? $fck_attribute['Width'] : '990';
 		$fck_editor->Height = $fck_attribute['Height'] ? $fck_attribute['Height'] : '400';
 		$fck_editor->Value = $this->getValue();
+		//We get the optionnals config parameters in $fck_attribute array
 		$fck_editor->Config = $fck_attribute['Config'] ? $fck_attribute['Config'] : array();
 		
 		
@@ -123,11 +123,12 @@ class HTML_QuickForm_html_editor extends HTML_QuickForm_textarea
 			$sql="SELECT isocode FROM ".$TBL_LANGUAGES." WHERE english_name='".$_SESSION["_course"]["language"]."'";
 		}
 		
-		
+		//Else, we get the current session language
 		elseif(isset($_SESSION["_user"]["language"])){
 			$sql="SELECT isocode FROM ".$TBL_LANGUAGES." WHERE english_name='".$_SESSION["_user"]["language"]."'";
 		}
 		
+		//Else we get the default platform language
 		else{
 			$platform_language=api_get_setting("platformLanguage");
 			$sql="SELECT isocode FROM ".$TBL_LANGUAGES." WHERE english_name='$platform_language'";
@@ -174,24 +175,7 @@ class HTML_QuickForm_html_editor extends HTML_QuickForm_textarea
 
 		$result .=$fck_editor->CreateHtml();
 
-		/*
-		$result .= '<script type="text/javascript" src="'.api_get_path(WEB_PATH).'main/inc/lib/fckeditor/fckeditor.js"></script>';
-		$result .= '<script type="text/javascript">';*/
-		//$result .= "\n/* <![CDATA[ */\n";
-		/*
-		$result .= 'var oFCKeditor = new FCKeditor( \''.$name.'\' ) ;';
-		$result .= 'oFCKeditor.BasePath = "'.api_get_path(WEB_PATH).'main/inc/lib/fckeditor/";';
-		$result .= 'oFCKeditor.Width = 650;';
-		$result .= 'oFCKeditor.Height = '. ($this->fullPage ? '500' : '300').';';
-		$result .= 'oFCKeditor.Config[ "FullPage" ] = '. ($this->fullPage ? 'true' : 'false').';';
-		$result .= 'oFCKeditor.Config[ "DefaultLanguage" ] = "'.$editor_lang.'" ;';
-		$result .= 'oFCKeditor.Value = "'.str_replace('"', '\"', str_replace(array ("\r\n", "\n", "\r", "/"), array (' ', ' ', ' ', '\/'), $this->getValue())).'" ;';
-		$result .= 'oFCKeditor.Create();';*/
-		//$result .= "\n/* ]]> */\n";
-		/*
-		$result .= '</script>';
-		$result .= '<noscript>'.parent :: toHTML().'</noscript>';
-		*/
+
 		$result .= '<small><a href="#" onclick="MyWindow=window.open('."'".api_get_path(WEB_CODE_PATH)."help/allowed_html_tags.php?fullpage=". ($this->fullPage ? '1' : '0')."','MyWindow','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=500,height=600,left=200,top=20'".'); return false;">'.get_lang('AllowedHTMLTags').'</a></small>';
 		return $result;
 	}