예제 #1
0
//----------------------------------
// prepare rss reader
//----------------------------------
// url where the reader will have to get the rss feed
$urlNewsClaroline = 'http://www.claroline.net/rss.php';
$rss = new lastRSS();
// where the cached file will be written
$rss->cache_dir = get_path('rootSys') . '/tmp/cache/';
// how long without refresh the cache
$rss->cache_time = 1200;
//----------------------------------
// DISPLAY
//----------------------------------
// title variable
$out = '';
$out .= claro_html_tool_title($nameTools);
if (false !== ($rs = $rss->get($urlNewsClaroline))) {
    foreach ($rs['items'] as $item) {
        $href = $item['link'];
        $title = $item['title'];
        $summary = $rss->unhtmlentities($item['description']);
        $date = strtotime($item['pubDate']);
        $out .= '<div class="claroBlock">' . "\n" . '<h3 class="blockHeader">' . "\n" . '<a href="' . $href . '">' . $title . '</a>' . "\n" . '<small> - ' . claro_html_localised_date(get_locale('dateFormatLong'), $date) . '</small>' . "\n" . '</h3>' . "\n" . '<div class="claroBlockContent">' . "\n" . $summary . "\n" . '</div>' . "\n" . '</div>' . "\n\n";
    }
} else {
    $dialogBox = new dialogBox();
    $dialogBox->error(get_lang('Error : cannot read RSS feed (Check feed url and if php setting "allow_url_fopen" is turned on).'));
    $out .= $dialogBox->render();
}
$claroline->display->body->appendContent($out);
echo $claroline->display->render();
예제 #2
0
파일: module.php 프로젝트: rhertzog/lcs
$section_selected = isset($_REQUEST['section']) ? $_REQUEST['section'] : null;
$moduleId = isset($_REQUEST['module_id']) ? (int) $_REQUEST['module_id'] : null;
$module = get_module_info($moduleId);
if (!$module) {
    claro_die("ERROR: INVALID MODULE ID!!!");
}
language::load_module_translation($module['label']);
$dockList = get_dock_list($module['type']);
$nameTools = get_lang('Module settings');
$noPHP_SELF = true;
// FIXME : BAD use of get_lang !!!!!
ClaroBreadCrumbs::getInstance()->prepend(get_lang($module['module_name']));
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Module list'), get_path('rootAdminWeb') . 'module/module_list.php?typeReq=' . $module['type']);
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Administration'), get_path('rootAdminWeb'));
ClaroBreadCrumbs::getInstance()->setCurrent($nameTools);
$dialogBox = new dialogBox();
//----------------------------------
// EXECUTE COMMAND
//----------------------------------
switch ($cmd) {
    case 'activplatformadmin':
        if (allow_module_activation_by_course_manager($module['label'], false)) {
            $dialogBox->success(get_lang('Only PLATFORM_ADMIN can activate this module'));
            $module['accessManager'] = 'PLATFORM_ADMIN';
        } else {
            $dialogBox->error(get_lang('Cannot change module activation on course creation'));
        }
        break;
    case 'activcoursemanager':
        if (allow_module_activation_by_course_manager($module['label'], true)) {
            $dialogBox->success(get_lang('COURSE_ADMIN can activate this module'));