Пример #1
0
         $dialogBox->error(get_lang('This tool can not be uninstalled.'));
     } else {
         list($backlog, $success) = uninstall_module($module_id, $deleteModuleDatabase);
         $details = $backlog->output();
         if ($success) {
             $summary = get_lang('Module uninstallation succeeded');
             $dialogBox->success(Backlog_Reporter::report($summary, $details));
         } else {
             $summary = get_lang('Module uninstallation failed');
             $dialogBox->error(Backlog_Reporter::report($summary, $details));
         }
     }
     break;
 case 'rqUninstall':
     $moduleInfo = get_module_info($module_id);
     $dialogBox->form('<p>' . get_lang('Are you sure you want to delete module %module% ?', array('%module%' => $moduleInfo['module_name'])) . '</p>' . '<form enctype="multipart/form-data" action="' . $_SERVER['PHP_SELF'] . '" method="post">' . "\n" . '<input type="hidden" name="claroFormId" value="' . uniqid('') . '" />' . '<input type="hidden" name="module_id" value="' . $module_id . '" />' . '<input name="cmd" type="hidden" value="exUninstall" />' . "\n" . '<input name="deleteModuleDatabase" id="deleteModuleDatabase" type="checkbox" checked="checked" />' . '<label for="deleteModuleDatabase">' . get_lang('Also delete module main database') . '</label>' . '<br />' . "\n" . '<br />' . "\n" . '<input value="' . get_lang('Continue') . '" type="submit" onclick="return confirmation(\'' . $moduleInfo['module_name'] . '\');" />' . '&nbsp;' . "\n" . claro_html_button($_SERVER['PHP_SELF'], get_lang('Cancel')) . '</form>' . "\n");
     break;
 case 'exInstall':
     // call by rqInstall
     //1 GET THE FILE
     //2 UNZIP IF ZIPPED
     //3 INSTALL
     $moduleInstallable = false;
     //include needed librabries for treatment
     //1 GET THE FILE
     // File can be an uploaded package file
     // or a local package file
     // or a local unpackaged file
     // later: an url to a package file)
     // later: a local repository of many packages
     // Actually interface display two input, and only one must be filed. If the user give both , the uploaded package win.
Пример #2
0
 if (is_null($date)) {
     $CssLoader = CssLoader::getInstance();
     $CssLoader->load('ui.datepicker');
     $JsLoader = JavascriptLoader::getInstance();
     $JsLoader->load('jquery');
     $JsLoader->load('ui.datepicker');
     $javascript = '
         <script type="text/javascript" charset="utf-8">
             jQuery(function($){
                 $("#dateinput").datepicker({dateFormat: \'dd/mm/yy\'});
             });
         </script>';
     $claroline->display->header->addHtmlHeader($javascript);
     $disp = get_lang('Choose a date') . ' :<br />' . '<form action="' . $_SERVER['PHP_SELF'] . '?cmd=rqOlderThan" method="post">' . '<input type="text" name="date" value="' . date('d/m/Y') . '" id="dateinput" /> ' . get_lang('(jj/mm/aaaa)') . '<br />' . '<input type="submit" value="' . get_lang('Delete') . '" />' . '</form>';
     $dialogBox = new DialogBox();
     $dialogBox->form($disp);
     $content .= $dialogBox->render();
 } else {
     $javascriptDelete = '
         <script type="text/javascript">
         if (confirm("' . get_lang('Are you sure to delete all messages older than %date?', array('%date' => $date)) . "\n\n" . get_lang('There is no way to restore deleted messages.') . '"));
         {
             window.location=\'' . $_SERVER['PHP_SELF'] . '?cmd=exOlderThan&amp;date=' . urlencode($date) . '\';
         }
         else
         {
             window.location=\'admin.php\';
         }
         </script>';
     $claroline->display->header->addHtmlHeader($javascriptDelete);
     $dialogBox = new DialogBox();
Пример #3
0
 */
if (isset($_REQUEST['registration'])) {
    //RECHECK if subscribe is aivailable
    if (claro_is_course_member() && !claro_is_group_member() && $is_allowedToSelfRegInGroup) {
        if (isset($_REQUEST['doReg'])) {
            //RECHECK if subscribe is aivailable
            if (claro_is_course_member() && !claro_is_group_member() && $is_allowedToSelfRegInGroup) {
                $sql = "INSERT INTO `" . $tbl_group_rel_team_user . "`\n                SET `user` = " . (int) claro_get_current_user_id() . ",\n                    `team` = " . (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($_SERVER['PHP_SELF'] . '?gidReset=1&gidReq=' . claro_get_current_group_id() . '&regDone=1');
                    exit;
                }
            }
        } else {
            $dialogBox->form(get_lang('Confirm your subscription to 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="registration" value="1" />' . "\n" . '<input type="hidden" name="doReg" 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");
        }
    }
}
if (isset($_REQUEST['regDone'])) {
    $dialogBox->success(get_lang("You are now a member of this group."));
}
if (isset($_REQUEST['unregistration'])) {
    //RECHECK if subscribe is aivailable
    if (claro_is_course_member() && claro_is_group_member() && $is_allowedToSelfUnregInGroup) {
        if (isset($_REQUEST['doUnreg'])) {
            //RECHECK if subscribe is aivailable
            if (claro_is_course_member() && claro_is_group_member() && $is_allowedToSelfUnregInGroup) {
                $sql = "DELETE FROM `" . $tbl_group_rel_team_user . "`\n                WHERE `user` = " . (int) claro_get_current_user_id() . "\n                AND    `team` = " . (int) claro_get_current_group_id();
                if (claro_sql_query($sql)) {
                    // REFRESH THE SCRIPT TO COMPUTE NEW PERMISSIONS ON THE BASSIS OF THIS CHANGE
Пример #4
0
         $dialogBox->error(get_lang('Error : Can not delete all classes'));
     }
     break;
     // Empty all classes
 // Empty all classes
 case 'exEmptyAll':
     if (empty_all_class()) {
         $dialogBox->success(get_lang('All classes emptied'));
     } else {
         $dialogBox->error(get_lang('Error : Can not empty all classes'));
     }
     break;
     // Display form to create a new class
 // Display form to create a new class
 case 'rqAdd':
     $dialogBox->form('<form action="' . $_SERVER['PHP_SELF'] . '" method="post" >' . "\n" . '<input type="hidden" name="cmd" value="exAdd" />' . "\n" . '<input type="hidden" name="claroFormId" value="' . uniqid('') . '" />' . '<table>' . "\n" . '<tr>' . "\n" . '<td>' . get_lang('New Class name') . ' : ' . '</td>' . "\n" . '<td>' . "\n" . '<input type="text" name="class_name" />' . "\n" . '</td>' . "\n" . '</tr>' . "\n" . '<tr>' . "\n" . '<td>' . get_lang('Location') . ' :' . '</td>' . "\n" . '<td>' . "\n" . displaySelectBox() . '<input type="submit" value=" Ok " />' . "\n" . '</td>' . "\n" . '</tr>' . "\n" . '</table>' . "\n" . '</form>' . "\n ");
     break;
     // Create a new class
 // Create a new class
 case 'exAdd':
     if (empty($form_data['class_name'])) {
         $dialogBox->warning(get_lang('You cannot give a blank name to a class'));
     } else {
         if (class_create($form_data['class_name'], $form_data['class_parent_id'])) {
             $dialogBox->success(get_lang('The new class has been created'));
         }
     }
     break;
     // Edit class properties with posted form
 // Edit class properties with posted form
 case 'exEdit':
Пример #5
0
/**
* Display list of messages in substyled boxes in a message_box
*
* In most of cases  function message_box() is enough.
*
* @param array $msgArrBody of array of blocs containing array of messages
* @author Christophe Gesche <*****@*****.**>
* @version 1.0
* @see  message_box()
*
*  code for using this    in your    tools:
*  $msgArrBody["nameOfCssClass"][]="foo";
*  css    class can be defined in    script but try to use
*  class from    generic    css    ()
*  error success warning
*  ...
*
* @todo this must be a message object where code add messages with a priority,
* and the rendering is set by by priority
*
*/
function claro_html_msg_list($msgArrBody, $return = true)
{
    $msgBox = '';
    if (is_array($msgArrBody) && count($msgArrBody) > 0) {
        foreach ($msgArrBody as $classMsg => $thisMsgArr) {
            if (is_array($thisMsgArr)) {
                $msgBox .= '<div class="' . $classMsg . '">';
                foreach ($thisMsgArr as $anotherThis) {
                    $msgBox .= '<div class="msgLine" >' . $anotherThis . '</div>';
                }
                $msgBox .= '</div>';
            } else {
                $msgBox .= '<div class="' . $classMsg . '">';
                $msgBox .= '<div class="msgLine" >' . $thisMsgArr . '</div>';
                $msgBox .= '</div>';
            }
        }
    }
    $dialogBox = new DialogBox();
    if ($msgBox) {
        $dialogBox->form($msgBox);
    }
    if ($return) {
        return $dialogBox->render();
    } else {
        echo $dialogBox->render();
    }
    return true;
}
Пример #6
0
}
if ('show' != $cmd) {
    if ('default' == $anonymityStatus) {
        $info = '<tr valign="top">' . "\n" . '<td>&nbsp;</td>' . '<td><strong>' . get_lang('Contributions to this forum are anonymous by default!<br/>') . get_lang('If you want to sign your post all the same, uncheck the checkbox above the "OK" button') . '</strong></td>' . '</tr>' . '<tr style="height:1px;"><td colspan="2">&nbsp;</td></tr>';
    } elseif ('allowed' == $anonymityStatus) {
        $info = '<tr valign="top">' . "\n" . '<td>&nbsp;</td>' . '<td><strong>' . get_lang('This forum allows anonymous contributions!<br/>') . get_lang('If you do not want to sign your post, check the checkbox above the "OK" button') . '</strong></td>' . '</tr>' . '<tr style="height:1px;"><td colspan="2">&nbsp;</td></tr>';
    }
    if (!empty($info)) {
        $dialogBox->info($info);
    }
}
$out .= $dialogBox->render();
//display edit form if any
if (isset($form)) {
    $formBox = new DialogBox();
    $formBox->form($form->render());
    $out .= $formBox->render() . '<hr />';
}
//display topic review if any
if ($topicSettingList) {
    // get post and use pager
    if (!$viewall) {
        $postLister = new postLister($topicId, $start, get_conf('posts_per_page'));
    } else {
        $postLister = new postLister($topicId, $start, get_total_posts($topicId, 'topic'));
        $incrementViewCount = false;
    }
    // get post and use pager
    $postList = $postLister->get_post_list();
    $totalPosts = $postLister->sqlPager->get_total_item_count();
    $pagerUrl = claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?topic=' . $topicId));
Пример #7
0
                // determine the default order of this Learning path
                $result = claro_sql_query("SELECT MAX(`rank`)\n                                               FROM `" . $TABLELEARNPATH . "`");
                list($orderMax) = mysql_fetch_row($result);
                $order = $orderMax + 1;
                // create new learning path
                $sql = "INSERT\n                              INTO `" . $TABLELEARNPATH . "`\n                                     (`name`, `comment`, `rank`)\n                              VALUES ('" . claro_sql_escape($_POST['newPathName']) . "','" . claro_sql_escape(trim($_POST['newComment'])) . "'," . (int) $order . ")";
                //echo $sql;
                $lp_id = claro_sql_query_insert_id($sql);
                // notify the creation to eventmanager
                $eventNotifier->notifyCourseEvent("learningpath_created", claro_get_current_course_id(), claro_get_current_tool_id(), $lp_id, claro_get_current_group_id(), "0");
            } else {
                // display error message
                $dialogBox->error(get_lang('Error : Name already exists in the learning path or in the module pool'));
            }
        } else {
            $dialogBox->form("\n\n" . '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">' . "\n" . '<fieldset>' . claro_form_relay_context() . '<h4>' . get_lang('Create a new learning path') . '</h4>' . "\n" . '<dl>' . '<dt><label for="newPathName">' . get_lang('Title') . '</label></dt>' . "\n" . '<dd><input type="text" name="newPathName" id="newPathName" maxlength="255" /></dd>' . "\n" . '<dt><label for="newComment">' . get_lang('Comment') . '</label></dt>' . "\n" . '<dd>' . claro_html_textarea_editor('newComment', '', 15, 55) . '</dd>' . '</dl>' . "\n" . '</fieldset>' . "\n" . '<input type="hidden" name="cmd" value="create" />' . "\n" . '<input type="submit" value="' . get_lang('Ok') . '" />&nbsp;' . "\n" . claro_html_button('learningPathList.php', get_lang('Cancel')) . '</form>' . "\n");
        }
        break;
}
// IF ORDER COMMAND RECEIVED
// CHANGE ORDER
if (isset($sortDirection) && $sortDirection) {
    $sql = "SELECT `learnPath_id`, `rank`\n            FROM `" . $TABLELEARNPATH . "`\n            ORDER BY `rank` {$sortDirection}";
    $result = claro_sql_query($sql);
    // LP = learningPath
    while (list($LPId, $LPOrder) = mysql_fetch_row($result)) {
        // STEP 2 : FOUND THE NEXT ANNOUNCEMENT ID AND ORDER.
        //          COMMIT ORDER SWAP ON THE DB
        if (isset($thisLPOrderFound) && $thisLPOrderFound == true) {
            $nextLPId = $LPId;
            $nextLPOrder = $LPOrder;
Пример #8
0
         /*--------------------------------------------------------------------
            IN CASE OF HTML FILE, LOOKS FOR IMAGE NEEDING TO BE UPLOADED TOO
           --------------------------------------------------------------------*/
         if (preg_match('/.htm$/i', $_FILES['userFile']['name']) || preg_match('/.html$/i', $_FILES['userFile']['name'])) {
             $imgFilePath = search_img_from_html($baseWorkDir . $cwd . '/' . $uploadedFileName);
             /*
              * Generate Form for image upload
              */
             if (sizeof($imgFilePath) > 0) {
                 $dialogBox->warning(get_lang("Missing images detected"));
                 $form = '<form method="post" action="' . claro_htmlspecialchars($_SERVER['PHP_SELF']) . '" ' . 'enctype="multipart/form-data">' . "\n" . claro_form_relay_context() . '<input type="hidden" name="claroFormId" value="' . uniqid('') . '" />' . '<input type="hidden" name="cmd" value="submitImage" />' . "\n" . '<input type="hidden" name="relatedFile" ' . ' value="' . $cwd . '/' . $uploadedFileName . '" />' . "\n" . '<table border="0">' . "\n";
                 foreach ($imgFilePath as $thisImgKey => $thisImgFilePath) {
                     $form .= '<tr>' . "\n" . '<td>' . "\n" . '<label for="' . $thisImgKey . '">' . basename($thisImgFilePath) . ' : </label>' . "\n" . '</td>' . "\n" . '<td>' . '<input type="file"  id="' . $thisImgKey . '" name="imgFile[]" />' . "\n" . '<input type="hidden" name="imgFilePath[]"  value="' . $thisImgFilePath . '" />' . '</td>' . "\n" . '</tr>' . "\n";
                 }
                 $form .= '<tr>' . "\n" . '<td>&nbsp;</td>' . "\n" . '<td>' . "\n" . '<input type="submit" name="submitImage" value="' . get_lang("Ok") . '" />&nbsp;' . "\n" . claro_html_button(claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=exChDir&file=' . base64_encode($cwd))), get_lang("Cancel")) . '</td>' . "\n" . '</tr>' . "\n\n" . '</table>' . "\n" . '</form>' . "\n";
                 $dialogBox->form($form);
             }
             // end if ($imgFileNb > 0)
         }
         // end if (strrchr($fileName) == "htm"
     }
     // end if is_uploaded_file
 }
 // end if ($cmd == 'exUpload')
 if ($cmd == 'rqUpload') {
     /*
      * Prepare dialog box display
      */
     $spaceAlreadyOccupied = dir_total_space($baseWorkDir);
     $remainingDiskSpace = $maxFilledSpace - $spaceAlreadyOccupied;
     $maxUploadSize = get_max_upload_size($maxFilledSpace, $baseWorkDir);
Пример #9
0
          Display user courses in order to unenroll (default display)
          ---------------------------------------------------------------------*/
    /*---------------------------------------------------------------------
      Display user courses in order to unenroll (default display)
      ---------------------------------------------------------------------*/
    case DISPLAY_USER_COURSES:
        $out .= claro_html_tool_title(array('mainTitle' => get_lang('User\'s course') . ' : ' . $userInfo['firstname'] . ' ' . $userInfo['lastname'], 'subTitle' => get_lang('Remove course from your personal course list'))) . $dialogBox->render() . $courseListView->render();
        break;
    case DISPLAY_REGISTRATION_KEY_FORM:
        $courseData = claro_get_course_data($_REQUEST['course']);
        $courseName = $courseData['name'];
        $out .= claro_html_tool_title(array('mainTitle' => get_lang('User\'s course') . ' : ' . $userInfo['firstname'] . ' ' . $userInfo['lastname'], 'subTitle' => get_lang('Enrol to %course', array('%course' => $courseName))));
        $template = new CoreTemplate('course_registration_key_form.tpl.php');
        $template->assign('formAction', Url::Contextualize($_SERVER['PHP_SELF']));
        $template->assign('courseCode', $courseCode);
        $dialogBox->form($template->render());
        $out .= $dialogBox->render();
        break;
    case DISPLAY_REGISTRATION_DISABLED_FORM:
        if (empty($courseData['email'])) {
            $courseData['email'] = get_conf('administrator_email');
        }
        if (empty($courseData['titular'])) {
            $courseData['titular'] = get_conf('administrator_name');
        }
        $out .= $dialogBox->render();
        break;
}
// end of switch ($displayMode)
if ($newLink != '') {
    $out .= $newLink;
Пример #10
0
        $manager = new $ctr(claro_get_current_course_id());
        $manager->deleteAll();
    }
    $dialogBox->success(get_lang('Course statistics are now empty'));
    Console::log("In course " . claro_get_current_course_id() . " : all tracking events deleted by user " . claro_get_current_user_id(), 'COURSE_RESET_ALL_TRACKING');
    $display = DISP_FLUSH_RESULT;
}
/*
 * Prepare output
 */
$nameTools = get_lang('Delete all course statistics');
/*
 * Output
 */
$html = '';
$html .= claro_html_tool_title($nameTools);
if (DISP_FLUSH_RESULT == $display) {
    // display confirm msg and back link
    $dialogBox->info('<small>' . '<a href="courseReport.php">' . '&lt;&lt;&nbsp;' . get_lang('Back') . '</a>' . '</small>' . "\n");
} elseif (DISP_FORM == $display) {
    $dialogBox->warning(get_lang('Delete is definitive.  There is no way to get your data back after delete.'));
    $dialogBox->form('<form action="' . $_SERVER['PHP_SELF'] . '">' . "\n" . claro_form_relay_context() . '<input type="hidden" name="cmd" value="exDelete" />' . "\n" . '<input type="radio" name="scope" id="scope_all" value="ALL" />' . "\n" . '<label for="scope_all">' . get_lang('All') . '</label>' . "\n" . '<br />' . "\n" . '<input type="radio" name="scope" id="scope_before" value="BEFORE" checked="checked" />' . "\n" . '<label for="scope_before" >' . get_lang('Before') . '</label> ' . "\n" . claro_html_date_form('beforeDate[day]', 'beforeDate[month]', 'beforeDate[year]', time(), 'short') . '<br /><br />' . "\n" . '<input type="submit" name="action" value="' . get_lang('Ok') . '" />&nbsp; ' . claro_html_button('courseReport.php', get_lang('Cancel')) . '</form>' . "\n");
}
// end else if $delete
$html .= $dialogBox->render();
/*
 * Output rendering
 */
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Statistics'), 'courseReport.php');
$claroline->display->body->setContent($html);
echo $claroline->display->render();
Пример #11
0
// Instanciate dialog box
$dialogBox = new DialogBox();
// Build the breadcrumb
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Administration'), get_path('rootAdminWeb'));
$nameTools = get_lang('Categories');
// Get the cmd and id arguments
$cmd = isset($_REQUEST['cmd']) ? $_REQUEST['cmd'] : null;
$id = isset($_REQUEST['categoryId']) ? $_REQUEST['categoryId'] : null;
// Javascript confirm pop up declaration for header
JavascriptLanguage::getInstance()->addLangVar('Are you sure to delete %name ?');
JavascriptLoader::getInstance()->load('admin');
switch ($cmd) {
    // Display form to create a new category
    case 'rqAdd':
        $category = new claroCategory();
        $dialogBox->form($category->displayForm());
        break;
        // Create a new category
    // Create a new category
    case 'exAdd':
        $category = new claroCategory();
        $category->handleForm();
        if ($category->validate()) {
            $category->save();
            $dialogBox->success(get_lang('Category created'));
        } else {
            if (claro_failure::get_last_failure() == 'category_duplicate_code') {
                $dialogBox->error(get_lang('This code already exists'));
            } elseif (claro_failure::get_last_failure() == 'category_missing_field') {
                $dialogBox->error(get_lang('Some fields are missing'));
            }
Пример #12
0
function disp_search_box()
{
    if (isset($_REQUEST['cmd']) && $_REQUEST['cmd'] == 'rqSearch') {
        $dialogBox = new DialogBox();
        $dialogBox->form('<form action="' . claro_htmlspecialchars(get_module_url('CLFRM') . '/viewsearch.php') . '" method="post">' . claro_form_relay_context() . get_lang('Search') . ' : <br />' . '<input type="text" name="searchPattern" /><br />' . '<input type="submit" value="' . get_lang('Ok') . '" />&nbsp; ' . claro_html_button(claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'])), get_lang('Cancel')) . '</form>');
        return $dialogBox->render();
    } else {
        return '';
    }
}
Пример #13
0
/**
 * This function is used to display the list of document available in the course
 * It also displays the form used to add selected document in the learning path
 *
 * @param string $dialogBox Error or confirmation text
 * @return nothing
 * @author Piraux S�bastien <*****@*****.**>
 * @author Lederer Guillaume <*****@*****.**>
 */
function display_my_documents($dialogBox)
{
    global $is_allowedToEdit;
    global $curDirName;
    global $curDirPath;
    global $parentDir;
    global $fileList;
    /**
     * DISPLAY
     */
    $out = '';
    $out .= '<!-- display_my_documents output -->' . "\n";
    $dspCurDirName = claro_htmlspecialchars($curDirName);
    $cmdCurDirPath = rawurlencode($curDirPath);
    $cmdParentDir = rawurlencode($parentDir);
    $out .= '<br />' . '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">';
    /*--------------------------------------
      DIALOG BOX SECTION
      --------------------------------------*/
    $colspan = 4;
    if (!empty($dialogBox)) {
        $_dialogBox = new DialogBox();
        $_dialogBox->form($dialogBox);
        $out .= $_dialogBox->render();
    }
    /*--------------------------------------
      CURRENT DIRECTORY LINE
      --------------------------------------*/
    /* GO TO PARENT DIRECTORY */
    if ($curDirName) {
        $out .= '<a href="' . $_SERVER['PHP_SELF'] . '?cmd=exChDir&amp;file=' . $cmdParentDir . '">' . "\n" . '<img src="' . get_icon_url('parent') . '" hspace="5" alt="" /> ' . "\n" . '<small>' . get_lang('Up') . '</small>' . "\n" . '</a>' . "\n";
    }
    /* CURRENT DIRECTORY */
    $out .= '<table class="claroTable emphaseLine">' . '<thead>';
    // If the $curDirName is empty, we're in the root point
    // and there is'nt a dir name to display
    if ($curDirName) {
        $out .= '<!-- current dir name -->' . "\n" . '<tr>' . "\n" . '<th class="superHeader" colspan="' . $colspan . '" align="left">' . "\n" . '<img src="' . get_icon_url('opendir') . '" vspace=2 hspace=5 alt="" /> ' . "\n" . $dspCurDirName . "\n" . '</td>' . "\n" . '</tr>' . "\n";
    }
    $out .= '<tr align="center" valign="top">' . "\n" . '<th width="10%">' . get_lang('Add module(s)') . '</th>' . "\n" . '<th>' . get_lang('Name') . '</th>' . "\n" . '<th>' . get_lang('Size') . '</th>' . "\n" . '<th>' . get_lang('Date') . '</th>' . "\n" . '</tr>' . '</thead>' . '<tbody>' . "\n";
    /*--------------------------------------
      DISPLAY FILE LIST
      --------------------------------------*/
    if ($fileList) {
        $iterator = 0;
        while (list($fileKey, $fileName) = each($fileList['name'])) {
            $dspFileName = claro_htmlspecialchars($fileName);
            $cmdFileName = str_replace("%2F", "/", rawurlencode($curDirPath . "/" . $fileName));
            if ($fileList['visibility'][$fileKey] == "i") {
                if ($is_allowedToEdit) {
                    $style = ' class="invisible"';
                } else {
                    $style = "";
                    continue;
                    // skip the display of this file
                }
            } else {
                $style = "";
            }
            if ($fileList['type'][$fileKey] == A_FILE) {
                $image = choose_image($fileName);
                $size = format_file_size($fileList['size'][$fileKey]);
                $date = format_date($fileList['date'][$fileKey]);
                if ($GLOBALS['is_Apache'] && get_conf('secureDocumentDownload')) {
                    // slash argument method - only compatible with Apache
                    $doc_url = $cmdFileName;
                } else {
                    // question mark argument method, for IIS ...
                    $doc_url = '?url=' . $cmdFileName;
                }
                $urlFileName = get_path('clarolineRepositoryWeb') . 'backends/download.php' . $doc_url;
            } elseif ($fileList['type'][$fileKey] == A_DIRECTORY) {
                $image = 'folder';
                $size = '&nbsp;';
                $date = '&nbsp;';
                $urlFileName = $_SERVER['PHP_SELF'] . '?openDir=' . $cmdFileName;
            }
            $out .= '<tr ' . $style . '>' . "\n";
            if ($fileList['type'][$fileKey] == A_FILE) {
                $iterator++;
                $out .= '<td style="vertical-align:top; text-align: center;">' . '<input type="checkbox" name="insertDocument_' . $iterator . '" id="insertDocument_' . $iterator . '" value="' . $curDirPath . "/" . $fileName . '" />' . '</td>' . "\n";
            } else {
                $out .= '<td>&nbsp;</td>';
            }
            $out .= '<td>' . '<a href="' . $urlFileName . '" ' . $style . '>' . '<img src="' . get_icon_url($image) . '" hspace="5" alt="" /> ' . $dspFileName . '</a>';
            // Comments
            if ($fileList['comment'][$fileKey] != "") {
                $fileList['comment'][$fileKey] = claro_htmlspecialchars($fileList['comment'][$fileKey]);
                $fileList['comment'][$fileKey] = claro_parse_user_text($fileList['comment'][$fileKey]);
                $out .= '<div class="comment">' . $fileList['comment'][$fileKey] . '</div>' . "\n";
            }
            $out .= '</td>' . "\n" . '<td><small>' . $size . '</small></td>' . "\n" . '<td><small>' . $date . '</small></td>' . "\n";
            /* NB : Before tracking implementation the url above was simply
             * "<a href=\"",$urlFileName,"\"",$style,">"
             */
            $out .= '</tr>' . "\n";
        }
        // end each ($fileList)
        // form button
        $out .= '</tbody>' . '</table>' . "\n\n" . '<input type="hidden" name="openDir" value="' . $curDirPath . '" />' . "\n" . '<input type="hidden" name="maxDocForm" value ="' . $iterator . '" />' . "\n" . '<input type="submit" name="submitInsertedDocument" value="' . get_lang('Add selection') . '" />';
    } else {
        $out .= '<tr>' . "\n" . '<td colspan="2" align="center">' . get_lang('There is no document for the moment') . '</td>' . "\n" . '</tr>' . "\n" . '</tbody>' . '</table>' . "\n\n";
    }
    $out .= '</form>' . "\n" . '<br /><br />' . '<!-- end of display_my_documents output -->' . "\n";
    return $out;
}
Пример #14
0
                $dialogBox->success(get_lang('Your password has been emailed to') . ' : ' . $emailTo);
            } else {
                $dialogBox->error(get_lang('The system is unable to send you an e-mail.') . '<br />' . get_lang('Please contact') . ' : ' . '<a href="mailto:' . get_conf('administrator_email') . '?BODY=' . $emailTo . '">' . get_lang('Platform administrator') . '</a>');
            }
        }
    } else {
        $dialogBox->error(get_lang('There is no user account with this email address.'));
    }
    if ($extAuthPasswordCount > 0) {
        if ($extAuthPasswordCount == count($userList)) {
            $dialogBox->warning(get_lang('Your password(s) is (are) recorded in an external authentication system outside the platform.'));
        } else {
            $dialogBox->warning(get_lang('Passwords of some of your user account(s) are recorded an in external authentication system outside the platform.'));
        }
        $dialogBox->info(get_lang('For more information take contact with the platform administrator.'));
    }
}
////////////////////////////////////////////////////
// display section
$out = '';
// display title
$out .= claro_html_tool_title($nameTools);
// display message box
if (!$passwordFound) {
    $dialogBox->title(get_lang('Enter your email so we can send you your password.'));
    $dialogBox->form('<form action="' . $_SERVER['PHP_SELF'] . '" method="post">' . '<input type="hidden" name="searchPassword" value="1" />' . '<label for="Femail">' . get_lang('Email') . ' : </label>' . '<br />' . '<input type="text" name="Femail" id="Femail" size="50" maxlength="100" value="' . claro_htmlspecialchars($emailTo) . '" />' . '<br /><br />' . '<input type="submit" name="retrieve" value="' . get_lang('Ok') . '" />&nbsp; ' . claro_html_button(get_conf('urlAppend') . '/index.php', get_lang('Cancel')) . '</form>');
}
$out .= $dialogBox->render();
// display form
$claroline->display->body->appendContent($out);
echo $claroline->display->render();
Пример #15
0
    } else {
        header("Location: " . Url::Contextualize("./learningPathList.php"));
    }
    exit;
}
// select details of learning path to display
$sql = "SELECT lp.`learnPath_id`,\n        lp.`name`,\n        lp.`comment`,\n        lp.`lock`,\n        lp.`visibility`,\n        lp.`rank`\n        FROM `" . $TABLELEARNPATH . "` AS lp\n        WHERE lp.`learnPath_id` = " . (int) $_SESSION['path_id'];
$query = claro_sql_query($sql);
$LPDetails = mysql_fetch_array($query);
// parse commands
$cmd = isset($_REQUEST['cmd']) ? $_REQUEST['cmd'] : '';
switch ($cmd) {
    // REQUEST EDIT
    case "rqEdit":
        if (isset($_SESSION['path_id'])) {
            $dialogBox->form("\n\n" . '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">' . "\n" . '<fieldset>' . "\n" . claro_form_relay_context() . '<h4>' . get_lang('Edit this learning path') . '</h4>' . "\n" . '<dl>' . "\n" . '<dt><label for="newName">' . get_lang('Title') . '</label></dt>' . "\n" . '<dd>' . "\n" . '<input type="text" name="newName" id="newName" size="50" maxlength="255" value="' . claro_htmlspecialchars(claro_utf8_decode($LPDetails['name'], get_conf('charset'))) . '" />' . "\n" . '</dd>' . "\n" . '<dt><label for="newComment">' . get_lang('Comment') . '</label></dt>' . "\n" . '<dd>' . "\n" . claro_html_textarea_editor('newComment', $LPDetails['comment'], 15, 55) . '</dd>' . "\n" . '</dl>' . "\n" . '</fieldset>' . "\n" . '<input type="hidden" name="cmd" value="exEdit" />' . "\n" . '<input type="submit" value="' . get_lang('Ok') . '" />&nbsp;' . "\n" . claro_html_button(Url::Contextualize($_SERVER['PHP_SELF']), get_lang('Cancel')) . '</form>' . "\n");
        } else {
            $dialogBox->error(get_lang('Wrong operation'));
        }
        break;
        // EXECUTE EDIT
    // EXECUTE EDIT
    case "exEdit":
        // Name must be unique
        $sql = "SELECT COUNT(`name`)\n                             FROM `" . $TABLELEARNPATH . "`\n                            WHERE `name` = '" . claro_sql_escape($_POST['newName']) . "'\n                              AND !(`learnPath_id` = " . (int) $_SESSION['path_id'] . ")";
        $num = claro_sql_query_get_single_value($sql);
        if ($num == 0) {
            $sql = "UPDATE `" . $TABLELEARNPATH . "`\n                    SET `name` = '" . claro_sql_escape($_POST['newName']) . "',\n                        `comment` = '" . claro_sql_escape($_POST['newComment']) . "'\n                    WHERE `learnPath_id` = " . (int) $_SESSION['path_id'];
            if (claro_sql_query($sql)) {
                $dialogBox->success(get_lang('Learning path updated'));
            }
Пример #16
0
         }
         if (is_null($searchResult)) {
             $searchResult = array();
         }
         $wikiList = $searchResult;
         break;
     } else {
         $message = '<p>' . get_lang("Missing search keywords") . '</p>';
         $dialogBox->error($message);
     }
     // search wiki
 // search wiki
 case 'rqSearch':
     //if ( !isset( $message ) ) $message = '';
     $message = '<form method="post" action="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'])) . '">' . "\n" . '<input type="hidden" name="action" value="exSearch" />' . "\n" . claro_form_relay_context() . "\n" . '<label for="searchPattern">' . get_lang("Search") . '</label><br />' . "\n" . '<input type="text" id="searchPattern" name="searchPattern" />' . "\n" . '<input type="submit" value="' . get_lang("Ok") . '" />' . "\n" . claro_html_button(Url::Contextualize($_SERVER['PHP_SELF']), get_lang("Cancel")) . '</form>' . "\n";
     $dialogBox->form($message);
     $action = 'list';
     break;
     // request delete
 // request delete
 case 'rqDelete':
     if (!$wikiStore->wikiIdExists($wikiId)) {
         // die( get_lang("Invalid Wiki Id") );
         $message = get_lang("Invalid Wiki Id");
         $dialogBox->error($message);
         $action = 'error';
     } else {
         $wiki = $wikiStore->loadWiki($wikiId);
         $wikiTitle = $wiki->getTitle();
         $message = get_lang("WARNING : you are going to delete this wiki and all its pages. Are you sure to want to continue ?");
         $dialogBox->question($message);
Пример #17
0
        $out .= '</form>';
        break;
    case 'exSearch':
        $out .= '<h3>' . get_lang("Search result") . '</h3>' . "\n";
        $out .= '<ul>' . "\n";
        foreach ($searchResult as $page) {
            if ('__MainPage__' == $page['title']) {
                $title = get_lang("Main page");
            } else {
                $title = $page['title'];
            }
            $urltitle = rawurlencode($page['title']);
            $link = '<a href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?wikiId=' . $wikiId . '&title=' . $urltitle . '&action=show')) . '">' . $title . '</a>';
            $out .= '<li>' . $link . '</li>' . "\n";
        }
        $out .= '</ul>' . "\n";
        break;
    case 'rqSearch':
        $searchForm = '<form method="post" action="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?wikiId=' . (int) $wikiId)) . '">' . "\n" . '<input type="hidden" name="action" value="exSearch" />' . "\n" . claro_form_relay_context() . "\n" . '<label for="searchPattern">' . get_lang("Search") . '</label><br />' . "\n" . '<input type="text" id="searchPattern" name="searchPattern" />' . "\n" . '<input type="submit" value="' . get_lang("Ok") . '" />' . "\n" . claro_html_button(claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?wikiId=' . $wikiId)), get_lang("Cancel")) . '</form>' . "\n";
        $dialogBox->form($searchForm);
        break;
    default:
        trigger_error("Invalid action supplied to " . claro_htmlspecialchars($_SERVER['PHP_SELF']), E_USER_ERROR);
}
$output = '';
$output .= claro_html_tool_title($toolTitle, $helpUrl, $cmdList);
$output .= $dialogBox->render();
$output .= $out;
// ------------ End of wiki script ---------------
$claroline->display->body->appendContent($output);
echo $claroline->display->render();
Пример #18
0
 if ('exMkCat' == $cmd) {
     if (create_category($catName)) {
         $dialogBox->success(get_lang('The new category has been created.'));
     } else {
         $dialogBox->error(get_lang('Unable to create category'));
         $cmd = 'rqMkCat';
     }
 }
 if ('rqMkCat' == $cmd) {
     try {
         $form = new ModuleTemplate('CLFRM', 'forum_editcat.tpl.php');
         $form->assign('header', get_lang('Add a category'));
         $form->assign('catName', '');
         $form->assign('nextCommand', 'exMkCat');
         $form->assign('catId', 0);
         $dialogBox->form($form->render());
     } catch (Exception $ex) {
         if (claro_debug_mode()) {
             $dialogBox->error('<pre>' . $ex->__toString() . '</pre>');
         } else {
             $dialogBox->error($ex->getMessage());
         }
     }
 }
 if ('exEdCat' == $cmd) {
     if (update_category_title($catId, $catName)) {
         $dialogBox->success(get_lang('Category updated'));
     } else {
         $dialogBox->error(get_lang('Unable to update category'));
     }
 }
Пример #19
0
if (claro_is_in_a_course()) {
    ClaroBreadCrumbs::getInstance()->prepend(get_lang('Users'), get_module_url('CLUSR') . '/user.php' . (!is_null($courseId) ? '?cid=' . $courseId : ''));
} else {
    ClaroBreadCrumbs::getInstance()->prepend(get_lang('Platform administration'), get_path('rootAdminWeb'));
}
$dialogBox = new DialogBox();
$defaultFormat = 'lastname,firstname,username,email,officialCode,groupId,groupName';
if (empty($_SESSION['claro_usedFormat'])) {
    $_SESSION['claro_usedFormat'] = $defaultFormat;
}
$usedFormat = $_SESSION['claro_usedFormat'];
switch ($cmd) {
    case 'rqChangeFormat':
        $compulsory_list = array('firstname', 'lastname', 'username');
        $chFormatForm = get_lang('Modify the format') . ' : ' . '<br /><br />' . "\n" . get_lang('Simply write the fields\' names in right order and separated by commas') . '<br />' . "\n" . get_lang('The fields <em>%field_list</em> are compulsory', array('%field_list' => implode(', ', $compulsory_list))) . '<br /><br />' . "\n" . '<form name="chFormat" method="post" action="' . claro_htmlspecialchars($_SERVER['PHP_SELF']) . '?&cmd=exChangeFormat" >' . "\n" . '<input type="text" name="usedFormat" value="' . claro_htmlspecialchars($usedFormat) . '" size="55" />' . "\n" . claro_form_relay_context() . "\n" . '<br /><br />' . "\n" . '<input type="submit" value="' . get_lang('Ok') . '" />' . "\n" . '</form>';
        $dialogBox->form($chFormatForm);
        break;
    case 'exChangeFormat':
        $usedFormat = $userInput->get('usedFormat');
        $userFormat = str_replace(';', ',', $usedFormat);
        //replace ; by ,
        if (!$usedFormat) {
            $dialogBox->error(get_lang('Unable to load the selected format'));
            break;
        }
        if (!CsvImport::format_ok($usedFormat)) {
            $dialogBox->error(get_lang('ERROR: The format you gave is not compatible with Claroline'));
            break;
        }
        $dialogBox->success(get_lang('Format changed'));
        $_SESSION['claro_usedFormat'] = $usedFormat;
Пример #20
0
}
// display select box with language in the table
$sql = "SELECT DISTINCT language \n        FROM " . $tbl_translation . "\n        ORDER BY language ";
$results = claro_sql_query($sql);
$form .= "<select name=\"language\">";
while ($result = mysql_fetch_row($results)) {
    if ($result[0] == $language) {
        $form .= "<option value={$result['0']} selected=\"selected\">" . $result[0] . "</option>";
    } else {
        $form .= "<option value={$result['0']}>" . $result[0] . "</option>";
    }
}
$form .= "</select>";
$form .= "<input type=\"submit\" value=\"OK\" />";
$form .= "</form>";
$dialogBox->form($form);
echo $dialogBox->render();
// select variables with same content
$sql = " SELECT DISTINCT L1.language , L1.varContent , L1.varName , L1.sourceFile\n    FROM " . $tbl_translation . " L1,\n         " . $tbl_translation . " L2,\n         " . $tbl_used_lang . " U\n    WHERE L1.language = \"" . $language . "\" and\n        L1.language = L2.language and\n        L1.varContent = L2.varContent and\n        L1.varName <> L2.varName and\n        L1.varName = U.varName\n    ORDER BY L1.varContent, L1.varName";
// build pager
$myPager = new claro_sql_pager($sql, $offset, $resultPerPage);
$results = $myPager->get_result_list();
// display nb results
echo '<p>' . get_lang('Total') . ': ' . $myPager->totalItemCount . '</p>';
// display pager
echo $myPager->disp_pager_tool_bar($_SERVER['PHP_SELF'] . '?language=' . $language);
// display table header
echo "<table class=\"claroTable\" width=\"100%\">\n<thead>\n<tr class=\"headerX\">\n<th>N°</th>\n<th>language</th>\n<th>varName</th>\n<th>varContent</th>\n<th>sourceFile</th>\n</tr>\n</thead>\n<tbody>";
$varContent = "";
$i = $offset;
$color = true;
Пример #21
0
        $unixEndDate = mktime($_REQUEST['endHour'], $_REQUEST['endMinute'], '00', $_REQUEST['endMonth'], $_REQUEST['endDay'], $_REQUEST['endYear']);
        $assignment->setEndDate($unixEndDate);
        $assignment_data['start_date'] = $unixStartDate;
        $assignment_data['end_date'] = $unixEndDate;
    } else {
        // create new assignment
        // add date format used to pre fill the form
        $assignment_data['start_date'] = $assignment->getStartDate();
        $assignment_data['end_date'] = $assignment->getEndDate();
    }
}
// Submission download requested
if ($is_allowedToEdit && $cmd == 'rqDownload' && (claro_is_platform_admin() || get_conf('allow_download_all_submissions'))) {
    require_once $includePath . '/lib/form.lib.php';
    $dialogBox->title(get_lang('Download'));
    $dialogBox->form('<form action="' . get_module_url('CLWRK') . '/export.php" 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.php', get_lang('Cancel')) . '</form>' . "\n");
}
if ($is_allowedToEdit) {
    /*--------------------------------------------------------------------
                            CHANGE VISIBILITY
      --------------------------------------------------------------------*/
    // change visibility of an assignment
    if ($cmd == 'exChVis') {
        if (isset($_REQUEST['vis'])) {
            $_REQUEST['vis'] == 'v' ? $visibility = 'VISIBLE' : ($visibility = 'INVISIBLE');
            Assignment::updateAssignmentVisibility($assigId, $visibility);
            // notify eventmanager
            $eventNotifier->notifyCourseEvent('work_updated', claro_get_current_course_id(), claro_get_current_tool_id(), $assigId, claro_get_current_group_id(), '0');
            if ($_REQUEST['vis'] == 'v') {
                $eventNotifier->notifyCourseEvent('work_visible', claro_get_current_course_id(), claro_get_current_tool_id(), $assigId, claro_get_current_group_id(), '0');
            } else {
Пример #22
0
    $JsLoader->load('ui.datepicker');
    $javascript = '
        <script type="text/javascript" charset="utf-8">
            $(document).ready( function(){
                $(".daterange").datepicker({dateFormat: \'dd/mm/yy\', beforeShow: customRange});
                
                function customRange(input) {
                    return {minDate: (input.id == \'dateinput2\' ? $(\'#dateinput1\').datepicker(\'getDate\') : null),
                    maxDate: (input.id == \'dateinput1\' ? $(\'#dateinput2\').datepicker(\'getDate\') : null)};
                }
            });
        </script>';
    $claroline->display->header->addHtmlHeader($javascript);
    $disp = "\n" . get_lang('Select interval') . '<br />' . "\n" . '<form action="' . $_SERVER['PHP_SELF'] . '?search=timeInterval" method="post">' . "\n" . get_lang('From') . ' <input type="text" name="date1" value="' . $date1 . '" class="daterange" id="dateinput1" /> ' . "\n" . get_lang('to') . ' <input type="text" name="date2" value="' . $date2 . '" class="daterange" id="dateinput2" /> ' . get_lang('(jj/mm/aaaa)') . '<br />' . "\n" . '<input type="submit" value="' . get_lang('Search') . '" />' . "\n" . '</form>' . "\n\n";
    $dialogbox = new DialogBox();
    $dialogbox->form($disp);
    $content .= $dialogbox->render();
}
if ($displayTable) {
    $argLink = makeArgLink($arguments, array('fieldOrder', 'order'));
    $orderLink = $_SERVER['PHP_SELF'] . '?' . $argLink;
    if ($argLink != "") {
        $orderLink .= "&amp;";
    }
    $orderLink .= "order=" . $nextOrder . "&amp;";
    $javascriptDelete = '
    <script type="text/javascript">
  
        function deleteSelection ()
        {
           if ( $("input[@type=checkbox][@checked]").size() < 1 )
Пример #23
0
}
$addToURL = isset($_REQUEST['addToURL']) ? $_REQUEST['addToURL'] : '';
$dialogBox = new DialogBox();
//TABLES
//declare needed tables
// Deal with interbreadcrumbs
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Administration'), get_path('rootAdminWeb'));
$nameTools = get_lang('User list');
$offset = isset($_REQUEST['offset']) ? $_REQUEST['offset'] : 0;
//------------------------------------
// Execute COMMAND section
//------------------------------------
switch ($cmd) {
    case 'rqResetAllPasswords':
        $dialogBox->question(get_lang('Do you really want to reset all the passwords ?') . '<br />' . '<small>' . get_lang('The platform administrators and course creators password will remain unchanged') . '</small>' . '<br />');
        $dialogBox->form(' <form method="post" action="' . claro_htmlspecialchars($_SERVER['PHP_SELF']) . '">' . '<input type="hidden" name="cmd" value="exResetAllPasswords" />' . '<input id="sendEmail" type="checkbox" name="sendEmail" value="yes" checked="checked" />' . '<label for="sendEmail">' . get_lang('send new password by email') . '</label>' . '<br />' . '<small>' . get_lang('Only the users with a valid address will receive their password by email') . '</small>' . '<br />' . '<input type="submit" value="' . get_lang('Yes') . '" />' . claro_html_button($_SERVER['PHP_SELF'], get_lang('Cancel')) . '</form>');
        $dialogBox->warning('<em>' . get_lang('This may take some time, please wait until the end of the process...') . '</em>');
        break;
    case 'exResetAllPasswords':
        $userList = getAllStudentUserId();
        $failedMailList = array();
        $failedList = array();
        $sendEmail = isset($_REQUEST['sendEmail']) && $_REQUEST['sendEmail'] ? true : false;
        foreach ($userList as $user) {
            $mailSent = FALSE;
            $userInfo = user_get_properties($user['id']);
            if (!$userInfo['isPlatformAdmin'] && !$userInfo['isCourseCreator']) {
                $userInfo['password'] = mk_password(8);
                if (user_set_properties($user['id'], array('password' => $userInfo['password']))) {
                    if ($sendEmail && user_send_registration_mail($user['id'], $userInfo)) {
                        $mailSent = TRUE;
Пример #24
0
    $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) {
    $out .= '<tr align="center">' . "\n" . '<td align="left">' . $thisWrk['name'] . '</td>' . "\n" . '<td>' . (!empty($thisWrk['title']) ? $thisWrk['title'] . '<small> ( ' . $thisWrk['last_edit_date'] . ' )</small>' : '&nbsp;') . '</td>' . "\n" . '<td>' . $thisWrk['submissionCount'] . '</td>' . "\n" . '<td>' . $thisWrk['feedbackCount'] . '</td>' . "\n";
Пример #25
0
     } else {
         $backlog = new Backlog();
         $importedExId = import_exercise($_FILES['uploadedExercise']['name'], $backlog);
         if ($importedExId) {
             $dialogBox->success('<strong>' . get_lang('Import done') . '</strong>');
         } else {
             $dialogBox->error('<strong>' . get_lang('Import failed') . '</strong>');
             $cmd = 'rqImport';
         }
         $dialogBox->info($backlog->output());
     }
 }
 if ($cmd == 'rqImport') {
     require_once get_path('incRepositorySys') . '/lib/fileDisplay.lib.php';
     require_once get_path('incRepositorySys') . '/lib/fileUpload.lib.php';
     $dialogBox->form("\n" . '<strong>' . get_lang('Import exercise') . '</strong><br />' . "\n" . get_lang('Imported exercises must be an ims-qti zip file.') . '<br />' . "\n" . '<form enctype="multipart/form-data" action="./exercise.php" method="post">' . "\n" . '<input type="hidden" name="claroFormId" value="' . uniqid('') . '">' . "\n" . '<input name="cmd" type="hidden" value="exImport" />' . "\n" . claro_form_relay_context() . "\n" . '<input name="uploadedExercise" type="file" /><br />' . "\n" . '<small>' . get_lang('Max file size') . ' : ' . format_file_size(get_max_upload_size($maxFilledSpace, $courseDir)) . '</small>' . "\n" . '<p>' . "\n" . '<input value="' . get_lang('Import exercise') . '" type="submit" /> ' . "\n" . claro_html_button(Url::Contextualize('./exercise.php'), get_lang('Cancel')) . '</p>' . "\n" . '</form>');
 }
 //-- export
 if ($cmd == 'rqExport' && $exId) {
     $exercise = new Exercise();
     if (!$exercise->load($exId)) {
         $dialogBox->error(get_lang('Unable to load the exercise'));
     } else {
         $dialogBoxContent = "\n" . '<strong>' . get_lang('Export exercise') . '</strong><br />' . "\n" . get_lang('Select the type for your export :') . '<br />' . "\n" . '<ul>' . "\n";
         if (get_conf('enableExerciseExportQTI')) {
             $dialogBoxContent .= '<li>' . "\n" . '<img src="' . get_icon_url('export') . '" alt="' . get_lang('Export in IMS QTI') . '" /> ' . "\n" . '<a href="' . claro_htmlspecialchars(Url::Contextualize('exercise.php?cmd=exExport&exId=' . $exId)) . '">' . get_lang('Export in IMS QTI') . '</a>' . "\n" . '</li>' . "\n";
             if ($exercise->getShuffle()) {
                 $dialogBoxContent .= '<li>' . "\n" . '<img src="' . get_icon_url('export') . '" alt="' . get_lang('Export in IMS QTI (Shuffle)') . '" /> ' . "\n" . '<a href="' . claro_htmlspecialchars(Url::Contextualize('exercise.php?cmd=exExport&exId=' . $exId . '&shuffle=1')) . '">' . get_lang('Export in IMS QTI (Shuffle)') . '</a>' . "\n" . '</li>' . "\n";
             }
         }
         $dialogBoxContent .= '<li>' . "\n" . '<img src="' . get_icon_url('mime/pdf') . '" alt="' . get_lang('Export to PDF') . '" /> ' . "\n" . '<a href="' . claro_htmlspecialchars(Url::Contextualize('exercise.php?cmd=exExportPDF&exId=' . $exId)) . '">' . get_lang('Export to PDF') . '</a>' . "\n" . '</li>' . "\n";