/** * @param array $group_list * @param int $category_id */ static function process_groups($group_list, $category_id = null) { global $origin, $charset; $category_id = intval($category_id); $totalRegistered = 0; $group_data = array(); $user_info = api_get_user_info(); $session_id = api_get_session_id(); $user_id = $user_info['user_id']; $orig = isset($origin) ? $origin : null; foreach ($group_list as $this_group) { // Validation when belongs to a session $session_img = api_get_session_image($this_group['session_id'], $user_info['status']); // All the tutors of this group $tutorsids_of_group = self::get_subscribed_tutors($this_group['id'], true); // Create a new table-row $row = array(); // Checkbox if (api_is_allowed_to_edit(false, true) && count($group_list) > 1) { $row[] = $this_group['id']; } // Group name if ((api_is_allowed_to_edit(false, true) || in_array($user_id, $tutorsids_of_group) || $this_group['is_member'] || self::user_has_access($user_id, $this_group['id'], self::GROUP_TOOL_FORUM) || self::user_has_access($user_id, $this_group['id'], self::GROUP_TOOL_DOCUMENTS) || self::user_has_access($user_id, $this_group['id'], self::GROUP_TOOL_CALENDAR) || self::user_has_access($user_id, $this_group['id'], self::GROUP_TOOL_ANNOUNCEMENT) || self::user_has_access($user_id, $this_group['id'], self::GROUP_TOOL_WORK) || self::user_has_access($user_id, $this_group['id'], self::GROUP_TOOL_WIKI)) && !(api_is_course_coach() && intval($this_group['session_id']) != $session_id)) { $group_name = '<a href="group_space.php?cidReq=' . api_get_course_id() . '&origin=' . $orig . '&gidReq=' . $this_group['id'] . '">' . Security::remove_XSS($this_group['name']) . '</a> '; if (!empty($user_id) && !empty($this_group['id_tutor']) && $user_id == $this_group['id_tutor']) { $group_name .= Display::label(get_lang('OneMyGroups'), 'success'); } elseif ($this_group['is_member']) { $group_name .= Display::label(get_lang('MyGroup'), 'success'); } if (api_is_allowed_to_edit() && !empty($this_group['session_name'])) { $group_name .= ' (' . $this_group['session_name'] . ')'; } $group_name .= $session_img; $row[] = $group_name . '<br />' . stripslashes(trim($this_group['description'])); } else { $row[] = $this_group['name'] . '<br />' . stripslashes(trim($this_group['description'])); } // Tutor name $tutor_info = null; if (count($tutorsids_of_group) > 0) { foreach ($tutorsids_of_group as $tutor_id) { $tutor = api_get_user_info($tutor_id); $username = api_htmlentities(sprintf(get_lang('LoginX'), $tutor['username']), ENT_QUOTES); if (api_get_setting('show_email_addresses') == 'true') { $tutor_info .= Display::tag('span', Display::encrypted_mailto_link($tutor['mail'], api_get_person_name($tutor['firstName'], $tutor['lastName'])), array('title' => $username)) . ', '; } else { if (api_is_allowed_to_edit()) { $tutor_info .= Display::tag('span', Display::encrypted_mailto_link($tutor['mail'], api_get_person_name($tutor['firstName'], $tutor['lastName'])), array('title' => $username)) . ', '; } else { $tutor_info .= Display::tag('span', api_get_person_name($tutor['firstName'], $tutor['lastName']), array('title' => $username)) . ', '; } } } } $tutor_info = api_substr($tutor_info, 0, api_strlen($tutor_info) - 2); $row[] = $tutor_info; // Max number of members in group $max_members = $this_group['maximum_number_of_members'] == self::MEMBER_PER_GROUP_NO_LIMIT ? ' ' : ' / ' . $this_group['maximum_number_of_members']; // Number of members in group $row[] = $this_group['number_of_members'] . $max_members; // Self-registration / unregistration if (!api_is_allowed_to_edit(false, true)) { if (self::is_self_registration_allowed($user_id, $this_group['id'])) { $row[] = '<a class = "btn" href="group.php?' . api_get_cidreq() . '&category=' . $category_id . '&action=self_reg&group_id=' . $this_group['id'] . '" onclick="javascript:if(!confirm(' . "'" . addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)) . "'" . ')) return false;">' . get_lang('GroupSelfRegInf') . '</a>'; } elseif (self::is_self_unregistration_allowed($user_id, $this_group['id'])) { $row[] = '<a class = "btn" href="group.php?' . api_get_cidreq() . '&category=' . $category_id . '&action=self_unreg&group_id=' . $this_group['id'] . '" onclick="javascript:if(!confirm(' . "'" . addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)) . "'" . ')) return false;">' . get_lang('GroupSelfUnRegInf') . '</a>'; } else { $row[] = '-'; } } $url = api_get_path(WEB_CODE_PATH) . 'group/'; // Edit-links if (api_is_allowed_to_edit(false, true) && !(api_is_course_coach() && intval($this_group['session_id']) != $session_id)) { $edit_actions = '<a href="' . $url . 'settings.php?' . api_get_cidreq(true, false) . '&gidReq=' . $this_group['id'] . '" title="' . get_lang('Edit') . '">' . Display::return_icon('edit.png', get_lang('EditGroup'), '', ICON_SIZE_SMALL) . '</a> '; $edit_actions .= '<a href="' . $url . 'member_settings.php?' . api_get_cidreq(true, false) . '&gidReq=' . $this_group['id'] . '" title="' . get_lang('GroupMembers') . '">' . Display::return_icon('user.png', get_lang('GroupMembers'), '', ICON_SIZE_SMALL) . '</a> '; $edit_actions .= '<a href="' . $url . 'group_overview.php?action=export&type=xls&' . api_get_cidreq(true, false) . '&id=' . $this_group['id'] . '" title="' . get_lang('ExportUsers') . '">' . Display::return_icon('export_excel.png', get_lang('Export'), '', ICON_SIZE_SMALL) . '</a> '; /*$edit_actions .= '<a href="'.api_get_self().'?'.api_get_cidreq(true, false).'&category='.$category_id.'&action=empty_one&id='.$this_group['id'].'" onclick="javascript: if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;" title="'.get_lang('EmptyGroup').'">'. Display::return_icon('clean.png',get_lang('EmptyGroup'),'',ICON_SIZE_SMALL).'</a> ';*/ $edit_actions .= '<a href="' . api_get_self() . '?' . api_get_cidreq(true, false) . '&category=' . $category_id . '&action=fill_one&id=' . $this_group['id'] . '" onclick="javascript: if(!confirm(' . "'" . addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES)) . "'" . ')) return false;" title="' . get_lang('FillGroup') . '">' . Display::return_icon('fill.png', get_lang('FillGroup'), '', ICON_SIZE_SMALL) . '</a> '; $edit_actions .= '<a href="' . api_get_self() . '?' . api_get_cidreq(true, false) . '&category=' . $category_id . '&action=delete_one&id=' . $this_group['id'] . '" onclick="javascript: if(!confirm(' . "'" . addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES)) . "'" . ')) return false;" title="' . get_lang('Delete') . '">' . Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL) . '</a> '; $row[] = $edit_actions; } if (!empty($this_group['nbMember'])) { $totalRegistered = $totalRegistered + $this_group['nbMember']; } $group_data[] = $row; } // end loop $table = new SortableTableFromArrayConfig($group_data, 1, 20, 'group_category_' . $category_id); $table->set_additional_parameters(array('category' => $category_id)); $column = 0; if (api_is_allowed_to_edit(false, true) and count($group_list) > 1) { $table->set_header($column++, '', false); } $table->set_header($column++, get_lang('Groups')); $table->set_header($column++, get_lang('GroupTutor')); $table->set_header($column++, get_lang('Registered'), false); if (!api_is_allowed_to_edit(false, true)) { // If self-registration allowed $table->set_header($column++, get_lang('GroupSelfRegistration'), false); } if (api_is_allowed_to_edit(false, true)) { // Only for course administrator $table->set_header($column++, get_lang('Modify'), false); $form_actions = array(); $form_actions['fill_selected'] = get_lang('FillGroup'); $form_actions['empty_selected'] = get_lang('EmptyGroup'); $form_actions['delete_selected'] = get_lang('Delete'); if (count($group_list) > 1) { $table->set_form_actions($form_actions, 'group'); } } $table->display(); }
$interbreadcrumb[] = array('url' => $_SESSION['gradebook_dest'] . '?selectcat=' . Security::remove_XSS($_GET['selectcat']), 'name' => get_lang('Details')); $interbreadcrumb[] = array('url' => 'gradebook_showlog_eval.php?visiblelog=' . Security::remove_XSS($_GET['visiblelog']) . '&selectcat=' . Security::remove_XSS($_GET['selectcat']), 'name' => get_lang('GradebookQualifyLog')); $this_section = SECTION_COURSES; Display::display_header(''); echo Display::page_header(get_lang('GradebookQualifyLog')); $t_linkeval_log = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG); $t_user = Database::get_main_table(TABLE_MAIN_USER); $visible_log = Security::remove_XSS($_GET['visiblelog']); $evaledit = Evaluation::load($visible_log); $sql = "SELECT le.name,le.description,le.weight,le.visible,le.type,le.created_at,us.username FROM " . $t_linkeval_log . " le INNER JOIN " . $t_user . " us\n ON le.user_id_log=us.user_id where id_linkeval_log=" . $evaledit[0]->get_id() . " and type='evaluation';"; $result = Database::query($sql); $list_info = array(); while ($row = Database::fetch_row($result)) { $list_info[] = $row; } foreach ($list_info as $key => $info_log) { $list_info[$key][5] = $info_log[5] ? api_convert_and_format_date($info_log[5]) : 'N/A'; $list_info[$key][3] = $info_log[3] == 1 ? get_lang('GradebookVisible') : get_lang('GradebookInvisible'); } $parameters = array('visiblelog' => $visible_log, 'selectcat' => intval($_GET['selectcat'])); $table = new SortableTableFromArrayConfig($list_info, 1, 20, 'gradebookeval'); $table->set_additional_parameters($parameters); $table->set_header(0, get_lang('GradebookNameLog')); $table->set_header(1, get_lang('GradebookDescriptionLog')); $table->set_header(2, get_lang('GradebookPreviousWeight')); $table->set_header(3, get_lang('GradebookVisibilityLog')); $table->set_header(4, get_lang('ResourceType')); $table->set_header(5, get_lang('Date')); $table->set_header(6, get_lang('GradebookWhoChangedItLog')); $table->display(); Display::display_footer();
$column_order[3] = 4; } $default_column = $is_allowed_to_edit ? 2 : 1; $tableName = $is_allowed_to_edit ? 'teacher_table' : 'student_table'; $table = new SortableTableFromArrayConfig($sortable_data, $default_column, 20, $tableName, $column_show, $column_order, 'ASC', true); $query_vars = array(); if (isset($_GET['keyword'])) { $query_vars['keyword'] = Security::remove_XSS($_GET['keyword']); } else { $query_vars['curdirpath'] = $curdirpath; } if ($groupId) { $query_vars['gidReq'] = $groupId; } $query_vars['cidReq'] = api_get_course_id(); $table->set_additional_parameters($query_vars); $column = 0; if (($is_allowed_to_edit || $group_member_with_upload_rights) && count($documentAndFolders) > 1) { $table->set_header($column++, '', false, array('style' => 'width:12px;')); } $table->set_header($column++, get_lang('Type'), true, array('style' => 'width:30px;')); $table->set_header($column++, get_lang('Name')); $table->set_header($column++, get_lang('Size'), true, array('style' => 'width:50px;')); $table->set_header($column++, get_lang('Date'), true, array('style' => 'width:150px;')); // Admins get an edit column if ($is_allowed_to_edit || $group_member_with_upload_rights || DocumentManager::is_my_shared_folder(api_get_user_id(), $curdirpath, $sessionId)) { $table->set_header($column++, get_lang('Actions'), false, array('class' => 'td_actions')); } // Actions on multiple selected documents // TODO: Currently only delete action -> take only DELETE permission into account if (count($documentAndFolders) > 1) {
/** * Displays a table with a special configuration * @param array $header Titles for the table header * each item in this array can contain 3 values * - 1st element: the column title * - 2nd element: true or false (column sortable?) * - 3th element: additional attributes for * th-tag (eg for column-width) * - 4the element: additional attributes for the td-tags * @param array $content 2D-array with the tables content * @param array $sorting_options Keys are: * 'column' = The column to use as sort-key * 'direction' = SORT_ASC or SORT_DESC * @param array $paging_options Keys are: * 'per_page_default' = items per page when switching from * full- list to per-page-view * 'per_page' = number of items to show per page * 'page_nr' = The page to display * @param array $query_vars Additional variables to add in the query-string * @param array $column_show Array of binaries 1= show columns 0. hide a column * @param array $column_order An array of integers that let us decide how the columns are going to be sort. * i.e: $column_order=array('1''4','3','4'); The 2nd column will be order like the 4th column * @param array $form_actions Set optional forms actions * * @author Julio Montoya */ public static function display_sortable_config_table($table_name, $header, $content, $sorting_options = array(), $paging_options = array(), $query_vars = null, $column_show = array(), $column_order = array(), $form_actions = array()) { global $origin; $column = isset($sorting_options['column']) ? $sorting_options['column'] : 0; $default_items_per_page = isset($paging_options['per_page']) ? $paging_options['per_page'] : 20; $table = new SortableTableFromArrayConfig($content, $column, $default_items_per_page, $table_name, $column_show, $column_order); if (is_array($query_vars)) { $table->set_additional_parameters($query_vars); } // Show or hide the columns header if (is_array($column_show)) { for ($i = 0; $i < count($column_show); $i++) { if (!empty($column_show[$i])) { $val0 = isset($header[$i][0]) ? $header[$i][0] : null; $val1 = isset($header[$i][1]) ? $header[$i][1] : null; $val2 = isset($header[$i][2]) ? $header[$i][2] : null; $val3 = isset($header[$i][3]) ? $header[$i][3] : null; $table->set_header($i, $val0, $val1, $val2, $val3); } } } $table->set_form_actions($form_actions); $table->display(); }
/** * Most visited */ public function getMostVisited() { $tbl_wiki = $this->tbl_wiki; $course_id = $this->course_id; $groupfilter = $this->groupfilter; $condition_session = $this->condition_session; $_course = $this->courseInfo; echo '<div class="actions">' . get_lang('MostVisitedPages') . '</div>'; if (api_is_allowed_to_edit(false, true) || api_is_platform_admin()) { //only by professors if page is hidden $sql = 'SELECT *, SUM(hits) AS tsum FROM ' . $tbl_wiki . ' WHERE c_id = ' . $course_id . ' AND ' . $groupfilter . $condition_session . ' GROUP BY reflink'; } else { $sql = 'SELECT *, SUM(hits) AS tsum FROM ' . $tbl_wiki . ' WHERE c_id = ' . $course_id . ' AND ' . $groupfilter . $condition_session . ' AND visibility=1 GROUP BY reflink'; } $allpages = Database::query($sql); //show table if (Database::num_rows($allpages) > 0) { $rows = array(); while ($obj = Database::fetch_object($allpages)) { //get type assignment icon $ShowAssignment = ''; if ($obj->assignment == 1) { $ShowAssignment = Display::return_icon('wiki_assignment.png', get_lang('AssignmentDesc'), '', ICON_SIZE_SMALL); } elseif ($obj->assignment == 2) { $ShowAssignment = $ShowAssignment = Display::return_icon('wiki_work.png', get_lang('AssignmentWork'), '', ICON_SIZE_SMALL); } elseif ($obj->assignment == 0) { $ShowAssignment = Display::return_icon('px_transparent.gif'); } $row = array(); $row[] = $ShowAssignment; $row[] = '<a href="' . api_get_self() . '?cidReq=' . $_course['code'] . '&action=showpage&title=' . api_htmlentities(urlencode($obj->reflink)) . '&session_id=' . api_htmlentities($_GET['session_id']) . '&group_id=' . api_htmlentities($_GET['group_id']) . '">' . api_htmlentities($obj->title) . '</a>'; $row[] = $obj->tsum; $rows[] = $row; } $table = new SortableTableFromArrayConfig($rows, 2, 10, 'MostVisitedPages_table', '', '', 'DESC'); $table->set_additional_parameters(array('cidReq' => Security::remove_XSS($_GET['cidReq']), 'action' => Security::remove_XSS($this->action), 'session_id' => intval($_GET['session_id']), 'group_id' => intval($_GET['group_id']))); $table->set_header(0, get_lang('Type'), true, array('style' => 'width:30px;')); $table->set_header(1, get_lang('Title'), true); $table->set_header(2, get_lang('Visits'), true); $table->display(); } }
/** * Displays the results of a wiki search * @param string Search term * @param int Whether to search the contents (1) or just the titles (0) */ function display_wiki_search_results($search_term, $search_content = 0, $all_vers = 0) { global $tbl_wiki, $groupfilter, $MonthsLong, $condition_session; echo '<legend>' . get_lang('WikiSearchResults') . '</legend>'; $_clean['group_id'] = (int) $_SESSION['_gid']; $session_id = api_get_session_id(); $course_id = api_get_course_int_id(); //only by professors when page is hidden if (api_is_allowed_to_edit(false, true) || api_is_platform_admin()) { if ($all_vers == '1') { if ($search_content == '1') { $sql = "SELECT * FROM " . $tbl_wiki . "\n\t\t\t\t\t\tWHERE c_id = {$course_id} AND title LIKE '%" . Database::escape_string($search_term) . "%' OR content LIKE '%" . Database::escape_string($search_term) . "%' AND " . $groupfilter . $condition_session . ""; //search all pages and all versions } else { $sql = "SELECT * FROM " . $tbl_wiki . "\n\t\t\t\t\t\tWHERE c_id = {$course_id} AND title LIKE '%" . Database::escape_string($search_term) . "%' AND " . $groupfilter . $condition_session . ""; //search all pages and all versions } } else { if ($search_content == '1') { $sql = "SELECT * FROM " . $tbl_wiki . " s1\n\t\t\t\t\t\tWHERE s1.c_id = {$course_id} AND title LIKE '%" . Database::escape_string($search_term) . "%' OR content LIKE '%" . Database::escape_string($search_term) . "%' AND\n\t\t\t \t\t\tid=(SELECT MAX(s2.id) FROM " . $tbl_wiki . " s2 WHERE s2.c_id = {$course_id} AND s1.reflink = s2.reflink AND " . $groupfilter . $condition_session . ")"; // warning don't use group by reflink because don't return the last version } else { $sql = " SELECT * FROM " . $tbl_wiki . " s1\n\t\t\t \t\t\tWHERE s1.c_id = {$course_id} AND title LIKE '%" . Database::escape_string($search_term) . "%' AND\n\t\t\t \t\t\tid=(SELECT MAX(s2.id) FROM " . $tbl_wiki . " s2 WHERE s2.c_id = {$course_id} AND s1.reflink = s2.reflink AND " . $groupfilter . $condition_session . ")"; // warning don't use group by reflink because don't return the last version } } } else { if ($all_vers == '1') { if ($search_content == '1') { $sql = "SELECT * FROM " . $tbl_wiki . " WHERE c_id = {$course_id} AND visibility=1 AND title LIKE '%" . Database::escape_string($search_term) . "%' OR content LIKE '%" . Database::escape_string($search_term) . "%' AND " . $groupfilter . $condition_session . ""; //search all pages and all versions } else { $sql = "SELECT * FROM " . $tbl_wiki . " WHERE c_id = {$course_id} AND visibility=1 AND title LIKE '%" . Database::escape_string($search_term) . "%' AND " . $groupfilter . $condition_session . ""; //search all pages and all versions } } else { if ($search_content == '1') { $sql = " SELECT * FROM " . $tbl_wiki . " s1\n\t\t\t \t\t WHERE s1.c_id = {$course_id} AND visibility=1 AND title LIKE '%" . Database::escape_string($search_term) . "%' OR content LIKE '%" . Database::escape_string($search_term) . "%' AND\n\t\t\t \t\t\tid=(SELECT MAX(s2.id) FROM " . $tbl_wiki . " s2 WHERE s2.c_id = {$course_id} AND s1.reflink = s2.reflink AND " . $groupfilter . $condition_session . ")"; // warning don't use group by reflink because don't return the last version } else { $sql = " SELECT * FROM " . $tbl_wiki . " s1\n\t\t\t \t\t\tWHERE s1.c_id = {$course_id} AND visibility=1 AND title LIKE '%" . Database::escape_string($search_term) . "%' AND\n\t\t\t \t\t\tid=(SELECT MAX(s2.id) FROM " . $tbl_wiki . " s2 WHERE s2.c_id = {$course_id} AND s1.reflink = s2.reflink AND " . $groupfilter . $condition_session . ")"; // warning don't use group by reflink because don't return the last version } } } $result = Database::query($sql); //show table if (Database::num_rows($result) > 0) { $row = array(); while ($obj = Database::fetch_object($result)) { //get author $userinfo = api_get_user_info($obj->user_id); //get time $year = substr($obj->dtime, 0, 4); $month = substr($obj->dtime, 5, 2); $day = substr($obj->dtime, 8, 2); $hours = substr($obj->dtime, 11, 2); $minutes = substr($obj->dtime, 14, 2); $seconds = substr($obj->dtime, 17, 2); //get type assignment icon if ($obj->assignment == 1) { $ShowAssignment = Display::return_icon('wiki_assignment.png', get_lang('AssignmentDesc'), '', ICON_SIZE_SMALL); } elseif ($obj->assignment == 2) { $ShowAssignment = Display::return_icon('wiki_work.png', get_lang('AssignmentWork'), '', ICON_SIZE_SMALL); } elseif ($obj->assignment == 0) { $ShowAssignment = '<img src="../img/px_transparent.gif" />'; } $row = array(); $row[] = $ShowAssignment; if ($all_vers == '1') { $row[] = '<a href="' . api_get_self() . '?cidReq=' . $_course['id'] . '&action=showpage&title=' . api_htmlentities(urlencode($obj->reflink)) . '&view=' . $obj->id . '&session_id=' . api_htmlentities(urlencode($_GET['$session_id'])) . '&group_id=' . api_htmlentities(urlencode($_GET['group_id'])) . '">' . api_htmlentities($obj->title) . '</a>'; } else { $row[] = '<a href="' . api_get_self() . '?cidReq=' . $_course[id] . '&action=showpage&title=' . api_htmlentities(urlencode($obj->reflink)) . '&session_id=' . api_htmlentities($_GET['session_id']) . '&group_id=' . api_htmlentities($_GET['group_id']) . '">' . $obj->title . '</a>'; } $row[] = $obj->user_id != 0 ? '<a href="../user/userInfo.php?uInfo=' . $userinfo['user_id'] . '">' . api_htmlentities($userinfo['complete_name']) . '</a>' : get_lang('Anonymous') . ' (' . $obj->user_ip . ')'; $row[] = $year . '-' . $month . '-' . $day . ' ' . $hours . ":" . $minutes . ":" . $seconds; if ($all_vers == '1') { $row[] = $obj->version; } else { if (api_is_allowed_to_edit(false, true) || api_is_platform_admin()) { $showdelete = ' <a href="' . api_get_self() . '?cidReq=' . $_course[id] . '&action=delete&title=' . api_htmlentities(urlencode($obj->reflink)) . '&group_id=' . api_htmlentities($_GET['group_id']) . '">' . Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL); } $row[] = '<a href="' . api_get_self() . '?cidReq=' . $_course[id] . '&action=edit&title=' . api_htmlentities(urlencode($obj->reflink)) . '&group_id=' . api_htmlentities($_GET['group_id']) . '">' . Display::return_icon('edit.png', get_lang('EditPage'), '', ICON_SIZE_SMALL) . '</a> <a href="' . api_get_self() . '?cidReq=' . $_course[id] . '&action=discuss&title=' . api_htmlentities(urlencode($obj->reflink)) . '&session_id=' . api_htmlentities($_GET['session_id']) . '&group_id=' . api_htmlentities($_GET['group_id']) . '">' . Display::return_icon('discuss.png', get_lang('Discuss'), '', ICON_SIZE_SMALL) . '</a> <a href="' . api_get_self() . '?cidReq=' . $_course[id] . '&action=history&title=' . api_htmlentities(urlencode($obj->reflink)) . '&session_id=' . api_htmlentities($_GET['session_id']) . '&group_id=' . api_htmlentities($_GET['group_id']) . '">' . Display::return_icon('history.png', get_lang('History'), '', ICON_SIZE_SMALL) . '</a> <a href="' . api_get_self() . '?cidReq=' . $_course[id] . '&action=links&title=' . api_htmlentities(urlencode($obj->reflink)) . '&group_id=' . api_htmlentities($_GET['group_id']) . '">' . Display::return_icon('what_link_here.png', get_lang('LinksPages'), '', ICON_SIZE_SMALL) . '</a>' . $showdelete; } $rows[] = $row; } $table = new SortableTableFromArrayConfig($rows, 1, 10, 'SearchPages_table', '', '', 'ASC'); $table->set_additional_parameters(array('cidReq' => $_GET['cidReq'], 'action' => $_GET['action'], 'group_id' => Security::remove_XSS($_GET['group_id']), 'mode_table' => 'yes2', 'search_term' => $search_term, 'search_content' => $search_content, 'all_vers' => $all_vers)); $table->set_header(0, get_lang('Type'), true, array('style' => 'width:30px;')); $table->set_header(1, get_lang('Title'), true); if ($all_vers == '1') { $table->set_header(2, get_lang('Author'), true); $table->set_header(3, get_lang('Date'), true); $table->set_header(4, get_lang('Version'), true); } else { $table->set_header(2, get_lang('Author') . ' (' . get_lang('LastVersion') . ')', true); $table->set_header(3, get_lang('Date') . ' (' . get_lang('LastVersion') . ')', true); $table->set_header(4, get_lang('Actions'), false, array('style' => 'width:130px;')); } $table->display(); } else { echo get_lang('NoSearchResults'); } }
if ($obj->user_id != 0) { $row[] = '<a href="../user/userInfo.php?uInfo=' . $userinfo['user_id'] . '">' . Display::tag('span', api_htmlentities($userinfo['complete_name_login_as'])) . '</a>'; } else { $row[] = get_lang('Anonymous') . ' (' . api_htmlentities($obj->user_ip) . ')'; } $row[] = api_get_local_time($obj->dtime, null, date_default_timezone_get()); if (api_is_allowed_to_edit(false, true) || api_is_platform_admin()) { $showdelete = ' <a href="' . api_get_self() . '?cidReq=' . $_course['id'] . '&action=delete&title=' . Security::remove_XSS($obj->reflink) . '&session_id=' . Security::remove_XSS($_GET['session_id']) . '&group_id=' . Security::remove_XSS($_GET['group_id']) . '">' . Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL); } if (api_is_allowed_to_session_edit(false, true)) { $row[] = '<a href="' . api_get_self() . '?cidReq=' . $_course['id'] . '&action=edit&title=' . Security::remove_XSS($obj->reflink) . '&session_id=' . Security::remove_XSS($_GET['session_id']) . '&group_id=' . Security::remove_XSS($_GET['group_id']) . '">' . Display::return_icon('edit.png', get_lang('EditPage'), '', ICON_SIZE_SMALL) . '</a> <a href="' . api_get_self() . '?cidReq=' . $_course['id'] . '&action=discuss&title=' . Security::remove_XSS($obj->reflink) . '&group_id=' . Security::remove_XSS($_GET['group_id']) . '">' . Display::return_icon('discuss.png', get_lang('Discuss'), '', ICON_SIZE_SMALL) . '</a> <a href="' . api_get_self() . '?cidReq=' . $_course['id'] . '&action=history&title=' . api_htmlentities(urlencode($obj->reflink)) . '&session_id=' . Security::remove_XSS($_GET['session_id']) . '&group_id=' . Security::remove_XSS($_GET['group_id']) . '">' . Display::return_icon('history.png', get_lang('History'), '', ICON_SIZE_SMALL) . '</a> <a href="' . api_get_self() . '?cidReq=' . $_course['id'] . '&action=links&title=' . api_htmlentities(urlencode($obj->reflink)) . '&session_id=' . Security::remove_XSS($_GET['session_id']) . '&group_id=' . Security::remove_XSS($_GET['group_id']) . '">' . Display::return_icon('what_link_here.png', get_lang('LinksPages'), '', ICON_SIZE_SMALL) . '</a>' . $showdelete; } $rows[] = $row; } $table = new SortableTableFromArrayConfig($rows, 1, 10, 'AllPages_table', '', '', 'ASC'); $table->set_additional_parameters(array('cidReq' => Security::remove_XSS($_GET['cidReq']), 'action' => Security::remove_XSS($_GET['action']), 'group_id' => Security::remove_XSS($_GET['group_id']))); $table->set_header(0, get_lang('Type'), true, array('style' => 'width:30px;')); $table->set_header(1, get_lang('Title'), true); $table->set_header(2, get_lang('Author') . ' (' . get_lang('LastVersion') . ')', true); $table->set_header(3, get_lang('Date') . ' (' . get_lang('LastVersion') . ')', true); if (api_is_allowed_to_session_edit(false, true)) { $table->set_header(4, get_lang('Actions'), true, array('style' => 'width:130px;')); } $table->display(); } } // Discuss pages if ($_GET['action'] == 'discuss') { if (api_get_session_id() != 0 && api_is_allowed_to_session_edit(false, true) == false) { api_not_allowed(); }