本文整理汇总了PHP中api_get_group_id函数的典型用法代码示例。如果您正苦于以下问题:PHP api_get_group_id函数的具体用法?PHP api_get_group_id怎么用?PHP api_get_group_id使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了api_get_group_id函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_announcements
private function get_announcements($username, $course_code, $announcement_id = 0)
{
$session_id = api_get_session_id();
$condition_session = api_get_session_condition($session_id);
$announcement_id = $announcement_id == 0 ? "" : "AND announcement.id=" . $announcement_id;
$user_id = UserManager::get_user_id_from_username($username);
//$listOfCourses = CourseManager::get_course_information_by_id($course_id);
$course_info = CourseManager::get_course_information($course_code);
$course_db = $course_info['db_name'];
$tbl_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY, $course_db);
$tbl_announcement = Database::get_course_table(TABLE_ANNOUNCEMENT, $course_db);
$maximum = '12';
$group_memberships = GroupManager::get_group_ids($course_info['real_id'], $user_id);
if (api_get_group_id() == 0) {
$cond_user_id = " AND ( ip.to_user_id='" . $user_id . "'" . "OR ip.to_group_id IN (0, " . implode(", ", $group_memberships) . ")) ";
} else {
$cond_user_id = " AND ( ip.to_user_id='" . $user_id . "'" . "OR ip.to_group_id IN (0, " . api_get_group_id() . ")) ";
}
// the user is member of several groups => display personal announcements AND his group announcements AND the general announcements
if (is_array($group_memberships) && count($group_memberships) > 0) {
$sql = "SELECT\n announcement.*, ip.visibility, ip.to_group_id, ip.insert_user_id\n FROM {$tbl_announcement} announcement, {$tbl_item_property} ip\n WHERE announcement.id = ip.ref\n AND ip.tool='announcement'\n AND ip.visibility='1'\n {$announcement_id}\n {$cond_user_id}\n {$condition_session}\n GROUP BY ip.ref\n ORDER BY display_order DESC\n LIMIT 0,{$maximum}";
} else {
// the user is not member of any group
// this is an identified user => show the general announcements AND his personal announcements
if ($user_id) {
if (api_get_course_setting('allow_user_edit_announcement') && !api_is_anonymous()) {
$cond_user_id = " AND (ip.lastedit_user_id = '" . api_get_user_id() . "' OR ( ip.to_user_id='" . $user_id . "' OR ip.to_group_id='0')) ";
} else {
$cond_user_id = " AND ( ip.to_user_id='" . $user_id . "' OR ip.to_group_id='0') ";
}
$sql = "SELECT\n announcement.*, ip.visibility, ip.to_group_id, ip.insert_user_id\n FROM {$tbl_announcement} announcement, {$tbl_item_property} ip\n WHERE announcement.id = ip.ref\n AND ip.tool='announcement'\n AND ip.visibility='1'\n {$announcement_id}\n {$cond_user_id}\n {$condition_session}\n GROUP BY ip.ref\n ORDER BY display_order DESC\n LIMIT 0,{$maximum}";
} else {
if (api_get_course_setting('allow_user_edit_announcement')) {
$cond_user_id = " AND (ip.lastedit_user_id = '" . api_get_user_id() . "' OR ip.to_group_id='0') ";
} else {
$cond_user_id = " AND ip.to_group_id='0' ";
}
// the user is not identiefied => show only the general announcements
$sql = "SELECT\n announcement.*, ip.visibility, ip.to_group_id, ip.insert_user_id\n FROM {$tbl_announcement} announcement, {$tbl_item_property} ip\n WHERE announcement.id = ip.ref\n AND ip.tool='announcement'\n AND ip.visibility='1'\n AND ip.to_group_id='0'\n {$announcement_id}\n {$condition_session}\n GROUP BY ip.ref\n ORDER BY display_order DESC\n LIMIT 0,{$maximum}";
}
}
$result = Database::query($sql);
return $result;
}
示例2: all_users
/**
* Returns either all course users or all session users depending on whether
* session is turned on or not
*
* @return array
*/
public function all_users()
{
$course_code = $this->course('code');
if (empty($this->session_id)) {
$group_id = api_get_group_id();
if (empty($group_id)) {
$user_list = CourseManager::get_user_list_from_course_code($course_code);
} else {
$user_list = GroupManager::get_users($group_id);
$new_user_list = array();
foreach ($user_list as $user) {
$new_user_list[] = array('user_id' => $user);
}
$user_list = $new_user_list;
}
} else {
$user_list = CourseManager::get_user_list_from_course_code($course_code, $this->session_id);
}
return $user_list;
}
示例3: setFocus
);
});
function setFocus() {
$("#document_title").focus();
}
$(window).load(function () {
setFocus();
});
</script>';
require_once api_get_path(SYS_CODE_PATH) . 'document/document.inc.php';
//I'm in the certification module?
$is_certificate_mode = false;
$_course = api_get_course_info();
$groupId = api_get_group_id();
if (isset($_REQUEST['certificate']) && $_REQUEST['certificate'] == 'true') {
$is_certificate_mode = true;
}
if ($is_certificate_mode) {
$nameTools = get_lang('CreateCertificate');
} else {
$nameTools = get_lang('CreateDocument');
}
/* Constants and variables */
$doc_table = Database::get_course_table(TABLE_DOCUMENT);
$course_id = api_get_course_int_id();
$document_data = DocumentManager::get_document_data_by_id($_REQUEST['id'], api_get_course_id(), true);
if (empty($document_data)) {
if (api_is_in_group()) {
$group_properties = GroupManager::get_group_properties($groupId);
示例4: get_attachment
$attachment_list = get_attachment($row['post_id']);
}
$id_attach = !empty($attachment_list) ? $attachment_list['id'] : '';
$sql_post_id = "SELECT post_id FROM {$table_posts} WHERE c_id = {$course_id} AND post_title='" . Database::escape_string($row['thread_title']) . "'";
$result_post_id = Database::query($sql_post_id);
$row_post_id = Database::fetch_array($result_post_id);
if ($origin != 'learnpath') {
if (api_is_allowed_to_edit(false, true) && !(api_is_course_coach() && $current_forum['session_id'] != $_SESSION['id_session'])) {
echo '<a href="' . $forumUrl . 'editpost.php?' . api_get_cidreq() . '&forum=' . Security::remove_XSS($my_forum) . '&thread=' . Security::remove_XSS($row['thread_id']) . '&post=' . $row_post_id['post_id'] . '&id_attach=' . $id_attach . '">' . Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . '</a>';
if (api_resource_is_locked_by_gradebook($row['thread_id'], LINK_FORUM_THREAD)) {
echo Display::return_icon('delete_na.png', get_lang('ResourceLockedByGradebook'), array(), ICON_SIZE_SMALL);
} else {
echo '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&forum=' . Security::remove_XSS($my_forum) . '&action=delete&content=thread&id=' . $row['thread_id'] . $origin_string . "\" onclick=\"javascript:if(!confirm('" . addslashes(api_htmlentities(get_lang('DeleteCompleteThread'), ENT_QUOTES)) . "')) return false;\">" . Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
}
display_visible_invisible_icon('thread', $row['thread_id'], $row['visibility'], array('forum' => $my_forum, 'origin' => $origin, 'gidReq' => $groupId));
display_lock_unlock_icon('thread', $row['thread_id'], $row['locked'], array('forum' => $my_forum, 'origin' => $origin, 'gidReq' => api_get_group_id()));
echo '<a href="viewforum.php?' . api_get_cidreq() . '&forum=' . Security::remove_XSS($my_forum) . '&action=move&thread=' . $row['thread_id'] . $origin_string . '">' . Display::return_icon('move.png', get_lang('MoveThread'), array(), ICON_SIZE_SMALL) . '</a>';
}
}
$iconnotify = 'send_mail.gif';
if (is_array(isset($_SESSION['forum_notification']['thread']) ? $_SESSION['forum_notification']['thread'] : null)) {
if (in_array($row['thread_id'], $_SESSION['forum_notification']['thread'])) {
$iconnotify = 'send_mail_checked.gif';
}
}
$icon_liststd = 'user.png';
if (!api_is_anonymous() && api_is_allowed_to_session_edit(false, true)) {
echo '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&forum=' . Security::remove_XSS($my_forum) . '&origin=' . $origin . '&action=notify&content=thread&id=' . $row['thread_id'] . '">' . Display::return_icon($iconnotify, get_lang('NotifyMe')) . '</a>';
}
if (api_is_allowed_to_edit(null, true) && $origin != 'learnpath') {
echo '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&forum=' . Security::remove_XSS($my_forum) . '&origin=' . $origin . '&action=liststd&content=thread&id=' . $row['thread_id'] . '">' . Display::return_icon($icon_liststd, get_lang('StudentList'), array(), ICON_SIZE_SMALL) . '</a>';
示例5: api_get_course_id
*/
require_once '../inc/global.inc.php';
//exit;
$document_id = $_GET['id'];
$courseCode = api_get_course_id();
if ($document_id) {
$document_data = DocumentManager::get_document_data_by_id($document_id, $courseCode);
if (empty($document_data)) {
api_not_allowed();
}
} else {
api_not_allowed();
}
//Check user visibility
//$is_visible = DocumentManager::is_visible_by_id($document_id, $course_info, api_get_session_id(), api_get_user_id());
$is_visible = DocumentManager::check_visibility_tree($document_id, api_get_course_id(), api_get_session_id(), api_get_user_id(), api_get_group_id());
if (!api_is_allowed_to_edit() && !$is_visible) {
api_not_allowed(true);
}
$header_file = $document_data['path'];
$pathinfo = pathinfo($header_file);
$show_web_odf = false;
$web_odf_supported_files = DocumentManager::get_web_odf_extension_list();
if (in_array(strtolower($pathinfo['extension']), $web_odf_supported_files)) {
$show_web_odf = true;
}
$file_url_web = api_get_path(WEB_COURSE_PATH) . $_course['path'] . '/document' . $header_file;
if ($show_web_odf) {
//$htmlHeadXtra[] = api_get_js('webodf/webodf.js');
$htmlHeadXtra[] = api_get_js('wodotexteditor/wodotexteditor.js');
$htmlHeadXtra[] = api_get_js('wodotexteditor/localfileeditor.js');
示例6: api_get_self
// Tool introduction
if (empty($_GET['origin']) || $_GET['origin'] !== 'learnpath') {
Display::display_introduction_section(TOOL_ANNOUNCEMENT);
}
// Actions
$show_actions = false;
$actionsLeft = '';
if ((api_is_allowed_to_edit(false, true) || api_get_course_setting('announcement.allow_user_edit_announcement') && !api_is_anonymous()) && (empty($_GET['origin']) || $_GET['origin'] !== 'learnpath')) {
if (in_array($action, array('add', 'modify', 'view'))) {
$actionsLeft .= "<a href='" . api_get_self() . "?" . api_get_cidreq() . "&origin=" . $origin . "'>" . Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM) . "</a>";
} else {
$actionsLeft .= "<a href='" . api_get_self() . "?" . api_get_cidreq() . "&action=add&origin=" . $origin . "'>" . Display::return_icon('new_announce.png', get_lang('AddAnnouncement'), '', ICON_SIZE_MEDIUM) . "</a>";
}
$show_actions = true;
} else {
if (in_array($action, array('view'))) {
$actionsLeft .= "<a href='" . api_get_self() . "?" . api_get_cidreq() . "&origin=" . $origin . "'>" . Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM) . "</a>";
echo '</div>';
}
}
if (api_is_allowed_to_edit() && $announcement_number > 1) {
if (api_get_group_id() == 0) {
if (!isset($_GET['action'])) {
$actionsLeft .= "<a href=\"" . api_get_self() . "?" . api_get_cidreq() . "&action=delete_all\" onclick=\"javascript:if(!confirm('" . get_lang("ConfirmYourChoice") . "')) return false;\">" . Display::return_icon('delete_announce.png', get_lang('AnnouncementDeleteAll'), '', ICON_SIZE_MEDIUM) . "</a>";
}
}
}
if ($show_actions) {
echo Display::toolbarAction('toolbar', array($actionsLeft, $searchFormToString), 2, false);
}
echo $content;
示例7: search_widget_show
/**
* Show the search widget
*
* The form will post to index.php by default, you can pass a value to
* $action to use a custom action.
* IMPORTANT: you have to call search_widget_prepare() before calling this
* function or otherwise the form will not behave correctly.
*
* @param string $action Just in case your action is not
* index.php
*/
function search_widget_show($action = 'index.php')
{
require_once api_get_path(LIBRARY_PATH) . 'search/ChamiloQuery.php';
// TODO: load images dinamically when they're avalaible from specific field ui to add
$groupId = api_get_group_id();
$sf_terms = array();
$specific_fields = get_specific_field_list();
$url_params = array();
if (($cid = api_get_course_id()) != -1) {
// with cid
// get search engine terms
$course_filter = chamilo_get_boolean_query(XAPIAN_PREFIX_COURSEID . $cid);
$dkterms = chamilo_query_simple_query('', 0, 1000, array($course_filter));
//prepare specific fields names (and also get possible URL param names)
foreach ($specific_fields as $specific_field) {
$temp = array();
if (is_array($dkterms) && count($dkterms) > 0) {
foreach ($dkterms[1] as $obj) {
$temp = array_merge($obj['sf-' . $specific_field['code']], $temp);
}
}
$sf_terms[$specific_field['code']] = $temp;
$url_params[] = 'sf_' . $specific_field['code'];
unset($temp);
}
} else {
// without cid
// prepare specific fields names (and also get possible URL param names)
foreach ($specific_fields as $specific_field) {
//get Xapian terms for a specific term prefix, in ISO, apparently
$sf_terms[$specific_field['code']] = xapian_get_all_terms(1000, $specific_field['code']);
$url_params[] = 'sf_' . $specific_field['code'];
}
}
echo '<h2>' . get_lang('Search') . '</h2>';
// Tool introduction
// TODO: Settings for the online editor to be checked (insert an image for example). Probably this is a special case here.
if (api_get_course_id() !== -1) {
if (!empty($groupId)) {
Display::display_introduction_section(TOOL_SEARCH . $groupId);
} else {
Display::display_introduction_section(TOOL_SEARCH);
}
}
$op = 'or';
if (!empty($_REQUEST['operator']) && in_array($op, array('or', 'and'))) {
$op = $_REQUEST['operator'];
}
//check if URL params are defined (to see if we show the thesaurus or not)
$show_thesaurus = false;
foreach ($url_params as $param) {
if (isset($_REQUEST[$param]) && is_array($_REQUEST[$param])) {
$thesaurus_decided = FALSE;
foreach ($_REQUEST[$param] as $term) {
if (!empty($term)) {
$show_thesaurus = true;
$thesaurus_decided = TRUE;
break;
}
}
if ($thesaurus_decided) {
break;
}
}
}
// create the form
// TODO: use FormValidator
display_search_form($action, $show_thesaurus, $sf_terms, $op);
}
示例8: upload_document
/**
* Uploads a document
*
* @param array $files the $_FILES variable
* @param string $path
* @param string $title
* @param string $comment
* @param int $unzip unzip or not the file
* @param string $if_exists overwrite, rename or warn (default)
* @param bool $index_document index document (search xapian module)
* @param bool $show_output print html messages
* @return array|bool
*/
public static function upload_document($files, $path, $title = null, $comment = null, $unzip = 0, $if_exists = null, $index_document = false, $show_output = false, $fileKey = 'file')
{
$course_info = api_get_course_info();
$sessionId = api_get_session_id();
$course_dir = $course_info['path'] . '/document';
$sys_course_path = api_get_path(SYS_COURSE_PATH);
$base_work_dir = $sys_course_path . $course_dir;
if (isset($files[$fileKey])) {
$upload_ok = process_uploaded_file($files[$fileKey], $show_output);
if ($upload_ok) {
// File got on the server without problems, now process it
$new_path = handle_uploaded_document($course_info, $files[$fileKey], $base_work_dir, $path, api_get_user_id(), api_get_group_id(), null, $unzip, $if_exists, $show_output, false, null, $sessionId);
if ($new_path) {
$documentId = DocumentManager::get_document_id($course_info, $new_path, $sessionId);
if (!empty($documentId)) {
$table_document = Database::get_course_table(TABLE_DOCUMENT);
$params = array();
/*if ($if_exists == 'rename') {
// Remove prefix
$suffix = DocumentManager::getDocumentSuffix(
$course_info,
$sessionId,
api_get_group_id()
);
$new_path = basename($new_path);
$new_path = str_replace($suffix, '', $new_path);
error_log('renamed');
error_log($new_path);
$params['title'] = get_document_title($new_path);
} else {
if (!empty($title)) {
$params['title'] = get_document_title($title);
} else {
$params['title'] = get_document_title($files['file']['name']);
}
}*/
if (!empty($comment)) {
$params['comment'] = trim($comment);
}
Database::update($table_document, $params, array('id = ? AND c_id = ? ' => array($documentId, $course_info['real_id'])));
}
// Showing message when sending zip files
if ($new_path === true && $unzip == 1 && $show_output) {
Display::display_confirmation_message(get_lang('UplUploadSucceeded') . '<br />', false);
}
if ($index_document) {
self::index_document($documentId, $course_info['code'], null, $_POST['language'], $_REQUEST, $if_exists);
}
if (!empty($documentId) && is_numeric($documentId)) {
$documentData = self::get_document_data_by_id($documentId, $course_info['code'], false, $sessionId);
return $documentData;
}
}
}
}
return false;
}
示例9: api_protect_course_group
/**
* @param string $tool Possible values:
* GroupManager::GROUP_TOOL_*
*
*/
function api_protect_course_group($tool, $showHeader = true)
{
$userId = api_get_user_id();
$groupId = api_get_group_id();
if (!empty($groupId)) {
$allow = GroupManager::user_has_access($userId, $groupId, $tool);
if (!$allow) {
api_not_allowed($showHeader);
}
}
}
示例10: users_list_in_chat
/**
* @return array user list in chat
*/
function users_list_in_chat()
{
$list_users_in_chat = array();
$tbl_chat_connected = Database::get_course_table(TABLE_CHAT_CONNECTED);
$course_id = api_get_course_int_id();
$session_id = api_get_session_id();
$group_id = api_get_group_id();
if (!empty($group_id)) {
$extra_condition = " WHERE to_group_id = '{$group_id}'";
} else {
$extra_condition = api_get_session_condition($session_id, false);
}
$extra_condition .= " AND c_id = {$course_id} ";
$sql = 'SELECT user_id, last_connection FROM ' . $tbl_chat_connected . $extra_condition;
$result = Database::query($sql);
while ($row = Database::fetch_array($result, 'ASSOC')) {
$list_users_in_chat[] = $row;
}
return $list_users_in_chat;
}
示例11: array
if ($current_group['work_state'] == GroupManager::TOOL_PUBLIC) {
// Link to the works area of this group
$actions_array[] = array('url' => api_get_path(WEB_CODE_PATH) . 'work/work.php?' . api_get_cidreq(), 'content' => Display::return_icon('work.png', get_lang('GroupWork'), array(), ICON_SIZE_MEDIUM));
}
if ($current_group['announcements_state'] == GroupManager::TOOL_PUBLIC) {
// Link to a group-specific part of announcements
$actions_array[] = array('url' => api_get_path(WEB_CODE_PATH) . 'announcements/announcements.php?' . api_get_cidreq(), 'content' => Display::return_icon('announce.png', get_lang('GroupAnnouncements'), array(), ICON_SIZE_MEDIUM));
}
if ($current_group['wiki_state'] == GroupManager::TOOL_PUBLIC) {
// Link to the wiki area of this group
$actions_array[] = array('url' => api_get_path(WEB_CODE_PATH) . 'wiki/index.php?' . api_get_cidreq() . '&action=show&title=index&session_id=' . api_get_session_id() . '&group_id=' . $current_group['id'], 'content' => Display::return_icon('wiki.png', get_lang('GroupWiki'), array(), 32));
}
if ($current_group['chat_state'] == GroupManager::TOOL_PUBLIC) {
// Link to the chat area of this group
if (api_get_course_setting('allow_open_chat_window')) {
$actions_array[] = array('url' => "javascript: void(0);\" onclick=\"window.open('../chat/chat.php?" . api_get_cidreq() . "&toolgroup=" . $current_group['id'] . "','window_chat_group_" . api_get_course_id() . "_" . api_get_group_id() . "','height=380, width=625, left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no') \"", 'content' => Display::return_icon('chat.png', get_lang('Chat'), array(), 32));
} else {
$actions_array[] = array('url' => api_get_path(WEB_CODE_PATH) . "chat/chat.php?" . api_get_cidreq() . "&toolgroup=" . $current_group['id'], 'content' => Display::return_icon('chat.png', get_lang('Chat'), array(), 32));
}
}
if (!empty($actions_array)) {
echo Display::actions($actions_array);
}
}
/*
* List all the tutors of the current group
*/
$tutors = GroupManager::get_subscribed_tutors($current_group['id']);
$tutor_info = '';
if (count($tutors) == 0) {
$tutor_info = get_lang('GroupNoneMasc');
示例12: api_get_path
$lib_path = api_get_path(LIBRARY_PATH);
/* Libraries */
require_once $lib_path . 'document.lib.php';
api_protect_course_script(true);
$htmlHeadXtra[] = api_get_jqgrid_js();
$course_info = api_get_course_info();
$course_dir = $course_info['path'] . '/document';
$sys_course_path = api_get_path(SYS_COURSE_PATH);
$base_work_dir = $sys_course_path . $course_dir;
$http_www = api_get_path(WEB_COURSE_PATH) . $_course['path'] . '/document';
$dbl_click_id = 0;
// Used for avoiding double-click
/* Constants and variables */
$session_id = api_get_session_id();
$course_code = api_get_course_id();
$to_group_id = api_get_group_id();
$is_allowed_to_edit = api_is_allowed_to_edit(null, true);
$group_member_with_upload_rights = false;
// If the group id is set, we show them group documents
$group_properties = array();
$group_properties['directory'] = null;
// For sessions we should check the parameters of visibility
if (api_get_session_id() != 0) {
$group_member_with_upload_rights = $group_member_with_upload_rights && api_is_allowed_to_session_edit(false, true);
}
//Actions
$document_id = intval($_REQUEST['id']);
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null;
switch ($action) {
case 'download':
$document_data = DocumentManager::get_document_data_by_id($document_id, api_get_course_id());
示例13: document_exists
/**
* Check if a document width the chosen filename already exists
*/
function document_exists($filename)
{
global $dir;
$cleanName = api_replace_dangerous_char($filename);
// No "dangerous" files
$cleanName = disable_dangerous_file($cleanName);
return !DocumentManager::documentExists($dir . $cleanName . '.html', api_get_course_info(), api_get_session_id(), api_get_group_id());
}
示例14: get_lang
$tool_name = get_lang('ToolWiki');
/* ACCESS */
api_protect_course_script();
api_block_anonymous_users();
api_protect_course_group(GroupManager::GROUP_TOOL_WIKI);
/* TRACKING */
Event::event_access_tool(TOOL_WIKI);
if ($groupId) {
$group_properties = GroupManager::get_group_properties($groupId);
$interbreadcrumb[] = array("url" => api_get_path(WEB_CODE_PATH) . "group/group.php?" . api_get_cidreq(), "name" => get_lang('Groups'));
$interbreadcrumb[] = array("url" => api_get_path(WEB_CODE_PATH) . "group/group_space.php?" . api_get_cidreq(), "name" => get_lang('GroupSpace') . ' ' . Security::remove_XSS($group_properties['name']));
//ensure this tool in groups whe it's private or deactivated
if ($group_properties['wiki_state'] == 0) {
api_not_allowed();
} elseif ($group_properties['wiki_state'] == 2) {
if (!api_is_allowed_to_edit(false, true) and !GroupManager::is_user_in_group(api_get_user_id(), api_get_group_id())) {
api_not_allowed();
}
}
}
$is_allowed_to_edit = api_is_allowed_to_edit(false, true);
// The page we are dealing with
$page = isset($_GET['title']) ? $_GET['title'] : 'index';
$action = isset($_GET['action']) ? Security::remove_XSS($_GET['action']) : 'showpage';
$view = isset($_GET['view']) ? Security::remove_XSS($_GET['view']) : null;
$wiki->page = $page;
$wiki->action = $action;
// Setting wiki data
if (!empty($view)) {
$wiki->setWikiData($view);
}
示例15: search_link
if ($origin != 'learnpath') {
echo '<div class="actions">';
echo '<span style="float:right;">' . search_link() . '</span>';
echo '<a href="viewthread.php?' . api_get_cidreq() . '&forum=' . Security::remove_XSS($_GET['forum']) . '&gradebook=' . $gradebook . '&thread=' . Security::remove_XSS($_GET['thread']) . '&origin=' . $origin . '">' . Display::return_icon('back.png', get_lang('BackToThread'), '', ICON_SIZE_MEDIUM) . '</a>';
echo '</div>';
} else {
echo '<div style="height:15px"> </div>';
}
/*New display forum div*/
echo '<div class="forum_title">';
echo '<h1><a href="viewforum.php?&origin=' . $origin . '&forum=' . $current_forum['forum_id'] . '" ' . class_visible_invisible($current_forum['visibility']) . '>' . prepare4display($current_forum['forum_title']) . '</a></h1>';
echo '<p class="forum_description">' . prepare4display($current_forum['forum_comment']) . '</p>';
echo '</div>';
/* End new display forum */
// The form for the reply
$my_action = isset($_GET['action']) ? Security::remove_XSS($_GET['action']) : '';
$my_post = isset($_GET['post']) ? Security::remove_XSS($_GET['post']) : '';
$my_elements = isset($_SESSION['formelements']) ? $_SESSION['formelements'] : '';
$values = show_add_post_form($current_forum, $forum_setting, $my_action, $my_post, $my_elements);
if (!empty($values) and isset($_POST['SubmitPost'])) {
$result = store_reply($current_forum, $values);
//@todo split the show_add_post_form function
$url = 'viewthread.php?forum=' . $current_thread['forum_id'] . '&gradebook=' . $gradebook . '&thread=' . intval($_GET['thread']) . '&gidReq=' . api_get_group_id() . '&origin=' . $origin . '&msg=' . $result['msg'] . '&type=' . $result['type'];
echo '
<script>
window.location = "' . $url . '";
</script>';
}
if (isset($origin) && $origin != 'learnpath') {
Display::display_footer();
}