Ejemplo n.º 1
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.º 2
0
$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
$out .= $myPager->disp_pager_tool_bar($pagerUrl);
$claroline->display->body->appendContent($out);
echo $claroline->display->render();
Ejemplo n.º 3
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.º 4
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.º 5
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.º 6
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.º 7
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();