Browse Source

Ckeditor - Fix old fckeditor code see BT#8968

Julio Montoya 10 years ago
parent
commit
cf4e8dfc5b
2 changed files with 39 additions and 46 deletions
  1. 14 14
      main/coursecopy/classes/CourseRestorer.class.php
  2. 25 32
      main/document/showinframesmin.php

+ 14 - 14
main/coursecopy/classes/CourseRestorer.class.php

@@ -1131,7 +1131,7 @@ class CourseRestorer
 			$table = Database :: get_course_table(TABLE_AGENDA);
 			$resources = $this->course->resources;
 			foreach ($resources[RESOURCE_EVENT] as $id => $event) {
-				// check resources inside html from fckeditor tool and copy correct urls into recipient course
+				// check resources inside html from ckeditor tool and copy correct urls into recipient course
                 $event->content = DocumentManager::replace_urls_inside_content_html_from_copy_course(
                     $event->content,
                     $this->course->code,
@@ -1208,7 +1208,7 @@ class CourseRestorer
 					$course_destination=$this->course->destination_path;
 				}
 
-				// check resources inside html from fckeditor tool and copy correct urls into recipient course
+				// check resources inside html from ckeditor tool and copy correct urls into recipient course
                 $description_content = DocumentManager::replace_urls_inside_content_html_from_copy_course(
                     $cd->content,
                     $this->course->code,
@@ -1240,7 +1240,7 @@ class CourseRestorer
 			$resources = $this->course->resources;
 			foreach ($resources[RESOURCE_ANNOUNCEMENT] as $id => $announcement) {
 
-				// check resources inside html from fckeditor tool and copy correct urls into recipient course
+				// check resources inside html from ckeditor tool and copy correct urls into recipient course
                 $announcement->content = DocumentManager::replace_urls_inside_content_html_from_copy_course(
                     $announcement->content,
                     $this->course->code,
@@ -1342,7 +1342,7 @@ class CourseRestorer
 				}
 
 				if ($id != -1) {
-					// check resources inside html from fckeditor tool and copy correct urls into recipient course
+					// check resources inside html from ckeditor tool and copy correct urls into recipient course
                     $quiz->description = DocumentManager::replace_urls_inside_content_html_from_copy_course(
                         $quiz->description,
                         $this->course->code,
@@ -1438,7 +1438,7 @@ class CourseRestorer
 			$table_ans 		= Database::get_course_table(TABLE_QUIZ_ANSWER);
             $table_options	= Database::get_course_table(TABLE_QUIZ_QUESTION_OPTION);
 
-			// check resources inside html from fckeditor tool and copy correct urls into recipient course
+			// check resources inside html from ckeditor tool and copy correct urls into recipient course
             $question->description = DocumentManager::replace_urls_inside_content_html_from_copy_course(
                 $question->description,
                 $this->course->code,
@@ -1513,7 +1513,7 @@ class CourseRestorer
                 $correct_answers = array();
 				foreach ($question->answers as $index => $answer) {
 
-					// check resources inside html from fckeditor tool and copy correct urls into recipient course
+					// check resources inside html from ckeditor tool and copy correct urls into recipient course
                     $answer['answer'] = DocumentManager::replace_urls_inside_content_html_from_copy_course(
                         $answer['answer'],
                         $this->course->code,
@@ -1717,7 +1717,7 @@ class CourseRestorer
 
 				$result_check = Database::query($sql_check);
 
-				// check resources inside html from fckeditor tool and copy correct urls into recipient course
+				// check resources inside html from ckeditor tool and copy correct urls into recipient course
                 $survey->title = DocumentManager::replace_urls_inside_content_html_from_copy_course(
                     $survey->title,
                     $this->course->code,
@@ -1902,7 +1902,7 @@ class CourseRestorer
 			$table_que = Database :: get_course_table(TABLE_SURVEY_QUESTION);
 			$table_ans = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION);
 
-			// check resources inside html from fckeditor tool and copy correct urls into recipient course
+			// check resources inside html from ckeditor tool and copy correct urls into recipient course
             $question->survey_question = DocumentManager::replace_urls_inside_content_html_from_copy_course(
                 $question->survey_question,
                 $this->course->code,
@@ -1927,7 +1927,7 @@ class CourseRestorer
 			$new_id = Database::insert_id();
 			foreach ($question->answers as $index => $answer) {
 
-				// check resources inside html from fckeditor tool and copy correct urls into recipient course
+				// check resources inside html from ckeditor tool and copy correct urls into recipient course
                 $answer['option_text'] = DocumentManager::replace_urls_inside_content_html_from_copy_course(
                     $answer['option_text'],
                     $this->course->code,
@@ -2376,7 +2376,7 @@ class CourseRestorer
     				$condition_session = " , session_id = '$session_id' ";
     			}
 
-				// check resources inside html from fckeditor tool and copy correct urls into recipient course
+				// check resources inside html from ckeditor tool and copy correct urls into recipient course
                 $glossary->description = DocumentManager::replace_urls_inside_content_html_from_copy_course(
                     $glossary->description,
                     $this->course->code,
@@ -2429,7 +2429,7 @@ class CourseRestorer
 			foreach ($resources[RESOURCE_WIKI] as $id => $wiki) {
 				// the sql statement to insert the groups from the old course to the new course
 
-				// check resources inside html from fckeditor tool and copy correct urls into recipient course
+				// check resources inside html from ckeditor tool and copy correct urls into recipient course
                 $wiki->content = DocumentManager::replace_urls_inside_content_html_from_copy_course(
                     $wiki->content,
                     $this->course->code,
@@ -2478,7 +2478,7 @@ class CourseRestorer
 			$resources = $this->course->resources;
 			foreach ($resources[RESOURCE_THEMATIC] as $id => $thematic) {
 
-				// check resources inside html from fckeditor tool and copy correct urls into recipient course
+				// check resources inside html from ckeditor tool and copy correct urls into recipient course
                 $thematic->content = DocumentManager::replace_urls_inside_content_html_from_copy_course(
                     $thematic->content,
                     $this->course->code,
@@ -2533,7 +2533,7 @@ class CourseRestorer
 			$resources = $this->course->resources;
 			foreach ($resources[RESOURCE_ATTENDANCE] as $id => $obj) {
 
-				// check resources inside html from fckeditor tool and copy correct urls into recipient course
+				// check resources inside html from ckeditor tool and copy correct urls into recipient course
                 $obj->params['description'] = DocumentManager::replace_urls_inside_content_html_from_copy_course(
                     $obj->params['description'],
                     $this->course->code,
@@ -2576,7 +2576,7 @@ class CourseRestorer
             $resources = $this->course->resources;
             foreach ($resources[RESOURCE_WORK] as $obj) {
 
-                // check resources inside html from fckeditor tool and copy correct urls into recipient course
+                // check resources inside html from ckeditor tool and copy correct urls into recipient course
                 $obj->params['description'] = DocumentManager::replace_urls_inside_content_html_from_copy_course(
                     $obj->params['description'],
                     $this->course->code,

+ 25 - 32
main/document/showinframesmin.php

@@ -65,8 +65,7 @@ if ($is_allowed_in_course == false) {
     api_not_allowed(true);
 }
 
-//Check user visibility
-//$is_visible = DocumentManager::is_visible_by_id($document_id, $course_info, api_get_session_id(), api_get_user_id());
+// Check user visibility
 $is_visible = DocumentManager::check_visibility_tree(
     $document_id,
     api_get_course_id(),
@@ -91,32 +90,31 @@ $browser_display_title = 'Documents - '.Security::remove_XSS($_GET['cidReq']).'
 
 $js_glossary_in_documents = '';
 if (api_get_setting('show_glossary_in_documents') == 'ismanual') {
-    $js_glossary_in_documents = '	//	    $(document).ready(function() {
-                                    $.frameReady(function() {
-                                       //  $("<div>I am a div courses</div>").prependTo("body");
-                                      }, "mainFrame",
-                                      { load: [
-                                              {type:"script", id:"_fr1", src:"'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.min.js"},
-                                            {type:"script", id:"_fr2", src:"'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.highlight.js"},
-                                            {type:"script", id:"_fr3", src:"'.api_get_path(WEB_LIBRARY_PATH).'javascript/ckeditor/plugins/glossary/fck_glossary_manual.js"}
-                                           ]
-                                      }
-                                      );
-                                    //});';
+    $js_glossary_in_documents = '
+    $.frameReady(function() {
+       //  $("<div>I am a div courses</div>").prependTo("body");
+      }, "mainFrame",
+      { load: [
+              {type:"script", id:"_fr1", src:"'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.min.js"},
+            {type:"script", id:"_fr2", src:"'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.highlight.js"},
+            {type:"script", id:"_fr3", src:"'.api_get_path(WEB_LIBRARY_PATH).'javascript/ckeditor/plugins/glossary/fck_glossary_manual.js"}
+           ]
+      }
+      );
+    ';
 } elseif (api_get_setting('show_glossary_in_documents') == 'isautomatic') {
-    $js_glossary_in_documents =	'//    $(document).ready(function() {
-                                      $.frameReady(function(){
-                                       //  $("<div>I am a div courses</div>").prependTo("body");
-
-                                      }, "mainFrame",
-                                      { load: [
-                                              {type:"script", id:"_fr1", src:"'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.min.js"},
-                                            {type:"script", id:"_fr2", src:"'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.highlight.js"},
-                                            {type:"script", id:"_fr3", src:"'.api_get_path(WEB_LIBRARY_PATH).'fckeditor/editor/plugins/glossary/fck_glossary_automatic.js"}
-                                           ]
-                                      }
-                                      );
-                                //   });';
+    $js_glossary_in_documents =	'
+      $.frameReady(function(){
+       //  $("<div>I am a div courses</div>").prependTo("body");
+
+      }, "mainFrame",
+      { load: [
+              {type:"script", id:"_fr1", src:"'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.min.js"},
+            {type:"script", id:"_fr2", src:"'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.highlight.js"},
+            {type:"script", id:"_fr3", src:"'.api_get_path(WEB_LIBRARY_PATH).'javascript/ckeditor/plugins/glossary/fck_glossary_automatic.js"}
+           ]
+      });
+    ';
 }
 
 $htmlHeadXtra[] = '<script type="text/javascript">
@@ -127,11 +125,7 @@ $htmlHeadXtra[] = '<script type="text/javascript">
 $htmlHeadXtra[] = '<script type="text/javascript" src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.frameready.js"></script>';
 $htmlHeadXtra[] = '
 <script type="text/javascript">
-<!--
     var updateContentHeight = function() {
-        //HeaderHeight = document.getElementById("header").offsetHeight;
-        //FooterHeight = document.getElementById("footer").offsetHeight;
-        //document.getElementById("mainFrame").style.height = ((docHeight-(parseInt(HeaderHeight)+parseInt(FooterHeight)))+60)+"px";
         my_iframe           = document.getElementById("mainFrame");
         new_height          = my_iframe.contentWindow.document.body.scrollHeight;
         my_iframe.height    = my_iframe.contentWindow.document.body.scrollHeight + "px";
@@ -142,7 +136,6 @@ $htmlHeadXtra[] = '
          updateContentHeight();
         '.$js_glossary_in_documents.'
     }
--->
 </script>';
 
 Display::display_reduced_header();