news_list.php 1.0 KB

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