From 00ccb8e73b2522d72047c0713b2bcbaeb986a45e Mon Sep 17 00:00:00 2001 From: Isaac Flores Date: Thu, 18 Jun 2009 17:15:12 +0200 Subject: [PATCH] [svn r21497] Logic changes - improvements in document tool - (partial FS#4337) --- .../document/document_with_glossary_terms.php | 31 ++++++++----------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/main/document/document_with_glossary_terms.php b/main/document/document_with_glossary_terms.php index 6cc4da98a4..b62636a775 100644 --- a/main/document/document_with_glossary_terms.php +++ b/main/document/document_with_glossary_terms.php @@ -15,24 +15,7 @@ $file_url_sys=api_get_path(SYS_COURSE_PATH).$file_root; $file_url_web=api_get_path(WEB_COURSE_PATH).$file_root; $content_html=file_get_contents($file_url_sys); -$array_glossary=GlossaryManager::get_glossary_terms(); -if (count($array_glossary)>0) { - foreach ($array_glossary as $index_glossary => $value_glossary) { - $to_be_replaced[]=$str_href=''.$value_glossary['name'].''; - $to_replaced[]=$value_glossary['name']; - } -} - -$new_file=str_replace($to_replaced,$to_be_replaced,$content_html); $new_file=str_replace('','',$new_file); +',$content_html); +$content_html=explode('',$new_file); +$head_html=$content_html[0]; +$content_html=$content_html[1]; +$array_glossary=GlossaryManager::get_glossary_terms(); +if (count($array_glossary)>0) { + foreach ($array_glossary as $index_glossary => $value_glossary) { + $to_be_replaced[]=$str_href=''.$value_glossary['name'].''; + $to_replaced[]=$value_glossary['name']; + } +} +$new_file=str_replace($to_replaced,$to_be_replaced,$content_html); +$new_file=$head_html.$new_file; echo $new_file; ?>