Ejemplo n.º 1
0
$template->addGlobal('is_allowed_to_edit', $is_allowed_to_edit);
$template->addGlobal('gamification_mode', $gamificationMode);
$template->addGlobal('breadcrumb', $breadcrumb);
$template->addGlobal('button_home_url', $buttonHomeUrl);
$template->addGlobal('button_home_text', $buttonHomeText);
$template->addGlobal('navigation_bar', $navigation_bar);
$template->addGlobal('progress_bar', $progress_bar);
$template->addGlobal('show_audio_player', $show_audioplayer);
$template->addGlobal('media_player', $mediaplayer);
$template->addGlobal('toc_list', $get_toc_list);
$template->addGlobal('teacher_toc_buttons', $get_teacher_buttons);
$template->addGlobal('iframe_src', $src);
$template->addGlobal('navigation_bar_bottom', $navigation_bar_bottom);
if ($gamificationMode == 1) {
    $template->addGlobal('gamification_stars', $learnPath->getCalculateStars($sessionId));
    $template->addGlobal('gamification_points', $learnPath->getCalculateScore($sessionId));
}
$template->addGlobal('lp_preview_image', Display::img($lpPreviewImagePath, $learnPath->name, array('class' => 'img-circle'), ICON_SIZE_BIG));
$template->addGlobal('lp_author', $learnPath->get_author());
$template->addGlobal('lp_mode', $learnPath->mode);
$template->addGlobal('lp_title_scorm', $learnPath->name);
$template->addGlobal('lp_html_toc', $learnPath->get_html_toc($get_toc_list));
$template->addGlobal('lp_id', $learnPath->lp_id);
$template->addGlobal('lp_current_item_id', $learnPath->get_current_item_id());
$content = $template->render('@template_style/learnpath/view.html.twig');
echo $content;
// Restore a global setting.
$_setting['show_navigation_menu'] = $save_setting;
// Hide headers
Container::$legacyTemplate = 'layout_one_col_no_content.html.twig';
$learnPath->updateCurrentLpFromSession();
    $glossary_id = Security::remove_XSS($_POST['glossary_id']);
    $glossary_description_by_id = GlossaryManager::get_glossary_term_by_glossary_id($glossary_id);
    $glossary_description_by_id = str_replace($path_image_search, $path_image, $glossary_description_by_id);
    echo api_xml_http_response_encode($glossary_description_by_id);
} elseif (isset($_POST['glossary_data']) && $_POST['glossary_data'] == 'true') {
    //get_glossary_terms
    $glossary_data = GlossaryManager::get_glossary_terms();
    $glossary_all_data = array();
    if (count($glossary_data) > 0) {
        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);
    }
} elseif (isset($_POST['glossary_name'])) {
    $my_glossary_name = Security::remove_XSS($_POST['glossary_name']);
    $my_glossary_name = api_convert_encoding($my_glossary_name, $charset, 'UTF-8');
    $my_glossary_name = trim($my_glossary_name);
    $glossary_description = GlossaryManager::get_glossary_term_by_glossary_name($my_glossary_name);
    $glossary_description = str_replace($path_image_search, $path_image, $glossary_description);
    if (is_null($glossary_description) || strlen(trim($glossary_description)) == 0) {
        echo api_xml_http_response_encode(get_lang('NoResults'));
    } else {
        echo api_xml_http_response_encode($glossary_description);
    }
} else {
    echo api_xml_http_response_encode(get_lang('NoResults'));
}
Container::$legacyTemplate = 'layout_empty.html.twig';