Ejemplo n.º 1
0
 public function __construct($profileList = null)
 {
     parent::__construct('CLUSR', 'profileselector_select.tpl.php');
     if (!$profileList) {
         $this->profileList = new CLUSR_ProfileList();
     } else {
         $this->profileList = $profileList;
     }
 }
Ejemplo n.º 2
0
 public function __construct(\DocumentParser $modx, $ajax = false, $tplFolder = null)
 {
     $this->_modx = $modx;
     self::$_ajax = (bool) $ajax;
     $this->loadVars();
     if (is_null($tplFolder)) {
         $tplFolder = dirname(dirname(__FILE__));
     }
     $FS = \Helpers\FS::getInstance();
     $tplFolder = $FS->relativePath($tplFolder);
     $this->_publicFolder = "/" . $tplFolder . "/public/";
     $this->_tplFolder = MODX_BASE_PATH . $tplFolder . "/template/";
     if (!defined('MODX_MAIN_URL')) {
         define('MODX_MAIN_URL', MODX_SITE_URL);
     }
 }
Ejemplo n.º 3
0
<?php

/**
 * CLAROLINE Applet
 *
 * @author Loic Fortemps
 *
 * @package MOBILE
 *
 */
$tlabelReq = 'MOBILE';
require_once dirname(__FILE__) . '/../../claroline/inc/claro_init_global.inc.php';
Claroline::initDisplay(Claroline::POPUP);
CssLoader::getInstance()->load('mobile', 'all');
$pageTitle = array('mainTitle' => get_lang('Mobile Apps Configuration'), 'subTitle' => get_lang('Configuration helper'));
ClaroBreadCrumbs::getInstance()->append($pageTitle['mainTitle'], $_SERVER['PHP_SELF']);
ClaroBreadCrumbs::getInstance()->append($pageTitle['subTitle']);
$template = new ModuleTemplate($tlabelReq, 'popup.tpl.php');
Claroline::getInstance()->display->body->appendContent(claro_html_tool_title($pageTitle) . $template->render());
echo Claroline::getInstance()->display->render();
Ejemplo n.º 4
0
            $thisAnn['visible'] = false;
        } else {
            $thisAnn['visible'] = true;
        }
        // Flag hot items
        if (claro_is_user_authenticated() && $claro_notifier->is_a_notified_ressource(claro_get_current_course_id(), $date, claro_get_current_user_id(), claro_get_current_group_id(), claro_get_current_tool_id(), $thisAnn['id'])) {
            $thisAnn['hot'] = true;
        } else {
            $thisAnn['hot'] = false;
        }
        $thisAnn['content'] = make_clickable($thisAnn['content']);
        // Post time format in MySQL date format
        $lastPostDate = isset($thisAnn['visibleFrom']) ? $thisAnn['visibleFrom'] : $thisAnn['time'];
        // Set the current locator
        $currentLocator = ResourceLinker::$Navigator->getCurrentLocator(array('id' => $thisAnn['id']));
        $thisAnn['currentLocator'] = $currentLocator;
        if ($is_allowedToEdit || $isVisible && !$isOffDeadline) {
            $preparedAnnList[] = $thisAnn;
        }
    }
    $maxMinRanks = clann_get_max_and_min_rank();
    $template = new ModuleTemplate($tlabelReq, 'list.tpl.php');
    $template->assign('announcementList', $preparedAnnList);
    $template->assign('lastPostDate', $lastPostDate);
    $template->assign('maxRank', $maxMinRanks['maxRank']);
    $template->assign('minRank', $maxMinRanks['minRank']);
    Claroline::getDisplay()->body->appendContent($template->render());
}
// end if displayList
Claroline::getDisplay()->body->appendContent($output);
echo Claroline::getDisplay()->render();
Ejemplo n.º 5
0
            $this_forum['anonymity'] = 'allowed';
            break;
        case 2:
            $this_forum['anonymity'] = 'default';
            break;
        default:
            $this_forum['anonymity'] = 'forbidden';
            break;
    }
    // Visit only my group forum if not admin or tutor.
    // If tutor, see all groups but indicate my groups.
    // Group Category == 1
    $displayList[] = $this_forum;
}
try {
    $display = new ModuleTemplate('CLFRM', 'forum_index.tpl.php');
    $display->assign('categoryList', $categories);
    $display->assign('forumList', $forum_list);
    $display->assign('is_allowedToEdit', $is_allowedToEdit);
    $display->assign('claro_notifier', $claro_notifier);
    $out .= $display->render();
} catch (Exception $ex) {
    if (claro_debug_mode()) {
        $dialogBox->error('<pre>' . $ex->__toString() . '</pre>');
    } else {
        $dialogBox->error($ex->getMessage());
    }
    $out .= $dialogBox->render();
}
ClaroBreadCrumbs::getInstance()->setCurrent($nameTools, 'index.php');
$claroline->display->body->appendContent($out);
Ejemplo n.º 6
0
        Claroline::getDisplay()->body->appendContent($template->render());
    }
}
// end if is_allowedToEdit
/******************************************************************************
DESCRIPTION LIST DISPLAY
******************************************************************************/
if (claro_is_user_authenticated()) {
    $date = $claro_notifier->get_notification_date(claro_get_current_user_id());
}
$preparedDescList = array();
foreach ($descList as $description) {
    if (claro_is_user_authenticated() && $claro_notifier->is_a_notified_ressource(claro_get_current_course_id(), $date, claro_get_current_user_id(), claro_get_current_group_id(), claro_get_current_tool_id(), $description['id'])) {
        $description['hot'] = true;
    } else {
        $description['hot'] = false;
    }
    // Remove invisible items
    if ($description['visibility'] == 'VISIBLE' || $description['visibility'] == 'INVISIBLE' && $is_allowedToEdit) {
        if ($description['visibility'] == 'VISIBLE') {
            $description['visible'] = 1;
        } else {
            $description['visible'] = 0;
        }
        $preparedDescList[] = $description;
    }
}
$template = new ModuleTemplate($tlabelReq, 'list.tpl.php');
$template->assign('descriptionList', $preparedDescList);
Claroline::getDisplay()->body->appendContent($template->render());
echo Claroline::getInstance()->display->render();
Ejemplo n.º 7
0
if (claro_is_user_authenticated()) {
    $date = $claro_notifier->get_notification_date(claro_get_current_user_id());
}
$preparedEventList = array();
foreach ($eventList as $thisEvent) {
    if ('HIDE' == $thisEvent['visibility'] && $is_allowedToEdit || 'SHOW' == $thisEvent['visibility']) {
        // Hot item ?
        if (claro_is_user_authenticated() && $claro_notifier->is_a_notified_ressource(claro_get_current_course_id(), $date, claro_get_current_user_id(), claro_get_current_group_id(), claro_get_current_tool_id(), $thisEvent['id'])) {
            $thisEvent['hot'] = true;
        } else {
            $thisEvent['hot'] = false;
        }
        // Visible item ?
        if ($thisEvent['visibility'] == 'SHOW') {
            $thisEvent['visible'] = true;
        } else {
            $thisEvent['visible'] = false;
        }
        // Linked resources ?
        $currentLocator = ResourceLinker::$Navigator->getCurrentLocator(array('id' => $thisEvent['id']));
        $thisEvent['currentLocator'] = $currentLocator;
        if ($is_allowedToEdit || $thisEvent['visible']) {
            $preparedEventList[] = $thisEvent;
        }
    }
}
$template = new ModuleTemplate($tlabelReq, 'list.tpl.php');
$template->assign('eventList', $preparedEventList);
$template->assign('orderDirection', $orderDirection);
Claroline::getDisplay()->body->appendContent($template->render());
echo Claroline::getDisplay()->render();
Ejemplo n.º 8
0
 public function __construct($course, $assignment, $scoreList)
 {
     parent::__construct('CLWRK', 'work_score.tpl.php');
     $this->assign('course', $course);
     $this->assign('scoreList', $scoreList);
     $this->assign('assignment', $assignment);
 }
Ejemplo n.º 9
0
            // deal with already registered users found in result
            if (empty($thisUser['registered'])) {
                $profileSelector->setUserId($thisUser['uid']);
                $out .= $profileSelector->render();
            } else {
                $out .= '<span class="highlight">' . get_lang('Already enroled') . '</span>';
            }
            $out .= '</td>' . "\n" . '</tr>' . "\n";
        }
        if (sizeof($userList) == 0) {
            $out .= '<td align="center" colspan="6">' . get_lang('No user found') . '</td>';
        }
        $out .= '</tbody>' . '</table>' . '<hr />';
    }
    // Display form to add a user
    if ($displayForm) {
        if ((get_conf('is_coursemanager_allowed_to_register_single_user') || claro_is_platform_admin()) && $formToDisplay == CLUSER_ADD_FORM) {
            $profileSelector = new CLUSR_ProfileSelector();
            $profileSelector->ignoreNonMemberProfiles();
            $tpl = new ModuleTemplate('CLUSR', 'course_user_add.tpl.php');
            $tpl->assign('profileSelector', $profileSelector);
            $out .= $tpl->render();
        } else {
            $tpl = new ModuleTemplate('CLUSR', 'course_user_search.tpl.php');
            $out .= $tpl->render();
        }
    }
}
// end else of if ( $courseRegSucceed )
$claroline->display->body->appendContent($out);
echo $claroline->display->render();
Ejemplo n.º 10
0
}
CssLoader::getInstance()->load('exercise', 'screen');
$out = '';
$out .= claro_html_tool_title($toolTitle, null, $cmdList);
// dialog box if required
$out .= $dialogBox->render();
if ($displayForm) {
    // -- edit form
    $display = new ModuleTemplate('CLQWZ', 'exercise_form.tpl.php');
    $display->assign('exId', $exId);
    $display->assign('data', $form);
    $display->assign('relayContext', claro_form_relay_context());
    $display->assign('questionCount', count($exercise->getQuestionList()));
    $out .= $display->render();
} else {
    //-- exercise settings
    $detailsDisplay = new ModuleTemplate('CLQWZ', 'exercise_details.tpl.php');
    $detailsDisplay->assign('exercise', $exercise);
    $detailsDisplay->assign('dateTimeFormatLong', $dateTimeFormatLong);
    $detailsDisplay->assign('questionList', $exercise->getQuestionList());
    $detailsDisplay->assign('localizedQuestionType', get_localized_question_type());
    $out .= $detailsDisplay->render();
    $qlistDisplay = new ModuleTemplate('CLQWZ', 'question_list.tpl.php');
    $qlistDisplay->assign('exId', $exercise->getId());
    $qlistDisplay->assign('questionList', $exercise->getQuestionList());
    $qlistDisplay->assign('context', 'exercise');
    $qlistDisplay->assign('localizedQuestionType', get_localized_question_type());
    $out .= $qlistDisplay->render();
}
$claroline->display->body->appendContent($out);
echo $claroline->display->render();
Ejemplo n.º 11
0
// As we are trying to get the authorization of a particular user, it works better if this one is logged in.
if (!claro_is_user_authenticated()) {
    claro_disp_auth_form();
}
// Initialization of the OAuth Server.
require_once __DIR__ . '/lib/InitServer.php';
// Set up the request from the Globals.
$request = OAuth2\Request::createFromGlobals();
$response = new OAuth2\Response();
// Submit the request to the OAuth server. In particular, the server check that the client asking access is well registered,
// all the requested parameters are presents and the scope, if any, is valid.
if (!$server->validateAuthorizeRequest($request, $response)) {
    $response->send();
    die;
}
// If POST is empty, we know that the user has not authorized the client yet. So we show the form.
if (empty($_POST)) {
    // Get the client name from the Storage.
    $client_name = $server->getStorage('client')->getClientDetails($request->query('client_id'))['client_name'];
    $template = new ModuleTemplate($tlabelReq, 'authorization_form.tpl.php');
    $template->assign('clientName', $client_name);
    ClaroBody::getInstance()->appendContent($template->render());
    echo Claroline::getDisplay()->render();
} else {
    // is_authorized is TRUE iff the user clicked "Yes" on the Authorization Form.
    $is_authorized = isset($_POST['authorized']);
    // If the client is authorized, we can process and associate a freshly created Authorization Token to the user_id,
    // and return it to the client.
    $server->handleAuthorizeRequest($request, $response, $is_authorized, claro_get_current_user_id());
    $response->send();
}
Ejemplo n.º 12
0
    $is_allowedToEdit = claro_is_allowed_to_edit() || claro_is_group_tutor() && !claro_is_course_manager();
    // (  claro_is_group_tutor()
    //  is added to give admin status to tutor
    // && !claro_is_course_manager())
    // is added  to let course admin, tutor of current group, use student mode
    if (claro_is_allowed_to_edit()) {
        $out .= '<div style="float: right;">' . "\n" . '<img src="' . get_icon_url('html') . '" alt="" /> <a href="' . claro_htmlspecialchars(Url::Contextualize('export.php?type=HTML&forum=' . $forumId)) . '" target="_blank">' . get_lang('Export to HTML') . '</a>' . "\n" . '<img src="' . get_icon_url('mime/pdf') . '" alt="" /> <a href="' . claro_htmlspecialchars(Url::Contextualize('export.php?type=PDF&forum=' . $forumId)) . '" target="_blank">' . get_lang('Export to PDF') . '</a>' . "\n" . '</div>' . "\n";
    }
    $out .= disp_forum_breadcrumb($pagetype, $forumId, $forum_name);
    $out .= $dialogBox->render();
    $topicLister = new topicLister($forumId, $start, get_conf('topics_per_page'));
    $topicList = $topicLister->get_topic_list();
    $pagerUrl = claro_htmlspecialchars(Url::Contextualize(get_module_url('CLFRM') . '/viewforum.php?forum=' . $forumId));
    $out .= $topicLister->disp_pager_tool_bar($pagerUrl);
    try {
        $display = new ModuleTemplate('CLFRM', 'forum_viewforum.tpl.php');
        $display->assign('forumId', $forumId);
        $display->assign('forumName', $display_name);
        $display->assign('forumSettings', $forumSettingList);
        $display->assign('topicList', $topicList);
        $display->assign('is_allowedToEdit', $is_allowedToEdit);
        $display->assign('claro_notifier', $claro_notifier);
        $out .= $display->render();
    } catch (Exception $ex) {
        $dialogBox->error($ex);
    }
    $out .= $topicLister->disp_pager_tool_bar($pagerUrl);
}
ClaroBreadCrumbs::getInstance()->setCurrent(get_lang('Forums'), 'index.php');
$claroline->display->body->appendContent($out);
echo $claroline->display->render();
Ejemplo n.º 13
0
    //ClaroBreadCrumbs::getInstance()->prepend( get_lang('Exercise'), './edit_exercise.php?exId='.$exId );
} else {
    ClaroBreadCrumbs::getInstance()->prepend(get_lang('Question pool'), Url::Contextualize('./question_pool.php'));
}
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Exercises'), Url::Contextualize(get_module_url('CLQWZ') . '/exercise.php'));
// Command list
$cmdList = array();
$cmdList[] = array('img' => 'edit', 'name' => get_lang('Edit question'), 'url' => claro_htmlspecialchars(Url::Contextualize('./edit_question.php?exId=' . $exId . '&cmd=rqEdit&quId=' . $quId)));
$cmdList[] = array('img' => 'edit', 'name' => get_lang('Edit answers'), 'url' => claro_htmlspecialchars(Url::Contextualize('./edit_answers.php?exId=' . $exId . '&cmd=rqEdit&quId=' . $quId)));
$cmdList[] = array('img' => 'default_new', 'name' => get_lang('New question'), 'url' => claro_htmlspecialchars(Url::Contextualize('./edit_question.php?exId=' . $exId . '&cmd=rqEdit')));
$out = '';
$out .= claro_html_tool_title($nameTools, null, $cmdList);
// dialog box if required
$out .= $dialogBox->render();
$localizedQuestionType = get_localized_question_type();
if ($displayForm) {
    //-- edit form
    $display = new ModuleTemplate('CLQWZ', 'question_form.tpl.php');
    $display->assign('question', $question);
    $display->assign('exId', $exId);
    $display->assign('data', $form);
    $display->assign('relayContext', claro_form_relay_context());
    $display->assign('askDuplicate', $askDuplicate);
    $display->assign('categoryList', getQuestionCategoryList());
    $display->assign('questionType', get_localized_question_type());
    $out .= $display->render();
} else {
    $out .= $question->getQuestionAnswerHtml();
}
$claroline->display->body->appendContent($out);
echo $claroline->display->render();
Ejemplo n.º 14
0
 }
 if ($is_postAllowed) {
     $cmdList = get_forum_toolbar_array('viewtopic', $forumSettingList['forum_id'], $forumSettingList['cat_id'], $topicId);
     if (count($postList) > 2) {
         $start_last_message = (ceil($totalPosts / get_conf('posts_per_page')) - 1) * get_conf('posts_per_page');
         $lastMsgUrl = Url::Contextualize($_SERVER['PHP_SELF'] . '?forum=' . $forumSettingList['forum_id'] . '&amp;topic=' . $topicId . '&amp;start=' . $start_last_message . '#post' . $topicSettingList['topic_last_post_id']);
         $cmdList[] = array('name' => get_lang('Last message'), 'url' => claro_htmlspecialchars(Url::Contextualize($lastMsgUrl)));
         if (!$viewall) {
             $viewallUrl = Url::Contextualize($_SERVER['PHP_SELF'] . '?forum=' . $forumSettingList['forum_id'] . '&amp;topic=' . $topicId . '&amp;viewall=1');
             $cmdList[] = array('name' => get_lang('Full review'), 'url' => claro_htmlspecialchars(Url::Contextualize($viewallUrl)));
         }
     }
 }
 $out .= $postLister->disp_pager_tool_bar($pagerUrl);
 try {
     $display = new ModuleTemplate('CLFRM', 'forum_viewtopic.tpl.php');
     $display->assign('forum_id', $forumId);
     $display->assign('topic_id', $topicId);
     $display->assign('topic_subject', $topicSettingList['topic_title']);
     $display->assign('postList', $postList);
     $display->assign('is_allowedToEdit', $is_allowedToEdit);
     $display->assign('anonymity', $anonymityStatus);
     $display->assign('claro_notifier', $claro_notifier);
     $display->assign('is_post_allowed', $is_postAllowed);
     $out .= $display->render();
 } catch (Exception $ex) {
     $dialogBox->error($ex);
 }
 if ($is_postAllowed) {
     $replyUrl = Url::Contextualize($_SERVER['PHP_SELF'] . '?topic=' . $topicId . '&amp;cmd=rqPost' . '&amp;mode=reply');
     $toolBar[] = claro_html_cmd_link(claro_htmlspecialchars($replyUrl), '<img src="' . get_icon_url('reply') . '" alt="" />' . ' ' . get_lang('Reply'));
Ejemplo n.º 15
0
 public function render()
 {
     $template = new ModuleTemplate('CLTI', 'item.tpl.php');
     $template->assign('intro', $this);
     $template->assign('rsLocator', ResourceLinker::$Navigator->getCurrentLocator(array('id' => $this->id)));
     return $template->render();
 }
Ejemplo n.º 16
0
$out .= claro_html_tool_title($nameTools, null, $toolList);
$out .= $dialogBox->render();
//-- filter listbox
$attr['onchange'] = 'filterForm.submit()';
$out .= "\n" . '<form method="get" name="filterForm" action="question_pool.php">' . "\n" . '<input type="hidden" name="exId" value="' . $exId . '" />' . "\n" . claro_form_relay_context() . "\n" . '<p align="right">' . "\n" . '<label for="filter">' . get_lang('Filter') . '&nbsp;:&nbsp;</label>' . "\n" . claro_html_form_select('filter', $filterList, $filter, $attr) . "\n" . '<noscript>' . "\n" . '<input type="submit" value="' . get_lang('Ok') . '" />' . "\n" . '</noscript>' . "\n" . '</p>' . "\n" . '</form>' . "\n\n";
//-- pager
$out .= $myPager->disp_pager_tool_bar($pagerUrl);
/*
 * enable multiple question selection
 */
if (!is_null($exId)) {
    $out .= '<form method="post" name="QCMEncode" action="' . $_SERVER['PHP_SELF'] . '?cmd=recupMultipleQuestions">' . "\n";
    $out .= '<input type="hidden" name="exId" value="' . $exId . '" />' . "\n";
}
//-- list
$display = new ModuleTemplate('CLQWZ', 'question_list.tpl.php');
$display->assign('exId', $exId);
$display->assign('questionList', $questionList);
$display->assign('context', is_null($exId) ? 'pool' : 'reuse');
$display->assign('localizedQuestionType', get_localized_question_type());
$display->assign('offset', $offset);
$out .= $display->render();
/*
 * enable multiple question selection
 */
if (!is_null($exId)) {
    $out .= '<div align="center"><input type="submit" name="submit" value="' . get_lang('Ok') . '" />' . "\n";
    $out .= '<input type="reset" name="reset" value="' . get_lang('cancel') . '" /></div>' . "\n";
    $out .= '</form>' . "\n";
}
//-- pager
Ejemplo n.º 17
0
    // Command list
    $cmdList = array();
    $advancedCmdList = array();
    if ($is_allowedToEdit) {
        $cmdList[] = array('img' => 'quiz_new', 'name' => get_lang('New exercise'), 'url' => claro_htmlspecialchars(Url::Contextualize('admin/edit_exercise.php?cmd=rqEdit')));
        $advancedCmdList[] = array('img' => 'question_pool', 'name' => get_lang('Question pool'), 'url' => claro_htmlspecialchars(Url::Contextualize('admin/question_pool.php')));
        $advancedCmdList[] = array('img' => 'question_pool', 'name' => get_lang('Question categories'), 'url' => claro_htmlspecialchars(Url::Contextualize('admin/question_category.php')));
        $advancedCmdList[] = array('img' => 'import', 'name' => get_lang('Import exercise'), 'url' => claro_htmlspecialchars(Url::Contextualize('exercise.php?cmd=rqImport')));
    }
    if (get_conf('is_trackingEnabled') && claro_is_user_authenticated()) {
        $cmdList[] = array('img' => 'statistics', 'name' => get_lang('My results'), 'url' => claro_htmlspecialchars(Url::Contextualize('../tracking/userReport.php?userId=' . claro_get_current_user_id())));
    }
    $out .= claro_html_tool_title($nameTools, $helpUrl, $cmdList, $advancedCmdList);
    $out .= $dialogBox->render();
    //-- pager
    $out .= $myPager->disp_pager_tool_bar($_SERVER['PHP_SELF']);
    //-- list
    $display = new ModuleTemplate('CLQWZ', 'exercise_list.tpl.php');
    $display->assign('exerciseList', $exerciseList);
    $display->assign('is_allowedToTrack', $is_allowedToTrack);
    $display->assign('is_allowedToEdit', $is_allowedToEdit);
    $display->assign('notifier', $claro_notifier);
    $out .= $display->render();
} else {
    $out .= claro_html_tool_title($nameTools, $helpUrl);
    $out .= $dialogBox->render();
}
//-- pager
$out .= $myPager->disp_pager_tool_bar($_SERVER['PHP_SELF']);
$claroline->display->body->appendContent($out);
echo $claroline->display->render();