|
|
|
@ -20,15 +20,11 @@ $charset = api_get_system_encoding(); |
|
|
|
|
$path_image = api_get_path(WEB_COURSE_PATH).api_get_course_path(); |
|
|
|
|
$path_image_search = '../..'.api_get_path(REL_COURSE_PATH).api_get_course_path(); |
|
|
|
|
$glossaryId = isset($_POST['glossary_id']) ? (int) $_POST['glossary_id'] : 0; |
|
|
|
|
$description = get_lang('NoResults'); |
|
|
|
|
|
|
|
|
|
if (!empty($glossaryId)) { |
|
|
|
|
$description = GlossaryManager::get_glossary_term_by_glossary_id($glossaryId); |
|
|
|
|
$description = str_replace( |
|
|
|
|
$path_image_search, |
|
|
|
|
$path_image, |
|
|
|
|
$description |
|
|
|
|
); |
|
|
|
|
echo api_xml_http_response_encode($description); |
|
|
|
|
$description = str_replace($path_image_search, $path_image, $description); |
|
|
|
|
} elseif (isset($_POST['glossary_data']) && $_POST['glossary_data'] == 'true') { |
|
|
|
|
// get_glossary_terms |
|
|
|
|
$glossary_data = GlossaryManager::get_glossary_terms(); |
|
|
|
@ -37,8 +33,7 @@ if (!empty($glossaryId)) { |
|
|
|
|
foreach ($glossary_data as $glossary_index => $glossary_value) { |
|
|
|
|
$glossary_all_data[] = $glossary_value['id'].'__|__|'.$glossary_value['name']; |
|
|
|
|
} |
|
|
|
|
$glossary_all_data = implode('[|.|_|.|-|.|]', $glossary_all_data); |
|
|
|
|
echo api_xml_http_response_encode($glossary_all_data); |
|
|
|
|
$description = implode('[|.|_|.|-|.|]', $glossary_all_data); |
|
|
|
|
} |
|
|
|
|
} elseif (isset($_POST['glossary_name'])) { |
|
|
|
|
$my_glossary_name = Security::remove_XSS($_POST['glossary_name']); |
|
|
|
@ -54,12 +49,10 @@ if (!empty($glossaryId)) { |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
if (is_null($description) || strlen(trim($description)) == 0) { |
|
|
|
|
echo api_xml_http_response_encode(get_lang('NoResults')); |
|
|
|
|
$description = get_lang('NoResults'); |
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
$description = str_replace('class="glossary"', '', $description); |
|
|
|
|
echo api_xml_http_response_encode($description); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
echo api_xml_http_response_encode(get_lang('NoResults')); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
echo api_xml_http_response_encode($description); |