function display_form()
{
    $html = '';
    $sessions = SessionManager::get_sessions_list(array(), array('name', 'ASC'));
    // Actions
    // Link back to the documents overview
    $actionsLeft = '<a href="../admin/index.php">' . Display::return_icon('back.png', get_lang('BackTo') . ' ' . get_lang('PlatformAdmin'), '', ICON_SIZE_MEDIUM) . '</a>';
    $html .= Display::toolbarAction('toolbar-copysession', array(0 => $actionsLeft));
    $html .= Display::return_message(get_lang('CopyCourseFromSessionToSessionExplanation'), 'warning');
    $html .= '<form class="form-horizontal" name="formulaire" method="post" action="' . api_get_self() . '" >';
    $html .= '<div class="form-group">';
    // origin
    $html .= '<label class="col-sm-2 control-label">' . get_lang('OriginCoursesFromSession') . ': </label>';
    $html .= '<div class="col-sm-5">' . make_select_session_list('sessions_list_origin', $sessions, array('onchange' => 'javascript: xajax_search_courses(this.value,\'origin\');')) . '</div>';
    $html .= '<div class="col-sm-5" id="ajax_list_courses_origin">';
    $html .= '<select id="origin" class="form-control" name="SessionCoursesListOrigin[]" ></select>';
    $html .= '</div></div>';
    //destination
    $html .= '<div class="form-group">';
    $html .= '<label class="col-sm-2 control-label">' . get_lang('DestinationCoursesFromSession') . ': </label>';
    $html .= '<div class="col-sm-5" id="ajax_sessions_list_destination">';
    $html .= '<select class="form-control" name="sessions_list_destination" onchange="javascript: xajax_search_courses(this.value,\'destination\');">';
    $html .= '<option value = "0">' . get_lang('ThereIsNotStillASession') . '</option></select ></div>';
    $html .= '<div class="col-sm-5" id="ajax_list_courses_destination">';
    $html .= '<select id="destination" class="form-control" name="SessionCoursesListDestination[]" ></select>';
    $html .= '</div></div>';
    $options = '<div class="radio"><label><input type="radio" id="copy_option_1" name="copy_option" value="full_copy" checked="checked"/>';
    $options .= get_lang('FullCopy') . '</label></div>';
    $options .= '<div class="radio"><label><input type="radio" id="copy_option_2" name="copy_option" value="select_items" disabled="disabled"/>';
    $options .= ' ' . get_lang('LetMeSelectItems') . '</label></div>';
    $options .= '<div class="checkbox"><label><input type="checkbox" id="copy_base_content_id" name="copy_only_session_items" />' . get_lang('CopyOnlySessionItems') . '</label></div>';
    $html .= Display::panel($options, get_lang('TypeOfCopy'));
    $html .= '<div class="form-group"><div class="col-sm-12">';
    $html .= '<button class="btn btn-success" type="submit" onclick="javascript:if(!confirm(' . "'" . addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES)) . "'" . ')) return false;"><em class="fa fa-files-o"></em> ' . get_lang('CopyCourse') . '</button>';
    // Add Security token
    $html .= '<input type="hidden" value="' . Security::get_token() . '" name="sec_token">';
    $html .= '</div></div>';
    $html .= '</form>';
    echo $html;
}
Exemplo n.º 2
0
 /**
  * This is the main function that displays the list or the table with all
  * the glossary terms
  * @param  string  View ('table' or 'list'). Optional parameter.
  * Defaults to 'table' and prefers glossary_view from the session by default.
  * @return void
  * @author Patrick Cool <*****@*****.**>, Ghent University, Belgium
  * @version januari 2009, dokeos 1.8.6
  */
 public static function display_glossary($view = 'table')
 {
     // This function should always be called with the corresponding
     // parameter for view type. Meanwhile, use this cheap trick.
     $glossaryView = Session::read('glossary_view');
     if (empty($glossaryView)) {
         Session::write('glossary_view', $view);
     }
     // action links
     //echo '<div class="actions">';
     $actionsLeft = '';
     if (api_is_allowed_to_edit(null, true)) {
         $actionsLeft .= '<a href="index.php?' . api_get_cidreq() . '&action=addglossary&msg=add?' . api_get_cidreq() . '">' . Display::return_icon('new_glossary_term.png', get_lang('TermAddNew'), '', ICON_SIZE_MEDIUM) . '</a>';
     }
     $actionsLeft .= '<a href="index.php?' . api_get_cidreq() . '&action=export">' . Display::return_icon('export_csv.png', get_lang('ExportGlossaryAsCSV'), '', ICON_SIZE_MEDIUM) . '</a>';
     if (api_is_allowed_to_edit(null, true)) {
         $actionsLeft .= '<a href="index.php?' . api_get_cidreq() . '&action=import">' . Display::return_icon('import_csv.png', get_lang('ImportGlossary'), '', ICON_SIZE_MEDIUM) . '</a>';
     }
     $actionsLeft .= '<a href="index.php?' . api_get_cidreq() . '&action=export_to_pdf">' . Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_MEDIUM) . '</a>';
     if (isset($_SESSION['glossary_view']) && $_SESSION['glossary_view'] == 'table' or !isset($_SESSION['glossary_view'])) {
         $actionsLeft .= '<a href="index.php?' . api_get_cidreq() . '&action=changeview&view=list">' . Display::return_icon('view_detailed.png', get_lang('ListView'), '', ICON_SIZE_MEDIUM) . '</a>';
     } else {
         $actionsLeft .= '<a href="index.php?' . api_get_cidreq() . '&action=changeview&view=table">' . Display::return_icon('view_text.png', get_lang('TableView'), '', ICON_SIZE_MEDIUM) . '</a>';
     }
     /* BUILD SEARCH FORM */
     $form = new FormValidator('search', 'get', api_get_self() . '?' . api_get_cidreq(), '', array(), FormValidator::LAYOUT_INLINE);
     $form->addText('keyword', '', false, array('class' => 'col-md-2'));
     $form->addElement('hidden', 'cidReq', api_get_course_id());
     $form->addElement('hidden', 'id_session', api_get_session_id());
     $form->addButtonSearch(get_lang('Search'));
     $actionsRight = $form->returnForm();
     $toolbar = Display::toolbarAction('toolbar-document', array(0 => $actionsLeft, 1 => $actionsRight));
     echo $toolbar;
     if ($glossaryView == 'table') {
         $table = new SortableTable('glossary', array('GlossaryManager', 'get_number_glossary_terms'), array('GlossaryManager', 'get_glossary_data'), 0);
         //$table->set_header(0, '', false);
         $table->set_header(0, get_lang('TermName'), true);
         $table->set_header(1, get_lang('TermDefinition'), true);
         if (api_is_allowed_to_edit(null, true)) {
             $table->set_header(2, get_lang('Actions'), false, 'width=90px', array('class' => 'td_actions'));
             $table->set_column_filter(2, array('GlossaryManager', 'actions_filter'));
         }
         $table->display();
     }
     if ($glossaryView == 'list') {
         GlossaryManager::display_glossary_list();
     }
 }
Exemplo n.º 3
0
    //Block Social Menu
    $social_menu_block = SocialManager::show_social_menu('messages');
}
//Right content
$social_right_content = null;
$keyword = '';
if (api_get_setting('social.allow_social_tool') == 'true') {
    $actionsLeft = '<a href="' . api_get_path(WEB_PATH) . 'main/messages/new_message.php?f=social">' . Display::return_icon('new-message.png', get_lang('ComposeMessage'), array(), 32) . '</a>';
    $actionsLeft .= '<a href="' . api_get_path(WEB_PATH) . 'main/messages/outbox.php?f=social">' . Display::return_icon('outbox.png', get_lang('Outbox'), array(), 32) . '</a>';
    $form = MessageManager::getSearchForm(api_get_path(WEB_PATH) . 'main/messages/inbox.php');
    if ($form->validate()) {
        $values = $form->getSubmitValues();
        $keyword = $values['keyword'];
    }
    $actionsRight = $form->returnForm();
    $social_right_content .= Display::toolbarAction('toolbar', [$actionsLeft, $actionsRight]);
}
//MAIN CONTENT
if (!isset($_GET['del_msg'])) {
    $social_right_content .= MessageManager::inbox_display();
} else {
    $num_msg = intval($_POST['total']);
    for ($i = 0; $i < $num_msg; $i++) {
        if ($_POST[$i]) {
            //the user_id was necesarry to delete a message??
            Display::addFlash(MessageManager::delete_message_by_user_receiver(api_get_user_id(), $_POST['_' . $i]));
        }
    }
    $social_right_content .= MessageManager::inbox_display();
}
if (api_get_setting('social.allow_social_tool') == 'true') {
Exemplo n.º 4
0
        $form_action['delete'] = get_lang('Delete');
        $portfolio_actions = Portfolio::actions();
        foreach ($portfolio_actions as $action) {
            $form_action[$action->get_name()] = $action->get_title();
        }
        $table->set_form_actions($form_action, 'ids');
    }
}
//Display::display_header('', 'Doc');
/* Introduction section (editable by course admins) */
if (!empty($groupId)) {
    Display::display_introduction_section(TOOL_DOCUMENT . $groupId);
} else {
    Display::display_introduction_section(TOOL_DOCUMENT);
}
$toolbar = Display::toolbarAction('toolbar-document', array(0 => $actionsLeft, 1 => $actionsRight));
echo $toolbar;
echo $templateForm;
echo $moveForm;
echo $dirForm;
echo $selector;
$table->display();
if (count($documentAndFolders) > 1) {
    if ($is_allowed_to_edit || $group_member_with_upload_rights) {
        // Getting the course quota
        $course_quota = DocumentManager::get_course_quota();
        // Calculating the total space
        $already_consumed_space_course = DocumentManager::documents_total_space(api_get_course_int_id());
        // Displaying the quota
        DocumentManager::display_simple_quota($course_quota, $already_consumed_space_course);
    }
Exemplo n.º 5
0
/*    Here we do all the work */
$unzip = isset($_POST['unzip']) ? $_POST['unzip'] : null;
$index = isset($_POST['index_document']) ? $_POST['index_document'] : null;
// User has submitted a file
if (!empty($_FILES)) {
    DocumentManager::upload_document($_FILES, $_POST['curdirpath'], $_POST['title'], $_POST['comment'], $unzip, $_POST['if_exists'], $index, true);
}
// Actions
// Link back to the documents overview
if ($is_certificate_mode) {
    $actions = '<a href="document.php?id=' . $document_id . '&selectcat=' . $selectcat . '&' . api_get_cidreq() . '">' . Display::return_icon('back.png', get_lang('BackTo') . ' ' . get_lang('CertificateOverview'), '', ICON_SIZE_MEDIUM) . '</a>';
} else {
    $actions = '<a href="document.php?id=' . $document_id . '&' . api_get_cidreq() . '">' . Display::return_icon('back.png', get_lang('BackTo') . ' ' . get_lang('DocumentsOverview'), '', ICON_SIZE_MEDIUM) . '</a>';
}
// Link to create a folder
echo $toolbar = Display::toolbarAction('toolbar-upload', array(0 => $actions), 1);
// Form to select directory
$folders = DocumentManager::get_all_document_folders($_course, $groupId, $is_allowed_to_edit);
if (!$is_certificate_mode) {
    echo DocumentManager::build_directory_selector($folders, $document_id, isset($group_properties['directory']) ? $group_properties['directory'] : array());
}
$action = api_get_self() . '?' . api_get_cidreq() . '&id=' . $document_id;
$form = new FormValidator('upload', 'POST', $action . '#tabs-2', '', array('enctype' => 'multipart/form-data'));
$form->addElement('hidden', 'id', $document_id);
$form->addElement('hidden', 'curdirpath', $path);
$course_quota = format_file_size(DocumentManager::get_course_quota() - DocumentManager::documents_total_space());
$label = get_lang('MaxFileSize') . ': ' . ini_get('upload_max_filesize') . '<br/>' . get_lang('DocumentQuota') . ': ' . $course_quota;
$form->addElement('file', 'file', array(get_lang('File'), $label), 'style="width: 250px" id="user_upload"');
$form->addElement('text', 'title', get_lang('Title'), array('id' => 'title_file'));
$form->addElement('textarea', 'comment', get_lang('Comment'));
// Advanced parameters
Exemplo n.º 6
0
    $actionsLeft .= '<a href="' . api_get_path(WEB_CODE_PATH) . 'work/add_user.php?' . api_get_cidreq() . '&id=' . $workId . '">';
    $actionsLeft .= Display::return_icon('addworkuser.png', get_lang('AddUsers'), '', ICON_SIZE_MEDIUM) . '</a>';
    $actionsLeft .= '<a href="' . api_get_path(WEB_CODE_PATH) . 'work/work_list_all.php?' . api_get_cidreq() . '&id=' . $workId . '&action=export_pdf">';
    $actionsLeft .= Display::return_icon('pdf.png', get_lang('Export'), '', ICON_SIZE_MEDIUM) . '</a>';
    $display_output = '<a href="' . api_get_path(WEB_CODE_PATH) . 'work/work_missing.php?' . api_get_cidreq() . '&id=' . $workId . '&amp;list=without">' . Display::return_icon('exercice_uncheck.png', get_lang('ViewUsersWithoutTask'), '', ICON_SIZE_MEDIUM) . "</a>";
    $count = get_count_work($workId);
    if ($count > 0) {
        $display_output .= '<a href="downloadfolder.inc.php?id=' . $workId . '&' . api_get_cidreq() . '">' . Display::return_icon('save_pack.png', get_lang('Save'), null, ICON_SIZE_MEDIUM) . '</a>';
    }
    $actionsLeft .= $display_output;
    $actionsLeft .= '<a href="' . api_get_path(WEB_CODE_PATH) . 'work/edit_work.php?' . api_get_cidreq() . '&id=' . $workId . '">';
    $actionsLeft .= Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_MEDIUM) . '</a>';
    $url = api_get_path(WEB_CODE_PATH) . 'work/upload_corrections.php?' . api_get_cidreq() . '&id=' . $workId;
    $actionsLeft .= Display::toolbarButton(get_lang('UploadCorrections'), $url, 'upload', 'success');
}
echo Display::toolbarAction('toolbar-worklist', array(0 => $actionsLeft));
if (!empty($my_folder_data['title'])) {
    echo Display::page_subheader($my_folder_data['title']);
}
$error_message = Session::read('error_message');
if (!empty($error_message)) {
    echo $error_message;
    Session::erase('error_message');
}
if (!empty($my_folder_data['description'])) {
    $contentWork = Security::remove_XSS($my_folder_data['description']);
    $html = '';
    $html .= Display::panel($contentWork, get_lang('Description'));
    echo $html;
}
$check_qualification = intval($my_folder_data['qualification']);
        default:
            $affected_rows = 0;
    }
    if ($affected_rows) {
        $msg = get_lang('AssignedUsersHaveBeenUpdatedSuccessfully');
    }
}
// Display header
Display::display_header($tool_name);
// actions
if ($userStatus != STUDENT_BOSS) {
    $actionsLeft = Display::url(Display::return_icon('course-add.png', get_lang('AssignCourses'), null, ICON_SIZE_MEDIUM), "dashboard_add_courses_to_user.php?user={$user_id}");
    $actionsLeft .= Display::url(Display::return_icon('session-add.png', get_lang('AssignSessions'), null, ICON_SIZE_MEDIUM), "dashboard_add_sessions_to_user.php?user={$user_id}");
}
$actionsRight = Display::url('<em class="fa fa-search"></em> ' . get_lang('AdvancedSearch'), '#', array('class' => 'btn btn-default advanced_options', 'id' => 'advanced_search'));
$toolbar = Display::toolbarAction('toolbar-dashboard', $content = array(0 => $actionsLeft, 1 => $actionsRight));
echo $toolbar;
echo '<div id="advanced_search_options" style="display:none">';
$searchForm->display();
echo '</div>';
echo Display::page_header(sprintf(get_lang('AssignUsersToX'), api_get_person_name($user_info['firstname'], $user_info['lastname'])), null, $size = 'h3');
$assigned_users_to_hrm = array();
switch ($userStatus) {
    case DRH:
        //no break;
    //no break;
    case PLATFORM_ADMIN:
        $assigned_users_to_hrm = UserManager::get_users_followed_by_drh($user_id);
        break;
    case STUDENT_BOSS:
        $assigned_users_to_hrm = UserManager::getUsersFollowedByStudentBoss($user_id);
Exemplo n.º 8
0
     if (in_array($_REQUEST['filter'], array_keys($values))) {
         $default_filter = $_REQUEST['filter'];
     }
 } else {
     $default_filter = 'today';
 }
 $renderer = $form->defaultRenderer();
 $renderer->setCustomElementTemplate('<div class="col-md-2">{label}</div><div class="col-md-10"> {element} </div>');
 $form->setDefaults(array('filter' => $default_filter, 'group_id' => $groupId));
 if (!$is_locked_attendance || api_is_platform_admin()) {
     $actionsLeft = '<a style="float:left;" href="index.php?' . api_get_cidreq() . '&action=calendar_list&attendance_id=' . $attendance_id . '">' . Display::return_icon('attendance_calendar.png', get_lang('AttendanceCalendar'), '', ICON_SIZE_MEDIUM) . '</a>';
     $actionsLeft .= '<a id="pdf_export" style="float:left;"  href="index.php?' . api_get_cidreq() . '&action=attendance_sheet_export_to_pdf&attendance_id=' . $attendance_id . '&filter=' . $default_filter . '&group_id=' . $groupId . '">' . Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_MEDIUM) . '</a>';
     //if (count($users_in_course) > 0) {
     $actionsRight = $form->returnForm();
     //}
     $toolbar = Display::toolbarAction('toolbar-attendance', array(0 => $actionsLeft, 1 => $actionsRight), 2, false);
     echo $toolbar;
 }
 $message_information = get_lang('AttendanceSheetDescription');
 if (!empty($message_information)) {
     $message = '<strong>' . get_lang('Information') . '</strong><br />';
     $message .= $message_information;
     Display::display_normal_message($message, false);
 }
 if ($is_locked_attendance) {
     Display::display_warning_message(get_lang('TheAttendanceSheetIsLocked'), false);
 }
 $param_filter = '&filter=' . Security::remove_XSS($default_filter) . '&group_id=' . $groupId;
 if (count($users_in_course) > 0) {
     ?>
     <script>
Exemplo n.º 9
0
         $interbreadcrumb[] = array('url' => '#', 'name' => $document_data['title']);
     } else {
         foreach ($document_data['parents'] as $document_sub_data) {
             $interbreadcrumb[] = array('url' => $document_sub_data['document_url'], 'name' => $document_sub_data['title']);
         }
     }
 }
 Display::display_header($nameTools, "Doc");
 // actions
 // link back to the documents overview
 if ($is_certificate_mode) {
     $actionsLeft = '<a href="document.php?certificate=true&id=' . $folder_id . '&selectcat=' . Security::remove_XSS($_GET['selectcat']) . '">' . Display::return_icon('back.png', get_lang('Back') . ' ' . get_lang('To') . ' ' . get_lang('CertificateOverview'), '', ICON_SIZE_MEDIUM) . '</a>';
 } else {
     $actionsLeft = '<a href="document.php?curdirpath=' . Security::remove_XSS($dir) . '">' . Display::return_icon('back.png', get_lang('Back') . ' ' . get_lang('To') . ' ' . get_lang('DocumentsOverview'), '', ICON_SIZE_MEDIUM) . '</a>';
 }
 echo $toolbar = Display::toolbarAction('actions-documents', array(0 => $actionsLeft, 1 => ''));
 if ($is_certificate_mode) {
     $all_information_by_create_certificate = DocumentManager::get_all_info_to_certificate(api_get_user_id(), api_get_course_id());
     $str_info = '';
     foreach ($all_information_by_create_certificate[0] as $info_value) {
         $str_info .= $info_value . '<br/>';
     }
     $create_certificate = get_lang('CreateCertificateWithTags');
     Display::display_normal_message($create_certificate . ': <br /><br/>' . $str_info, false);
 }
 // HTML-editor
 echo '<div class="row" style="overflow:hidden">
         <div id="template_col" class="col-md-2">
             <div class="panel panel-default">
             <div class="panel-body">
                 <div id="frmModel" class="items-templates scrollbar-macosx"></div>
Exemplo n.º 10
0
}
$sort_by_first_name = api_sort_by_first_name();
$actionsLeft = '';
if (api_is_drh()) {
    $menu_items = array(Display::url(Display::return_icon('stats.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH) . "auth/my_progress.php"), Display::url(Display::return_icon('user.png', get_lang('Students'), array(), ICON_SIZE_MEDIUM), 'student.php'), Display::url(Display::return_icon('teacher_na.png', get_lang('Trainers'), array(), ICON_SIZE_MEDIUM), 'teachers.php'), Display::url(Display::return_icon('course.png', get_lang('Courses'), array(), ICON_SIZE_MEDIUM), 'course.php'), Display::url(Display::return_icon('session.png', get_lang('Sessions'), array(), ICON_SIZE_MEDIUM), 'session.php'));
    $nb_menu_items = count($menu_items);
    if ($nb_menu_items > 1) {
        foreach ($menu_items as $key => $item) {
            $actionsLeft .= $item;
        }
    }
}
$actionsRight = '';
$actionsRight .= Display::url(Display::return_icon('printer.png', get_lang('Print'), array(), ICON_SIZE_MEDIUM), 'javascript: void(0);', array('onclick' => 'javascript: window.print();'));
$actionsRight .= Display::url(Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), array(), ICON_SIZE_MEDIUM), api_get_self() . '?export=csv&keyword=' . $keyword);
$toolbar = Display::toolbarAction('toolbar-teachers', $content = array(0 => $actionsLeft, 1 => $actionsRight));
$table = new SortableTable('tracking_teachers', 'get_count_users', 'get_users', ($is_western_name_order xor $sort_by_first_name) ? 1 : 0, 10);
$params = array('keyword' => $keyword, 'active' => $active, 'sleeping_days' => $sleepingDays);
$table->set_additional_parameters($params);
if ($is_western_name_order) {
    $table->set_header(0, get_lang('FirstName'), false);
    $table->set_header(1, get_lang('LastName'), false);
} else {
    $table->set_header(0, get_lang('LastName'), false);
    $table->set_header(1, get_lang('FirstName'), false);
}
$table->set_header(2, get_lang('FirstLogin'), false);
$table->set_header(3, get_lang('LastConnexion'), false);
$table->set_header(4, get_lang('Details'), false);
if ($export_csv) {
    if ($is_western_name_order) {
Exemplo n.º 11
0
 /**
  * Get actions bar
  * @return string
  */
 public function showActionBar()
 {
     $_course = $this->courseInfo;
     $session_id = $this->session_id;
     $groupId = $this->group_id;
     $page = $this->page;
     $actionsLeft = '';
     $actionsLeft .= '<a href="index.php?action=showpage&title=index&cidReq=' . $_course['id'] . '&session_id=' . $session_id . '&group_id=' . $groupId . '">' . Display::return_icon('home.png', get_lang('Home'), '', ICON_SIZE_MEDIUM) . '</a>';
     if (api_is_allowed_to_session_edit(false, true) && api_is_allowed_to_edit()) {
         // menu add page
         $actionsLeft .= '<a href="index.php?cidReq=' . $_course['id'] . '&action=addnew&session_id=' . $session_id . '&group_id=' . $groupId . '"' . self::is_active_navigation_tab('addnew') . '>' . Display::return_icon('add.png', get_lang('AddNew'), '', ICON_SIZE_MEDIUM) . '</a>';
     }
     $lock_unlock_addnew = null;
     $protect_addnewpage = null;
     if (api_is_allowed_to_edit(false, true) || api_is_platform_admin()) {
         // page action: enable or disable the adding of new pages
         if (self::check_addnewpagelock() == 0) {
             $protect_addnewpage = Display::return_icon('off.png', get_lang('AddOptionProtected'));
             $lock_unlock_addnew = 'unlockaddnew';
         } else {
             $protect_addnewpage = Display::return_icon('on.png', get_lang('AddOptionUnprotected'));
             $lock_unlock_addnew = 'lockaddnew';
         }
     }
     // menu find
     $actionsLeft .= '<a href="index.php?cidReq=' . $_course['id'] . '&action=searchpages&session_id=' . $session_id . '&group_id=' . $groupId . '"' . self::is_active_navigation_tab('searchpages') . '>' . Display::return_icon('search.png', get_lang('SearchPages'), '', ICON_SIZE_MEDIUM) . '</a></li>';
     ///menu more
     $actionsLeft .= '<a href="index.php?action=morectitle=' . api_htmlentities(urlencode($page)) . '"' . self::is_active_navigation_tab('more') . '>' . Display::return_icon('stats.png', get_lang('Statistics'), '', ICON_SIZE_MEDIUM) . '</a></li>';
     // menu all pages
     $actionsLeft .= '<a class="btn btn-default" href="index.php?cidReq=' . $_course['id'] . '&action=allpages&session_id=' . $session_id . '&group_id=' . $groupId . '"' . self::is_active_navigation_tab('allpages') . '>' . get_lang('AllPages') . '</a>';
     // menu recent changes
     $actionsLeft .= '<a class="btn btn-default" href="index.php?cidReq=' . $_course['id'] . '&action=recentchanges&session_id=' . $session_id . '&group_id=' . $groupId . '"' . self::is_active_navigation_tab('recentchanges') . '>' . get_lang('RecentChanges') . '</a>';
     echo Display::toolbarAction('toolbar-wiki', array(0 => $actionsLeft));
 }
Exemplo n.º 12
0
$actionsLeft = Display::url(Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM), $url);
if (isset($keyword)) {
    $actionsLeft .= '<a href="subscribe_user.php?type=' . $type . '&' . api_get_cidreq() . '">' . Display::return_icon('clean_group.gif') . ' ' . get_lang('ClearSearchResults') . '</a>';
}
if (isset($_GET['subscribe_user_filter_value']) && !empty($_GET['subscribe_user_filter_value'])) {
    $actionsLeft .= '<a href="subscribe_user.php?type=' . $type . '&' . api_get_cidreq() . '">' . Display::return_icon('clean_group.gif') . ' ' . get_lang('ClearFilterResults') . '</a>';
}
if (api_get_setting('profile.profiling_filter_adding_users') == 'true') {
    display_extra_profile_fields_filter();
}
// Build search-form
$form = new FormValidator('search_user', 'get', api_get_self() . '?' . api_get_cidreq(), '', null, FormValidator::LAYOUT_INLINE);
$form->addText('keyword', '', false);
$form->addElement('hidden', 'type', $type);
$form->addButtonSearch(get_lang('Search'));
echo Display::toolbarAction('toolbar-subscriber', array(0 => $actionsLeft, 1 => $form->returnForm()));
$option = $type == COURSEMANAGER ? 2 : 1;
echo UserManager::getUserSubscriptionTab($option);
// Display table
$table->display();
/*		SHOW LIST OF USERS  */
/**
 ** Get the users to display on the current page.
 */
function get_number_of_users()
{
    // Database table definition
    $user_table = Database::get_main_table(TABLE_MAIN_USER);
    $course_user_table = Database::get_main_table(TABLE_MAIN_COURSE_USER);
    $tbl_session_rel_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
    $table_user_field_values = Database::get_main_table(TABLE_EXTRA_FIELD_VALUES);
Exemplo n.º 13
0
if (!empty($group_id)) {
    $group_properties = GroupManager::get_group_properties($group_id);
    $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH) . 'group/group.php?' . api_get_cidreq(), 'name' => get_lang('Groups'));
    $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH) . 'group/group_space.php?' . api_get_cidreq(), 'name' => get_lang('GroupSpace') . ' ' . $group_properties['name']);
}
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH) . 'work/work.php?' . api_get_cidreq(), 'name' => get_lang('StudentPublications'));
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH) . 'work/work_list.php?' . api_get_cidreq() . '&id=' . $workId, 'name' => $my_folder_data['title']);
$documentsAddedInWork = getAllDocumentsFromWorkToString($workId, $courseInfo);
Display::display_header(null);
$actionsLeft = '<a href="' . api_get_path(WEB_CODE_PATH) . 'work/work.php?' . api_get_cidreq() . '&origin=' . $origin . '">' . Display::return_icon('back.png', get_lang('BackToWorksList'), '', ICON_SIZE_MEDIUM) . '</a>';
if (api_is_allowed_to_session_edit(false, true) && !empty($workId) && !api_is_invitee()) {
    $url = api_get_path(WEB_CODE_PATH) . 'work/upload.php?' . api_get_cidreq() . '&id=' . $workId . '&origin=' . $origin;
    //$actionsRight .= Display::return_icon('upload_file.png', get_lang('UploadADocument'), '', ICON_SIZE_MEDIUM).' ' . get_lang('UploadADocument') . '</a>';
    $actionsRight = Display::toolbarButton(get_lang('UploadMyAssignment'), $url, 'upload', 'success');
}
echo Display::toolbarAction('toolbar-work', array(0 => $actionsLeft . $actionsRight));
if (!empty($my_folder_data['title'])) {
    echo Display::page_subheader($my_folder_data['title']);
}
$error_message = Session::read('error_message');
if (!empty($error_message)) {
    echo $error_message;
    Session::erase('error_message');
}
if (!empty($my_folder_data['description'])) {
    $contentWork = Security::remove_XSS($my_folder_data['description']);
    $html = '';
    $html .= Display::panel($contentWork, get_lang('Description'));
    echo $html;
}
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null;
$errorMsg = $firstLetterCourse = '';
$UserList = array();
$msg = '';
if (isset($_POST['formSent']) && intval($_POST['formSent']) == 1) {
    $courses_list = $_POST['CoursesList'];
    $affected_rows = CourseManager::subscribeCoursesToDrhManager($user_id, $courses_list);
    if ($affected_rows) {
        $msg = get_lang('AssignedCoursesHaveBeenUpdatedSuccessfully');
    }
}
// display header
Display::display_header($tool_name);
// actions
$actionsLeft = '<a href="dashboard_add_users_to_user.php?user='******'">' . Display::return_icon('add-user.png', get_lang('AssignUsers'), null, ICON_SIZE_MEDIUM) . '</a>';
$actionsLeft .= '<a href="dashboard_add_sessions_to_user.php?user='******'">' . Display::return_icon('session-add.png', get_lang('AssignSessions'), null, ICON_SIZE_MEDIUM) . '</a>';
echo $html = Display::toolbarAction('toolbar-dashboard', array($actionsLeft));
echo Display::page_header(sprintf(get_lang('AssignCoursesToX'), api_get_person_name($user_info['firstname'], $user_info['lastname'])), null, 'h3');
$assigned_courses_to_hrm = CourseManager::get_courses_followed_by_drh($user_id);
$assigned_courses_code = array_keys($assigned_courses_to_hrm);
foreach ($assigned_courses_code as &$value) {
    $value = "'" . $value . "'";
}
$without_assigned_courses = '';
if (count($assigned_courses_code) > 0) {
    $without_assigned_courses = " AND c.code NOT IN(" . implode(',', $assigned_courses_code) . ")";
}
$needle = '%';
$firstLetter = null;
if (isset($_POST['firstLetterCourse'])) {
    $firstLetter = $_POST['firstLetterCourse'];
    $needle = Database::escape_string($firstLetter . '%');
if (isset($_POST['formSent']) && intval($_POST['formSent']) == 1) {
    $sessions_list = $_POST['SessionsList'];
    $userInfo = api_get_user_info($user_id);
    $affected_rows = SessionManager::suscribe_sessions_to_hr_manager($userInfo, $sessions_list);
    if ($affected_rows) {
        Display::addFlash(Display::return_message(get_lang('AssignedSessionsHaveBeenUpdatedSuccessfully')));
    }
}
// display header
Display::display_header($tool_name);
// actions
if ($user_info['status'] != SESSIONADMIN) {
    $actionsLeft = '<a href="dashboard_add_users_to_user.php?user='******'">' . Display::return_icon('add-user.png', get_lang('AssignUsers'), null, ICON_SIZE_MEDIUM) . '</a>';
    $actionsLeft .= '<a href="dashboard_add_courses_to_user.php?user='******'">' . Display::return_icon('course-add.png', get_lang('AssignCourses'), null, ICON_SIZE_MEDIUM) . '</a>';
}
echo Display::toolbarAction('toolbar-dashboard', array(0 => $actionsLeft, 1 => ''));
echo Display::page_header(sprintf(get_lang('AssignSessionsToX'), api_get_person_name($user_info['firstname'], $user_info['lastname'])), null, 'h3');
$assigned_sessions_to_hrm = SessionManager::get_sessions_followed_by_drh($user_id);
$assigned_sessions_id = array_keys($assigned_sessions_to_hrm);
$without_assigned_sessions = '';
if (count($assigned_sessions_id) > 0) {
    $without_assigned_sessions = " AND s.id NOT IN (" . implode(',', $assigned_sessions_id) . ") ";
}
$needle = '%';
if (!empty($firstLetterSession)) {
    $needle = Database::escape_string($firstLetterSession . '%');
}
if (api_is_multiple_url_enabled()) {
    $sql = "SELECT s.id, s.name\n\t        FROM {$tbl_session} s\n            LEFT JOIN {$tbl_session_rel_access_url} a ON (s.id = a.session_id)\n            WHERE\n                s.name LIKE '{$needle}%' {$without_assigned_sessions} AND\n                access_url_id = " . api_get_current_access_url_id() . "\n            ORDER BY s.name";
} else {
    $sql = "SELECT s.id, s.name FROM {$tbl_session} s\n\t\t    WHERE  s.name LIKE '{$needle}%' {$without_assigned_sessions}\n            ORDER BY s.name";
Exemplo n.º 16
0
}
$users_tracking_per_page = '';
if (isset($_GET['users_tracking_per_page'])) {
    $users_tracking_per_page = '&users_tracking_per_page=' . intval($_GET['users_tracking_per_page']);
}
$actionsRight .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&export=csv&' . $addional_param . $users_tracking_per_page . '">
     ' . Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), '', ICON_SIZE_MEDIUM) . '</a>';
$actionsRight .= '</div>';
// Create a search-box.
$form_search = new FormValidator('search_simple', 'GET', api_get_path(WEB_CODE_PATH) . 'tracking/courseLog.php?' . api_get_cidreq(), '', array(), FormValidator::LAYOUT_INLINE);
$form_search->addElement('hidden', 'from', Security::remove_XSS($from));
$form_search->addElement('hidden', 'session_id', $sessionId);
$form_search->addElement('hidden', 'id_session', $sessionId);
$form_search->addElement('text', 'user_keyword');
$form_search->addButtonSearch(get_lang('SearchUsers'));
echo Display::toolbarAction('toolbar-courselog', array(0 => $actionsLeft, 1 => $form_search->returnForm(), 2 => $actionsRight), 3);
$course_name = get_lang('Course') . ' ' . $courseInfo['name'];
if ($session_id) {
    $titleSession = Display::return_icon('session.png', get_lang('Session'), array(), ICON_SIZE_SMALL) . ' ' . api_get_session_name($session_id);
    $titleCourse = Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL) . ' ' . $course_name;
} else {
    $titleSession = Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL) . ' ' . $courseInfo['name'];
}
$teacherList = CourseManager::getTeacherListFromCourseToString($courseInfo['real_id'], ',', false, true);
$coaches = null;
if (!empty($session_id)) {
    $coaches = CourseManager::get_coachs_from_course_to_string($session_id, $courseInfo['real_id'], ',', false, true);
}
$html = '';
if (!empty($teacherList)) {
    $html .= Display::page_subheader2(get_lang('Teachers'));
Exemplo n.º 17
0
 /**
  * @param int $filter
  * @param string $view
  * @return string
  */
 public function displayActions($view, $filter = 0)
 {
     $courseInfo = api_get_course_info();
     $actionsLeft = '';
     $actionsLeft .= "<a href='" . api_get_path(WEB_CODE_PATH) . "calendar/agenda_js.php?type={$this->type}'>" . Display::return_icon('calendar.png', get_lang('Calendar'), '', ICON_SIZE_MEDIUM) . "</a>";
     $courseCondition = '';
     if (!empty($courseInfo)) {
         $courseCondition = api_get_cidreq();
     }
     $actionsLeft .= "<a href='" . api_get_path(WEB_CODE_PATH) . "calendar/agenda_list.php?type={$this->type}&" . $courseCondition . "'>" . Display::return_icon('week.png', get_lang('AgendaList'), '', ICON_SIZE_MEDIUM) . "</a>";
     $form = '';
     if (api_is_allowed_to_edit(false, true) || api_get_course_setting('allow_user_edit_agenda') && !api_is_anonymous() && api_is_allowed_to_session_edit(false, true) || GroupManager::user_has_access(api_get_user_id(), api_get_group_id(), GroupManager::GROUP_TOOL_CALENDAR) && GroupManager::is_tutor_of_group(api_get_user_id(), api_get_group_id())) {
         $actionsLeft .= Display::url(Display::return_icon('new_event.png', get_lang('AgendaAdd'), '', ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH) . "calendar/agenda.php?" . api_get_cidreq() . "&action=add&type=" . $this->type);
         $actionsLeft .= Display::url(Display::return_icon('import_calendar.png', get_lang('ICalFileImport'), '', ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH) . "calendar/agenda.php?" . api_get_cidreq() . "&action=importical&type=" . $this->type);
         if ($this->type == 'course') {
             if (!isset($_GET['action'])) {
                 $form = new FormValidator('form-search', 'post', '', '', array(), FormValidator::LAYOUT_INLINE);
                 $attributes = array('multiple' => false, 'id' => 'select_form_id_search');
                 $selectedValues = $this->parseAgendaFilter($filter);
                 $this->showToForm($form, $selectedValues, $attributes);
                 $form = $form->returnForm();
             }
         }
     }
     if (api_is_platform_admin() || api_is_teacher() || api_is_student_boss() || api_is_drh() || api_is_session_admin() || api_is_coach()) {
         if ($this->type == 'personal') {
             $form = null;
             if (!isset($_GET['action'])) {
                 $form = new FormValidator('form-search', 'get', api_get_self() . '?type=personal&', '', array(), FormValidator::LAYOUT_INLINE);
                 $sessions = SessionManager::get_sessions_by_user(api_get_user_id());
                 $form->addHidden('type', 'personal');
                 $sessions = array_column($sessions, 'session_name', 'session_id');
                 $sessions = ['0' => get_lang('SelectAnOption')] + $sessions;
                 $form->addSelect('session_id', get_lang('Session'), $sessions, ['id' => 'session_id', 'onchange' => 'submit();']);
                 //$form->addButtonFilter(get_lang('Filter'));
                 //$renderer = $form->defaultRenderer();
                 //$renderer->setCustomElementTemplate('<div class="col-md-6">{element}</div>');
                 $form->addButtonReset(get_lang('Reset'));
                 $form = $form->returnForm();
             }
         }
     }
     $actionsRight = '';
     if ($view == 'calendar') {
         $actionsRight .= $form;
     }
     $toolbar = Display::toolbarAction('toolbar-agenda', array(0 => $actionsLeft, 1 => $actionsRight), 2, false);
     return $toolbar;
 }
Exemplo n.º 18
0
    if ($show_message == '') {
        // Student
        if (!api_is_allowed_to_edit() && !api_is_excluded_user_type()) {
            $certificate = Category::register_user_certificate($category_id, $stud_id);
            if (isset($certificate['pdf_url'])) {
                $actionsLeft .= Display::url(Display::returnFontAwesomeIcon('file-pdf-o') . get_lang('DownloadCertificatePdf'), $certificate['pdf_url'], ['class' => 'btn btn-default']);
            }
            $currentScore = Category::getCurrentScore($stud_id, $category_id, $course_code, $session_id, true);
            Category::registerCurrentScore($currentScore, $stud_id, $category_id);
        }
    }
}
if (!api_is_allowed_to_edit(null, true)) {
    $actionsLeft .= Display::url(Display::returnFontAwesomeIcon('file-pdf-o') . get_lang('DownloadReportPdf'), api_get_self() . "?" . api_get_self() . "&action=export_table", ['class' => 'btn btn-default']);
}
echo $toolbar = Display::toolbarAction('gradebook-student-actions', array(0 => $actionsLeft, 1 => ''));
if (api_is_allowed_to_edit(null, true)) {
    // Tool introduction
    Display::display_introduction_section(TOOL_GRADEBOOK, array('ToolbarSet' => 'AssessmentsIntroduction'));
    if (isset($_GET['selectcat']) && $_GET['selectcat'] != 0) {
        //
    } else {
        if (isset($_GET['selectcat']) && $_GET['selectcat'] == 0 || isset($_GET['cidReq']) && $_GET['cidReq'] !== '' || isset($_GET['isStudentView']) && $_GET['isStudentView'] == 'false') {
            $cats = Category::load(null, null, $course_code, null, null, $session_id, false);
        }
    }
}
if (isset($first_time) && $first_time == 1 && api_is_allowed_to_edit(null, true)) {
    echo '<meta http-equiv="refresh" content="0;url=' . api_get_self() . '?cidReq=' . $course_code . '" />';
} else {
    $cats = Category::load(null, null, $course_code, null, null, $session_id, false);
Exemplo n.º 19
0
// Tool introduction
if (empty($_GET['origin']) || $_GET['origin'] !== 'learnpath') {
    Display::display_introduction_section(TOOL_ANNOUNCEMENT);
}
// Actions
$show_actions = false;
$actionsLeft = '';
if ((api_is_allowed_to_edit(false, true) || api_get_course_setting('announcement.allow_user_edit_announcement') && !api_is_anonymous()) && (empty($_GET['origin']) || $_GET['origin'] !== 'learnpath')) {
    if (in_array($action, array('add', 'modify', 'view'))) {
        $actionsLeft .= "<a href='" . api_get_self() . "?" . api_get_cidreq() . "&origin=" . $origin . "'>" . Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM) . "</a>";
    } else {
        $actionsLeft .= "<a href='" . api_get_self() . "?" . api_get_cidreq() . "&action=add&origin=" . $origin . "'>" . Display::return_icon('new_announce.png', get_lang('AddAnnouncement'), '', ICON_SIZE_MEDIUM) . "</a>";
    }
    $show_actions = true;
} else {
    if (in_array($action, array('view'))) {
        $actionsLeft .= "<a href='" . api_get_self() . "?" . api_get_cidreq() . "&origin=" . $origin . "'>" . Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM) . "</a>";
        echo '</div>';
    }
}
if (api_is_allowed_to_edit() && $announcement_number > 1) {
    if (api_get_group_id() == 0) {
        if (!isset($_GET['action'])) {
            $actionsLeft .= "<a href=\"" . api_get_self() . "?" . api_get_cidreq() . "&action=delete_all\" onclick=\"javascript:if(!confirm('" . get_lang("ConfirmYourChoice") . "')) return false;\">" . Display::return_icon('delete_announce.png', get_lang('AnnouncementDeleteAll'), '', ICON_SIZE_MEDIUM) . "</a>";
        }
    }
}
if ($show_actions) {
    echo Display::toolbarAction('toolbar', array($actionsLeft, $searchFormToString), 2, false);
}
echo $content;
Exemplo n.º 20
0
    /**
     * Displays the header for the gradebook containing the navigation tree and links
     * @param Category $catobj
     * @param int $showtree '1' will show the browse tree and naviation buttons
     * @param boolean $is_course_admin
     * @param boolean $is_platform_admin
     * @param boolean Whether to show or not the link to add a new qualification
     * (we hide it in case of the course-embedded tool where we have only one
     * calification per course or session)
     * @param boolean Whether to show or not the link to add a new item inside
     * the qualification (we hide it in case of the course-embedded tool
     * where we have only one calification per course or session)
     * @return void Everything is printed on screen upon closing
     */
    static function header($catobj, $showtree, $selectcat, $is_course_admin, $is_platform_admin, $simple_search_form, $show_add_qualification = true, $show_add_link = true, $certificateLinkInfo = null)
    {
        $userId = api_get_user_id();
        $courseCode = api_get_course_id();
        $courseId = api_get_course_int_id();
        $sessionId = api_get_session_id();
        // Student.
        $status = CourseManager::get_user_in_course_status($userId, $courseCode);
        if (!empty($sessionId)) {
            $sessionStatus = SessionManager::get_user_status_in_course_session($userId, $courseId, $sessionId);
        }
        $objcat = new Category();
        $course_id = CourseManager::get_course_by_category($selectcat);
        $message_resource = $objcat->show_message_resource_delete($course_id);
        $grade_model_id = $catobj->get_grade_model_id();
        $header = null;
        //@todo move these in a function
        $sum_categories_weight_array = array();
        if (isset($catobj) && !empty($catobj)) {
            $categories = Category::load(null, null, null, $catobj->get_id(), null, $sessionId);
            if (!empty($categories)) {
                foreach ($categories as $category) {
                    $sum_categories_weight_array[$category->get_id()] = $category->get_weight();
                }
            } else {
                $sum_categories_weight_array[$catobj->get_id()] = $catobj->get_weight();
            }
        }
        if (!$is_course_admin && ($status != 1 || $sessionStatus == 0) && $selectcat != 0) {
            $catcourse = Category::load($catobj->get_id());
            /** @var Category $category */
            $category = $catcourse[0];
            $main_weight = $category->get_weight();
            $scoredisplay = ScoreDisplay::instance();
            $allevals = $category->get_evaluations($userId, true);
            $alllinks = $category->get_links($userId, true);
            $allEvalsLinks = array_merge($allevals, $alllinks);
            $item_value_total = 0;
            $scoreinfo = null;
            for ($count = 0; $count < count($allEvalsLinks); $count++) {
                $item = $allEvalsLinks[$count];
                $score = $item->calc_score($userId);
                if (!empty($score)) {
                    $divide = $score[1] == 0 ? 1 : $score[1];
                    $item_value = $score[0] / $divide * $item->get_weight();
                    $item_value_total += $item_value;
                }
            }
            $item_total = $main_weight;
            $total_score = array($item_value_total, $item_total);
            $scorecourse_display = $scoredisplay->display_score($total_score, SCORE_DIV_PERCENT);
            if (!$catobj->get_id() == '0' && !isset($_GET['studentoverview']) && !isset($_GET['search'])) {
                $aditionalButtons = null;
                if (!empty($certificateLinkInfo)) {
                    $aditionalButtons .= '<div class="btn-group pull-right">';
                    $aditionalButtons .= isset($certificateLinkInfo['certificate_link']) ? $certificateLinkInfo['certificate_link'] : '';
                    $aditionalButtons .= isset($certificateLinkInfo['badge_link']) ? $certificateLinkInfo['badge_link'] : '';
                    $aditionalButtons .= '</div>';
                }
                $scoreinfo .= '<strong>' . sprintf(get_lang('TotalX'), $scorecourse_display . $aditionalButtons) . '</strong>';
            }
            Display::display_normal_message($scoreinfo, false);
        }
        // show navigation tree and buttons?
        if ($showtree == '1' || isset($_GET['studentoverview'])) {
            $header = '<div class="actions"><table>';
            $header .= '<tr>';
            if (!$selectcat == '0') {
                $header .= '<td><a href="' . api_get_self() . '?selectcat=' . $catobj->get_parent_id() . '">' . Display::return_icon('back.png', get_lang('BackTo') . ' ' . get_lang('RootCat'), '', ICON_SIZE_MEDIUM) . '</a></td>';
            }
            $header .= '<td>' . get_lang('CurrentCategory') . '</td>' . '<td><form name="selector"><select name="selectcat" onchange="document.selector.submit()">';
            $cats = Category::load();
            $tree = $cats[0]->get_tree();
            unset($cats);
            $line = null;
            foreach ($tree as $cat) {
                for ($i = 0; $i < $cat[2]; $i++) {
                    $line .= '&mdash;';
                }
                $line = isset($line) ? $line : '';
                if (isset($_GET['selectcat']) && $_GET['selectcat'] == $cat[0]) {
                    $header .= '<option selected value=' . $cat[0] . '>' . $line . ' ' . $cat[1] . '</option>';
                } else {
                    $header .= '<option value=' . $cat[0] . '>' . $line . ' ' . $cat[1] . '</option>';
                }
                $line = '';
            }
            $header .= '</select></form></td>';
            if (!empty($simple_search_form) && $message_resource === false) {
                $header .= '<td style="vertical-align: top;">' . $simple_search_form->toHtml() . '</td>';
            } else {
                $header .= '<td></td>';
            }
            if ($is_course_admin && $message_resource === false && isset($_GET['selectcat']) && $_GET['selectcat'] != 0) {
                /* $header .= '<td style="vertical-align: top;"><a href="gradebook_flatview.php?'.api_get_cidreq().'&selectcat=' . $catobj->get_id() . '"><img src="../img/view_list.gif" alt="' . get_lang('FlatView') . '" /> ' . get_lang('FlatView') . '</a>';
                   if ($is_course_admin && $message_resource===false) {
                   $header .= '<td style="vertical-align: top;"><a href="gradebook_scoring_system.php?'.api_get_cidreq().'&selectcat=' . $catobj->get_id() .'"><img src="../img/acces_tool.gif" alt="' . get_lang('ScoreEdit') . '" /> ' . get_lang('ScoreEdit') . '</a>';
                   } */
            } elseif (!isset($_GET['studentoverview'])) {
                if ($message_resource === false) {
                    //$header .= '<td style="vertical-align: top;"><a href="'.api_get_self().'?'.api_get_cidreq().'&studentoverview=&selectcat=' . $catobj->get_id() . '"><img src="../img/view_list.gif" alt="' . get_lang('FlatView') . '" /> ' . get_lang('FlatView') . '</a>';
                }
            } else {
                $header .= '<td style="vertical-align: top;"><a href="' . api_get_self() . '?' . api_get_cidreq() . '&studentoverview=&exportpdf=&selectcat=' . $catobj->get_id() . '" target="_blank">
							<img src="../img/icons/32/pdf.png" alt="' . get_lang('ExportPDF') . '" /> ' . get_lang('ExportPDF') . '</a>';
            }
            $header .= '</td></tr>';
            $header .= '</table></div>';
        }
        // for course admin & platform admin add item buttons are added to the header
        $actionsLeft = '';
        $my_category = $catobj->shows_all_information_an_category($catobj->get_id());
        $user_id = api_get_user_id();
        $my_api_cidreq = api_get_cidreq();
        if (api_is_allowed_to_edit(null, true)) {
            if (empty($grade_model_id) || $grade_model_id == -1) {
                $actionsLeft .= '<a href="gradebook_add_cat.php?' . api_get_cidreq() . '&selectcat=' . $catobj->get_id() . '">' . Display::return_icon('new_folder.png', get_lang('AddGradebook'), array(), ICON_SIZE_MEDIUM) . '</a></td>';
            }
            if ($selectcat == '0') {
            } else {
                $my_category = $catobj->shows_all_information_an_category($catobj->get_id());
                if ($my_api_cidreq == '') {
                    $my_api_cidreq = 'cidReq=' . $my_category['course_code'];
                }
                if ($show_add_link && !$message_resource) {
                    $actionsLeft .= '<a href="gradebook_add_eval.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '" >' . Display::return_icon('new_evaluation.png', get_lang('NewEvaluation'), '', ICON_SIZE_MEDIUM) . '</a>';
                    $cats = Category::load($selectcat);
                    if ($cats[0]->get_course_code() != null && !$message_resource) {
                        $actionsLeft .= '<a href="gradebook_add_link.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '">' . Display::return_icon('new_online_evaluation.png', get_lang('MakeLink'), '', ICON_SIZE_MEDIUM) . '</a>';
                    } else {
                        $actionsLeft .= '<a href="gradebook_add_link_select_course.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '">' . Display::return_icon('new_online_evaluation.png', get_lang('MakeLink'), '', ICON_SIZE_MEDIUM) . '</a>';
                    }
                }
                if (!$message_resource) {
                    $actionsLeft .= '<a href="gradebook_flatview.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '">' . Display::return_icon('stats.png', get_lang('FlatView'), '', ICON_SIZE_MEDIUM) . '</a>';
                    if ($my_category['generate_certificates'] == 1) {
                        $actionsLeft .= Display::url(Display::return_icon('certificate_list.png', get_lang('GradebookSeeListOfStudentsCertificates'), '', ICON_SIZE_MEDIUM), "gradebook_display_certificate.php?{$my_api_cidreq}&cat_id=" . intval($_GET['selectcat']));
                    }
                    $actionsLeft .= Display::url(Display::return_icon('user.png', get_lang('GradebookListOfStudentsReports'), '', ICON_SIZE_MEDIUM), "gradebook_display_summary.php?{$my_api_cidreq}&selectcat=" . intval($_GET['selectcat']));
                    // Right icons
                    $actionsRight = '<a href="gradebook_edit_cat.php?editcat=' . $catobj->get_id() . '&amp;cidReq=' . $catobj->get_course_code() . '&id_session=' . $catobj->get_session_id() . '">' . Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_MEDIUM) . '</a>';
                    $actionsRight .= '<a href="../document/document.php?curdirpath=/certificates&' . $my_api_cidreq . '&origin=gradebook&selectcat=' . $catobj->get_id() . '">' . Display::return_icon('certificate.png', get_lang('AttachCertificate'), '', ICON_SIZE_MEDIUM) . '</a>';
                    if (empty($categories)) {
                        $actionsRight .= '<a href="gradebook_edit_all.php?id_session=' . api_get_session_id() . '&amp;' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '">' . Display::return_icon('percentage.png', get_lang('EditAllWeights'), '', ICON_SIZE_MEDIUM) . '</a>';
                    }
                    $score_display_custom = api_get_setting('gradebook_score_display_custom');
                    if (api_get_setting('teachers_can_change_score_settings') == 'true' && $score_display_custom['my_display_custom'] == 'true') {
                        $actionsRight .= '<a href="gradebook_scoring_system.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '">' . Display::return_icon('ranking.png', get_lang('ScoreEdit'), '', ICON_SIZE_MEDIUM) . '</a>';
                    }
                }
            }
        } elseif (isset($_GET['search'])) {
            echo $header = '<b>' . get_lang('SearchResults') . ' :</b>';
        }
        $isDrhOfCourse = CourseManager::isUserSubscribedInCourseAsDrh(api_get_user_id(), api_get_course_info());
        if ($isDrhOfCourse) {
            ${$actionsLeft} .= '<a href="gradebook_flatview.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '">' . Display::return_icon('stats.png', get_lang('FlatView'), '', ICON_SIZE_MEDIUM) . '</a>';
        }
        if (api_is_allowed_to_edit(null, true)) {
            echo $toolbar = Display::toolbarAction('gradebook-actions', array(0 => $actionsLeft, 1 => $actionsRight));
        }
        if (api_is_allowed_to_edit(null, true)) {
            $weight = intval($catobj->get_weight()) > 0 ? $catobj->get_weight() : 0;
            $weight = '<strong>' . get_lang('TotalWeight') . ' : </strong>' . $weight;
            $min_certification = intval($catobj->get_certificate_min_score() > 0) ? $catobj->get_certificate_min_score() : 0;
            $min_certification = get_lang('CertificateMinScore') . ' : ' . $min_certification;
            $edit_icon = '<a href="gradebook_edit_cat.php?editcat=' . $catobj->get_id() . '&amp;cidReq=' . $catobj->get_course_code() . '&id_session=' . $catobj->get_session_id() . '">' . Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . '</a>';
            //$msg = Display::tag('h3', $weight.' - '.$min_certification);
            $msg = $weight . ' - ' . $min_certification . $edit_icon;
            //@todo show description
            $description = $catobj->get_description() == "" || is_null($catobj->get_description()) ? '' : '<strong>' . get_lang('GradebookDescriptionLog') . '</strong>' . ': ' . $catobj->get_description();
            Display::display_normal_message($msg, false);
            if (!empty($description)) {
                echo Display::div($description, array());
            }
        }
    }
Exemplo n.º 21
0
        $menu_items[] = Display::url(Display::return_icon('course.png', get_lang('Courses'), array(), ICON_SIZE_MEDIUM), 'course.php');
        $menu_items[] = Display::url(Display::return_icon('session_na.png', get_lang('Sessions'), array(), ICON_SIZE_MEDIUM), '#');
    }
    $actionsLeft = '';
    $nb_menu_items = count($menu_items);
    if ($nb_menu_items > 1) {
        foreach ($menu_items as $key => $item) {
            $actionsLeft .= $item;
        }
    }
    $actionsRight = '';
    if (count($a_sessions) > 0) {
        $actionsRight = Display::url(Display::return_icon('printer.png', get_lang('Print'), array(), 32), 'javascript: void(0);', array('onclick' => 'javascript: window.print();'));
        $actionsRight .= Display::url(Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), array(), 32), api_get_self() . '?export=csv');
    }
    $toolbar = Display::toolbarAction('toolbar-session', $content = array(0 => $actionsLeft, 1 => $actionsRight));
    echo $toolbar;
    echo Display::page_header(get_lang('YourSessionsList'));
} else {
    $a_sessions = Tracking::get_sessions_coached_by_user($id_coach);
}
$form = new FormValidator('search_course', 'get', api_get_path(WEB_CODE_PATH) . 'mySpace/session.php');
$form->addElement('text', 'keyword', get_lang('Keyword'));
$form->addButtonSearch(get_lang('Search'));
$keyword = '';
if ($form->validate()) {
    $keyword = $form->getSubmitValue('keyword');
}
$form->setDefaults(array('keyword' => $keyword));
$url = api_get_path(WEB_AJAX_PATH) . 'model.ajax.php?a=get_sessions_tracking&keyword=' . Security::remove_XSS($keyword);
$columns = array(get_lang('Title'), get_lang('Date'), get_lang('NbCoursesPerSession'), get_lang('NbStudentPerSession'), get_lang('Details'));
Exemplo n.º 22
0
function disableresizing() { //v2.0
	document.options.width.disabled=true;
	//document.options.width.className='disabled_input';
	document.options.height.disabled=true;
	//document.options.height.className='disabled_input';
}
window.onload = <?php 
echo $image_resizing == 'resizing' ? 'enableresizing' : 'disableresizing';
?>
;
</script>

<?php 
$actions = '<a href="document.php?action=exit_slideshow&curdirpath=' . $pathurl . '">' . Display::return_icon('back.png', get_lang('BackTo') . ' ' . get_lang('DocumentsOverview'), '', ICON_SIZE_MEDIUM) . '</a>';
$actions .= '<a href="slideshow.php?curdirpath=' . $pathurl . '">' . Display::return_icon('slideshow.png', get_lang('BackTo') . ' ' . get_lang('SlideShow'), '', ICON_SIZE_MEDIUM) . '</a>';
Display::toolbarAction('toolbar-slideshow', $content);
?>
<div class="panel panel-default">
    <div class="panel-body">
<form action="slideshow.php?curdirpath=<?php 
echo $pathurl;
?>
" method="post" name="options" id="options" class="form-horizontal">
	<legend><?php 
echo get_lang('SlideshowOptions');
?>
</legend>
        <div class="radio">
            <label>
                <input name="radio_resizing" type="radio" onClick="disableresizing()" value="noresizing" <?php 
if ($image_resizing == 'noresizing' || $image_resizing == '') {