Ejemplo n.º 1
0
 /**
  * Function to create the different elements of the configuration form to display
  *
  * @param array $property_list
  * @param string $section_selected
  * @param string $url_params appeded to POST query
  * @return the HTML code to display web form to edit config file
  */
 function display_form($property_list = null, $section_selected = null, $url_params = null)
 {
     $form = '';
     // get section list
     $section_list = $this->get_def_section_list();
     if (!empty($section_list)) {
         if (empty($section_selected) || !in_array($section_selected, $section_list)) {
             $section_selected = current($section_list);
         }
         // display start form
         $form .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?config_code=' . $this->config_code . claro_htmlspecialchars($url_params) . '" name="editConfClass" >' . "\n" . claro_form_relay_context() . '<input type="hidden" name="config_code" value="' . claro_htmlspecialchars($this->config_code) . '" />' . "\n" . '<input type="hidden" name="section" value="' . claro_htmlspecialchars($section_selected) . '" />' . "\n" . '<input type="hidden" name="cmd" value="save" />' . "\n";
         $form .= '<table border="0" cellpadding="5" width="100%">' . "\n";
         if ($section_selected != 'viewall') {
             $section_list = array($section_selected);
         }
         foreach ($section_list as $thisSection) {
             if ($thisSection == 'viewall') {
                 continue;
             }
             // section array
             $section = $this->conf_def['section'][$thisSection];
             if ($section_selected == 'viewall') {
                 $form .= '<tr><td colspan="3">' . "\n";
                 $form .= '<ul class="tabTitle">' . "\n";
                 $form .= '<li><a href="#">' . claro_htmlspecialchars(get_lang($this->conf_def['section'][$thisSection]['label'])) . '</a></li>' . "\n";
                 $form .= '</ul>' . "\n";
                 $form .= '</td></tr>' . "\n";
             }
             // display description of the section
             if (!empty($section['description'])) {
                 $form .= '<tr><td colspan="3"><p class="configSectionDesc" ><em>' . get_lang($section['description']) . '</em></p></td></tr>';
             }
             // display each property of the section
             if (is_array($section['properties'])) {
                 foreach ($section['properties'] as $name) {
                     if (key_exists($name, $this->conf_def_property_list)) {
                         if (is_array($this->conf_def_property_list[$name])) {
                             if (isset($property_list[$name])) {
                                 // display elt with new content
                                 $form .= $this->display_form_elt($name, $property_list[$name]);
                             } else {
                                 // display elt with current content
                                 $form .= $this->display_form_elt($name, $this->property_list[$name]);
                             }
                         }
                     } else {
                         $form .= 'Error in section "' . $thisSection . '", "' . $name . '" doesn\'t exist in property list';
                     }
                 }
                 // foreach $section['properties'] as $name
             }
             // is_array($section['properties'])
         }
         // display submit button
         $form .= '<tr>' . "\n" . '<td style="text-align: right">' . get_lang('Save') . '&nbsp;:</td>' . "\n" . '<td colspan="2"><input type="submit" value="' . get_lang('Ok') . '" />&nbsp; ' . claro_html_button($this->backUrl, get_lang('Cancel')) . '</td>' . "\n" . '</tr>' . "\n";
         // display end form
         $form .= '</table>' . "\n" . '</form>' . "\n";
     }
     return $form;
 }
Ejemplo n.º 2
0
/**
 * CLAROLINE
 *
 * @version     $Revision: 14314 $
 * @copyright   (c) 2001-2011, Universite catholique de Louvain (UCL)
 * @license     http://www.gnu.org/copyleft/gpl.html (GPL) GENERAL PUBLIC LICENSE
 * @author      Piraux Sebastien <*****@*****.**>
 * @author      Lederer Guillaume <*****@*****.**>
 * @package     CLLNP
 * @since       1.8
 */
function lp_display_exercise($cmd, $TABLELEARNPATHMODULE, $TABLEMODULE, $TABLEASSET, $tbl_quiz_exercise)
{
    $out = '';
    if (isset($cmd) && ($cmd = "raw")) {
        // change raw if value is a number between 0 and 100
        if (isset($_POST['newRaw']) && is_num($_POST['newRaw']) && $_POST['newRaw'] <= 100 && $_POST['newRaw'] >= 0) {
            $sql = "UPDATE `" . $TABLELEARNPATHMODULE . "`\n                    SET `raw_to_pass` = " . (int) $_POST['newRaw'] . "\n                    WHERE `module_id` = " . (int) $_SESSION['module_id'] . "\n                    AND `learnPath_id` = " . (int) $_SESSION['path_id'];
            claro_sql_query($sql);
            $dialogBoxContent = get_lang('Minimum raw to pass has been changed');
        }
    }
    $out .= '<hr noshade="noshade" size="1" />';
    //####################################################################################\\
    //############################### DIALOG BOX SECTION #################################\\
    //####################################################################################\\
    if (!empty($dialogBoxContent)) {
        $dialogBox = new DialogBox();
        $dialogBox->success($dialogBoxContent);
        $out .= $dialogBox->render();
    }
    // form to change raw needed to pass the exercise
    $sql = "SELECT `lock`, `raw_to_pass`\n            FROM `" . $TABLELEARNPATHMODULE . "` AS LPM\n           WHERE LPM.`module_id` = " . (int) $_SESSION['module_id'] . "\n             AND LPM.`learnPath_id` = " . (int) $_SESSION['path_id'];
    $learningPath_module = claro_sql_query_get_single_row($sql);
    // if this module blocks the user if he doesn't complete
    if (isset($learningPath_module['lock']) && $learningPath_module['lock'] == 'CLOSE' && isset($learningPath_module['raw_to_pass'])) {
        $out .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">' . "\n" . claro_form_relay_context() . '<label for="newRaw">' . get_lang('Change minimum raw mark to pass this module (percentage) :') . ' </label>' . "\n" . '<input type="text" value="' . claro_htmlspecialchars($learningPath_module['raw_to_pass']) . '" name="newRaw" id="newRaw" size="3" maxlength="3" /> % ' . "\n" . '<input type="hidden" name="cmd" value="raw" />' . "\n" . '<input type="submit" value="' . get_lang('Ok') . '" />' . "\n" . '</form>' . "\n\n";
    }
    // display current exercise info and change comment link
    $sql = "SELECT `E`.`id` AS `exerciseId`, `M`.`name`\n            FROM `" . $TABLEMODULE . "` AS `M`,\n                 `" . $TABLEASSET . "`  AS `A`,\n                 `" . $tbl_quiz_exercise . "` AS `E`\n           WHERE `A`.`module_id` = M.`module_id`\n             AND `M`.`module_id` = " . (int) $_SESSION['module_id'] . "\n             AND `E`.`id` = `A`.`path`";
    $module = claro_sql_query_get_single_row($sql);
    if ($module) {
        $out .= "\n\n" . '<h4>' . get_lang('Exercise in module') . ' :</h4>' . "\n" . '<p>' . "\n" . claro_htmlspecialchars($module['name']) . '<a href="../exercise/admin/edit_exercise.php?exId=' . $module['exerciseId'] . '">' . '<img src="' . get_icon_url('edit') . '" alt="' . get_lang('Modify') . '" />' . '</a>' . "\n" . '</p>' . "\n";
    }
    // else sql error, do nothing except in debug mode, where claro_sql_query_fetch_all will show the error
    return $out;
}
Ejemplo n.º 3
0
            $errorsCount++;
        }
        if ($errorCount > 0) {
            $dialogBox->error(get_lang('Error while saving notification preferences'));
        } else {
            $dialogBox->success(get_lang('Notification preferences saved'));
        }
        //force refresh of course data in session!
        $courseData = claro_get_course_data(claro_get_current_course_id(), true);
    } else {
        $courseData = claro_get_course_data(claro_get_current_course_id(), false);
    }
} catch (Exception $ex) {
    $dialogBox->error($ex->getMessage());
}
//init other vars
if (!isset($courseData['notify_submissions'])) {
    $courseData['notify_submissions'] = get_conf('mail_notification', false) && get_conf('automatic_mail_notification', false) ? '1' : '0';
}
if (!isset($courseData['notify_feedbacks'])) {
    $courseData['notify_feedbacks'] = get_conf('mail_notification', false) && get_conf('automatic_mail_notification', false) ? '1' : '0';
}
//display
$out = '';
$nameTools = get_lang('Assignments preferences');
$out .= claro_html_tool_title($nameTools);
$out .= $dialogBox->render();
$out .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">' . "\n" . claro_form_relay_context() . "\n" . '<table border="0" width="50%" cellspacing="0" cellpadding="4"><tbody>' . "\n" . '<input type="hidden" name="claroFormId" value="' . uniqid('') . '" />' . "\n" . '<input name="cmd" type="hidden" value="savePrefs" />' . "\n" . '<ul class="tabTitle"><li>' . get_lang('Notifications to users') . '</li></ul>' . "\n" . '<tr>' . "\n" . '<td width="35%" valign="top" align="right">' . get_lang('Notify course managers of new assignments') . "\n" . '</td>' . "\n" . '<td width="20%" style="text-align:left;padding-left:30px;">' . "\n" . '<input id="submissions_yes" type="radio" value="1" name="submission" ' . ($courseData['notify_submissions'] == '1' ? 'checked="checked" />' : '/>') . "\n" . '<label for="submissions_yes">' . get_lang('Yes') . '</label><br/>' . "\n" . '<input id="submissions_no" type="radio" value="0" name="submission" ' . ($courseData['notify_submissions'] == '0' ? 'checked="checked" />' : '/>') . "\n" . '<label for="submissions_no">' . get_lang('No') . '</label>' . "\n" . '</td>' . "\n" . '<td align="left"><em>' . get_lang('Choose "Yes" to receive an email every time a submission is made') . '</em></td>' . "\n" . '</tr>' . "\n" . '<tr>' . "\n" . '<td width="30%" valign="top" align="right">' . get_lang('Notify students of feedbacks') . "\n" . '</td>' . "\n" . '<td width="20%" style="text-align:left;padding-left:30px;">' . "\n" . '<input id="feedbacks_yes" type="radio" value="1" name="feedback" ' . ($courseData['notify_feedbacks'] == '1' ? 'checked="checked" />' : '/>') . "\n" . '<label for="feedbacks_yes">' . get_lang('Yes') . '</label><br/>' . "\n" . '<input id="feedbacks_no" type="radio" value="0" name="feedback" ' . ($courseData['notify_feedbacks'] == '0' ? 'checked="checked" />' : '/>') . "\n" . '<label for="feedbacks_no">' . get_lang('No') . '</label>' . "\n" . '</td>' . "\n" . '<td align="left"><em>' . get_lang('Choose "Yes" to notify students when you add feedback information to their works') . '</em></td>' . "\n" . '</tr>' . "\n" . '<tr><td colspan="3">&nbsp;</td></tr>' . "\n" . '<tr><td colspan="3" style="text-align:center;">' . "\n" . '<input value="' . get_lang('Ok') . '" type="submit" name="submit"/>&nbsp;' . "\n" . claro_html_button(Url::Contextualize('work.php'), get_lang('Cancel')) . '</td>' . "\n" . '</tr>' . "\n" . '</tbody></table>' . "\n";
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Assignments'), Url::Contextualize('work.php'));
$claroline->display->body->appendContent($out);
echo $claroline->display->render();
Ejemplo n.º 4
0
}
if (isset($_REQUEST['tutorUnregistration'])) {
    //RECHECK if subscribe is aivailable
    if ($isTutorUnregAllowed) {
        if (isset($_REQUEST['doUnreg'])) {
            //RECHECK if subscribe is aivailable
            if ($isTutorUnregAllowed) {
                $sql = "UPDATE `" . $tbl_group_team . "`\n                SET \n                    `tutor` = NULL\n                WHERE\n                    `id` = " . (int) claro_get_current_group_id();
                if (claro_sql_query($sql)) {
                    // REFRESH THE SCRIPT TO COMPUTE NEW PERMISSIONS ON THE BASSIS OF THIS CHANGE
                    claro_redirect(dirname($_SERVER['PHP_SELF']) . '/group.php?gidReset=1&tutorUnregDone=1');
                    exit;
                }
            }
        } else {
            $dialogBox->form(get_lang('Confirm your unsubscription as tutor from the group &quot;<b>%group_name</b>&quot;', array('%group_name' => claro_get_current_group_data('name'))) . "\n" . '<form action="' . claro_htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">' . "\n" . claro_form_relay_context() . '<input type="hidden" name="tutorUnregistration" value="1" />' . "\n" . '<input type="hidden" name="doUnreg" value="1" />' . "\n" . '<br />' . "\n" . '<input type="submit" value="' . get_lang("Ok") . '" />' . "\n" . claro_html_button(claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'])), get_lang("Cancel")) . "\n" . '</form>' . "\n");
        }
    }
}
/********************************
 * GROUP INFORMATIONS RETRIVIAL
 ********************************/
/*----------------------------------------------------------------------------
GET GROUP MEMBER LIST
----------------------------------------------------------------------------*/
$groupMemberList = get_group_user_list(claro_get_current_group_id(), claro_get_current_course_id());
/*----------------------------------------------------------------------------
GET TUTOR(S) DATA
----------------------------------------------------------------------------*/
$sql = "SELECT user_id AS id, nom AS lastName, prenom AS firstName, email\n        FROM `" . $tbl_user . "` user\n        WHERE user.user_id='" . claro_get_current_group_data('tutorId') . "'";
$tutorDataList = claro_sql_query_fetch_all($sql);
Ejemplo n.º 5
0
}
$nameTools = get_lang('Create/edit document');
$out = '';
$out .= claro_html_tool_title(array('mainTitle' => get_lang('Documents and Links'), 'subTitle' => get_lang('Create/edit document')));
/*========================================================================
CREATE DOCUMENT
========================================================================*/
if ($cmd == 'rqMkHtml') {
    $out .= '<form action="' . claro_htmlspecialchars(get_module_entry_url('CLDOC')) . '" method="post">' . "\n" . claro_form_relay_context() . "\n" . '<input type="hidden" name="cmd" value="exMkHtml" />' . "\n" . '<input type="hidden" name="cwd" value="' . claro_htmlspecialchars(strip_tags($cwd)) . '" />' . "\n" . '<p>' . "\n" . '<b>' . get_lang('Document name') . '&nbsp;: </b><br />' . "\n" . '<input type="text" name="fileName" size="80" />' . "\n" . '</p>' . "\n" . '<p>' . "\n" . '<b>' . get_lang('Document content') . '&nbsp;: </b>' . "\n";
    if (!empty($_REQUEST['htmlContent'])) {
        $content = $_REQUEST['htmlContent'];
    } else {
        $content = "";
    }
    $out .= claro_html_textarea_editor('htmlContent', $content);
    // the second argument _REQUEST['htmlContent'] for the case when we have to
    // get to the editor because of an error at creation
    // (eg forgot to give a file name)
    $out .= '</p>' . "\n" . '<p>' . "\n" . '<input type="submit" value="' . get_lang('Ok') . '" />&nbsp;' . claro_html_button(claro_htmlspecialchars(Url::Contextualize('./document.php?cmd=exChDir&amp;file=' . strip_tags($cwd))), get_lang('Cancel')) . '</p>' . "\n" . '</form>' . "\n";
} elseif ($cmd == "rqEditHtml" && !empty($file)) {
    if (is_parent_path($baseWorkDir, $file)) {
        $fileContent = implode("\n", file($baseWorkDir . $file));
    } else {
        claro_die('WRONG PATH');
    }
    $fileContent = get_html_body_content($fileContent);
    $out .= '<form action="' . claro_htmlspecialchars(get_module_entry_url('CLDOC')) . '" method="post">' . "\n" . claro_form_relay_context() . "\n" . '<input type="hidden" name="cmd" value="exEditHtml" />' . "\n" . '<input type="hidden" name="file" value="' . claro_htmlspecialchars(base64_encode($file)) . '" />' . "\n" . '<b>' . get_lang('Document name') . ' : </b><br />' . "\n" . $file . "\n" . '</p>' . "\n" . '<p>' . "\n" . '<b>' . get_lang('Document content') . ' : </b>' . "\n" . claro_html_textarea_editor('htmlContent', $fileContent) . "\n" . '</p>' . '<p>' . '<input type="submit" value="' . get_lang('Ok') . '" />&nbsp;' . "\n" . claro_html_button(claro_htmlspecialchars(Url::Contextualize('./document.php?cmd=rqEdit&file=' . base64_encode($file))), get_lang('Cancel')) . "\n" . '</p>' . "\n" . '</form>' . "\n";
}
$out .= '<br />' . "\n" . '<br />' . "\n";
$claroline->display->body->appendContent($out);
echo $claroline->display->render();
Ejemplo n.º 6
0
    $titleParts = $nameTools;
}
Claroline::getDisplay()->body->appendContent(claro_html_tool_title($titleParts, null, $cmdList));
Claroline::getDisplay()->body->appendContent($dialogBox->render());
/**
 * FORM TO FILL OR MODIFY AN ANNOUNCEMENT
 */
if ($displayForm) {
    // DISPLAY ADD ANNOUNCEMENT COMMAND
    // Ressource linker
    if ($_REQUEST['cmd'] == 'rqEdit') {
        ResourceLinker::setCurrentLocator(ResourceLinker::$Navigator->getCurrentLocator(array('id' => (int) $_REQUEST['id'])));
    }
    $template = new ModuleTemplate($tlabelReq, 'form.tpl.php');
    $template->assign('formAction', Url::Contextualize($_SERVER['PHP_SELF']));
    $template->assign('relayContext', claro_form_relay_context());
    $template->assign('cmd', $formCmd);
    $template->assign('announcement', $announcement);
    Claroline::getDisplay()->body->appendContent($template->render());
}
/**
 * ANNOUNCEMENTS LIST
 */
if ($displayList) {
    // Get notification date
    if (claro_is_user_authenticated()) {
        $date = $claro_notifier->get_notification_date(claro_get_current_user_id());
    }
    $preparedAnnList = array();
    $lastPostDate = '';
    foreach ($announcementList as $thisAnn) {
Ejemplo n.º 7
0
<!-- $Id: course_user_search.tpl.php 14314 2012-11-07 09:09:19Z zefredz $ -->

<form action="<?php 
echo $_SERVER['PHP_SELF'];
?>
" method="post" enctype="multipart/form-data" >
    <?php 
echo claro_form_relay_context();
?>
    <input type="hidden" id="cmd" name="cmd" value="applySearch" />
    <fieldset>
        <legend><?php 
echo get_lang('Fill in one or more search criteria and press \'Search\'');
?>
</legend>
        <dl>
            <dt>
                <label for="lastname"><?php 
echo get_lang('Last name');
?>
</label>&nbsp;:
            </dt>
            <dd>
                <input type="text" size="40" id="lastname" name="lastname" value="" />
            </dd>
            
            <dt>
                <label for="firstname"><?php 
echo get_lang('First name');
?>
</label>&nbsp;:
Ejemplo n.º 8
0
  Display Section
 =================================================================*/
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Forums'), 'index.php');
$noPHP_SELF = true;
$out = '';
// display tool title
$out .= claro_html_tool_title(get_lang('Forums'), $is_allowedToEdit ? 'help_forum.php' : false);
if (!$allowed) {
    $out .= $dialogBox->render();
} else {
    // Display new topic page
    if (isset($_REQUEST['submit']) && !$error) {
        // Display success message
        $out .= disp_confirmation_message(get_lang('Your message has been entered'), $forum_id, $topic_id);
    } else {
        if ($error) {
            // display error message
            $out .= $dialogBox->render();
        }
        $out .= disp_forum_breadcrumb($pagetype, $forum_id, $forum_name) . claro_html_menu_horizontal(disp_forum_toolbar($pagetype, $forum_id, 0, 0)) . '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">' . "\n" . '<input type="hidden" name="forum" value="' . $forum_id . '" />' . "\n" . claro_form_relay_context() . '<table border="0" width="100%">' . "\n" . '<tr valign="top">' . "\n" . '<td align="right"><label for="subject">' . get_lang('Subject') . '</label> : </td>' . '<td><input type="text" name="subject" id="subject" size="50" maxlength="100" value="' . htmlspecialchars($subject) . '" /></td>' . '</tr>' . '<tr  valign="top">' . "\n" . '<td align="right"><br />' . get_lang('Message body') . ' :</td>';
        if (!empty($message)) {
            $content = $message;
        } else {
            $content = '';
        }
        $out .= '<td>' . claro_html_textarea_editor('message', $content) . '</td>' . '</tr>' . '<tr  valign="top"><td>&nbsp;</td>' . '<td><input type="submit" name="submit" value="' . get_lang('Ok') . '" />&nbsp; ' . '&nbsp;<input type="submit" name="cancel" value="' . get_lang('Cancel') . '" />' . "\n" . '</td></tr>' . '</table>' . '</form>' . "\n";
    }
}
// end allowed
$claroline->display->body->appendContent($out);
echo $claroline->display->render();
Ejemplo n.º 9
0
 /**
  * Display form profile
  * @return string
  */
 public function displayProfileForm()
 {
     $form = '<form action="' . $_SERVER['PHP_SELF'] . '" method="post" >' . claro_form_relay_context() . '<input type="hidden" name="profile_id" value="' . $this->id . '" />' . "\n" . '<input type="hidden" name="claroFormId" value="' . uniqid('') . '" />' . "\n" . '<input type="hidden" name="cmd" value="exSave" />' . "\n" . '<table>';
     // Display name
     $form .= '<tr valign="top">' . "\n" . '<td align="right">' . "\n" . '<label for="name">' . "\n" . get_lang('Name') . "\n" . ' :' . "\n" . '</label>' . "\n" . '</td>';
     if ($this->isRequired()) {
         $form .= '<td>' . claro_htmlspecialchars($this->getName()) . '</td>';
     } else {
         $form .= '<td>' . "\n" . '<input type="text" id="name" name="name" value="' . $this->getName() . '"/>' . "\n" . '</td>';
     }
     $form .= '</tr>';
     // Display description
     $form .= '<tr valign="top">' . "\n" . '<td align="right">' . "\n" . '<label for="description">' . get_lang('Description') . ' :</label>' . "\n" . '</td>' . "\n" . '<td >' . "\n" . '<textarea cols="60" rows="3" id="description" name="description">' . $this->getDescription() . '</textarea>' . "\n" . '</td>' . "\n" . '</tr>';
     // Display type
     // TODO after 1.8
     /*
             $form .= '
                 <tr valign="top">
                 <td align="right">' . get_lang('Type') . ' :</td>
                 <td><input type="text" name="type" value="' . $this->type . '"/></td>
                 </tr>';
     $form .= '<input type="hidden" name="type" value="' . PROFILE_TYPE_COURSE . '" />' ;
     // Display 'is course manager'
             $form .= '
                 <tr valign="top">
                 <td align="right"><label for="isCourseManager">' . get_lang('Course manager') . ' :</label></td>
                 <td><input type="checkbox" id="isCourseManager" name="isCourseManager" value="1" ' . ($this->isCourseManager?'checked="checked"':'') . '/></td>
                 </tr>';
     // Display 'is tutor'
             $form .= '
                 <tr valign="top">
                 <td align="right"><label for="isTutor">' . get_lang('Tutor') . ' :</label></td>
                 <td><input type="checkbox" id="isTutor" name="isTutor" value="1" ' . ($this->isTutor?'checked="checked"':'') . '/></td>
                 </tr>';
     */
     // Display 'is locked'
     $form .= '
         <tr valign="top">
         <td align="right"><label for="isLocked">' . get_lang('Locked') . ' :</label></td>
         <td><input type="checkbox" id="isLocked" name="isLocked" value="1" ' . ($this->isLocked ? 'checked="checked"' : '') . '/></td>
         </tr>';
     /*
     // Display is 'user public'
             $form .= '
                 <tr valign="top">
                 <td align="right"><label for="isUserPublic">' . get_lang('Display in user list') . ' :</label></td>
                 <td><input type="checkbox" id="isUserPublic" name="isUserPublic" value="1" ' . ($this->isUserPublic?'checked="checked"':'') . '/></td>
                 </tr>';
     // Display is 'mailing list'
             $form .= '
                 <tr valign="top">
                 <td align="right"><label for="isEmailNotify">' . get_lang('Email notification') . ' :</label></td>
                 <td><input type="checkbox" id="isEmailNotify" name="isEmailNotify" value="1" ' . ($this->isEmailNotify?'checked="checked"':'') . '/></td>
                 </tr>';
     */
     // Display submit button
     $form .= '
         <tr>
         <td align="right">&nbsp;</td>
         <td><input type="submit" name="submitProfile" value="' . get_lang('Ok') . '" />&nbsp;' . claro_html_button(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '.', get_lang('Cancel')) . '</td></tr>
         </table>
         </form>';
     return $form;
 }
Ejemplo n.º 10
0
            $order = $orderMax + 1;
            //create and call the insertquery on the DB to add the checked module to the learning path
            $insertquery = "INSERT INTO `" . $TABLELEARNPATHMODULE . "`\n                          (`learnPath_id`, `module_id`, `specificComment`, `rank`, `lock` )\n                          VALUES (" . (int) $_SESSION['path_id'] . ", " . (int) $list['module_id'] . ", ''," . $order . ", 'OPEN')";
            claro_sql_query($insertquery);
            $atleastOne = TRUE;
            $nb++;
        }
    }
}
//end if ADD command
//STEP ONE : display form to add module of the course that are not in this path yet
// this is the same SELECT as "select all 'addable' modules of this course for this learning path"
// **BUT** normally there is less 'addable' modules here than in the first one
$result = claro_sql_query(buildRequestModules());
// Display available modules
$out .= '<form name="addmodule" action="' . $_SERVER['PHP_SELF'] . '?cmdglobal=add">' . "\n" . claro_form_relay_context() . "\n" . '<table class="claroTable">' . "\n" . '<thead>' . "\n" . '<tr align="center" valign="top">' . "\n" . '<th width="10%">' . get_lang('Add module(s)') . '</th>' . "\n" . '<th>' . get_lang('Module') . '</th>' . "\n" . '</tr>' . "\n" . '</thead>' . "\n\n" . '<tbody>' . "\n\n";
$atleastOne = false;
while ($list = mysql_fetch_array($result)) {
    //CHECKBOX, NAME, RENAME, COMMENT
    if ($list['contentType'] == CTEXERCISE_) {
        $moduleImg = get_icon_url('quiz', 'CLQWZ');
    } else {
        $moduleImg = get_icon_url(choose_image(basename($list['path'])));
    }
    $contentType_alt = selectAlt($list['contentType']);
    $out .= '<tr>' . "\n" . '<td style="vertical-align:top; text-align: center;">' . "\n" . '<input type="checkbox" name="check_' . $list['module_id'] . '" id="check_' . $list['module_id'] . '" />' . "\n" . '</td>' . "\n" . '<td align="left">' . "\n" . '<label for="check_' . $list['module_id'] . '" >' . '<img hspace="5" src="' . $moduleImg . '" alt="' . $contentType_alt . '" /> ' . $list['name'] . '</label>' . "\n" . ($list['comment'] != null ? '<div class="comment">' . $list['comment'] . '</small>' . '</div>' . "\n\n" : '') . '</td>' . "\n" . '</tr>' . "\n\n";
    $atleastOne = true;
}
//end while another module to display
if (!$atleastOne) {
    $out .= '<tr>' . "\n" . '<td colspan="2" align="center">' . get_lang('All modules of this course are already used in this learning path.') . '</td>' . "\n" . '</tr>' . "\n";
Ejemplo n.º 11
0
  Display Section
 =================================================================*/
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Forums'), 'index.php');
$noPHP_SELF = true;
$out = '';
// Forum Title
$out .= claro_html_tool_title(get_lang('Forums'), $is_allowedToEdit ? 'help_forum.php' : false);
if (!$allowed || !$is_allowedToEdit) {
    $out .= $dialogBox->render();
} else {
    if (isset($_REQUEST['submit']) && !$error) {
        if (!isset($_REQUEST['delete'])) {
            $out .= disp_confirmation_message(get_lang('Your message has been entered'), $forum_id, $topic_id);
        } else {
            $out .= disp_confirmation_message(get_lang('Your message has been deleted'), $forum_id);
        }
    } else {
        $first_post = is_first_post($topic_id, $post_id);
        if ($error) {
            $out .= $dialogBox->render();
        }
        $out .= disp_forum_breadcrumb($pagetype, $forum_id, $forum_name, $topic_id, $subject) . claro_html_menu_horizontal(disp_forum_toolbar($pagetype, $forum_id, $topic_id, 0)) . '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post" >' . "\n" . claro_form_relay_context() . '<input type="hidden" name="post_id" value="' . $post_id . '" />' . "\n" . '<table border="0" width="100%" >' . "\n";
        if ($first_post) {
            $out .= '<tr valign="top">' . "\n" . '<td align="right">' . "\n" . '<label for="subject">' . get_lang('Subject') . '</label> : ' . '</td>' . "\n" . '<td>' . "\n" . '<input type="text" name="subject" id="subject" size="50" maxlength="100" value="' . htmlspecialchars($subject) . '" />' . '</td>' . "\n" . '</tr>' . "\n";
        }
        $out .= '<tr valign="top">' . "\n" . '<td align="right">' . "\n" . '<br />' . get_lang('Message body') . ' : ' . "\n" . '</td>' . "\n" . '<td>' . "\n" . claro_html_textarea_editor('message', $message) . '</td>' . "\n" . '</tr>' . "\n" . '<tr valign="top">' . "\n" . '<td align="right">' . "\n" . '<label for="delete" >' . get_lang('Delete') . '</label>' . "\n" . ' : ' . "\n" . '</td>' . "\n" . '<td>' . "\n" . '<input type="checkbox" name="delete" id="delete" />' . "\n" . '</td>' . "\n" . '</tr>' . "\n" . '<tr>' . '<td>&nbsp;</td>' . "\n" . '<td>' . '<input type="submit" name="submit" value="' . get_lang('Ok') . '" />&nbsp; ' . '<input type="submit" name="cancel" value="' . get_lang('Cancel') . '" />' . '</td>' . "\n" . '</tr>' . "\n" . '</table>' . "\n" . '</form>' . "\n" . '<br />' . "\n" . '<center>' . '<a href="' . htmlspecialchars(Url::Contextualize(get_module_url('CLFRM') . '/viewtopic.php?topic=' . $topic_id)) . '" target="_blank">' . get_lang('Topic review') . '</a>' . '</center>' . '<br />' . "\n";
    }
    // end // else if ! isset submit
}
$claroline->display->body->appendContent($out);
echo $claroline->display->render();
Ejemplo n.º 12
0
 /**
  * display the form to edit answers
  *
  * @param $exId exercise id, required to get stay in the exercise context if required after posting the form
  * @param $askDuplicate display or not the form elements allowing to choose if the question must be duplicated or modified in all exercises
  * @author Sebastien Piraux <*****@*****.**>
  * @return string html code for display of answer edition form
  */
 public function getFormHtml($exId = null, $askDuplicate = false)
 {
     $html = '<form method="post" action="./edit_answers.php?exId=' . $exId . '&amp;quId=' . $this->questionId . '">' . "\n" . '<input type="hidden" name="cmd" value="exEdit" />' . "\n" . '<input type="hidden" name="claroFormId" value="' . uniqid('') . '" />' . "\n" . claro_form_relay_context() . "\n" . '<table class="claroTable">' . "\n";
     if (!empty($exId) && $askDuplicate) {
         $html .= html_ask_duplicate();
     }
     $html .= '<thead>' . "\n" . '<tr>' . "\n" . '<th>' . get_lang('Expected choice') . '</th>' . "\n" . '<th>' . get_lang('Answer') . '</th>' . "\n" . '<th>' . get_lang('Comment') . '</th>' . "\n" . '<th>' . get_lang('Weighting') . '</th>' . "\n" . '</tr>' . "\n" . '</thead>' . "\n" . '<tr>' . "\n" . '<td valign="top" align="center">' . '<input name="correctAnswer" id="trueCorrect" ' . ($this->correctAnswer == "TRUE" ? 'checked="checked"' : '') . 'type="radio" value="true" />' . '</td>' . "\n" . '<td valign="top"><label for="trueCorrect">' . get_lang('True') . '</label></td>' . "\n" . '<td>' . claro_html_textarea_editor('trueFeedback', $this->trueFeedback, 10, 25, '', 'simple') . '</td>' . "\n" . '<td valign="top"><input name="trueGrade" size="5" value="' . $this->trueGrade . '" type="text" /></td>' . "\n" . '</tr>' . "\n\n" . '<tr>' . "\n" . '<td valign="top" align="center">' . '<input name="correctAnswer" id="falseCorrect" ' . ($this->correctAnswer == "FALSE" ? 'checked="checked"' : '') . 'type="radio" value="false" />' . '</td>' . "\n" . '<td valign="top"><label for="falseCorrect">' . get_lang('False') . '</label></td>' . "\n" . '<td>' . claro_html_textarea_editor('falseFeedback', $this->falseFeedback, 10, 25, '', 'simple') . '</td>' . "\n" . '<td valign="top"><input name="falseGrade" size="5" value="' . $this->falseGrade . '" type="text" /></td>' . "\n" . '</tr>' . "\n\n" . '<tr>' . "\n" . '<td colspan="4" align="center">' . '<input type="submit" name="cmdOk" value="' . get_lang('Ok') . '" />&nbsp;&nbsp;' . claro_html_button(Url::Contextualize('./edit_question.php?exId=' . $exId . '&amp;quId=' . $this->questionId), get_lang("Cancel")) . '</td>' . "\n" . '</tr>' . "\n\n" . '</table>' . "\n\n" . '</form>';
     return $html;
 }
Ejemplo n.º 13
0
$out = '';
$nameTools = get_lang('Chat');
$out .= claro_html_tool_title($nameTools);
if (claro_is_javascript_enabled() && $_uid) {
    $jsloader = JavascriptLoader::getInstance();
    $jsloader->load('jquery');
    $jsloader->load('clchat');
    // init var with values from get_conf before including tool library
    $htmlHeaders = '<script type="text/javascript">' . "\n" . 'var refreshRate = "' . get_conf('msg_list_refresh_rate', 5) * 1000 . '";' . "\n" . 'var userListRefresh = "' . get_conf('user_list_refresh_rate') * 1000 . '";' . "\n" . 'var cidReq = "' . claro_get_current_course_id() . '";' . "\n";
    if (claro_is_in_a_group()) {
        $htmlHeaders .= 'var gidReq = "' . claro_get_current_group_id() . '";' . "\n";
    }
    $htmlHeaders .= 'var lang = new Array();' . "\n" . 'lang["confirmFlush"] = "' . clean_str_for_javascript(get_lang('Are you sure to delete all logs ?')) . '";' . '</script>';
    $claroline->display->header->addHtmlHeader($htmlHeaders);
    // dialog box
    $out .= '<div id="clchat_user_list"></div>' . "\n" . '<div id="clchat_chatarea">' . "\n" . ' <div id="clchat_log"></div>' . "\n" . ' <div id="clchat_connectTime">' . get_lang('Start of this chat session (%connectTime)', array('%connectTime' => claro_html_localised_date(get_locale('dateTimeFormatLong'), $_SESSION['chat_connectionTime']))) . '</div>' . "\n" . ' <div id="clchat_text"></div>' . "\n" . '</div>' . "\n";
    // display form
    $out .= '<form action="#" id="clchat_form" method="get" >' . "\n" . claro_form_relay_context() . "\n" . '<img src="' . get_module_url('CLCHAT') . '/img/loading.gif" alt="' . get_lang('Loading...') . '" id="clchat_loading" width="16" height="16" />' . "\n" . '<input id="clchat_msg" type="text" name="message" maxlength="200" size="80" />' . "\n" . '<input type="submit" name="Submit" value=" &gt;&gt; " />' . "\n" . '</form>' . "\n" . claro_html_menu_horizontal($cmdMenu) . "\n" . '<p id="clchat_dialogBox"></p>' . "\n";
} else {
    if (!claro_is_javascript_enabled()) {
        $dialogBox = new DialogBox();
        $dialogBox->error(get_lang('Javascript must be enabled in order to use this tool.'));
        $out .= $dialogBox->render();
    } elseif (!$_uid) {
        $dialogBox = new DialogBox();
        $dialogBox->error(get_lang('Anonymous users cannot use this tool.'));
        $out .= $dialogBox->render();
    }
}
$claroline->display->body->appendContent($out);
echo $claroline->display->render();
Ejemplo n.º 14
0
/*
 * Output
 */
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Exercises'), Url::Contextualize('../exercise.php'));
$nameTools = get_lang('Question categories');
$noQUERY_STRING = true;
// Tool list
$toolList = array();
if ($is_allowedToEdit) {
    $toolList[] = array('img' => 'quiz_new', 'name' => get_lang('New category'), 'url' => claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=add')));
}
$out = '';
$out .= $dialogBox->render();
$out .= claro_html_tool_title($nameTools, null, $toolList);
if ($displayForm) {
    $out .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '" >' . "\n\n" . claro_form_relay_context() . '<input type="hidden" name="cmd" value="exEdit" />' . "\n" . '<input type="hidden" name="catId" value="' . $catId . '" />' . "\n" . '<input type="hidden" name="claroFormId" value="' . uniqid('') . '" />' . "\n";
    $out .= '<table border="0" cellpadding="5">' . "\n";
    //--
    // title
    $out .= '<tr>' . "\n" . '<td valign="top"><label for="title">' . get_lang('Title') . '&nbsp;<span class="required">*</span>&nbsp;:</label></td>' . "\n" . '<td><input type="text" name="title" id="title" size="60" maxlength="200" value="' . $form['title'] . '" /></td>' . "\n" . '</tr>' . "\n\n";
    // description
    $out .= '<tr>' . "\n" . '<td valign="top"><label for="description">' . get_lang('Description') . '&nbsp;:</label></td>' . "\n" . '<td>' . claro_html_textarea_editor('description', $form['description']) . '</td>' . "\n" . '</tr>' . "\n\n";
    //--
    $out .= '<tr>' . "\n" . '<td>&nbsp;</td>' . "\n" . '<td><small>' . get_lang('<span class="required">*</span> denotes required field') . '</small></td>' . "\n" . '</tr>' . "\n\n";
    //-- buttons
    $out .= '<tr>' . "\n" . '<td>&nbsp;</td>' . "\n" . '<td>' . '<input type="submit" name="" id="" value="' . get_lang('Ok') . '" />&nbsp;&nbsp;' . claro_html_button(Url::Contextualize($_SERVER['PHP_SELF']), get_lang("Cancel")) . '</td>' . "\n" . '</tr>' . "\n\n";
    $out .= '</table>' . "\n\n" . '</form>' . "\n\n";
}
//-- pager
$out .= $myPager->disp_pager_tool_bar($_SERVER['PHP_SELF']);
//-- list
Ejemplo n.º 15
0
 /**
  * Display form
  *
  * @param $cancelUrl string url of the cancel button
  * @return string html output of form
  */
 public function displayForm($cancelUrl = null)
 {
     JavascriptLoader::getInstance()->load('course_form');
     $languageList = get_language_to_display_list('availableLanguagesForCourses');
     $categoriesList = claroCategory::getAllCategoriesFlat();
     $linkedCategoriesListHtml = '';
     // Categories linked to the course
     $unlinkedCategoriesListHtml = '';
     // Other categories (not linked to the course)
     foreach ($categoriesList as $category) {
         // Is that category linked to the current course or not ?
         $match = false;
         foreach ($this->categories as $searchCategory) {
             if ($category['id'] == (int) $searchCategory->id) {
                 $match = true;
                 break;
             } else {
                 $match = false;
             }
         }
         // Dispatch in the lists
         if ($match) {
             $linkedCategoriesListHtml .= '<option ' . (!$category['visible'] ? 'class="hidden" ' : '') . 'value="' . $category['id'] . '">' . $category['path'] . '</option>' . "\n";
         } else {
             if ($category['canHaveCoursesChild'] || claro_is_platform_admin()) {
                 $unlinkedCategoriesListHtml .= '<option ' . (!$category['visible'] ? 'class="hidden" ' : '') . 'value="' . $category['id'] . '">' . $category['path'] . '</option>' . "\n";
             }
         }
     }
     $publicDisabled = !(get_conf('allowPublicCourses', true) || claro_is_platform_admin()) ? ' disabled="disabled"' : '';
     $publicCssClass = !(get_conf('allowPublicCourses', true) || claro_is_platform_admin()) ? ' class="notice"' : '';
     $publicMessage = $this->access != 'public' && !(get_conf('allowPublicCourses', true) || claro_is_platform_admin()) ? '<br /><span class="notice">' . get_lang('If you need to create a public course, please contact the platform administrator') . '</span>' : '';
     $cancelUrl = is_null($cancelUrl) ? get_path('clarolineRepositoryWeb') . 'course/index.php?cid=' . claro_htmlspecialchars($this->courseId) : $cancelUrl;
     $template = new CoreTemplate('course_form.tpl.php');
     $template->assign('formAction', $_SERVER['PHP_SELF']);
     $template->assign('relayContext', claro_form_relay_context());
     $template->assign('course', $this);
     $template->assign('linkedCategoriesListHtml', $linkedCategoriesListHtml);
     $template->assign('unlinkedCategoriesListHtml', $unlinkedCategoriesListHtml);
     $template->assign('languageList', $languageList);
     $template->assign('publicDisabled', $publicDisabled);
     $template->assign('publicCssClass', $publicCssClass);
     $template->assign('publicMessage', $publicMessage);
     $template->assign('cancelUrl', $cancelUrl);
     $template->assign('nonRootCategoryRequired', !get_conf('clcrs_rootCategoryAllowed', true));
     return $template->render();
 }
Ejemplo n.º 16
0
if ($is_allowedToEdit) {
    $cmdList[] = array('img' => 'assignment', 'name' => get_lang('Create a new assignment'), 'url' => claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=rqMkAssig')));
    if (claro_is_platform_admin() || get_conf('allow_download_all_submissions')) {
        $cmdList[] = array('img' => 'save', 'name' => get_lang('Download submissions'), 'url' => claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=rqDownload')));
    }
    if (get_conf('mail_notification', false) && !get_conf('automatic_mail_notification', false)) {
        $cmdList[] = array('img' => 'settings', 'name' => get_lang('Assignments preferences'), 'url' => claro_htmlspecialchars(Url::Contextualize('work_settings.php')));
    }
}
$out = '';
$out .= claro_html_tool_title($nameTools, $helpUrl, $cmdList);
if ($is_allowedToEdit) {
    $out .= $dialogBox->render();
    // Form
    if (isset($displayAssigForm) && $displayAssigForm) {
        $out .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '" enctype="multipart/form-data">' . "\n" . '<input type="hidden" name="claroFormId" value="' . uniqid('') . '" />' . "\n" . '<input type="hidden" name="cmd" value="' . $cmdToSend . '" />' . "\n" . claro_form_relay_context() . "\n" . '<fieldset>';
        if (!is_null($assigId)) {
            $out .= '<input type="hidden" name="assigId" value="' . $assigId . '" />' . "\n";
        }
        $out .= '<dl>' . '<dt><label for="title">' . get_lang('Assignment title') . ' <span class="required">*</span></label></dt>' . '<dd><input type="text" name="title" id="title" size="50" maxlength="200" value="' . claro_htmlspecialchars($assignment->getTitle()) . '" /></dd>' . '<dt><label for="description">' . get_lang('Description') . '<br /></label></dt>' . '<dd>' . claro_html_textarea_editor('description', $assignment->getDescription()) . '</dd>' . '<dt>' . get_lang('Submission type') . '</dt>' . '<dd>' . '<input type="radio" name="authorized_content" id="authorizeFile" value="FILE" ' . ($assignment->getSubmissionType() == "FILE" ? 'checked="checked"' : '') . ' />
                <label for="authorizeFile">&nbsp;' . get_lang('File (file required, description text optional)') . '</label>
                <br />
                <input type="radio" name="authorized_content" id="authorizeText" value="TEXT" ' . ($assignment->getSubmissionType() == "TEXT" ? 'checked="checked"' : '') . '/>
                <label for="authorizeText">&nbsp;' . get_lang('Text only (text required, no file)') . '</label>
                <br />
                <input type="radio" name="authorized_content" id="authorizeTextFile" value="TEXTFILE" ' . ($assignment->getSubmissionType() == "TEXTFILE" ? 'checked="checked"' : '') . ' />
                <label for="authorizeTextFile">&nbsp;' . get_lang('Text with attached file (text required, file optional)') . '</label>' . '</dd>' . '<dt>' . get_lang('Assignment type') . '</dt>' . '<dd>' . '<input type="radio" name="assignment_type" id="individual" value="INDIVIDUAL" ' . ($assignment->getAssignmentType() == "INDIVIDUAL" ? 'checked="checked"' : '') . ' />
                <label for="individual">&nbsp;' . get_lang('Individual') . '</label>
                <br />
                <input type="radio" name="assignment_type" id="group" value="GROUP" ' . ($assignment->getAssignmentType() == "GROUP" ? 'checked="checked"' : '') . ' />
                <label for="group">&nbsp;' . get_lang('Groups (from groups tool, only group members can post)') . '</label>' . '</dd>' . '<dt>' . get_lang('Start date') . '</dt>' . '<dd>' . claro_html_date_form('startDay', 'startMonth', 'startYear', $assignment_data['start_date'], 'long') . ' ' . claro_html_time_form('startHour', 'startMinute', $assignment_data['start_date']) . '<p class="notice">' . get_lang('(d/m/y hh:mm)') . '</p>' . '</dd>' . '<dt>' . get_lang('End date') . '</dt>' . '<dd>' . claro_html_date_form('endDay', 'endMonth', 'endYear', $assignment_data['end_date'], 'long') . ' ' . claro_html_time_form('endHour', 'endMinute', $assignment_data['end_date']) . '<p class="notice">' . get_lang('(d/m/y hh:mm)') . '</p>' . '</dd>' . '<dt>' . get_lang('Allow late upload') . '</dt>' . '<dd>
Ejemplo n.º 17
0
 case 'error':
     break;
 case 'exExport':
     $out .= '<blockquote>' . get_lang("Wiki %TITLE% exported to course documents. (this file is visible)", array('%TITLE%' => $wikiTitle)) . '</blockquote>';
     $cmdList[] = array('name' => get_lang("Go to documents tool"), 'url' => claro_htmlspecialchars(Url::Contextualize(get_module_url('CLDOC') . '/document.php?gidReset=1')));
     $cmdList[] = array('name' => get_lang("Go back to Wiki list"), 'url' => claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'])));
     break;
     // edit form
 // edit form
 case 'rqEdit':
     $out .= claro_disp_wiki_properties_form($wikiId, $wikiTitle, $wikiDesc, $groupId, $wikiACL);
     break;
     // delete form
 // delete form
 case 'rqDelete':
     $out .= '<form method="post" action="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'])) . '" id="rqDelete">' . "\n" . '<div style="padding: 5px">' . "\n" . '<input type="hidden" name="wikiId" value="' . $wikiId . '" />' . "\n" . claro_form_relay_context() . "\n" . '<input type="submit" name="action[exDelete]" value="' . get_lang("Continue") . '" />' . "\n" . claro_html_button(claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'])), get_lang("Cancel")) . '</div>' . "\n" . '</form>' . "\n";
     break;
     // list wiki
 // list wiki
 case 'exSearch':
 case 'list':
     //find the wiki with recent modification from the notification system
     if (claro_is_user_authenticated()) {
         $date = $claro_notifier->get_notification_date(claro_get_current_user_id());
         $modified_wikis = $claro_notifier->get_notified_ressources(claro_get_current_course_id(), $date, claro_get_current_user_id(), claro_get_current_group_id(), claro_get_current_tool_id());
     } else {
         $modified_wikis = array();
     }
     // if admin, display add new wiki link
     $out .= '<p>';
     if ($groupId && claro_is_group_member() || $is_allowedToAdmin) {
Ejemplo n.º 18
0
    $toolTitle['mainTitle'] = $nameTools;
    $toolTitle['subTitle'] = $exercise->getTitle();
    ClaroBreadCrumbs::getInstance()->prepend(get_lang('Exercises'), Url::Contextualize(get_module_url('CLQWZ') . '/exercise.php'));
    ClaroBreadCrumbs::getInstance()->setCurrent($nameTools, Url::Contextualize('./edit_exercise.php?exId=' . $exId));
}
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());
Ejemplo n.º 19
0
 * @package CLCHT
 *
 * @author Claro Team <*****@*****.**>
 * @author Christophe Gesché <*****@*****.**>
 * @copyright   (c) 2001-2011, Universite catholique de Louvain (UCL)
 *
 */
require '../inc/claro_init_global.inc.php';
$is_allowedToManage = claro_is_course_manager() || claro_is_in_a_group() && claro_is_group_tutor();
// header
$htmlHeadXtra[] = '
<script type="text/javascript">
function prepare_message()
{
    document.chatForm.chatLine.value=document.chatForm.msg.value;
    document.chatForm.msg.value = "";
    document.chatForm.msg.focus();
    return true;
}
</script>';
$cmdMenu = array();
if ($is_allowedToManage) {
    $cmdMenu[] = claro_html_cmd_link('messageList.php?cmd=reset' . claro_url_relay_context('&amp;'), get_lang('Reset'), array('target' => "messageList"));
    $cmdMenu[] = claro_html_cmd_link('messageList.php?cmd=store' . claro_url_relay_context('&amp;'), get_lang('Store Chat'), array('target' => "messageList"));
}
$hide_banner = TRUE;
// Turn off session lost
$warnSessionLost = false;
include get_path('incRepositorySys') . '/claro_init_header.inc.php';
echo '<form name="chatForm" action="messageList.php#final" method="post" target="messageList" onsubmit="return prepare_message();">' . "\n" . claro_form_relay_context() . '<input type="text"    name="msg" size="80" />' . "\n" . '<input type="hidden"  name="chatLine" />' . "\n" . '<input type="submit" value=" >> " />' . "\n" . '<br />' . "\n" . '' . "\n" . claro_html_menu_horizontal($cmdMenu) . '</form>';
include get_path('incRepositorySys') . '/claro_init_footer.inc.php';
Ejemplo n.º 20
0
 public function renderForm()
 {
     $template = new ModuleTemplate('CLTI', 'form.tpl.php');
     $template->assign('formAction', Url::Contextualize($_SERVER['PHP_SELF']));
     $template->assign('relayContext', claro_form_relay_context());
     $template->assign('cmd', $this->id ? 'exEd' : 'exAdd');
     $template->assign('intro', $this);
     return $template->render();
 }
Ejemplo n.º 21
0
      = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
    if ('exChVis' == $cmd && $courseContext) {
        $_REQUEST['file'] = secure_file_path($_REQUEST['file']);
        update_db_info('update', $_REQUEST['file'], array('visibility' => $_REQUEST['vis']));
        //notify claroline that visibility changed
        if ($_REQUEST['vis'] == 'v') {
            $eventNotifier->notifyCourseEvent("document_visible", claro_get_current_course_id(), claro_get_current_tool_id(), $_REQUEST['file'], claro_get_current_group_id(), "0");
        } else {
            $eventNotifier->notifyCourseEvent("document_invisible", claro_get_current_course_id(), claro_get_current_tool_id(), $_REQUEST['file'], claro_get_current_group_id(), "0");
        }
    }
}
// END is Allowed to Edit
if ('rqSearch' == $cmd) {
    $searchMsg = !empty($cwd) ? '<br />' . get_lang('Search in %currentDirectory', array('%currentDirectory' => claro_htmlspecialchars($cwd))) : '';
    $dialogBox->form('<form action="' . claro_htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">' . "\n" . claro_form_relay_context() . '<input type="hidden" name="cmd" value="exSearch" />' . "\n" . '<input type="text" id="searchPattern" name="searchPattern" class="inputSearch" />' . "\n" . '<input type="hidden" name="cwd" value="' . claro_htmlspecialchars($cwd) . '" />' . "\n" . '<input type="submit" value="' . get_lang('Search') . '" />&nbsp;' . claro_html_button(claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=exChDir&file=' . base64_encode($cwd))), get_lang("Cancel")) . $searchMsg . '</form>' . "\n");
}
if ('exDownload' == $cmd) {
    if (claro_is_user_authenticated() && (claro_is_allowed_to_edit() || get_conf('cldoc_allowNonManagersToDownloadFolder', true)) || get_conf('cldoc_allowNonManagersToDownloadFolder', true) && get_conf('cldoc_allowAnonymousToDownloadFolder', true)) {
        /*
         * PREPARE THE FILE COLLECTION
         */
        if (isset($_REQUEST['file'])) {
            $requestDownloadPath = $baseWorkDir . secure_file_path($_REQUEST['file']);
            $searchDownloadPattern = '';
        } elseif (isset($_REQUEST['searchPattern'])) {
            $requestDownloadPath = $baseWorkDir;
            $searchDownloadPattern = $_REQUEST['searchPattern'];
        }
        if (!$is_allowedToEdit && $courseContext) {
            // Build an exclude file list to prevent simple user
Ejemplo n.º 22
0
/**
 * Generate html code of Wiki properties edit form
 * @param int wikiId ID of the wiki
 * @param string title wiki tile
 * @param string desc wiki description
 * @param int groupId id of the group the wiki belongs to
 *      (0 for a course wiki)
 * @param array acl wiki access control list
 * @param string script callback script url
 * @return string html code of the wiki properties form
 */
function claro_disp_wiki_properties_form($wikiId = 0, $title = '', $desc = '', $groupId = 0, $acl = null, $script = null)
{
    $title = $title != '' ? $title : get_lang("New Wiki");
    $desc = $desc != '' ? $desc : get_lang("Enter the description of your wiki here");
    if (is_null($acl) && $groupId == 0) {
        $acl = WikiAccessControl::defaultCourseWikiACL();
    } elseif (is_null($acl) && $groupId != 0) {
        $acl = WikiAccessControl::defaultGroupWikiACL();
    }
    // process ACL
    $group_read_checked = $acl['group_read'] == true ? ' checked="checked"' : '';
    $group_edit_checked = $acl['group_edit'] == true ? ' checked="checked"' : '';
    $group_create_checked = $acl['group_create'] == true ? ' checked="checked"' : '';
    $course_read_checked = $acl['course_read'] == true ? ' checked="checked"' : '';
    $course_edit_checked = $acl['course_edit'] == true ? ' checked="checked"' : '';
    $course_create_checked = $acl['course_create'] == true ? ' checked="checked"' : '';
    $other_read_checked = $acl['other_read'] == true ? ' checked="checked"' : '';
    $other_edit_checked = $acl['other_edit'] == true ? ' checked="checked"' : '';
    $other_create_checked = $acl['other_create'] == true ? ' checked="checked"' : '';
    $script = is_null($script) ? Url::Contextualize($_SERVER['PHP_SELF']) : $script;
    $form = '<form method="post" id="wikiProperties" action="' . claro_htmlspecialchars($script) . '">' . "\n" . '<fieldset>' . "\n" . '<legend>' . get_lang("Wiki description") . '</legend>' . "\n" . '<!-- wikiId = 0 if creation, != 0 if edition  -->' . "\n" . '<p class="notice">' . get_lang('You can choose a title and a description for the wiki :') . '</p>' . "\n" . '<input type="hidden" name="wikiId" value="' . $wikiId . '" />' . "\n" . '<!-- groupId = 0 if course wiki, != 0 if group_wiki  -->' . "\n" . '<input type="hidden" name="groupId" value="' . $groupId . '" />' . "\n" . '<dl>' . "\n" . '<dt><label for="wikiTitle">' . get_lang("Title of the wiki") . '</label></dt>' . "\n" . '<dd><input type="text" name="title" id="wikiTitle" size="80" maxlength="254" value="' . claro_htmlspecialchars($title) . '" /></dd>' . "\n" . '<dt><label for="wikiDesc">' . get_lang("Description of the Wiki") . '</label></dt>' . "\n" . '<dd><textarea id="wikiDesc" name="desc" cols="80" rows="10">' . $desc . '</textarea></dd>' . "\n" . '</dl>' . '</fieldset>' . "\n\n" . '<fieldset id="acl">' . "\n" . '<legend>' . get_lang("Access control management") . '</legend>' . "\n" . '<p class="notice">' . get_lang('You can set access rights for users using the following grid :') . '</p>' . "\n" . '<table style="text-align: center; padding: 5px;" id="wikiACL">' . "\n" . '<tr class="matrixAbs">' . "\n" . '<td><!-- empty --></td>' . "\n" . '<td>' . get_lang("Read Pages") . '</td>' . "\n" . '<td>' . get_lang("Edit Pages") . '</td>' . "\n" . '<td>' . get_lang("Create Pages") . '</td>' . "\n" . '</tr>' . "\n" . '<tr>' . "\n" . '<td class="matrixOrd">' . get_lang("Course members") . '</td>' . "\n" . '<td><input type="checkbox" onclick="updateBoxes(\'course\',\'read\');" id="course_read" name="acl[course_read]"' . $course_read_checked . ' /></td>' . "\n" . '<td><input type="checkbox" onclick="updateBoxes(\'course\',\'edit\');" id="course_edit" name="acl[course_edit]"' . $course_edit_checked . ' /></td>' . "\n" . '<td><input type="checkbox" onclick="updateBoxes(\'course\',\'create\');" id="course_create" name="acl[course_create]"' . $course_create_checked . ' /></td>' . "\n" . '</tr>' . "\n";
    if ($groupId != 0) {
        $form .= '<!-- group acl row hidden if groupId == 0, set all to false -->' . "\n" . '<tr>' . "\n" . '<td class="matrixOrd">' . get_lang("Group members") . '</td>' . "\n" . '<td><input type="checkbox" onclick="updateBoxes(\'group\',\'read\');" id="group_read" name="acl[group_read]"' . $group_read_checked . ' /></td>' . "\n" . '<td><input type="checkbox" onclick="updateBoxes(\'group\',\'edit\');" id="group_edit" name="acl[group_edit]"' . $group_edit_checked . ' /></td>' . "\n" . '<td><input type="checkbox" onclick="updateBoxes(\'group\',\'create\');" id="group_create" name="acl[group_create]"' . $group_create_checked . ' /></td>' . "\n" . '</tr>' . "\n";
    }
    $form .= '<tr>' . "\n" . '<td class="matrixOrd">' . get_lang("Others (*)") . '</td>' . "\n" . '<td><input type="checkbox" onclick="updateBoxes(\'other\',\'read\');" id="other_read" name="acl[other_read]"' . $other_read_checked . ' /></td>' . "\n" . '<td><input type="checkbox" onclick="updateBoxes(\'other\',\'edit\');" id="other_edit" name="acl[other_edit]"' . $other_edit_checked . ' /></td>' . "\n" . '<td><input type="checkbox" onclick="updateBoxes(\'other\',\'create\');" id="other_create" name="acl[other_create]"' . $other_create_checked . ' /></td>' . "\n" . '</tr>' . "\n" . '</table>' . "\n" . '<p class="notice">' . get_lang("(*) anonymous users, users who are not members of this course...") . '</p>' . "\n" . '</fieldset>' . "\n\n";
    if ($groupId != 0) {
        $form .= '<input type="hidden" name="gidReq" value="' . $groupId . '" />' . "\n";
    }
    $form .= claro_form_relay_context() . "\n";
    $form .= '<input type="submit" name="action[exEdit]" value="' . get_lang("Ok") . '" />' . "\n" . claro_html_button(claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?action=list')), get_lang("Cancel")) . "\n";
    $form .= '</form>' . "\n";
    return $form;
}
Ejemplo n.º 23
0
 /**
  * display the form to edit answers
  *
  * @param $exId exercise id, required to get stay in the exercise context if required after posting the form
  * @param $askDuplicate display or not the form elements allowing to choose if the question must be duplicated or modified in all exercises
  * @author Sebastien Piraux <*****@*****.**>
  * @return string html code for display of answer edition form
  */
 public function getFormHtml($exId = null, $askDuplicate)
 {
     $html = '<form method="post" action="./edit_answers.php?exId=' . $exId . '&amp;quId=' . $this->questionId . '">' . "\n" . '<input type="hidden" name="cmd" value="exEdit" />' . "\n" . '<input type="hidden" name="step" value="' . $this->step . '" />' . "\n" . claro_form_relay_context() . "\n";
     if ($this->step > 1) {
         $html .= '<input type="hidden" name="answer" value="' . claro_htmlspecialchars($this->answerText) . '" />' . "\n" . '<input type="hidden" name="type" value="' . claro_htmlspecialchars($this->type) . '" />' . "\n" . '<input type="hidden" name="wrongAnswerList" value="' . claro_htmlspecialchars(implode("\n", $this->wrongAnswerList)) . '" />' . "\n\n";
         if (!empty($exId) && $askDuplicate) {
             if (isset($_REQUEST['duplicate'])) {
                 $html .= '<input type="hidden" name="duplicate" value="' . claro_htmlspecialchars($_REQUEST['duplicate']) . '" />' . "\n";
             }
         }
         $html .= '<p>' . get_lang('Please give a weighting to each blank') . '&nbsp;:</p>' . "\n" . '<table border="0" cellpadding="5" width="500">' . "\n";
         $i = 0;
         foreach ($this->answerList as $correctAnswer) {
             $value = isset($this->gradeList[$i]) ? $this->gradeList[$i] : '0';
             $html .= '<tr>' . "\n" . '<td width="50%">' . $correctAnswer . '</td>' . "\n" . '<td width="50%">' . '<input type="text" name="grade[' . $i . ']" size="5" value="' . $value . '" />' . '</td>' . "\n" . '</tr>' . "\n\n";
             $i++;
         }
         $html .= '</table>' . "\n\n" . '<input type="submit" name="cmdBack" value="&lt; ' . get_lang('Back') . '" />&nbsp;&nbsp;' . '<input type="submit" name="cmdOk" value="' . get_lang('Ok') . '" />&nbsp;&nbsp;' . claro_html_button('./edit_question.php?exId=' . $exId . '&amp;quId=' . $this->questionId, get_lang("Cancel"));
     } else {
         // populate fields of other steps
         $i = 0;
         foreach ($this->gradeList as $grade) {
             $html .= '<input type="hidden" name="grade[' . $i . ']" value="' . $grade . '" />' . "\n";
             $i++;
         }
         if (!empty($exId) && $askDuplicate) {
             $html .= '<p>' . html_ask_duplicate() . '</p>' . "\n";
         }
         // answer
         $text = $this->addslashesEncodedBrackets($this->answerText);
         $text = $this->answerDecode($text);
         $html .= '<p>' . get_lang('Please type your text below, use brackets %mask to define one or more blanks', array('%mask' => '&#91;...&#93;')) . ' :</p>' . "\n" . claro_html_textarea_editor('answer', $text) . "\n" . '<p>' . get_lang('Fill type') . '&nbsp;:</p>' . "\n" . '<p>' . "\n" . '<input type="radio" name="type" id="textFill" value="' . TEXTFIELD_FILL . '"' . ($this->type == TEXTFIELD_FILL ? 'checked="checked"' : '') . ' /><label for="textFill">' . get_lang('Fill text field') . '</label><br />' . "\n" . '<input type="radio" name="type" id="listboxFill" value="' . LISTBOX_FILL . '"' . ($this->type == LISTBOX_FILL ? 'checked="checked"' : '') . ' /><label for="listboxFill">' . get_lang('Select in drop down list') . '</label><br />' . "\n" . '</p>' . "\n" . '<p>' . get_lang('Add wrong answers for drop down lists <small>(Optionnal. One wrong answer by line.)</small>') . '</p>' . '<textarea name="wrongAnswerList" cols="30" rows="5">' . claro_htmlspecialchars($this->answerDecode(implode("\n", $this->wrongAnswerList))) . '</textarea>' . "\n" . '<p>' . "\n" . '<input type="submit" name="cmdNext" value="' . get_lang('Next') . ' &gt;" />&nbsp;&nbsp;' . claro_html_button(Url::Contextualize('./edit_question.php?exId=' . $exId . '&amp;quId=' . $this->questionId), get_lang("Cancel")) . '</p>' . "\n";
     }
     $html .= '</form>';
     return $html;
 }
Ejemplo n.º 24
0
        } else {
            $dialogBox = new DialogBox();
            $dialogBox->error(get_lang('Name cannot be empty'));
            $out .= $dialogBox->render();
        }
        break;
        //display the form to modify the comment
    //display the form to modify the comment
    case "rqComment":
        if (isset($_REQUEST['module_id'])) {
            //get current comment from DB
            $query = "SELECT `comment`\n                    FROM `" . $TABLEMODULE . "`\n                    WHERE `module_id` = '" . (int) $_REQUEST['module_id'] . "'";
            $result = claro_sql_query($query);
            $comment = mysql_fetch_array($result);
            if (isset($comment['comment'])) {
                $out .= '<form method="get" action="' . $_SERVER['PHP_SELF'] . '">' . "\n" . claro_form_relay_context() . claro_html_textarea_editor('comment', $comment['comment'], 15, 55) . "\n" . '<br />' . "\n" . '<input type="hidden" name="cmd" value="exComment" />' . "\n" . '<input type="hidden" name="module_id" value="' . $_REQUEST['module_id'] . '" />' . "\n" . '<input type="submit" value="' . get_lang('Ok') . '" />' . "\n" . '<br /><br />' . "\n" . '</form>' . "\n";
            }
        }
        // else no module_id
        break;
        //make update to change the comment in the database for this module
    //make update to change the comment in the database for this module
    case "exComment":
        if (isset($_REQUEST['module_id']) && isset($_REQUEST['comment'])) {
            $sql = "UPDATE `" . $TABLEMODULE . "`\n                    SET `comment` = '" . claro_sql_escape($_REQUEST['comment']) . "'\n                    WHERE `module_id` = " . (int) $_REQUEST['module_id'];
            claro_sql_query($sql);
        }
        break;
}
$sql = "SELECT M.*,\n               count(M.`module_id`) AS timesUsed\n        FROM `" . $TABLEMODULE . "` AS M\n          LEFT JOIN `" . $TABLELEARNPATHMODULE . "` AS LPM ON LPM.`module_id` = M.`module_id`\n        WHERE M.`contentType` != '" . CTSCORM_ . "'\n          AND M.`contentType` != '" . CTLABEL_ . "'\n        GROUP BY M.`module_id`\n        ORDER BY M.`name` ASC, M.`contentType`ASC, M.`accessibility` ASC";
$result = claro_sql_query($sql);
Ejemplo n.º 25
0
            } else {
                $statusToDisplay = get_lang('Never browsed');
            }
        } else {
            $statusToDisplay = $resultBrowsed['lesson_status'];
        }
        $out .= '<tr>' . "\n" . '<td>' . get_lang('Module status') . '</td>' . "\n" . '<td>' . $statusToDisplay . '</td>' . "\n" . '</tr>' . "\n\n" . '</tbody>' . "\n\n" . '</table>' . "\n\n";
    }
    //end display stats
    /* START */
    // check if module.startAssed_id is set and if an asset has the corresponding asset_id
    // asset_id exists ?  for the good module  ?
    $sql = "SELECT `asset_id`\n              FROM `" . $TABLEASSET . "`\n             WHERE `asset_id` = " . (int) $module['startAsset_id'] . "\n               AND `module_id` = " . (int) $_SESSION['module_id'];
    $asset = claro_sql_query_get_single_row($sql);
    if ($module['startAsset_id'] != "" && $asset['asset_id'] == $module['startAsset_id']) {
        $out .= '<center>' . "\n" . '<form action="./navigation/viewer.php" method="post">' . "\n" . claro_form_relay_context() . '<input type="submit" value="' . get_lang('Start Module') . '" />' . "\n" . '</form>' . "\n" . '</center>' . "\n\n";
    } else {
        $out .= '<p><center>' . get_lang('There is no start asset defined for this module.') . '</center></p>' . "\n";
    }
}
// end if($module['contentType'] != CTLABEL_)
// if module is a label, only allow to change its name.
//####################################################################################\\
//################################# ADMIN DISPLAY ####################################\\
//####################################################################################\\
if ($is_allowedToEdit) {
    switch ($module['contentType']) {
        case CTDOCUMENT_:
            require "./include/document.inc.php";
            $out .= lp_display_document($TABLEASSET);
            break;
Ejemplo n.º 26
0
/**
 * build an html form listing all directories of a given directory and file to move
 *
 * @param file        string: filename to o move
 * @param baseWorkDir string: complete path to root directory to prupose as target for move
 */
function form_dir_list($file, $baseWorkDir)
{
    $dirList = index_and_sort_dir($baseWorkDir);
    $dialogBox = '<strong>' . get_lang('Move') . '</strong>' . "\n" . "<form action=\"" . $_SERVER['PHP_SELF'] . "\" method=\"post\">\n" . claro_form_relay_context() . "<input type=\"hidden\" name=\"cmd\" value=\"exMv\" />\n" . "<input type=\"hidden\" name=\"file\" value=\"" . base64_encode($file) . "\" />\n" . "<label for=\"destiantion\">" . get_lang('Move <i>%filename</i> to', array('%filename' => basename($file))) . "</label> \n" . "<select name=\"destination\">\n";
    if (dirname($file) == '/' || dirname($file) == '\\') {
        $dialogBox .= '<option value="" class="invisible">root</option>' . "\n";
    } else {
        $dialogBox .= '<option value="" >root</option>' . "\n";
    }
    $bwdLen = strlen($baseWorkDir);
    // base directories length, used under
    /* build html form inputs */
    if ($dirList) {
        while (list(, $pathValue) = each($dirList)) {
            $pathValue = substr($pathValue, $bwdLen);
            // truncate confidential informations
            $dirname = basename($pathValue);
            // extract $pathValue directory name
            /* compute de the display tab */
            $tab = '';
            // $tab reinitialisation
            $depth = substr_count($pathValue, '/');
            // The number of nombre '/' indicates the directory deepness
            for ($h = 0; $h < $depth; $h++) {
                $tab .= '&nbsp;&nbsp';
            }
            if ($file == $pathValue or dirname($file) == $pathValue) {
                $dialogBox .= '<option class="invisible" value="' . $pathValue . '">' . $tab . ' &gt; ' . $dirname . '</option>' . "\n";
            } else {
                $dialogBox .= '<option value="' . $pathValue . '">' . $tab . ' &gt; ' . $dirname . '</option>' . "\n";
            }
        }
    }
    $dialogBox .= '</select>' . "\n" . '<br /><br />' . '<input type="submit" value="' . get_lang('Ok') . '" />&nbsp;' . claro_html_button($_SERVER['PHP_SELF'] . '?cmd=exChDir&file=' . claro_htmlspecialchars(claro_dirname($file)), get_lang('Cancel')) . '</form>' . "\n";
    return $dialogBox;
}
Ejemplo n.º 27
0
if ($textOrFilePresent && ($showAfterEndDate || $showAfterPost)) {
    $out .= '<fieldset>' . "\n" . '<legend>' . '<b>' . get_lang('Feedback') . '</b>' . '</legend>';
    if ($assignment->getAutoFeedbackText() != '') {
        $out .= claro_parse_user_text($assignment->getAutoFeedbackText());
    }
    if ($assignment->getAutoFeedbackFilename() != '') {
        $target = get_conf('open_submitted_file_in_new_window') ? 'target="_blank"' : '';
        $out .= '<p><a href="' . claro_htmlspecialchars(Url::Contextualize($assignment->getAssigDirWeb() . $assignment->getAutoFeedbackFilename())) . '" ' . $target . '>' . $assignment->getAutoFeedbackFilename() . '</a></p>';
    }
    $out .= '</fieldset>' . '<br />' . "\n";
}
if ($is_allowedToEditAll) {
    // Submission download requested
    if ($cmd == 'rqDownload' && (claro_is_platform_admin() || get_conf('allow_download_all_submissions'))) {
        require_once $includePath . '/lib/form.lib.php';
        $downloadForm = '<strong>' . get_lang('Download') . '</strong>' . "\n" . '<form action="' . get_module_url('CLWRK') . '/export.php?assigId=' . $req['assignmentId'] . '" method="POST">' . "\n" . claro_form_relay_context() . '<input type="hidden" name="cmd" value="exDownload" />' . "\n" . '<input type="radio" name="downloadMode" id="downloadMode_from" value="from" checked /><label for="downloadMode_from">' . get_lang('Submissions posted or modified after date :') . '</label><br />' . "\n" . claro_html_date_form('day', 'month', 'year', time(), 'long') . ' ' . claro_html_time_form('hour', 'minute', time() - fmod(time(), 86400) - 3600) . '<small>' . get_lang('(d/m/y hh:mm)') . '</small>' . '<br /><br />' . "\n" . '<input type="radio" name="downloadMode" id="downloadMode_all" value="all" /><label for="downloadMode_all">' . get_lang('All submissions') . '</label><br /><br />' . "\n" . '<input type="checkbox" name="downloadOnlyCurrentMembers" id="downloadOnlyCurrentMembers_id" value="yes" checked="checked" /><label for="downloadOnlyCurrentMembers_id">' . get_lang('Download only submissions from current course members') . '</label><br /><br />' . "\n" . '<input type="checkbox" name="downloadScore" id="downloadScore_id" value="yes" checked="checked" /><label for="downloadScore_id">' . get_lang('Download score') . '</label><br /><br />' . "\n" . '<input type="submit" value="' . get_lang('OK') . '" />&nbsp;' . "\n" . claro_html_button('work_list.php?assigId=' . $req['assignmentId'], get_lang('Cancel')) . '</form>' . "\n";
        $dialogBox->form($downloadForm);
    }
}
// Render dialog box
$out .= $dialogBox->render();
/**
 * Submitter (User or group) listing
 */
$headerUrl = $workPager->get_sort_url_list(Url::Contextualize($_SERVER['PHP_SELF'] . '?assigId=' . $req['assignmentId']));
$out .= $workPager->disp_pager_tool_bar(Url::Contextualize($_SERVER['PHP_SELF'] . "?assigId=" . $req['assignmentId'])) . '<table class="claroTable emphaseLine" width="100%">' . "\n" . '<thead>' . "\n" . '<tr class="headerX">' . "\n" . '<th>' . '<a href="' . $headerUrl['name'] . '">' . get_lang('Author(s)') . '</a>' . '</th>' . "\n" . '<th>' . '<a href="' . $headerUrl['last_edit_date'] . '">' . get_lang('Last submission') . '</a>' . '</th>' . "\n" . '<th>' . '<a href="' . $headerUrl['submissionCount'] . '">' . get_lang('Submissions') . '</a>' . '</th>' . "\n" . '<th>' . '<a href="' . $headerUrl['feedbackCount'] . '">' . get_lang('Feedbacks') . '</a>' . '</th>' . "\n";
if ($is_allowedToEditAll) {
    $out .= '<th>' . '<a href="' . $headerUrl['maxScore'] . '">' . get_lang('Best score') . '</a>' . '</th>' . "\n";
}
$out .= '</tr>' . "\n" . '</thead>' . "\n" . '<tbody>';
foreach ($workList as $thisWrk) {
Ejemplo n.º 28
0
    //  if registration failed display error message
    $out .= '<style>
  .message {background-color: #E6E6E6;
    color: #339933;font-size: 0.9 em;}
  </style>';
    $out .= 'La synchronisation : <br />
    <ul>
    <li> ajoute les &#233;l&#232;ves pr&#233;sents dans le ldap mais absents de la plateforme et les affecte &#224; leur classe : <span id="cr0" class="message"></span></li>
    <li> ajoute les profs pr&#233;sents dans le ldap mais absents de la plateforme et les affecte &#224; la classe Profs : <span id="cr1"class="message"></span></li>
    <li> supprime les &#233;l&#232;ves qui ne sont plus dans l\'annuaire : <span id="cr2"class="message"></span></li>
    <li> supprime les profs qui ne sont plus dans l\'annuaire : <span id="cr3"class="message"></span></li>
    <li> d&#233;clare "orphelins" les cours des profs supprim&#233;s : <span id="cr4"class="message"></span></li>
    </ul>
    <div id="mess" class="message"></div>';
    if ($cmd == '') {
        $out .= '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"  >' . "\n" . claro_form_relay_context() . form_input_hidden('cmd', 'synchronisation');
        $out .= ' <br /><input type="submit"   value="' . get_lang('Ok') . '" />&nbsp;' . claro_html_button($_SERVER['HTTP_REFERER'], get_lang('Cancel'));
        $out .= '</form>' . "\n";
    }
}
$claroline->display->body->appendContent($out);
echo $claroline->display->render();
/*=====================================================================
  Main Section
 =====================================================================*/
if ($cmd == 'synchronisation') {
    $db = @mysql_connect($dbHost, $dbLogin, $dbPass, false, CLIENT_FOUND_ROWS) or die('<center>' . 'WARNING ! SYSTEM UNABLE TO CONNECT TO THE DATABASE SERVER.' . '</center>');
    /*=====================================================================
      Suppression des eleves absents du ldap
     =====================================================================*/
    //recherche de la liste des eleves
Ejemplo n.º 29
0
    }
}
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Exercises'), Url::Contextualize(get_module_url('CLQWZ') . '/exercise.php'));
$nameTools = get_lang('Question pool');
// Tool list
$toolList = array();
if (!is_null($exId)) {
    $toolList[] = array('img' => 'back', 'name' => get_lang('Go back to the exercise'), 'url' => claro_htmlspecialchars(Url::Contextualize('edit_exercise.php?exId=' . $exId)));
}
$toolList[] = array('img' => 'default_new', 'name' => get_lang('New question'), 'url' => claro_htmlspecialchars(Url::Contextualize('edit_question.php?cmd=rqEdit')));
$out = '';
$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());
Ejemplo n.º 30
0
/**
 * Display form to edit course user properties
 * @author Mathieu Laurent <*****@*****.**>
 * @param $data array to fill the form
 * @todo $courseManagerChecked never used
 */
function course_user_html_form($data, $courseId, $userId, $hiddenParam = null)
{
    // TODO $courseManagerChecked never used
    //$courseManagerChecked = $data['isCourseManager'] == 1 ? 'checked="checked"':'';
    $tutorChecked = $data['isTutor'] == 1 ? 'checked="checked"' : '';
    $selectedProfileId = isset($data['profileId']) ? (int) $data['profileId'] : 0;
    $form = '';
    $form .= '<form action="' . claro_htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">' . "\n" . claro_form_relay_context() . '<input type="hidden" name="cmd" value="exUpdateCourseUserProperties" />' . "\n";
    if (!is_null($hiddenParam) && is_array($hiddenParam)) {
        foreach ($hiddenParam as $name => $value) {
            $form .= '<input type="hidden" name="' . claro_htmlspecialchars($name) . '" value="' . claro_htmlspecialchars($value) . '" />' . "\n";
        }
    }
    $form .= '<table class="claroTable" cellpadding="3" cellspacing="0" border="0">' . "\n";
    // User firstname and lastname
    $form .= '<tr >' . "\n" . '<td align="right">' . get_lang('Name') . ' :</td>' . "\n" . '<td ><b>' . claro_htmlspecialchars($data['firstName']) . ' ' . claro_htmlspecialchars($data['lastName']) . '</b></td>' . "\n" . '</tr>' . "\n";
    // Profile select box
    $profileList = claro_get_all_profile_name_list();
    $form .= '<tr >' . "\n" . '<td align="right"><label for="profileId">' . get_lang('Profile') . ' :</label></td>' . "\n" . '<td>';
    if ($userId == $GLOBALS['_uid']) {
        $form .= '<input type="text" name="profileIdDisabled" value="' . claro_htmlspecialchars($profileList[$selectedProfileId]['name']) . '" disabled="disabled" id="profileId" />';
    } else {
        $form .= '<select name="profileId" id="profileId">';
        foreach ($profileList as $id => $info) {
            if ($info['label'] != 'anonymous' && $info['label'] != 'guest') {
                $form .= '<option value="' . $id . '" ' . ($selectedProfileId == $id ? 'selected="selected"' : '') . '>' . get_lang($info['name']) . '</option>' . "\n";
            }
        }
        $form .= '</select>';
    }
    $form .= '</td>' . "\n" . '</tr>' . "\n";
    // User role label
    $form .= '<tr >' . "\n" . '<td align="right"><label for="role">' . get_lang('Role') . ' (' . get_lang('Optional') . ')</label> :</td>' . "\n" . '<td ><input type="text" name="role" id="role" value="' . claro_htmlspecialchars($data['role']) . '" maxlength="40" /></td>' . "\n" . '</tr>' . "\n";
    // User is tutor
    $form .= '<tr >' . "\n" . '<td align="right"><label for="isTutor">' . get_lang('Group Tutor') . '</label> :</td>' . "\n" . '<td><input type="checkbox" name="isTutor" id="isTutor" value="1" ' . $tutorChecked . ' /></td>' . "\n" . '</tr>' . "\n";
    $form .= '<tr >' . "\n" . '<td align="right"><label for="applyChange">' . get_lang('Save changes') . '</label> :</td>' . "\n" . '<td><input type="submit" name="applyChange" id="applyChange" value="' . get_lang('Ok') . '" />&nbsp;' . claro_html_button(claro_htmlspecialchars(Url::Contextualize($_SERVER['HTTP_REFERER'])), get_lang('Cancel')) . '</td>' . "\n" . '</tr>' . "\n";
    $form .= '</table>' . "\n" . '</form>' . "\n";
    return $form;
}