-
Notifications
You must be signed in to change notification settings - Fork 1
/
news_list.php
executable file
·30 lines (25 loc) · 1.04 KB
/
news_list.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
/* For licensing terms, see /license.txt */
// including necessary files
require_once 'main/inc/global.inc.php';
$tool_name = get_lang('SystemAnnouncements');
$actions = '';
if (api_is_platform_admin()) {
$actions = '<a href="'.api_get_path(WEB_PATH).'main/admin/system_announcements.php">'.
Display::return_icon('edit.png', get_lang('EditSystemAnnouncement'), array(), 32).'</a>';
}
if (api_is_anonymous()) {
$visibility = SystemAnnouncementManager::VISIBLE_GUEST;
} else {
$visibility = api_is_allowed_to_create_course() ? SystemAnnouncementManager::VISIBLE_TEACHER : SystemAnnouncementManager::VISIBLE_STUDENT;
}
if (!isset($_GET['id']) || empty($_GET['id'])) {
$content = SystemAnnouncementManager::display_announcements_slider($visibility, $_GET['id']);
} else {
$content = SystemAnnouncementManager::displayAnnouncement($_GET['id'], $visibility);
}
$tpl = new Template($tool_name);
$tpl->assign('actions', $actions);
//$tpl->assign('message', $message);
$tpl->assign('content', $content);
$tpl->display_one_col_template();