本文整理汇总了PHP中api_get_session_image函数的典型用法代码示例。如果您正苦于以下问题:PHP api_get_session_image函数的具体用法?PHP api_get_session_image怎么用?PHP api_get_session_image使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了api_get_session_image函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_thematic_plan_div
/**
* @param array $data
* @return array
*/
public function get_thematic_plan_div($data)
{
$final_return = array();
$uinfo = api_get_user_info();
foreach ($data as $thematic_id => $thematic_plan_data) {
$new_thematic_plan_data = array();
foreach ($thematic_plan_data as $thematic_item) {
$thematic_simple_list[] = $thematic_item['description_type'];
$new_thematic_plan_data[$thematic_item['description_type']] = $thematic_item;
}
if (!empty($thematic_simple_list)) {
foreach ($thematic_simple_list as $item) {
$default_thematic_plan_title[$item] = $new_thematic_plan_data[$item]['title'];
}
}
$no_data = true;
$session_star = '';
$return = '<div id="thematic_plan_' . $thematic_id . '">';
if (!empty($default_thematic_plan_title)) {
foreach ($default_thematic_plan_title as $id => $title) {
//avoid others
if ($title == 'Others' && empty($data[$thematic_id][$id]['description'])) {
continue;
}
if (!empty($data[$thematic_id][$id]['title']) && !empty($data[$thematic_id][$id]['description'])) {
if (api_is_allowed_to_edit(null, true)) {
if ($data[$thematic_id][$id]['session_id'] != 0) {
$session_star = api_get_session_image(api_get_session_id(), $uinfo['status']);
}
}
$return .= Display::tag('h3', Security::remove_XSS($data[$thematic_id][$id]['title'], STUDENT) . $session_star);
$return .= Security::remove_XSS($data[$thematic_id][$id]['description'], STUDENT);
$no_data = false;
}
}
}
if ($no_data) {
$return .= '<div><em>' . get_lang('StillDoNotHaveAThematicPlan') . '</em></div>';
}
$return .= '</div>';
$final_return[$thematic_id] = $return;
}
return $final_return;
}
示例2: api_get_setting
} else {
echo '<th width="75%" style="text-align: left">'.get_lang('Title').'</th>';
echo '<th>'.get_lang('Progress')."</th>";
echo '<th width="1%"></th>';
}
echo '</tr>';
$test_mode = api_get_setting('server_type');
$max = count($flat_list);
$counter = 0;
$current = 0;
$autolunch_exists = false;
foreach ($flat_list as $id => $details) {
// Validation when belongs to a session.
$session_img = api_get_session_image($details['lp_session'], $userInfo['status']);
if (!$is_allowed_to_edit && $details['lp_visibility'] == 0) {
// This is a student and this path is invisible, skip.
continue;
}
// Check if the learnpath is visible for student.
if (!$is_allowed_to_edit && !learnpath::is_lp_visible_for_student($id, $userId)) {
continue;
}
$start_time = $end_time = '';
if (!$is_allowed_to_edit) {
$time_limits = false;
示例3: get_glossary_data
/**
* Get all the data of a glossary
*
* @param integer From which item
* @param integer Number of items to collect
* @param string Name of column on which to order
* @param string Whether to sort in ascending (ASC) or descending (DESC)
* @return unknown
*
* @author Patrick Cool <patrick.cool@ugent.be>
* @author Julio Montoya fixing this function, adding intvals
* @version januari 2009, dokeos 1.8.6
*/
public static function get_glossary_data($from, $number_of_items, $column, $direction)
{
global $_user;
// Database table definition
$t_glossary = Database::get_course_table(TABLE_GLOSSARY);
$t_item_propery = Database::get_course_table(TABLE_ITEM_PROPERTY);
if (api_is_allowed_to_edit(null, true)) {
$col2 = " glossary.glossary_id\tas col2, ";
} else {
$col2 = " ";
}
//condition for the session
$session_id = api_get_session_id();
$condition_session = api_get_session_condition($session_id, true, true);
$column = intval($column);
if (!in_array($direction, array('DESC', 'ASC'))) {
$direction = 'ASC';
}
$from = intval($from);
$number_of_items = intval($number_of_items);
$sql = "SELECT glossary.name \t\t\tas col0,\n\t\t\t\t\t glossary.description \tas col1,\n\t\t\t\t\t {$col2}\n\t\t\t\t\t glossary.session_id as session_id\n\t\t\t\tFROM {$t_glossary} glossary, {$t_item_propery} ip\n\t\t\t\tWHERE \tglossary.glossary_id = ip.ref AND\n\t\t\t\t\t\ttool = '" . TOOL_GLOSSARY . "' {$condition_session} AND\n\t\t\t\t\t\tglossary.c_id = " . api_get_course_int_id() . " AND\n\t\t\t\t\t\tip.c_id = " . api_get_course_int_id() . "\n\t\t ORDER BY col{$column} {$direction}\n\t\t LIMIT {$from},{$number_of_items}";
$res = Database::query($sql);
$return = array();
$array = array();
while ($data = Database::fetch_array($res)) {
//validacion when belongs to a session
$session_img = api_get_session_image($data['session_id'], $_user['status']);
$array[0] = $data[0] . $session_img;
if (!$_SESSION['glossary_view'] || $_SESSION['glossary_view'] == 'table') {
$array[1] = str_replace(array('<p>', '</p>'), array('', '<br />'), $data[1]);
} else {
$array[1] = $data[1];
}
if (api_is_allowed_to_edit(null, true)) {
// Date treatment for timezones
/*if (!empty($data[2]) && $data[2] != '0000-00-00 00:00:00:') {
$array[2] = api_get_local_time($data[2], null, date_default_timezone_get());
}
if (!empty($data[3]) && $data[3] != '0000-00-00 00:00:00:') {
$array[3] = api_get_local_time($data[3], null, date_default_timezone_get());
}*/
$array[2] = $data[2];
}
$return[] = $array;
}
return $return;
}
示例4: process_groups
/**
* @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'));
//.........这里部分代码省略.........
示例5: display_notes
static function display_notes()
{
global $_user;
if (!$_GET['direction']) {
$sort_direction = 'ASC';
$link_sort_direction = 'DESC';
} elseif ($_GET['direction'] == 'ASC') {
$sort_direction = 'ASC';
$link_sort_direction = 'DESC';
} else {
$sort_direction = 'DESC';
$link_sort_direction = 'ASC';
}
// action links
echo '<div class="actions">';
if (!api_is_anonymous()) {
if (api_get_session_id() == 0)
echo '<a href="index.php?' . api_get_cidreq() . '&action=addnote">' . Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32') . '</a>';
elseif (api_is_allowed_to_session_edit(false, true)) {
echo '<a href="index.php?' . api_get_cidreq() . '&action=addnote">' . Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32') . '</a>';
}
} else {
echo '<a href="javascript:void(0)">' . Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32') . '</a>';
}
echo '<a href="index.php?' . api_get_cidreq() . '&action=changeview&view=creation_date&direction=' . $link_sort_direction . '">' . Display::return_icon('notes_order_by_date_new.png', get_lang('OrderByCreationDate'), '', '32') . '</a>';
echo '<a href="index.php?' . api_get_cidreq() . '&action=changeview&view=update_date&direction=' . $link_sort_direction . '">' . Display::return_icon('notes_order_by_date_mod.png', get_lang('OrderByModificationDate'), '', '32') . '</a>';
echo '<a href="index.php?' . api_get_cidreq() . '&action=changeview&view=title&direction=' . $link_sort_direction . '">' . Display::return_icon('notes_order_by_title.png', get_lang('OrderByTitle'), '', '32') . '</a>';
echo '</div>';
if (!in_array($_SESSION['notebook_view'], array('creation_date', 'update_date', 'title'))) {
$_SESSION['notebook_view'] = 'creation_date';
}
// Database table definition
$t_notebook = Database :: get_course_table(TABLE_NOTEBOOK);
$order_by = "";
if ($_SESSION['notebook_view'] == 'creation_date' || $_SESSION['notebook_view'] == 'update_date') {
$order_by = " ORDER BY " . $_SESSION['notebook_view'] . " $sort_direction ";
} else {
$order_by = " ORDER BY " . $_SESSION['notebook_view'] . " $sort_direction ";
}
//condition for the session
$session_id = api_get_session_id();
$condition_session = api_get_session_condition($session_id);
$cond_extra = ($_SESSION['notebook_view'] == 'update_date') ? " AND update_date <> '0000-00-00 00:00:00'" : " ";
$course_id = api_get_course_int_id();
$sql = "SELECT * FROM $t_notebook WHERE c_id = $course_id AND user_id = '" . api_get_user_id() . "' $condition_session $cond_extra $order_by";
$result = Database::query($sql);
while ($row = Database::fetch_array($result)) {
//validacion when belongs to a session
$session_img = api_get_session_image($row['session_id'], $_user['status']);
$creation_date = api_get_local_time($row['creation_date'], null, date_default_timezone_get());
$update_date = api_get_local_time($row['update_date'], null, date_default_timezone_get());
echo '<div class="sectiontitle">';
echo '<span style="float: right;"> (' . get_lang('CreationDate') . ': ' . date_to_str_ago($creation_date) . ' <span class="dropbox_date">' . $creation_date . '</span>';
if ($row['update_date'] <> $row['creation_date']) {
echo ', ' . get_lang('UpdateDate') . ': ' . date_to_str_ago($update_date) . ' <span class="dropbox_date">' . $update_date . '</span>';
}
echo ')</span>';
echo $row['title'] . $session_img;
echo '</div>';
echo '<div class="sectioncomment">' . $row['description'] . '</div>';
echo '<div>';
echo '<a href="' . api_get_self() . '?action=editnote&notebook_id=' . $row['notebook_id'] . '">' . Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL) . '</a>';
echo '<a href="' . api_get_self() . '?action=deletenote&notebook_id=' . $row['notebook_id'] . '" onclick="return confirmation(\'' . $row['title'] . '\');">' . Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL) . '</a>';
echo '</div>';
}
}
示例6: display_blog_list
/**
* Blog admin | Returns table with blogs in this course
*/
public static function display_blog_list()
{
global $charset;
$_user = api_get_user_info();
$course_id = api_get_course_int_id();
// Init
$counter = 0;
$tbl_blogs = Database::get_course_table(TABLE_BLOGS);
//condition for the session
$session_id = api_get_session_id();
$condition_session = api_get_session_condition($session_id, false);
$sql = "SELECT blog_name, blog_subtitle, visibility, blog_id, session_id\n\t\t\t\tFROM {$tbl_blogs} WHERE c_id = {$course_id}\n\t\t\t\tORDER BY date_creation DESC";
$result = Database::query($sql);
$list_info = array();
if (Database::num_rows($result)) {
while ($row_project = Database::fetch_row($result)) {
$list_info[] = $row_project;
}
}
$list_content_blog = array();
$list_body_blog = array();
$_user = api_get_user_info();
if (is_array($list_info)) {
foreach ($list_info as $key => $info_log) {
// Validation when belongs to a session
$session_img = api_get_session_image($info_log[4], $_user['status']);
$url_start_blog = 'blog.php' . "?" . "blog_id=" . $info_log[3] . "&" . api_get_cidreq();
$title = $info_log[0];
$image = '<img src="../img/blog.gif" border="0" align="absmiddle" alt="' . $title . '">';
$list_name = '<div style="float: left; width: 35px; height: 22px;"><a href="' . $url_start_blog . '">' . $image . '</a></div><a href="' . $url_start_blog . '">' . $title . '</a>' . $session_img;
$list_body_blog[] = $list_name;
$list_body_blog[] = $info_log[1];
$visibility_icon = $info_log[2] == 0 ? 'invisible' : 'visible';
$visibility_info = $info_log[2] == 0 ? 'Visible' : 'Invisible';
$my_image = '<a href="' . api_get_self() . '?action=edit&blog_id=' . $info_log[3] . '">';
$my_image .= '<img src="../img/edit.gif" border="0" title="' . get_lang('EditBlog') . '" />';
$my_image .= "</a>\n";
$my_image .= '<a href="' . api_get_self() . '?action=delete&blog_id=' . $info_log[3] . '" ';
$my_image .= 'onclick="javascript:if(!confirm(\'' . addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES, $charset)) . '\')) return false;" >';
$my_image .= '<img src="../img/delete.gif" border="0" title="' . get_lang('DeleteBlog') . '" />';
$my_image .= "</a>\n";
$my_image .= '<a href="' . api_get_self() . '?action=visibility&blog_id=' . $info_log[3] . '">';
$my_image .= '<img src="../img/' . $visibility_icon . '.gif" border="0" title="' . get_lang($visibility_info) . '" />';
$my_image .= "</a>\n";
$list_body_blog[] = $my_image;
$list_content_blog[] = $list_body_blog;
$list_body_blog = array();
}
$parameters = '';
//$parameters=array('action'=>Security::remove_XSS($_GET['action']));
$table = new SortableTableFromArrayConfig($list_content_blog, 1, 20, 'project');
//$table->set_additional_parameters($parameters);
$table->set_header(0, get_lang('Title'));
$table->set_header(1, get_lang('SubTitle'));
$table->set_header(2, get_lang('Modify'));
$table->display();
}
}
示例7: listLinksAndCategories
public static function listLinksAndCategories($course_id, $session_id, $categoryId, $show = 'none', $token = null)
{
$tbl_link = Database::get_course_table(TABLE_LINK);
$_user = api_get_user_info();
$categoryId = intval($categoryId);
/* Action Links */
echo '<div class="actions">';
if (api_is_allowed_to_edit(null, true)) {
echo '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=addlink&category_id=' . $categoryId . '">' . Display::return_icon('new_link.png', get_lang('LinkAdd'), '', ICON_SIZE_MEDIUM) . '</a>';
echo '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=addcategory&category_id=' . $categoryId . '">' . Display::return_icon('new_folder.png', get_lang('CategoryAdd'), '', ICON_SIZE_MEDIUM) . '</a>';
}
$categories = Link::getLinkCategories($course_id, $session_id);
$count = count($categories);
if (!empty($count)) {
echo '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=list&show=none">';
echo Display::return_icon('view_remove.png', get_lang('shownone'), '', ICON_SIZE_MEDIUM) . '</a>';
echo '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=list&show=all">';
echo Display::return_icon('view_tree.png', get_lang('showall'), '', ICON_SIZE_MEDIUM) . '</a>';
}
echo '</div>';
// Displaying the links which have no category (thus category = 0 or NULL),
// if none present this will not be displayed
$sql = "SELECT * FROM {$tbl_link}\n WHERE c_id = {$course_id} AND category_id=0 OR category_id IS NULL";
$result = Database::query($sql);
$count = Database::num_rows($result);
if ($count !== 0) {
echo '<table class="data_table">';
echo '<tr><th style="font-weight: bold; text-align:left;padding-left: 10px;">' . get_lang('General') . '</th></tr>';
echo '</table>';
self::showlinksofcategory(0);
}
$i = 0;
$view = '0';
$counter = 0;
foreach ($categories as $myrow) {
// Student don't see invisible categories.
if (!api_is_allowed_to_edit(null, true)) {
if ($myrow['visibility'] == 0) {
continue;
}
}
// Validation when belongs to a session
$showChildren = $categoryId == $myrow['id'] || $show == 'all';
$session_img = api_get_session_image($myrow['session_id'], $_user['status']);
$myrow['description'] = text_filter($myrow['description']);
$strVisibility = '';
$visibilityClass = null;
if ($myrow['visibility'] == '1') {
$strVisibility = '<a href="link.php?' . api_get_cidreq() . '&sec_token=' . $token . '&action=invisible&id=' . $myrow['id'] . '&scope=' . TOOL_LINK_CATEGORY . '" title="' . get_lang('Hide') . '">' . Display::return_icon('visible.png', get_lang('Hide'), array(), ICON_SIZE_SMALL) . '</a>';
} elseif ($myrow['visibility'] == '0') {
$visibilityClass = 'invisible';
$strVisibility = ' <a href="link.php?' . api_get_cidreq() . '&sec_token=' . $token . '&action=visible&id=' . $myrow['id'] . '&scope=' . TOOL_LINK_CATEGORY . '" title="' . get_lang('Show') . '">' . Display::return_icon('invisible.png', get_lang('Show'), array(), ICON_SIZE_SMALL) . '</a>';
}
echo '<tr>';
echo '<table class="data_table">';
echo '<tr>';
echo '<th width="81%" style="font-weight: bold; text-align:left;padding-left: 5px;">';
if ($showChildren) {
echo '<a class="' . $visibilityClass . '" href="' . api_get_self() . '?' . api_get_cidreq() . '&category_id=">';
echo Display::return_icon('view_remove.png');
} else {
echo '<a class="' . $visibilityClass . '" href="' . api_get_self() . '?' . api_get_cidreq() . '&category_id=' . $myrow['id'] . '">';
echo Display::return_icon('view_tree.png');
}
echo ' ' . Security::remove_XSS($myrow['category_title']) . '</a>
<br /> ' . $myrow['description'];
echo '</th>';
if (api_is_allowed_to_edit(null, true)) {
if ($session_id == $myrow['session_id']) {
echo '<th>';
echo $strVisibility;
Link::showCategoryAdminTools($myrow, $counter, count($categories));
echo '</th>';
} else {
echo '<th>' . get_lang('EditionNotAvailableFromSession');
}
}
echo '</tr>';
echo '</table>';
if ($showChildren) {
echo Link::showlinksofcategory($myrow['id']);
}
echo '</tr>';
echo '</th>';
echo '</tr>';
echo '</table>';
echo '</tr>';
$counter++;
/*
if ($myrow['visibility'] == '1') {
if (isset($urlview[$i]) && $urlview[$i] == '1') {
$newurlview = $urlview;
$newurlview[$i] = '0';
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&urlview='.Security::remove_XSS($newurlview).'">';
echo '<img src="../img/icons/22/view_remove.png" /> '.Security::remove_XSS($myrow['category_title']).'</a>
<br /> '.$myrow['description'];
echo '</th>';
if (api_is_allowed_to_edit(null, true)) {
if ($session_id == $myrow['session_id']) {
//.........这里部分代码省略.........
示例8: get_lang
$i++;
}
}
echo '</div>';
}
// display course description list
if ($history) {
echo '<div><table width="100%"><tr><td><h3>' . get_lang('ThematicAdvanceHistory') . '</h3></td><td align="right"><a href="index.php?action=listing">' . Display::return_icon('info.png', get_lang('BackToCourseDesriptionList'), array('style' => 'vertical-align:middle;'), ICON_SIZE_SMALL) . ' ' . get_lang('BackToCourseDesriptionList') . '</a></td></tr></table></div>';
}
$user_info = api_get_user_info();
if (isset($descriptions) && count($descriptions) > 0) {
foreach ($descriptions as $id => $description) {
echo '<div class="sectiontitle">';
if (api_is_allowed_to_edit(null, true) && !$history) {
if (api_get_session_id() == $description['session_id']) {
$description['title'] = $description['title'] . ' ' . api_get_session_image(api_get_session_id(), $user_info['status']);
//delete
echo '<a href="' . api_get_self() . '?id=' . $description['id'] . '&cidReq=' . api_get_course_id() . '&id_session=' . $description['session_id'] . '&action=delete&description_type=' . $description['description_type'] . '" onclick="javascript:if(!confirm(\'' . addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)) . '\')) return false;">';
echo Display::return_icon('delete.png', get_lang('Delete'), array('style' => 'vertical-align:middle;float:right;'), ICON_SIZE_SMALL);
echo '</a> ';
//edit
echo '<a href="' . api_get_self() . '?id=' . $description['id'] . '&cidReq=' . api_get_course_id() . '&id_session=' . $description['session_id'] . '&action=edit&description_type=' . $description['description_type'] . '">';
echo Display::return_icon('edit.png', get_lang('Edit'), array('style' => 'vertical-align:middle;float:right; padding-right:4px;'), ICON_SIZE_SMALL);
echo '</a> ';
} else {
echo Display::return_icon('edit_na.png', get_lang('EditionNotAvailableFromSession'), array('style' => 'vertical-align:middle;float:right;'), ICON_SIZE_SMALL);
}
}
echo $description['title'];
echo '</div>';
echo '<div class="sectioncomment">';
示例9: showlinksofcategory
/**
* Displays all the links of a given category.
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
*/
function showlinksofcategory($catid)
{
global $is_allowed, $charset, $urlview, $up, $down, $_user, $token;
$tbl_link = Database::get_course_table(TABLE_LINK);
$TABLE_ITEM_PROPERTY = Database::get_course_table(TABLE_ITEM_PROPERTY);
// Condition for the session.
$session_id = api_get_session_id();
$condition_session = api_get_session_condition($session_id, true, true);
$catid = intval($catid);
$course_id = api_get_course_int_id();
$sqlLinks = "SELECT *, link.id FROM " . $tbl_link . " link, " . $TABLE_ITEM_PROPERTY . " itemproperties\n WHERE\n itemproperties.tool='" . TOOL_LINK . "' AND\n link.id=itemproperties.ref AND\n link.category_id='" . $catid . "' AND\n (itemproperties.visibility='0' OR itemproperties.visibility='1')\n {$condition_session} AND\n link.c_id = " . $course_id . " AND\n itemproperties.c_id = " . $course_id . "\n ORDER BY link.display_order DESC";
$result = Database::query($sqlLinks);
$numberoflinks = Database::num_rows($result);
if ($numberoflinks > 0) {
echo '<table class="data_table" width="100%">';
$i = 1;
while ($myrow = Database::fetch_array($result)) {
// Validation when belongs to a session.
$session_img = api_get_session_image($myrow['session_id'], $_user['status']);
$css_class = $i % 2 == 0 ? $css_class = 'row_odd' : ($css_class = 'row_even');
$link_validator = '';
if (api_is_allowed_to_edit(null, true)) {
$link_validator = '' . Display::url(Display::return_icon('preview_view.png', get_lang('CheckURL'), array(), 16), '#', array('onclick' => "check_url('" . $myrow['id'] . "', '" . addslashes($myrow['url']) . "');"));
$link_validator .= Display::span('', array('id' => 'url_id_' . $myrow['id']));
}
if ($myrow['visibility'] == '1') {
echo '<tr class="' . $css_class . '">';
echo '<td align="center" valign="middle" width="5%">';
echo '<a href="link_goto.php?' . api_get_cidreq() . '&link_id=' . $myrow['id'] . '&link_url=' . urlencode($myrow['url']) . '" target="_blank">
<img src="../../main/img/link.gif" border="0" alt="' . get_lang('Link') . '"/></a></td>
<td width="80%" valign="top"><a href="link_goto.php?' . api_get_cidreq() . '&link_id=' . $myrow['id'] . '&link_url=' . urlencode($myrow['url']) . '" target="' . $myrow['target'] . '">';
echo Security::remove_XSS($myrow['title']);
echo '</a>';
echo $link_validator;
echo $session_img;
echo '<br />' . $myrow['description'];
} else {
if (api_is_allowed_to_edit(null, true)) {
echo '<tr class="' . $css_class . '">';
echo '<td align="center" valign="middle" width="5%">
<a href="link_goto.php?' . api_get_cidreq() . '&link_id=' . $myrow['id'] . "\n &link_url=" . urlencode($myrow['url']) . '"
target="_blank" class="invisible">';
echo Display::return_icon('link_na.gif', get_lang('Link')), '</a>';
echo '</td><td width="80%" valign="top"><a href="link_goto.php?', api_get_cidreq(), '&link_id=', $myrow['id'], '&link_url=', urlencode($myrow['url']), '" target="', $myrow['target'], '" class="invisible">';
echo Security::remove_XSS($myrow['url']);
echo "</a>";
echo $link_validator;
echo $session_img, '<br />', $myrow['title'];
}
}
if (api_is_allowed_to_edit(null, true)) {
echo '<td style="text-align:center;">';
if ($session_id == $myrow['session_id']) {
echo '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&sec_token=' . $token . '&action=editlink&category=' . (!empty($category) ? $category : '') . '&id=' . $myrow['id'] . '&urlview=' . $urlview . '"title="' . get_lang('Modify') . '">' . Display::return_icon('edit.png', get_lang('Modify'), array(), ICON_SIZE_SMALL) . '</a>';
// DISPLAY MOVE UP COMMAND only if it is not the top link.
/* commented at least since 2014-10-11
if ($i != 1) {
echo '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&sec_token='.$token.'&urlview=' . $urlview . '&up=', $myrow[0], '" title="' . get_lang('Up') . '">' . Display :: return_icon('up.png', get_lang('Up'), array (), ICON_SIZE_SMALL) . '', "</a>\n";
} else {
echo Display :: return_icon('up_na.png', get_lang('Up'), array (), ICON_SIZE_SMALL) . '</a>';
}
// DISPLAY MOVE DOWN COMMAND only if it is not the bottom link.
if ($i < $numberoflinks) {
echo '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&sec_token='.$token.'&urlview=' . $urlview . '&down=' . $myrow[0] . '" title="' . get_lang('Down') . '">' . Display :: return_icon('down.png', get_lang('Down'), array (), ICON_SIZE_SMALL) . '', "</a>\n";
} else {
echo Display :: return_icon('down_na.png', get_lang('Down'), array (), ICON_SIZE_SMALL) . '', "</a>\n";
}*/
if ($myrow['visibility'] == '1') {
echo '<a href="link.php?' . api_get_cidreq() . '&sec_token=' . $token . '&action=invisible&id=' . $myrow['id'] . '&scope=link&urlview=' . $urlview . '" title="' . get_lang('Hide') . '">' . Display::return_icon('visible.png', get_lang('Hide'), array(), ICON_SIZE_SMALL) . '</a>';
}
if ($myrow['visibility'] == '0') {
echo ' <a href="link.php?' . api_get_cidreq() . '&sec_token=' . $token . '&action=visible&id=' . $myrow['id'] . '&scope=link&urlview=' . $urlview . '" title="' . get_lang('Show') . '">' . Display::return_icon('invisible.png', get_lang('Show'), array(), ICON_SIZE_SMALL) . '</a>';
}
echo ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&sec_token=' . $token . '&action=deletelink&id=' . $myrow['id'] . '&urlview=' . $urlview . "\"\n onclick=\"javascript: if(!confirm('" . get_lang('LinkDelconfirm') . "'))\n return false;\" title=\"" . get_lang('Delete') . '">' . Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
} else {
echo Display::return_icon('edit_na.png', get_lang('EditionNotAvailableFromSession'), array(), ICON_SIZE_SMALL);
//get_lang('EditionNotAvailableFromSession');
}
echo '</td>';
}
echo '</tr>';
$i++;
}
echo '</table>';
}
}
示例10: render
/**
* Render a template using data. Adds a few common parameters to the data array.
*
* @see /main/template/default/course_description/
* @param string $template
* @param array $data
*/
protected function render($template, $data)
{
$data = $data ? $data : (object) array();
$_user = api_get_user_info();
$session_id = Request::get_session_id();
$data->session_image = api_get_session_image($session_id, $_user);
$data->sec_token = $this->access()->get_token();
$data->root = $this->url('');
$data->session_id = $session_id;
$data->c_id = Request::get_c_id();
$data->is_allowed_to_edit = $this->is_allowed_to_edit();
parent::render("notebook/{$template}.tpl", $data);
}
示例11: listLinksAndCategories
/**
* @param int $course_id
* @param int $session_id
* @param int $categoryId
* @param string $show
* @param null $token
*/
public static function listLinksAndCategories($course_id, $session_id, $categoryId, $show = 'none', $token = null)
{
$tbl_link = Database::get_course_table(TABLE_LINK);
$_user = api_get_user_info();
$categoryId = intval($categoryId);
/* Action Links */
echo '<div class="actions">';
if (api_is_allowed_to_edit(null, true)) {
echo '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=addlink&category_id=' . $categoryId . '">' . Display::return_icon('new_link.png', get_lang('LinkAdd'), '', ICON_SIZE_MEDIUM) . '</a>';
echo '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=addcategory&category_id=' . $categoryId . '">' . Display::return_icon('new_folder.png', get_lang('CategoryAdd'), '', ICON_SIZE_MEDIUM) . '</a>';
}
$categories = Link::getLinkCategories($course_id, $session_id);
$count = count($categories);
if (!empty($count)) {
echo '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=list&show=none">';
echo Display::return_icon('forum_listview.png', get_lang('FlatView'), '', ICON_SIZE_MEDIUM) . ' </a>';
echo '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=list&show=all">';
echo Display::return_icon('forum_nestedview.png', get_lang('NestedView'), '', ICON_SIZE_MEDIUM) . '</a>';
}
echo '</div>';
// Displaying the links which have no category (thus category = 0 or NULL),
// if none present this will not be displayed
$sql = "SELECT * FROM {$tbl_link}\n WHERE c_id = {$course_id} AND (category_id=0 OR category_id IS NULL)";
$result = Database::query($sql);
$count = Database::num_rows($result);
if ($count !== 0) {
echo Display::panel(Link::showlinksofcategory(0), get_lang('General'));
}
$counter = 0;
foreach ($categories as $myrow) {
// Student don't see invisible categories.
if (!api_is_allowed_to_edit(null, true)) {
if ($myrow['visibility'] == 0) {
continue;
}
}
// Validation when belongs to a session
$showChildren = $categoryId == $myrow['id'] || $show == 'all';
$session_img = api_get_session_image($myrow['session_id'], $_user['status']);
$myrow['description'] = $myrow['description'];
$strVisibility = '';
$visibilityClass = null;
if ($myrow['visibility'] == '1') {
$strVisibility = '<a href="link.php?' . api_get_cidreq() . '&sec_token=' . $token . '&action=invisible&id=' . $myrow['id'] . '&scope=' . TOOL_LINK_CATEGORY . '" title="' . get_lang('Hide') . '">' . Display::return_icon('visible.png', get_lang('Hide'), array(), ICON_SIZE_SMALL) . '</a>';
} elseif ($myrow['visibility'] == '0') {
$visibilityClass = 'invisible';
$strVisibility = ' <a href="link.php?' . api_get_cidreq() . '&sec_token=' . $token . '&action=visible&id=' . $myrow['id'] . '&scope=' . TOOL_LINK_CATEGORY . '" title="' . get_lang('Show') . '">' . Display::return_icon('invisible.png', get_lang('Show'), array(), ICON_SIZE_SMALL) . '</a>';
}
$header = '';
if ($showChildren) {
$header .= '<a class="' . $visibilityClass . '" href="' . api_get_self() . '?' . api_get_cidreq() . '&category_id=">';
$header .= Display::return_icon('forum_nestedview.png');
} else {
$header .= '<a class="' . $visibilityClass . '" href="' . api_get_self() . '?' . api_get_cidreq() . '&category_id=' . $myrow['id'] . '">';
$header .= Display::return_icon('forum_listview.png');
}
$header .= Security::remove_XSS($myrow['category_title']) . '</a>';
$header .= '<div class="pull-right">';
if (api_is_allowed_to_edit(null, true)) {
if ($session_id == $myrow['session_id']) {
$header .= $strVisibility;
$header .= Link::showCategoryAdminTools($myrow, $counter, count($categories));
} else {
$header .= get_lang('EditionNotAvailableFromSession');
}
}
$childrenContent = '';
if ($showChildren) {
$childrenContent = Link::showlinksofcategory($myrow['id']);
}
echo Display::panel($myrow['description'] . $childrenContent, $header);
$counter++;
}
}
示例12: empty
$myorigin = empty($origin) ? '' : '&origin=' . $origin;
$mylpid = empty($learnpath_id) ? '' : '&learnpath_id=' . $learnpath_id;
$mylpitemid = empty($learnpath_item_id) ? '' : '&learnpath_item_id=' . $learnpath_item_id;
// $token = Security::get_token(); // has been moved above
$i = 1;
foreach ($exercise_list as $row) {
$my_exercise_id = $row['id'];
$exercise_obj = new Exercise();
$exercise_obj->read($my_exercise_id);
if (empty($exercise_obj->id)) {
continue;
}
$locked = $exercise_obj->is_gradebook_locked;
$i++;
//validacion when belongs to a session
$session_img = api_get_session_image($row['session_id'], $userInfo['status']);
$time_limits = false;
if ($row['start_time'] != '0000-00-00 00:00:00' || $row['end_time'] != '0000-00-00 00:00:00') {
$time_limits = true;
}
$is_actived_time = false;
if ($time_limits) {
// check if start time
$start_time = false;
if ($row['start_time'] != '0000-00-00 00:00:00') {
$start_time = api_strtotime($row['start_time'], 'UTC');
}
$end_time = false;
if ($row['end_time'] != '0000-00-00 00:00:00') {
$end_time = api_strtotime($row['end_time'], 'UTC');
}
示例13: show_tools_category
//.........这里部分代码省略.........
if (count(explode('type=classroom', $tool['link'])) == 2 || count(explode('type=conference', $tool['link'])) == 2) {
$tool_link_params = array('id' => 'tooldesc_' . $tool["id"], 'href' => $tool['link'], 'class' => $class, 'target' => '_blank');
} else {
$tool_link_params = array('id' => 'tooldesc_' . $tool["id"], 'href' => $tool['link'], 'class' => $class, 'target' => $tool['target']);
}
}
$tool_name = self::translate_tool_name($tool);
$toolTip = $tool_name;
if (!empty($tool['description'])) {
$toolTip = $tool['description'];
}
$tool_link_params['data-original-title'] = $toolTip;
$tool_link_params['data-toggle'] = 'tooltip';
//$tool_link_params['title'] = $toolTip;
// Including Courses Plugins
// Creating title and the link
if (isset($tool['category']) && $tool['category'] == 'plugin') {
$plugin_info = $app_plugin->get_plugin_info($tool['name']);
if (isset($plugin_info) && isset($plugin_info['title'])) {
$tool_name = $plugin_info['title'];
}
$tool_link_params['href'] = api_get_path(WEB_PLUGIN_PATH) . $tool['original_link'] . '?' . api_get_cidreq();
}
if (!empty($tool['custom_icon'])) {
//self::getCustomIconPath($courseInfo)
$icon = Display::img($tool['image'], null, array('class' => 'tool-icon', 'id' => 'toolimage_' . $tool['id']));
} else {
$image = substr($tool['image'], 0, strpos($tool['image'], '.')) . '.png';
$icon = Display::return_icon($image, null, array('class' => 'tool-icon', 'id' => 'toolimage_' . $tool['id']), ICON_SIZE_BIG, false);
}
$userInfo = api_get_user_info();
$userStatus = isset($userInfo['status']) ? $userInfo['status'] : null;
// Validation when belongs to a session
$session_img = api_get_session_image($tool['session_id'], $userStatus);
$item['url_params'] = $tool_link_params;
$item['icon'] = Display::url($icon, $tool_link_params['href'], $tool_link_params);
$item['tool'] = $tool;
$item['name'] = $tool_name;
$tool_link_params['id'] = 'is' . $tool_link_params['id'];
$item['link'] = Display::url($tool_name . $session_img, $tool_link_params['href'], $tool_link_params);
$items[] = $item;
}
// end of foreach
}
$i = 0;
$html = '';
$counter = 0;
if (!empty($items)) {
foreach ($items as $item) {
switch ($theme) {
case 'activity_big':
$data = '';
if ($counter == 0) {
$html .= $rowDiv;
}
$html .= '<div class="col-xs-4 col-md-4 course-tool">';
$image = substr($item['tool']['image'], 0, strpos($item['tool']['image'], '.')) . '.png';
if (!empty($item['tool']['custom_icon'])) {
$original_image = Display::img($item['tool']['image'], null, array('id' => 'toolimage_' . $item['tool']['id']));
} else {
$original_image = Display::return_icon($image, null, array('id' => 'toolimage_' . $item['tool']['id']), ICON_SIZE_BIG, false);
}
switch ($image) {
case 'scormbuilder.png':
if (api_is_allowed_to_edit(null, true)) {
$item['url_params']['href'] .= '&isStudentView=true';
示例14: get_lang
// Displaying the links which have no category (thus category = 0 or NULL), if none present this will not be displayed
$sqlLinks = "SELECT * FROM " . $tbl_link . " WHERE c_id = {$course_id} AND category_id=0 OR category_id IS NULL";
$result = Database::query($sqlLinks);
$numberofzerocategory = Database::num_rows($result);
if ($numberofzerocategory !== 0) {
echo '<table class="data_table">';
echo '<tr><th style="font-weight: bold; text-align:left;padding-left: 10px;">' . get_lang('General') . '</th></tr>';
echo '</table>';
showlinksofcategory(0);
}
$i = 0;
$catcounter = 1;
$view = '0';
while ($myrow = Database::fetch_array($resultcategories)) {
// Validacion when belongs to a session
$session_img = api_get_session_image($myrow['session_id'], $_user['status']);
//if (!isset($urlview)) {
if ($urlview == '') {
// No $view set in the url, thus for each category link it should be all zeros except it's own
makedefaultviewcode($i);
} else {
$view = $urlview;
$view[$i] = '1';
}
// If the $urlview has a 1 for this categorie, this means it is expanded and should be desplayed as a
// - instead of a +, the category is no longer clickable and all the links of this category are displayed
$myrow['description'] = $myrow['description'];
if (isset($urlview[$i]) && $urlview[$i] == '1') {
$newurlview = $urlview;
$newurlview[$i] = '0';
echo '<tr>';
示例15: get_survey_data
/**
* This function gets all the survey data that is to be displayed in the sortable table
*
* @param int $from
* @param int $number_of_items
* @param int $column
* @param string $direction
* @param bool $isDrh
* @return unknown
*
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
* @author Julio Montoya <gugli100@gmail.com>, Beeznest - Adding intvals
* @version January 2007
*/
static function get_survey_data($from, $number_of_items, $column, $direction, $isDrh = false)
{
$table_survey = Database::get_course_table(TABLE_SURVEY);
$table_user = Database::get_main_table(TABLE_MAIN_USER);
$table_survey_question = Database::get_course_table(TABLE_SURVEY_QUESTION);
$_user = api_get_user_info();
// Searching
$search_restriction = SurveyUtil::survey_search_restriction();
if ($search_restriction) {
$search_restriction = ' AND ' . $search_restriction;
}
$from = intval($from);
$number_of_items = intval($number_of_items);
$column = intval($column);
if (!in_array(strtolower($direction), array('asc', 'desc'))) {
$direction = 'asc';
}
// Condition for the session
$session_id = api_get_session_id();
$condition_session = api_get_session_condition($session_id);
$course_id = api_get_course_int_id();
$sql = "SELECT\n\t\t\t\t\tsurvey.survey_id AS col0,\n\t\t\t\t\tsurvey.title AS col1,\n\t\t\t\t\tsurvey.code AS col2,\n\t\t\t\t\tcount(survey_question.question_id) AS col3,\n\t\t\t\t\t" . (api_is_western_name_order() ? "CONCAT(user.firstname, ' ', user.lastname)" : "CONCAT(user.lastname, ' ', user.firstname)") . "\tAS col4,\n\t\t\t\t\tsurvey.avail_from AS col5,\n\t\t\t\t\tsurvey.avail_till AS col6,\n\t\t\t\t\tsurvey.invited AS col7,\n\t\t\t\t\tsurvey.anonymous AS col8,\n\t\t\t\t\tsurvey.survey_id AS col9,\n\t\t\t\t\tsurvey.session_id AS session_id,\n\t\t\t\t\tsurvey.answered,\n\t\t\t\t\tsurvey.invited\n\t\t\t\t FROM {$table_survey} survey\n LEFT JOIN {$table_survey_question} survey_question\n ON (survey.survey_id = survey_question.survey_id AND survey_question.c_id = {$course_id})\n LEFT JOIN {$table_user} user\n ON (survey.author = user.user_id)\n\t\t\t\t WHERE survey.c_id = {$course_id}\n\t\t\t\t {$search_restriction}\n\t\t\t\t {$condition_session} ";
$sql .= " GROUP BY survey.survey_id";
$sql .= " ORDER BY col{$column} {$direction} ";
$sql .= " LIMIT {$from},{$number_of_items}";
$res = Database::query($sql);
$surveys = array();
$array = array();
while ($survey = Database::fetch_array($res)) {
$array[0] = $survey[0];
$array[1] = Display::url($survey[1], api_get_path(WEB_CODE_PATH) . 'survey/survey.php?survey_id=' . $survey[0] . '&' . api_get_cidreq());
// Validation when belonging to a session
$session_img = api_get_session_image($survey['session_id'], $_user['status']);
$array[2] = $survey[2] . $session_img;
$array[3] = $survey[3];
$array[4] = $survey[4];
$array[5] = $survey[5];
$array[6] = $survey[6];
$array[7] = Display::url($survey['answered'], api_get_path(WEB_CODE_PATH) . 'survey/survey_invitation.php?view=answered&survey_id=' . $survey[0] . '&' . api_get_cidreq()) . ' / ' . Display::url($survey['invited'], api_get_path(WEB_CODE_PATH) . 'survey/survey_invitation.php?view=invited&survey_id=' . $survey[0] . '&' . api_get_cidreq());
$array[8] = $survey[8];
$array[9] = $survey[9];
if ($isDrh) {
$array[1] = $survey[1];
$array[7] = strip_tags($array[7]);
}
$surveys[] = $array;
}
return $surveys;
}