本文整理汇总了PHP中SortableTable类的典型用法代码示例。如果您正苦于以下问题:PHP SortableTable类的具体用法?PHP SortableTable怎么用?PHP SortableTable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SortableTable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: outbox_display
/**
* @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;
}
示例2: get_lang
}
}
} else {
if (api_is_student_boss()) {
$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'));
示例3: get_lang
$actions .= '<div class="pull-right">';
$actions .= '<a href="course_add.php">' . Display::return_icon('new_course.png', get_lang('AddCourse'), '', ICON_SIZE_MEDIUM) . '</a> ';
if (api_get_setting('course_validation') == 'true') {
$actions .= '<a href="course_request_review.php">' . Display::return_icon('course_request_pending.png', get_lang('ReviewCourseRequests'), '', ICON_SIZE_MEDIUM) . '</a>';
}
$actions .= '</div>';
$actions .= '<div class="pull-right">';
$actions .= $sessionFilter->return_form();
$actions .= '</div>';
$actions .= $form->return_form();
if (isset($_GET['session_id']) && !empty($_GET['session_id'])) {
// Create a sortable table with the course data filtered by session
$table = new SortableTable('courses', 'get_number_of_courses', 'get_course_data_by_session', 2);
} else {
// Create a sortable table with the course data
$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"');
示例4: get_lang
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();
}
}
示例5: api_get_self
} else {
// Show buttons for unsubscribe
if ($course_info['unsubscribe'] == 1) {
if ($user_id == $current_user_id) {
$result .= '<a class="btn btn-small btn-danger" href="' . api_get_self() . '?' . api_get_cidreq() . '&type=' . $type . '&unregister=yes&user_id=' . $user_id . '" title="' . get_lang('Unreg') . ' " onclick="javascript:if(!confirm(\'' . addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)) . '\')) return false;">' . get_lang('Unreg') . '</a> ';
}
}
}
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'));
示例6: SortableTable
$tutor_info .= '<li>';
$tutor_info .= Display::url($userInfo['complete_name'], $userInfo['profile_url']);
$tutor_info .= '</li>';
}
$tutor_info .= '</ul>';
}
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'));
示例7: get_lang
$not_register_user_message = '<br />' . get_lang('UsersNotRegistered') . '<br/><br /><br />' . $list_not_register_user;
Display::display_error_message($not_register_user_message, false);
}
break;
}
}
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'));
示例8: intval
$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();
示例9: get_lang
}
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;
示例10: get_lang
$status_options[SESSIONADMIN] = get_lang('SessionsAdmin');
$status_options[PLATFORM_ADMIN] = get_lang('Administrator');
$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"');
示例11: api_is_western_name_order
} else {
if ($export_csv) {
$is_western_name_order = api_is_western_name_order(PERSON_NAME_DATA_EXPORT);
} else {
$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);
示例12: display_glossary
/**
* 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 <patrick.cool@ugent.be>, 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();
}
}
示例13: api_get_cidreq
if (isset($_SESSION['gradebook'])) {
$param_gradebook = '&gradebook=' . Security::remove_XSS($_SESSION['gradebook']);
}
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) {
示例14: display_data
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();
}
}
示例15: array
$form->display();
if ($export_csv) {
$csv_content = array();
//override the SortableTable "per page" limit if CSV
$_GET['users_tracking_per_page'] = 1000000;
}
$all_datas = array();
$course_code = $_course['id'];
$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');