news_list.php 1.0 KB

123456789101112131415161718192021222324252627
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. // name of the language file that needs to be included
  4. $language_file = array ('admin','courses', 'index', 'announcements', 'group');
  5. // including necessary files
  6. require_once 'main/inc/global.inc.php';
  7. $tool_name = get_lang('SystemAnnouncements');
  8. $actions = '';
  9. if (api_is_platform_admin()) {
  10. $actions = '<a href="'.api_get_path(WEB_PATH).'main/admin/system_announcements.php">'.Display::return_icon('edit.png', get_lang('EditSystemAnnouncement'), array(), 32).'</a>';
  11. }
  12. if (api_is_anonymous()) {
  13. $visibility = SystemAnnouncementManager::VISIBLE_GUEST;
  14. } else {
  15. $visibility = api_is_allowed_to_create_course() ? SystemAnnouncementManager::VISIBLE_TEACHER : SystemAnnouncementManager::VISIBLE_STUDENT;
  16. }
  17. $content = SystemAnnouncementManager ::display_announcements_slider($visibility, $_GET['id']);
  18. $tpl = new Template($tool_name);
  19. $tpl->assign('actions', $actions);
  20. //$tpl->assign('message', $message);
  21. $tpl->assign('content', $content);
  22. $tpl->display_one_col_template();