site_announcement.php 683 B

12345678910111213141516171819202122232425
  1. <?php
  2. /**
  3. * Overrule the default icon view for this entity
  4. *
  5. * @uses $vars['entity'] the entity to view the icon of
  6. * @uses $vars['size'] the size of the icon to view
  7. */
  8. $entity = elgg_extract('entity', $vars);
  9. if (empty($entity) || !elgg_instanceof($entity, 'object', SITE_ANNOUNCEMENT_SUBTYPE)) {
  10. return;
  11. }
  12. if (!empty($entity->announcement_type)) {
  13. echo elgg_view_icon($entity->announcement_type, array(
  14. 'class' => 'site-announcements-icon',
  15. 'title' => elgg_echo("site_announcements:type:{$entity->announcement_type}")
  16. ));
  17. } else {
  18. echo elgg_view('output/img', array(
  19. 'src' => '_graphics/spacer.gif',
  20. 'alt' => elgg_echo('site_announcements:type:general')
  21. ));
  22. }