Browse Source

added fckeditor inside work tool - BT#652

Cristian Fasanando 15 years ago
parent
commit
bcbed11c8b
2 changed files with 18 additions and 8 deletions
  1. 5 5
      main/work/work.lib.php
  2. 13 3
      main/work/work.php

+ 5 - 5
main/work/work.lib.php

@@ -456,7 +456,10 @@ function display_student_publications_list($work_dir, $sub_course_dir, $currentC
 					$form_folder -> addGroup($group_name, 'my_group', get_lang('Title'));
 					$form_folder -> addGroupRule('my_group', get_lang('ThisFieldIsRequired'), 'required');
 					$defaults = array('my_group[dir_name]' => html_entity_decode($dir), 'description' => api_html_entity_decode($row['description']));
-					$form_folder-> addElement('textarea', 'description', get_lang('Description'), array('rows' => 5, 'cols' => 50));
+					
+					//$form_folder-> addElement('textarea', 'description', get_lang('Description'), array('rows' => 5, 'cols' => 50));
+					$form_folder->add_html_editor('description', get_lang('Description'), false, false, array('ToolbarSet' => 'profile', 'Width' => '100%', 'Height' => '200'));
+					
 					$qualification_input[] = FormValidator :: createElement('text','qualification');
 					$form_folder -> addGroup($qualification_input, 'qualification', get_lang('QualificationNumberOver'), 'size="10"');
 
@@ -526,15 +529,12 @@ function display_student_publications_list($work_dir, $sub_course_dir, $currentC
 					}
 
 					$form_folder -> addElement('style_submit_button', 'submit', get_lang('ModifyDirectory'), 'class="save"');
-
 					if ($there_is_a_end_date) {
 						$defaults = array_merge($defaults, convert_date_to_array($homework['ends_on'], 'ends'));
 					}
-
 					if ($there_is_a_expire_date) {
 						$defaults = array_merge($defaults, convert_date_to_array($homework['expires_on'], 'expires'));
-					}
-
+					}					
 					if (!empty($row['qualification'])) {
 						$defaults = array_merge($defaults, array('qualification[qualification]' => $row['qualification']));
 					}

+ 13 - 3
main/work/work.php

@@ -80,6 +80,7 @@ require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
 require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
 require_once api_get_path(LIBRARY_PATH).'mail.lib.inc.php';
 require_once api_get_path(LIBRARY_PATH).'text.lib.php';
+require_once api_get_path(LIBRARY_PATH).'fckeditor/fckeditor.php';
 
 // Section (for the tabs)
 $this_section = SECTION_COURSES;
@@ -1290,9 +1291,18 @@ if ($is_course_member) {
 								<div class="label">
 									'.get_lang('Description').'
 								</div>
-								<div class="formw">
-									<textarea name="description" rows="4" cols="70"></textarea>
-								</div>
+								<div class="formw">';
+									
+				$oFCKeditor = new FCKeditor('content') ;
+				$oFCKeditor->ToolbarSet = 'profile';
+				$oFCKeditor->Width		= '80%';
+				$oFCKeditor->Height		= '130';
+				$oFCKeditor->Value		= $message;	
+				$oFCKeditor->Name		= 'description';				
+				$return =	$oFCKeditor->CreateHtml();	
+				$new_folder_text .= $return;
+									
+		$new_folder_text .= '</div>
 							</div>';
 
 		// Advanced parameters