return $classes; } /** * Build the reg-column of the table * @param int $class_id The class id * @return string Some HTML-code */ function reg_filter($class_id) { $result = "<a href=\"" . api_get_self() . "?register=yes&class_id=" . $class_id . "\">" . get_lang("reg") . "</a>"; return $result; } // Build search-form $form = new FormValidator('search_class', 'get', '', '', null, false); $form->addText('keyword', '', false); $form->addButtonSearch(get_lang('SearchButton')); // Build table $table = new SortableTable('users', 'get_number_of_classes', 'get_class_data', 1); $parameters['keyword'] = Security::remove_XSS($_GET['keyword']); $table->set_additional_parameters($parameters); $col = 0; $table->set_header($col++, '', false); $table->set_header($col++, get_lang('ClassName')); $table->set_header($col++, get_lang('NumberOfUsers')); $table->set_header($col++, get_lang('reg'), false); $table->set_column_filter($col - 1, 'reg_filter'); $table->set_form_actions(array('subscribe' => get_lang('reg')), 'class'); // Display form & table $form->display(); $table->display(); Display::display_footer();
case 'thematic_details': echo '<a href="index.php?' . api_get_cidreq() . '&action=thematic_add' . $url_token . '">' . Display::return_icon('new_course_progress.png', get_lang('NewThematicSection'), '', ICON_SIZE_MEDIUM) . '</a>'; echo '<a href="index.php?' . api_get_cidreq() . '&action=thematic_import_select' . $url_token . '">' . Display::return_icon('import_csv.png', get_lang('ImportThematic'), '', ICON_SIZE_MEDIUM) . '</a>'; echo '<a href="index.php?' . api_get_cidreq() . '&action=thematic_export' . $url_token . '">' . Display::return_icon('export_csv.png', get_lang('ExportThematic'), '', ICON_SIZE_MEDIUM) . '</a>'; echo '<a href="index.php?' . api_get_cidreq() . '&action=thematic_export_pdf' . $url_token . '">' . Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_MEDIUM) . '</a>'; break; default: echo '<a href="index.php?' . api_get_cidreq() . '&action=thematic_add' . $url_token . '">' . Display::return_icon('new_course_progress.png', get_lang('NewThematicSection'), '', ICON_SIZE_MEDIUM) . '</a>'; } echo '</div>'; } if ($action == 'thematic_list') { $table = new SortableTable('thematic_list', array('Thematic', 'get_number_of_thematics'), array('Thematic', 'get_thematic_data')); $parameters['action'] = $action; $table->set_additional_parameters($parameters); $table->set_header(0, '', false, array('style' => 'width:20px;')); $table->set_header(1, get_lang('Title'), false); if (api_is_allowed_to_edit(null, true)) { $table->set_header(2, get_lang('Actions'), false, array('style' => 'text-align:center;width:40%;')); $table->set_form_actions(array('thematic_delete_select' => get_lang('DeleteAllThematics'))); } $table->display(); } elseif ($action == 'thematic_details') { if (isset($_GET['thematic_plan_save_message']) && $_GET['thematic_plan_save_message'] == 'ok') { Display::display_confirmation_message(get_lang('ThematicSectionHasBeenCreatedSuccessfull')); } if (isset($last_id) && $last_id) { $link_to_thematic_plan = '<a href="index.php?' . api_get_cidreq() . '&action=thematic_plan_list&thematic_id=' . $last_id . '">' . Display::return_icon('lesson_plan.png', get_lang('ThematicPlan'), array('style' => 'vertical-align:middle;float:none;'), ICON_SIZE_SMALL) . '</a>'; $link_to_thematic_advance = '<a href="index.php?' . api_get_cidreq() . '&action=thematic_advance_list&thematic_id=' . $last_id . '">' . Display::return_icon('lesson_plan_calendar.png', get_lang('ThematicAdvance'), array('style' => 'vertical-align:middle;float:none;'), ICON_SIZE_SMALL) . '</a>'; Display::display_confirmation_message(get_lang('ThematicSectionHasBeenCreatedSuccessfull') . '<br />' . sprintf(get_lang('NowYouShouldAddThematicPlanXAndThematicAdvanceX'), $link_to_thematic_plan, $link_to_thematic_advance), false); }
/** * 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">'; if (api_is_allowed_to_edit(null, true)) { echo '<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>'; } echo '<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)) { echo '<a href="index.php?' . api_get_cidreq() . '&action=import">' . Display::return_icon('import_csv.png', get_lang('ImportGlossary'), '', ICON_SIZE_MEDIUM) . '</a>'; } echo '<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($glossaryView) && $glossaryView == 'table' or !isset($glossaryView)) { echo '<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 { echo '<a href="index.php?' . api_get_cidreq() . '&action=changeview&view=table">' . Display::return_icon('view_text.png', get_lang('TableView'), '', ICON_SIZE_MEDIUM) . '</a>'; } echo '</div>'; if (!$glossaryView || $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(); } }
function display_data($return = false) { $count = array($this, 'count'); $data = array($this, 'get_data'); $parameters = array(); $parameters['sec_token'] = Security::get_token(); $parameters['ceiling'] = $this->get_ceiling(); $parameters['active_only'] = $this->get_active_only() ? 'true' : 'false'; $additional_parameters = $this->get_additional_parameters(); $parameters = array_merge($additional_parameters, $parameters); $table = new SortableTable('users', $count, $data, 1, 50); $table->set_additional_parameters($parameters); $col = 0; $table->set_header($col++, '', false); $table->set_header($col++, get_lang('Code')); $table->set_header($col++, get_lang('FirstName')); $table->set_header($col++, get_lang('LastName')); $table->set_header($col++, get_lang('LoginName')); $table->set_header($col++, get_lang('Email')); $table->set_header($col++, get_lang('Profile')); $table->set_header($col++, get_lang('AuthenticationSource')); $table->set_header($col++, get_lang('RegisteredDate')); $table->set_header($col++, get_lang('LastAccess'), false); $table->set_header($col++, get_lang('Active'), false); $table->set_column_filter(5, array($this, 'format_email')); $table->set_column_filter(6, array($this, 'format_status')); $table->set_column_filter(10, array($this, 'format_active')); $table->set_form_actions(array('activate' => get_lang('Activate'), 'deactivate' => get_lang('Deactivate'), 'delete' => get_lang('Delete'))); if ($return) { return $table->return_table(); } else { echo $table->return_table(); } }
} } return $result; } function hide_field() { return null; } $default_column = 3; $table = new SortableTable('user_list', 'get_number_of_users', 'get_user_data', $default_column); $parameters['keyword'] = isset($_GET['keyword']) ? Security::remove_XSS($_GET['keyword']) : null; $parameters['sec_token'] = Security::get_token(); $table->set_additional_parameters($parameters); $header_nr = 0; $indexList = array(); $table->set_header($header_nr++, '', false); $indexList['photo'] = $header_nr; $table->set_header($header_nr++, get_lang('Photo'), false); $table->set_header($header_nr++, get_lang('OfficialCode')); $indexList['official_code'] = $header_nr; if ($is_western_name_order) { $indexList['firstname'] = $header_nr; $table->set_header($header_nr++, get_lang('FirstName')); $indexList['lastname'] = $header_nr; $table->set_header($header_nr++, get_lang('LastName')); } else { $indexList['lastname'] = $header_nr; $table->set_header($header_nr++, get_lang('LastName')); $indexList['firstname'] = $header_nr; $table->set_header($header_nr++, get_lang('FirstName')); }
$table = new SortableTable('courses', 'get_number_of_courses', 'get_course_data', 2); } $parameters = array(); if (isset($_GET['keyword'])) { $parameters = array('keyword' => Security::remove_XSS($_GET['keyword'])); } elseif (isset($_GET['keyword_code'])) { $parameters['keyword_code'] = Security::remove_XSS($_GET['keyword_code']); $parameters['keyword_title'] = Security::remove_XSS($_GET['keyword_title']); $parameters['keyword_category'] = Security::remove_XSS($_GET['keyword_category']); $parameters['keyword_language'] = Security::remove_XSS($_GET['keyword_language']); $parameters['keyword_visibility'] = Security::remove_XSS($_GET['keyword_visibility']); $parameters['keyword_subscribe'] = Security::remove_XSS($_GET['keyword_subscribe']); $parameters['keyword_unsubscribe'] = Security::remove_XSS($_GET['keyword_unsubscribe']); } $table->set_additional_parameters($parameters); $table->set_header(0, '', false, 'width="8px"'); $table->set_header(1, get_lang('Title'), true, 'width="360px"'); $table->set_header(2, get_lang('Code')); $table->set_header(3, get_lang('Language'), true, 'width="70px"'); $table->set_header(4, get_lang('Category')); $table->set_header(5, get_lang('SubscriptionAllowed'), true, 'width="60px"'); $table->set_header(6, get_lang('UnsubscriptionAllowed'), false, 'width="50px"'); //$table->set_header(7, get_lang('Teacher')); $table->set_header(7, get_lang('Action'), false, 'width="160px"', array('class' => 'td_actions')); $table->set_column_filter(7, 'modify_filter'); $table->set_form_actions(array('delete_courses' => get_lang('DeleteCourse')), 'course'); $content .= $table->return_table(); } $tpl = new Template($tool_name); $tpl->assign('actions', $actions); $tpl->assign('message', $message);
/** * @return string */ static function outbox_display() { $social_link = false; if (isset($_REQUEST['f']) && $_REQUEST['f'] == 'social') { $social_link = 'f=social'; } $success = get_lang('SelectedMessagesDeleted') . ' </b><br /><a href="outbox.php?' . $social_link . '">' . get_lang('BackToOutbox') . '</a>'; $html = null; if (isset($_REQUEST['action'])) { switch ($_REQUEST['action']) { case 'delete': $number_of_selected_messages = count($_POST['id']); if ($number_of_selected_messages != 0) { foreach ($_POST['id'] as $index => $message_id) { MessageManager::delete_message_by_user_receiver(api_get_user_id(), $message_id); } } $html .= Display::return_message(api_xml_http_response_encode($success), 'normal', false); break; case 'deleteone': MessageManager::delete_message_by_user_receiver(api_get_user_id(), $_GET['id']); $html .= Display::return_message(api_xml_http_response_encode($success), 'normal', false); $html .= '<br/>'; break; } } // display sortable table with messages of the current user $table = new SortableTable('message_outbox', array('MessageManager', 'get_number_of_messages_sent'), array('MessageManager', 'get_message_data_sent'), 3, 20, 'DESC'); $parameters['f'] = isset($_GET['f']) && $_GET['f'] == 'social' ? 'social' : null; $table->set_additional_parameters($parameters); $table->set_header(0, '', false, array('style' => 'width:15px;')); $table->set_header(1, get_lang('Messages'), false); $table->set_header(2, get_lang('Date'), true, array('style' => 'width:160px;')); $table->set_header(3, get_lang('Modify'), false, array('style' => 'width:70px;')); $table->set_form_actions(array('delete' => get_lang('DeleteSelectedMessages'))); $html .= $table->return_table(); return $html; }
echo Display::page_subheader(get_lang('GroupTutors')); if (!empty($tutor_info)) { echo $tutor_info; } echo '<br />'; /* * List all the members of the current group */ echo Display::page_subheader(get_lang('GroupMembers')); $table = new SortableTable('group_users', 'get_number_of_group_users', 'get_group_user_data', (api_is_western_name_order() xor api_sort_by_first_name()) ? 2 : 1); $my_cidreq = isset($_GET['cidReq']) ? Security::remove_XSS($_GET['cidReq']) : ''; $my_origin = isset($_GET['origin']) ? Security::remove_XSS($_GET['origin']) : ''; $my_gidreq = isset($_GET['gidReq']) ? Security::remove_XSS($_GET['gidReq']) : ''; $parameters = array('cidReq' => $my_cidreq, 'origin' => $my_origin, 'gidReq' => $my_gidreq); $table->set_additional_parameters($parameters); $table->set_header(0, ''); if (api_is_western_name_order()) { $table->set_header(1, get_lang('FirstName')); $table->set_header(2, get_lang('LastName')); } else { $table->set_header(1, get_lang('LastName')); $table->set_header(2, get_lang('FirstName')); } if (api_get_setting('display.show_email_addresses') == 'true') { $table->set_header(3, get_lang('Email')); $table->set_column_filter(3, 'email_filter'); } else { if (api_is_allowed_to_edit() == 'true') { $table->set_header(3, get_lang('Email')); $table->set_column_filter(3, 'email_filter'); }
} echo '<div class="actions">'; echo '<a href="index.php?' . api_get_cidreq() . $param_gradebook . '&action=attendance_add">' . Display::return_icon('new_attendance_list.png', get_lang('CreateANewAttendance'), '', ICON_SIZE_MEDIUM) . '</a>'; /*echo '<a href="index.php?'.api_get_cidreq().$param_gradebook.'&action=calendar_logins">'. Display::return_icon('attendance_list.png',get_lang('Logins'),'',ICON_SIZE_MEDIUM).'</a>';*/ echo '</div>'; } $attendance = new Attendance(); if ($attendance->get_number_of_attendances() == 0) { $attendance->set_name(get_lang('Attendances')); $attendance->set_description(get_lang('Attendances')); $attendance->attendance_add(); } $table = new SortableTable('attendance_list', array('Attendance', 'get_number_of_attendances'), array('Attendance', 'get_attendance_data'), $default_column); $table->set_additional_parameters($parameters); $table->set_header(0, '', false, array('style' => 'width:20px;')); $table->set_header(1, get_lang('Name'), true); $table->set_header(2, get_lang('Description'), true); $table->set_header(3, get_lang('CountDoneAttendance'), true, array('style' => 'width:90px;')); if (api_is_allowed_to_edit(null, true)) { $table->set_header(4, get_lang('Actions'), false, array('style' => 'text-align:center')); $actions = array('attendance_set_invisible_select' => get_lang('SetInvisible'), 'attendance_set_visible_select' => get_lang('SetVisible')); $allow = api_get_configuration_value('allow_delete_attendance'); if ($allow) { $actions['attendance_delete_select'] = get_lang('DeleteAllSelectedAttendances'); } $table->set_form_actions($actions); } if ($table->get_total_number_of_items() > 0) { $table->display(); }
public static function displayTrackingAccessOverView($courseId, $sessionId, $studentId) { $courseId = intval($courseId); $sessionId = intval($sessionId); $studentId = intval($studentId); $em = Database::getManager(); $sessionRepo = $em->getRepository('ChamiloCoreBundle:Session'); $courseList = []; $sessionList = []; $studentList = []; if (!empty($courseId)) { $course = $em->find('ChamiloCoreBundle:Course', $courseId); $courseList[$course->getId()] = $course->getTitle(); } if (!empty($sessionId)) { $session = $em->find('ChamiloCoreBundle:Session', $sessionId); $sessionList[$session->getId()] = $session->getName(); } if (!empty($studentId)) { $student = $em->find('ChamiloUserBundle:User', $studentId); $studentList[$student->getId()] = $student->getCompleteName(); } $form = new FormValidator('access_overview', 'GET'); $form->addElement('select_ajax', 'course_id', get_lang('SearchCourse'), $courseList, ['url' => api_get_path(WEB_AJAX_PATH) . 'course.ajax.php?' . http_build_query(['a' => 'search_course_by_session_all', 'session_id' => $sessionId])]); $form->addElement('select_ajax', 'session_id', get_lang('SearchSession'), $sessionList, ['url_function' => "\n function () {\n var params = \$.param({\n a: 'search_session_by_course',\n course_id: \$('#course_id').val() || 0\n });\n\n return '" . api_get_path(WEB_AJAX_PATH) . "session.ajax.php?' + params;\n }\n "]); $form->addSelect('profile', get_lang('Profile'), ['' => get_lang('Select'), STUDENT => get_lang('Student'), COURSEMANAGER => get_lang('CourseManager'), DRH => get_lang('Drh')], ['id' => 'profile']); $form->addElement('select_ajax', 'student_id', get_lang('SearchUsers'), $studentList, ['placeholder' => get_lang('All'), 'url_function' => "\n function () {\n var params = \$.param({\n a: 'search_user_by_course',\n session_id: \$('#session_id').val(),\n course_id: \$('#course_id').val()\n });\n\n return '" . api_get_path(WEB_AJAX_PATH) . "course.ajax.php?' + params;\n }\n "]); $form->addDateRangePicker('date', get_lang('DateRange'), true, ['id' => 'date_range', 'format' => 'YYYY-MM-DD', 'timePicker' => 'false', 'validate_format' => 'Y-m-d']); $form->addHidden('display', 'accessoverview'); $form->addRule('course_id', get_lang('Required'), 'required'); $form->addRule('profile', get_lang('Required'), 'required'); $form->addButton('submit', get_lang('Generate'), 'gear', 'primary'); $table = null; if ($form->validate()) { $table = new SortableTable('tracking_access_overview', ['MySpace', 'getNumberOfRrackingAccessOverview'], ['MySpace', 'getUserDataAccessTrackingOverview'], 0); $table->additional_parameters = $form->exportValues(); $table->set_header(0, get_lang('LoginDate'), true); $table->set_header(1, get_lang('Username'), true); if (api_is_western_name_order()) { $table->set_header(2, get_lang('FirstName'), true); $table->set_header(3, get_lang('LastName'), true); } else { $table->set_header(2, get_lang('LastName'), true); $table->set_header(3, get_lang('FirstName'), true); } $table->set_header(4, get_lang('Clicks'), false); $table->set_header(5, get_lang('IP'), false); $table->set_header(6, get_lang('TimeLoggedIn'), false); } $template = new Template(null, false, false, false, false, false, false); $template->assign('form', $form->returnForm()); $template->assign('table', $table ? $table->return_table() : null); echo $template->fetch($template->get_template('my_space/accessoverview.tpl')); }
//$form->addElement('text','title',get_lang('FieldTitle')); //$form->addElement('text','default',get_lang('FieldDefaultValue')); //$form->addElement('submit','submit',get_lang('Search')); $form->addElement('static', 'search_advanced_link', null, '<a href="user_fields_add.php?action=fill">' . Display::return_icon('add_user_fields.png', get_lang('AddUserField'), '', ICON_SIZE_MEDIUM) . '</a>'); echo '<div class="actions">'; $form->display(); echo '</div>'; // Create a sortable table with user-data $parameters['sec_token'] = Security::get_token(); //$column_show = array(1,1,1,1,1,1,1,1,1,0,0); //$column_order = array(1,2,3,4,5,6,7,8,9,10,11); $extra_fields = UserManager::get_extra_fields(); $number_of_extra_fields = count($extra_fields); $table = new SortableTable('user_field', array('UserManager', 'get_number_of_extra_fields'), array('UserManager', 'get_extra_fields'), 5); $table->set_additional_parameters($parameters); $table->set_header(0, '', false); $table->set_header(1, get_lang('FieldLabel'), false); $table->set_header(2, get_lang('FieldType'), false); $table->set_header(3, get_lang('FieldTitle'), false); $table->set_header(4, get_lang('FieldDefaultValue'), false); $table->set_header(5, get_lang('FieldOrder'), false); $table->set_header(6, get_lang('FieldVisibility'), false); $table->set_header(7, get_lang('FieldChangeability'), false); $table->set_header(8, get_lang('FieldFilter'), false); $table->set_header(9, get_lang('Modify'), false); $table->set_column_filter(5, 'order_filter'); $table->set_column_filter(6, 'modify_visibility'); $table->set_column_filter(7, 'modify_changeability'); $table->set_column_filter(8, 'modify_field_filter'); $table->set_column_filter(9, 'edit_filter'); $table->set_column_filter(2, 'type_filter');
// BEGIN : form to remind inactives susers $form = new FormValidator('reminder_form', 'get', api_get_path(REL_CODE_PATH) . 'announcements/announcements.php'); $renderer = $form->defaultRenderer(); $renderer->setElementTemplate('<span>{label} {element}</span> <button class="save" type="submit">' . get_lang('SendNotification') . '</button>', 'since'); $options = array(2 => '2 ' . get_lang('Days'), 3 => '3 ' . get_lang('Days'), 4 => '4 ' . get_lang('Days'), 5 => '5 ' . get_lang('Days'), 6 => '6 ' . get_lang('Days'), 7 => '7 ' . get_lang('Days'), 15 => '15 ' . get_lang('Days'), 30 => '30 ' . get_lang('Days')); $el = $form->addElement('select', 'since', '<img width="22" align="middle" src="' . api_get_path(WEB_IMG_PATH) . 'messagebox_warning.gif" border="0" />' . get_lang('RemindInactivesLearnersSince'), $options); $el->setSelected(7); $form->addElement('hidden', 'action', 'add'); $form->addElement('hidden', 'remindallinactives', 'true'); $form->display(); // END : form to remind inactives susers $tracking_column = isset($_GET['tracking_column']) ? $_GET['tracking_column'] : 0; $tracking_direction = isset($_GET['tracking_direction']) ? $_GET['tracking_direction'] : 'DESC'; if (count($a_students) > 0) { $table = new SortableTable('tracking', 'count_student_in_course'); $table->set_header(0, get_lang('OfficialCode'), false, 'align="center"'); $table->set_header(1, get_lang('LastName'), true, 'align="center"'); $table->set_header(2, get_lang('FirstName'), false, 'align="center"'); $table->set_header(3, get_lang('TrainingTime'), false); $table->set_header(4, get_lang('CourseProgress'), false); $table->set_header(5, get_lang('Score'), false); $table->set_header(6, get_lang('Student_publication'), false); $table->set_header(7, get_lang('Messages'), false); $table->set_header(8, get_lang('FirstLogin'), false, 'align="center"'); $table->set_header(9, get_lang('LatestLogin'), false, 'align="center"'); $table->set_header(10, get_lang('Details'), false); if ($export_csv) { $csv_content[] = array(); } $all_datas = array(); $course_code = $_course['id'];
if (isset($_GET['action'])) { if ($_GET['action'] == 'show_message') { Display::display_normal_message(Security::remove_XSS(stripslashes($_GET['message']))); } Security::clear_token(); } $legal_count = LegalManager::count(); $languages = api_get_languages(); $available_languages = count($languages); if ($legal_count != $available_languages) { Display::display_warning_message(get_lang('YouShouldCreateTermAndConditionsForAllAvailableLanguages')); } //if ($legal_count < ) $table = new SortableTable('conditions', 'count_mask', 'get_legal_data_mask', 2); $table->set_additional_parameters($parameters); $table->set_header(0, get_lang('Version'), false, 'width="15px"'); $table->set_header(1, get_lang('Language'), false, 'width="30px"'); $table->set_header(2, get_lang('Content'), false); $table->set_header(3, get_lang('Changes'), false, 'width="60px"'); $table->set_header(4, get_lang('Type'), false, 'width="60px"'); $table->set_header(5, get_lang('Date'), false, 'width="50px"'); $table->display(); // this 2 "mask" function are here just because the SortableTable function get_legal_data_mask($id, $params = null, $row = null) { return LegalManager::get_legal_data($id, $params, $row); } function count_mask() { return LegalManager::count(); }
Display::display_header($tool_name); api_display_tool_title($tool_name); echo $msg; if ($_GET['action'] == 'blackout') { $result = Rsys::black_out_changer($_GET['id']); Display::display_normal_message(get_lang('BlackoutPage' . $result), false); } echo '<form id="cat_form" action="m_item.php" method="get"><div style="float: left;"><a href="m_item.php?action=add">' . get_lang('AddNewItem') . '</a></div><div style="text-align: right;">' . get_lang('CategoryFilter') . ': <select name="cat" onchange="this.form.submit();"><option value="0">*** ' . get_lang('All') . ' ***</option>'; $cats = Rsys::get_category_with_items_manager(); foreach ($cats as $cat) { echo '<option value="' . $cat['id'] . '"' . ($cat['id'] == $_GET['cat'] ? ' selected="selected"' : '') . '>' . $cat['name'] . '</option>'; } echo '</select></div></form>'; echo "hier"; $table = new SortableTable('item', array('Rsys', 'get_num_items'), array('Rsys', 'get_table_items'), 1); echo "hier2"; $table->set_additional_parameters(array('cat' => $_GET['cat'])); $table->set_header(0, '', false, array('style' => 'width:10px')); $table->set_header(1, get_lang('ItemName'), true); $table->set_header(2, get_lang('ItemDescription'), true); $table->set_header(3, get_lang('Category'), true); $table->set_header(4, get_lang('ItemCreator'), true); $table->set_header(5, '', false, array('style' => 'width:100px;')); $table->set_column_filter(5, 'modify_filter'); $table->set_form_actions(array('delete_items' => get_lang('DeleteSelectedItems')), 'items'); $table->display(); } /** --------------------------------------------------------------------- */ Display::display_footer();
function display_survey_list_for_coach() { $parameters = array(); $parameters['cidReq'] = api_get_course_id(); if (isset($_GET['do_search'])) { $message = get_lang('DisplaySearchResults') . '<br />'; $message .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '">' . get_lang('DisplayAll') . '</a>'; Display::display_normal_message($message, false); } // Create a sortable table with survey-data $table = new SortableTable('surveys_coach', 'get_number_of_surveys_for_coach', 'get_survey_data_for_coach', 2); $table->set_additional_parameters($parameters); $table->set_header(0, '', false); $table->set_header(1, get_lang('SurveyName')); $table->set_header(2, get_lang('SurveyCode')); $table->set_header(3, get_lang('NumberOfQuestions')); $table->set_header(4, get_lang('Author')); //$table->set_header(5, get_lang('Language')); //$table->set_header(6, get_lang('Shared')); $table->set_header(5, get_lang('AvailableFrom')); $table->set_header(6, get_lang('AvailableUntil')); $table->set_header(7, get_lang('Invite')); $table->set_header(8, get_lang('Anonymous')); $table->set_header(9, get_lang('Modify'), false, 'width="130"'); $table->set_column_filter(8, 'anonymous_filter'); $table->set_column_filter(9, 'modify_filter_for_coach'); $table->display(); }
/** * 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(); } }
if ($start_date_error) { $msg_error .= get_lang('YouMustSelectAtleastAStartDate') . '<br />'; } if ($duration_error) { $msg_error .= get_lang('DurationInHoursMustBeNumeric'); } if (!empty($msg_error)) { Display::display_error_message($msg_error, false); } $form->display(); } else { if ($action == 'thematic_advance_list') { // thematic advance list echo '<div class="actions">'; echo '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=thematic_details">' . Display::return_icon('back.png', get_lang("BackTo"), '', ICON_SIZE_MEDIUM) . '</a>'; if (api_is_allowed_to_edit(false, true)) { echo '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=thematic_advance_add&thematic_id=' . $thematic_id . '"> ' . Display::return_icon('add.png', get_lang('NewThematicAdvance'), '', ICON_SIZE_MEDIUM) . '</a>'; } echo '</div>'; $table = new SortableTable('thematic_advance_list', array('Thematic', 'get_number_of_thematic_advances'), array('Thematic', 'get_thematic_advance_data')); $table->set_additional_parameters($parameters); $table->set_header(0, '', false, array('style' => 'width:20px;')); $table->set_header(1, get_lang('StartDate'), false); $table->set_header(2, get_lang('DurationInHours'), false, array('style' => 'width:80px;')); $table->set_header(3, get_lang('Content'), false); if (api_is_allowed_to_edit(null, true)) { $table->set_header(4, get_lang('Actions'), false, array('style' => 'text-align:center')); } $table->display(); } }
$is_western_name_order = api_is_western_name_order(); } $sort_by_first_name = api_sort_by_first_name(); $tracking_column = isset($_GET['tracking_list_coaches_column']) ? $_GET['tracking_list_coaches_column'] : ($is_western_name_order xor $sort_by_first_name) ? 1 : 0; $tracking_direction = isset($_GET['tracking_list_coaches_direction']) && in_array(strtoupper($_GET['tracking_list_coaches_direction']), array('ASC', 'DESC', 'ASCENDING', 'DESCENDING', '0', '1')) ? $_GET['tracking_list_coaches_direction'] : 'DESC'; // Prepare array for column order - when impossible, use some of user names. if ($is_western_name_order) { $order = array(0 => 'firstname', 1 => 'lastname', 2 => $sort_by_first_name ? 'firstname' : 'lastname', 3 => 'login_date', 4 => $sort_by_first_name ? 'firstname' : 'lastname', 5 => $sort_by_first_name ? 'firstname' : 'lastname'); } else { $order = array(0 => 'lastname', 1 => 'firstname', 2 => $sort_by_first_name ? 'firstname' : 'lastname', 3 => 'login_date', 4 => $sort_by_first_name ? 'firstname' : 'lastname', 5 => $sort_by_first_name ? 'firstname' : 'lastname'); } $table = new SortableTable('tracking_list_coaches_myspace', 'count_coaches', null, ($is_western_name_order xor $sort_by_first_name) ? 1 : 0); $parameters['view'] = 'admin'; $table->set_additional_parameters($parameters); if ($is_western_name_order) { $table->set_header(0, get_lang('FirstName'), true); $table->set_header(1, get_lang('LastName'), true); } else { $table->set_header(0, get_lang('LastName'), true); $table->set_header(1, get_lang('FirstName'), true); } $table->set_header(2, get_lang('TimeSpentOnThePlatform'), false); $table->set_header(3, get_lang('LastConnexion'), false); $table->set_header(4, get_lang('NbStudents'), false); $table->set_header(5, get_lang('CountCours'), false); $table->set_header(6, get_lang('NumberOfSessions'), false); $table->set_header(7, get_lang('Sessions'), false); if ($is_western_name_order) { $csv_header[] = array(get_lang('FirstName', ''), get_lang('LastName', ''), get_lang('TimeSpentOnThePlatform', ''), get_lang('LastConnexion', ''), get_lang('NbStudents', ''), get_lang('CountCours', ''), get_lang('NumberOfSessions', '')); } else { $csv_header[] = array(get_lang('LastName', ''), get_lang('FirstName', ''), get_lang('TimeSpentOnThePlatform', ''), get_lang('LastConnexion', ''), get_lang('NbStudents', ''), get_lang('CountCours', ''), get_lang('NumberOfSessions', ''));
$actions .= Display::url(Display::return_icon('stats.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH) . "auth/my_progress.php"); $actions .= Display::url(Display::return_icon('user_na.png', get_lang('Students'), array(), ICON_SIZE_MEDIUM), '#'); $actions .= Display::url(Display::return_icon("statistics.png", get_lang("CompanyReport"), array(), ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH) . "mySpace/company_reports.php"); $actions .= Display::url(Display::return_icon("certificate_list.png", get_lang("GradebookSeeListOfStudentsCertificates"), [], ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH) . "gradebook/certificate_report.php"); } } $actions .= '<span style="float:right">'; $actions .= Display::url(Display::return_icon('printer.png', get_lang('Print'), array(), ICON_SIZE_MEDIUM), 'javascript: void(0);', array('onclick' => 'javascript: window.print();')); $actions .= Display::url(Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), array(), ICON_SIZE_MEDIUM), api_get_self() . '?export=csv&keyword=' . $keyword); $actions .= '</span>'; $actions .= '</div>'; $table = new SortableTable('tracking_student', '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) { $csv_header[] = array(get_lang('FirstName'), get_lang('LastName'), get_lang('FirstLogin'), get_lang('LastConnexion')); } else { $csv_header[] = array(get_lang('LastName'), get_lang('FirstName'), get_lang('FirstLogin'), get_lang('LastConnexion')); } }
if ($_GET['action'] == 'error_message') { Display::display_error_message(stripslashes($_GET['message']), false); } } if ($show_import_icon) { echo "<div align=\"right\">"; echo '<a href="user_import.php?id_session=' . $id_session . '&action=export&type=xml">' . Display::return_icon('excel.gif', get_lang('ImportUserListXMLCSV')) . ' ' . get_lang('ImportUserListXMLCSV') . '</a>'; echo "</div><br />"; } if (!api_is_drh() && !api_is_session_admin() && !api_is_platform_admin()) { $courses = Tracking::get_courses_followed_by_coach($_user['user_id'], $id_session); $a_courses = array_keys($courses); } $nb_courses = count($a_courses); $table = new SortableTable('tracking_list_course', 'count_courses'); $table->set_header(0, get_lang('CourseTitle'), false); $table->set_header(1, get_lang('NbStudents'), false); $table->set_header(2, get_lang('TimeSpentInTheCourse') . Display::return_icon('info3.gif', get_lang('TimeOfActiveByTraining'), array('align' => 'absmiddle', 'hspace' => '3px')), false); $table->set_header(3, get_lang('ThematicAdvance'), false); $table->set_header(4, get_lang('AvgStudentsProgress') . Display::return_icon('info3.gif', get_lang('AvgAllUsersInAllCourses'), array('align' => 'absmiddle', 'hspace' => '3px')), false); $table->set_header(5, get_lang('AvgCourseScore') . Display::return_icon('info3.gif', get_lang('AvgAllUsersInAllCourses'), array('align' => 'absmiddle', 'hspace' => '3px')), false); //$table -> set_header(5, get_lang('AvgExercisesScore'), false);// no code for this? $table->set_header(6, get_lang('AvgMessages'), false); $table->set_header(7, get_lang('AvgAssignments'), false); $table->set_header(8, get_lang('Details'), false); $csv_header[] = array(get_lang('CourseTitle', ''), get_lang('NbStudents', ''), get_lang('TimeSpentInTheCourse', ''), get_lang('ThematicAdvance', ''), get_lang('AvgStudentsProgress', ''), get_lang('AvgCourseScore', ''), get_lang('AvgMessages', ''), get_lang('AvgAssignments', '')); if (is_array($a_courses)) { foreach ($a_courses as $courseId) { $courseId = intval($courseId); $nb_students_in_course = 0; $course = api_get_course_info_by_id($courseId);
} } return $result; } function hide_field() { return null; } $default_column = 3; $table = new SortableTable('user_list', 'get_number_of_users', 'get_user_data', $default_column); $parameters['keyword'] = isset($_GET['keyword']) ? Security::remove_XSS($_GET['keyword']) : null; // Create a sortable table with user-data $parameters['sec_token'] = Security::get_token(); $table->set_additional_parameters($parameters); $header_nr = 0; $table->set_header($header_nr++, '', false); $table->set_header($header_nr++, get_lang('Photo'), false); $table->set_header($header_nr++, get_lang('OfficialCode')); if ($is_western_name_order) { $table->set_header($header_nr++, get_lang('FirstName')); $table->set_header($header_nr++, get_lang('LastName')); } else { $table->set_header($header_nr++, get_lang('LastName')); $table->set_header($header_nr++, get_lang('FirstName')); } $table->set_header($header_nr++, get_lang('LoginName')); // $table->set_header($header_nr++, get_lang('Description'), false); $table->set_header($header_nr++, get_lang('GroupSingle'), false); if (api_is_allowed_to_edit(null, true) && api_get_setting('allow_user_course_subscription_by_course_admin') == 'true') { } else {
$form->addElement('select', 'keyword_status', get_lang('Profile'), $status_options); $active_group = array(); $active_group[] = $form->createElement('checkbox', 'keyword_active', '', get_lang('Active')); $active_group[] = $form->createElement('checkbox', 'keyword_inactive', '', get_lang('Inactive')); $form->addGroup($active_group, '', get_lang('ActiveAccount'), '<br/>', false); $form->addElement('checkbox', 'check_easy_passwords', null, get_lang('CheckEasyPasswords')); $form->addButtonSearch(get_lang('SearchUsers')); $defaults = array(); $defaults['keyword_active'] = 1; $defaults['keyword_inactive'] = 1; $form->setDefaults($defaults); $form->addElement('html', '</div>'); $form = $form->returnForm(); $table = new SortableTable('users', 'get_number_of_users', 'get_user_data', (api_is_western_name_order() xor api_sort_by_first_name()) ? 3 : 2); $table->set_additional_parameters($parameters); $table->set_header(0, '', false, 'width="18px"'); $table->set_header(1, get_lang('Photo'), false); $table->set_header(2, get_lang('OfficialCode')); if (api_is_western_name_order()) { $table->set_header(3, get_lang('FirstName')); $table->set_header(4, get_lang('LastName')); } else { $table->set_header(3, get_lang('LastName')); $table->set_header(4, get_lang('FirstName')); } $table->set_header(5, get_lang('LoginName')); $table->set_header(6, get_lang('Email')); $table->set_header(7, get_lang('Profile')); $table->set_header(8, get_lang('Active'), true, 'width="15px"'); $table->set_header(9, get_lang('RegistrationDate'), true, 'width="90px"'); $table->set_header(10, get_lang('Action'), false, 'width="220px"');
case 'show_message': $message = Display::return_message(Security::remove_XSS(stripslashes($_GET['message']))); break; } } // Create a search-box $form = new FormValidator('search_simple', 'get', '', '', null, false); $renderer =& $form->defaultRenderer(); $renderer->setElementTemplate('<span>{element}</span> '); $form->addElement('text', 'keyword', get_lang('keyword')); $form->addElement('button', 'submit', get_lang('Search')); $content .= $form->return_form(); // Create the sortable table with class information $table = new SortableTable('classes', 'get_number_of_classes', 'get_class_data', 1); $table->set_additional_parameters(array('keyword' => $_GET['keyword'])); $table->set_header(0, '', false); $table->set_header(1, get_lang('ClassName')); $table->set_header(2, get_lang('NumberOfUsers')); $table->set_header(3, '', false); $table->set_column_filter(3, 'modify_filter'); $table->set_form_actions(array('delete_classes' => get_lang('DeleteSelectedClasses')), 'class'); $content .= $table->return_table(); $actions .= Display::url(Display::return_icon('add.png', get_lang('Add'), array(), ICON_SIZE_MEDIUM), 'class_add.php'); $actions .= Display::url(Display::return_icon('import_csv.png', get_lang('AddUsersToAClass'), array(), ICON_SIZE_MEDIUM), 'class_user_import.php'); $actions .= Display::url(Display::return_icon('import_csv.png', get_lang('ImportClassListCSV'), array(), ICON_SIZE_MEDIUM), 'class_import.php'); $app['title'] = $tool_name; $tpl = $app['template']; $tpl->assign('content', $content); $tpl->assign('actions', $actions); $tpl->assign('message', $message); $tpl->display_one_col_template();
} if (!empty($_SESSION['session_user_id'])) { unset($_SESSION['session_user_id']); } if (!empty($_SESSION['session_user_name'])) { unset($_SESSION['session_user_name']); } $is_western_name_order = api_is_western_name_order(); $sort_by_first_name = api_sort_by_first_name(); // Build table $table = new SortableTable('subscribe_users', 'get_number_of_users', 'get_user_data', ($is_western_name_order xor $sort_by_first_name) ? 3 : 2); $parameters['keyword'] = isset($_REQUEST['keyword']) ? Security::remove_XSS($_REQUEST['keyword']) : null; $parameters['type'] = isset($_REQUEST['type']) ? $type : null; $table->set_additional_parameters($parameters); $col = 0; $table->set_header($col++, '', false); $table->set_header($col++, get_lang('OfficialCode')); if (api_is_western_name_order()) { $table->set_header($col++, get_lang('FirstName')); $table->set_header($col++, get_lang('LastName')); } else { $table->set_header($col++, get_lang('LastName')); $table->set_header($col++, get_lang('FirstName')); } if (api_get_setting('show_email_addresses') == 'true') { $table->set_header($col++, get_lang('Email')); $table->set_column_filter($col - 1, 'email_filter'); } $table->set_header($col++, get_lang('Active'), false); $table->set_column_filter($col - 1, 'active_filter'); $table->set_header($col++, get_lang('Actions'), false);
$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']); } echo '<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>'; echo '</span>'; echo '</div>'; // Create a search-box. $form = new FormValidator('search_simple', 'GET', api_get_path(WEB_CODE_PATH) . 'tracking/course_log_resources.php?' . api_get_cidreq() . '&id_session' . $session_id, '', array('class' => 'form-search'), false); $renderer = $form->defaultRenderer(); $renderer->setCustomElementTemplate('<span>{element}</span>'); $form->addElement('text', 'keyword', get_lang('Keyword')); $form->addElement('hidden', 'cidReq', api_get_course_id()); $form->addElement('hidden', 'id_session', $session_id); $form->addButtonSearch(get_lang('SearchUsers'), 'submit'); echo '<div class="actions">'; $form->display(); echo '</div>'; $table = new SortableTable('resources', array('TrackingCourseLog', 'count_item_resources'), array('TrackingCourseLog', 'get_item_resources_data'), 5, 20, 'DESC'); $parameters = array('id_session' => $session_id, 'cidReq' => api_get_course_id()); $table->set_additional_parameters($parameters); $table->set_header(0, get_lang('Tool')); $table->set_header(1, get_lang('EventType')); $table->set_header(2, get_lang('Session'), false); $table->set_header(3, get_lang('UserName'), true, 'width=65px'); $table->set_header(4, get_lang('IPAddress'), true, 'width=100px'); $table->set_header(5, get_lang('Document'), false); $table->set_header(6, get_lang('Date'), true, 'width=190px'); $table->display(); Display::display_footer();
$start_date = Database::escape_string($_POST['keyword_start_date_start']); $end_date = Database::escape_string($_POST['keyword_start_date_end']); if ($start_date != '' || $end_date != '') { $sql .= " HAVING "; if ($start_date != '') $sql .= " access_date >= '$start_date' "; if ($end_date != '') { $sql = ($start_date == '') ? $sql : ($sql . " AND "); $sql .= " access_date <= '$end_date' "; } } $result = Database::query($sql); $table_result = new SortableTable(); $table_result->set_header(0, get_lang('User'), false); $table_result->set_header(1, get_lang('Fullname'), false); $table_result->set_header(2, get_lang('Date'), false); $table_result->set_header(3, get_lang('Course'), false); $table_result->set_header(4, get_lang('Tool'), false); while ($row = Database::fetch_assoc($result)) { $row = array( $row['username'], $row['fullname'], $row['access_date'], $row['course'], get_lang($tools[$row['tool']]['name']) ); $table_result->addRow($row); } $table_result->display();
$user_ids = array_keys($a_students); $table = new SortableTable( 'users_tracking', array('TrackingCourseLog', 'get_number_of_users'), array('TrackingCourseLog', 'get_user_data'), (api_is_western_name_order() xor api_sort_by_first_name()) ? 3 : 2); $parameters['cidReq'] = Security::remove_XSS($_GET['cidReq']); $parameters['id_session'] = $session_id; $parameters['from'] = isset($_GET['myspace']) ? Security::remove_XSS($_GET['myspace']) : null; $table->set_additional_parameters($parameters); $tab_table_header = array(); // tab of header texts $table->set_header(0, get_lang('OfficialCode'), true); $tab_table_header[] = get_lang('OfficialCode'); if ($is_western_name_order) { $table->set_header(1, get_lang('FirstName'), true); $tab_table_header[] = get_lang('FirstName'); $table->set_header(2, get_lang('LastName'), true); $tab_table_header[] = get_lang('LastName'); } else { $table->set_header(1, get_lang('LastName'), true); $tab_table_header[] = get_lang('LastName'); $table->set_header(2, get_lang('FirstName'), true); $tab_table_header[] = get_lang('FirstName'); } $table->set_header(3, get_lang('Login'), false); $tab_table_header[] = get_lang('Login');
Display::display_warning_message($message); echo ' <div class="actions"> <span style="float: right;"> </span> <form id="search_simple" name="search_simple" method="get" action="' . api_get_self() . '" class="form-search"> <fieldset> <span><label for="keyword">' . get_lang('SearchAUser') . ': </label><input type="text" name="keyword" size="25"></span> <span><button type="submit" name="submit" class="btn btn">' . get_lang('Search') . '</button></span> <div class="clear"></div> </fieldset> </form> </div>'; echo '<div class="users-list">'; $order = api_is_western_name_order() || api_sort_by_first_name() ? 3 : 2; $table = new SortableTable('users', 'get_number_of_users', 'get_user_data', $order, 10); $table->set_header(0, '', false, 'width="18px"'); $table->set_header(0, get_lang('Photo'), false); $table->set_header(1, get_lang('OfficialCode')); if (api_is_western_name_order()) { $table->set_header(2, get_lang('FirstName')); $table->set_header(3, get_lang('LastName')); } else { $table->set_header(2, get_lang('LastName')); $table->set_header(3, get_lang('FirstName')); } $table->set_header(4, get_lang('LoginName')); $table->set_header(5, get_lang('Email')); $table->set_header(6, get_lang('Action')); $table->display(); echo '</div>'; } else {
static function print_activities_stats() { echo '<h4>' . get_lang('ImportantActivities') . '</h4>'; // Create a search-box $form = new FormValidator('search_simple', 'get', api_get_path(WEB_CODE_PATH) . 'admin/statistics/index.php', '', 'width=200px', false); $renderer =& $form->defaultRenderer(); $renderer->setElementTemplate('<span>{element}</span> '); $form->addElement('hidden', 'report', 'activities'); $form->addElement('hidden', 'activities_direction', 'DESC'); $form->addElement('hidden', 'activities_column', '4'); $form->addElement('text', 'keyword', get_lang('keyword')); $form->addElement('style_submit_button', 'submit', get_lang('Search'), 'class="search"'); echo '<div class="actions">'; $form->display(); echo '</div>'; $table = new SortableTable('activities', array('Statistics', 'get_number_of_activities'), array('Statistics', 'get_activities_data'), 5, 50, 'DESC'); $parameters = array(); $parameters['report'] = 'activities'; if (isset($_GET['keyword'])) { $parameters['keyword'] = Security::remove_XSS($_GET['keyword']); } $table->set_additional_parameters($parameters); $table->set_header(0, get_lang('EventType')); $table->set_header(1, get_lang('DataType')); $table->set_header(2, get_lang('Value')); $table->set_header(3, get_lang('UserName')); $table->set_header(4, get_lang('IPAddress')); $table->set_header(5, get_lang('Date')); $table->display(); }
echo '</div>'; if (isset($_GET['keyword'])) { $parameters = array('keyword' => Security::remove_XSS($_GET['keyword'])); } // Create a sortable table with user-data $parameters['sec_token'] = Security::get_token(); // get the list of all admins to mark them in the users list $admin_table = Database::get_main_table(TABLE_MAIN_ADMIN); $sql_admin = "SELECT user_id FROM {$admin_table}"; $res_admin = Database::query($sql_admin); $_admins_list = array(); while ($row_admin = Database::fetch_row($res_admin)) { $_admins_list[] = $row_admin[0]; } $table = new SortableTable('group_list', 'get_number_of_groups', 'get_group_data', 2); $table->set_additional_parameters($parameters); $table->set_header(0, '', false); $table->set_header(1, get_lang('Name')); $table->set_header(2, get_lang('Description')); $table->set_header(3, get_lang('Visibility')); $table->set_header(4, '', false); $table->set_column_filter(4, 'modify_filter'); //$table->set_column_filter(6, 'status_filter'); //$table->set_column_filter(7, 'active_filter'); //$table->set_column_filter(8, 'modify_filter'); if (api_is_platform_admin()) { $table->set_form_actions(array('delete' => get_lang('DeleteFromPlatform'))); } $table->display(); } Display::display_footer();