news_list.php 899 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. require_once 'main/inc/global.inc.php';
  4. $tool_name = get_lang('SystemAnnouncements');
  5. $visibility = SystemAnnouncementManager::getCurrentUserVisibility();
  6. if (!isset($_GET['id']) || empty($_GET['id'])) {
  7. $content = SystemAnnouncementManager::displayAnnouncementsSlider($visibility, $_GET['id']);
  8. } else {
  9. $content = SystemAnnouncementManager::displayAnnouncement($_GET['id'], $visibility);
  10. }
  11. $tpl = new Template($tool_name);
  12. if (api_is_platform_admin()) {
  13. $actionEdit = Display::url(
  14. Display::return_icon('edit.png', get_lang('EditSystemAnnouncement'), [], ICON_SIZE_MEDIUM),
  15. api_get_path(WEB_PATH).'main/admin/system_announcements.php'
  16. );
  17. $tpl->assign(
  18. 'actions',
  19. Display::toolbarAction('toolbar', [$actionEdit])
  20. );
  21. }
  22. $tpl->assign('content', $content);
  23. $tpl->display_one_col_template();