news_list.php 893 B

12345678910111213141516171819202122232425262728293031
  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. $id = isset($_GET['id']) ? $_GET['id'] : 0;
  7. if (empty($id)) {
  8. $content = SystemAnnouncementManager::displayAnnouncementsSlider($visibility);
  9. } else {
  10. $content = SystemAnnouncementManager::displayAnnouncement($id, $visibility);
  11. }
  12. $tpl = new Template($tool_name);
  13. if (api_is_platform_admin()) {
  14. $actionEdit = Display::url(
  15. Display::return_icon('edit.png', get_lang('EditSystemAnnouncement'), [], ICON_SIZE_MEDIUM),
  16. api_get_path(WEB_PATH).'main/admin/system_announcements.php'
  17. );
  18. $tpl->assign(
  19. 'actions',
  20. Display::toolbarAction('toolbar', [$actionEdit])
  21. );
  22. }
  23. $tpl->assign('content', $content);
  24. $tpl->display_one_col_template();