本文整理汇总了PHP中SortableTable::return_table方法的典型用法代码示例。如果您正苦于以下问题:PHP SortableTable::return_table方法的具体用法?PHP SortableTable::return_table怎么用?PHP SortableTable::return_table使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SortableTable
的用法示例。
在下文中一共展示了SortableTable::return_table方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: FormValidator
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();
示例2: array
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();
}
}
示例3: switch
/**
* @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;
}
示例4: array
$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"');
$table->set_column_filter(3, 'user_filter');
$table->set_column_filter(4, 'user_filter');
$table->set_column_filter(6, 'email_filter');
$table->set_column_filter(7, 'status_filter');
$table->set_column_filter(8, 'active_filter');
$table->set_column_filter(10, 'modify_filter');
// Only show empty actions bar if delete users has been blocked
if (api_is_platform_admin() && !$deleteUserAvailable) {
$table->set_form_actions(array('delete' => get_lang('DeleteFromPlatform')));
} else {
$table->set_form_actions(array('none' => get_lang('NoActionAvailable')));
}
$table_result = $table->return_table();
$extra_search_options = '';
//Try to search the user everywhere
if ($table->get_total_number_of_items() == 0) {
if (api_get_multiple_access_url() && isset($_REQUEST['keyword'])) {
$keyword = Database::escape_string($_REQUEST['keyword']);
$conditions = array('username' => $keyword);
$user_list = UserManager::get_user_list($conditions, array(), false, ' OR ');
if (!empty($user_list)) {
$extra_search_options = Display::page_subheader(get_lang('UsersFoundInOtherPortals'));
$table = new HTML_Table(array('class' => 'data_table'));
$column = 0;
$row = 0;
$headers = array(get_lang('User'), 'URL', get_lang('Actions'));
foreach ($headers as $header) {
$table->setHeaderContents($row, $column, $header);
示例5: displayTrackingAccessOverView
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'));
}
示例6: foreach
$table->set_header(14, get_lang('Details'), false);
$headers['Details'] = get_lang('Details');
}
}
// display buttons to un hide hidden columns
$html .= '<div id="unhideButtons" class="btn-toolbar">';
$index = 0;
$getLangDisplayColumn = get_lang('DisplayColumn');
foreach ($headers as $header) {
$html .= Display::toolbarButton($header, '#', 'arrow-right', 'default', ['title' => htmlentities("{$getLangDisplayColumn} \"{$header}\"", ENT_QUOTES), 'class' => 'hide', 'onclick' => "foldup({$index}); return false;"]);
$index++;
}
$html .= "</div>";
// Display the table
$html .= "<div id='reporting_table'>";
$html .= $table->return_table();
$html .= "</div>";
} else {
$html .= Display::display_warning_message(get_lang('NoUsersInCourse'), true, true);
}
echo Display::panel($html, $titleSession);
// Send the csv file if asked.
if ($export_csv) {
$csv_headers = array();
$csv_headers[] = get_lang('OfficialCode', '');
if ($is_western_name_order) {
$csv_headers[] = get_lang('FirstName', '');
$csv_headers[] = get_lang('LastName', '');
} else {
$csv_headers[] = get_lang('LastName', '');
$csv_headers[] = get_lang('FirstName', '');