예제 #1
0
파일: index.php 프로젝트: rhertzog/lcs
$cidReset = true;
// course id
$gidReset = true;
// group id
$tidReset = true;
// tool id
// Load Claroline kernel
require_once dirname(__FILE__) . '/../inc/claro_init_global.inc.php';
// Build the breadcrumb
$nameTools = get_lang('Headlines');
// Initialisation of variables and used classes and libraries
require_once get_module_path('CLTI') . '/lib/toolintroductioniterator.class.php';
$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
$cmd = !empty($_REQUEST['cmd']) ? $_REQUEST['cmd'] : null;
$isAllowedToEdit = claro_is_allowed_to_edit();
set_current_module_label('CLINTRO');
// Init linker
FromKernel::uses('core/linker.lib');
ResourceLinker::init();
// Javascript confirm pop up declaration for header
JavascriptLanguage::getInstance()->addLangVar('Are you sure to delete %name ?');
JavascriptLoader::getInstance()->load('tool_intro');
// Instanciate dialog box
$dialogBox = new DialogBox();
$toolIntroForm = '';
if (isset($cmd) && $isAllowedToEdit) {
    // Set linker's params
    if ($id) {
        $currentLocator = ResourceLinker::$Navigator->getCurrentLocator(array('id' => (int) $id));
    } else {
        $currentLocator = null;
예제 #2
0
파일: module.lib.php 프로젝트: rhertzog/lcs
/**
 * Helper to set current module label and load config and language files
 * @param string $moduleLabel
 */
function set_and_load_current_module($moduleLabel)
{
    load_module_language($moduleLabel);
    load_module_config($moduleLabel);
    set_current_module_label($moduleLabel);
}
예제 #3
0
파일: dock.lib.php 프로젝트: rhertzog/lcs
 public function render()
 {
     $claro_buffer = new ClaroBuffer();
     $claro_buffer->append("\n" . '<!-- ' . $this->name . ' -->' . "\n");
     foreach ($this->appletList as $applet) {
         set_current_module_label($applet['label']);
         pushClaroMessage('Current module label set to : ' . get_current_module_label(), 'debug');
         // install course applet
         if (claro_is_in_a_course()) {
             install_module_in_course($applet['label'], claro_get_current_course_id());
         }
         if ($applet['activation'] == 'activated' && file_exists($applet['path'])) {
             load_module_config();
             Language::load_module_translation();
             if ($this->useList() && count($this->appletList) > 0) {
                 $claro_buffer->append("<li\n                        id=\"dock-" . $this->name . "-applet-" . $applet['label'] . "\"\n                        class=\"applet dock-" . $this->name . " applet-" . $applet['label'] . "\"><span>\n");
             } else {
                 $claro_buffer->append("<span\n                        id=\"dock-" . $this->name . "-applet-" . $applet['label'] . "\"\n                        class=\"applet dock-" . $this->name . " applet-" . $applet['label'] . "\">\n");
             }
             include_once $applet['path'];
             if ($this->useList() && count($this->appletList) > 0) {
                 $claro_buffer->append("\n</span></li>\n");
             } else {
                 $claro_buffer->append("\n</span>\n");
             }
         } else {
             Console::debug("Applet not found or not activated : " . $applet['label']);
         }
         clear_current_module_label();
         pushClaroMessage('Current module label set to : ' . get_current_module_label(), 'debug');
     }
     $claro_buffer->append("\n" . '<!-- End of ' . $this->name . ' -->' . "\n");
     return $claro_buffer->getContent();
 }
예제 #4
0
    require_once get_path('incRepositorySys') . '/lib/module/manage.lib.php';
    generate_module_cache();
}
require_once get_path('incRepositorySys') . '/lib/lock.lib.php';
if (file_exists($cacheRepositorySys . $module_cache_filename)) {
    include $cacheRepositorySys . $module_cache_filename;
} else {
    pushClaroMessage('module_cache not generated : check access right in ' . $cacheRepositorySys, 'warning');
}
// reset current module label after calling the cache
if (isset($tlabelReq) && get_current_module_label() != $tlabelReq) {
    // reset all previous occurence of module label in stack
    while (clear_current_module_label()) {
    }
    // set the current module label
    set_current_module_label($tlabelReq);
}
// Add feed RSS in header
if (claro_is_in_a_course() && get_conf('enableRssInCourse', true)) {
    require claro_get_conf_repository() . 'rss.conf.php';
    $claroline->display->header->addHtmlHeader('<link rel="alternate" type="application/rss+xml" title="' . claro_htmlspecialchars($_course['name'] . ' - ' . get_conf('siteName')) . '"' . ' href="' . get_path('url') . '/claroline/backends/rss.php?cidReq=' . claro_get_current_course_id() . '" />');
}
// timezone debug code
if (claro_debug_mode() && get_conf('clmain_serverTimezone', '')) {
    pushClaroMessage('timezone set to ' . date_default_timezone_get(), 'debug');
}
if (claro_is_in_a_course() && isset($tlabelReq) && $tlabelReq == 'CLQWZ') {
    require_once get_path('incRepositorySys') . '/../exercise/lib/add_missing_table.lib.php';
    init_qwz_questions_categories();
}
if (!claro_is_platform_admin()) {