| 785 | | /* returns the title of the thumnail */ |
| 786 | | function get_thumbnail_title($element_info) |
| 787 | | { |
| 788 | | // message in title for the thumbnail |
| 789 | | if (isset($element_info['file'])) |
| 790 | | { |
| 791 | | $thumbnail_title = $element_info['file']; |
| 792 | | } |
| 793 | | else |
| 794 | | { |
| 795 | | $thumbnail_title = ''; |
| 796 | | } |
| 797 | | |
| 798 | | if (!empty($element_info['filesize'])) |
| 799 | | { |
| 800 | | $thumbnail_title .= ' : '.sprintf(l10n('%d Kb'), $element_info['filesize']); |
| 801 | | } |
| 802 | | |
| 803 | | return $thumbnail_title; |
| | 785 | /** |
| | 786 | * returns the title of the thumbnail based on photo properties |
| | 787 | */ |
| | 788 | function get_thumbnail_title($info) |
| | 789 | { |
| | 790 | global $conf, $user; |
| | 791 | |
| | 792 | $title = get_picture_title($info); |
| | 793 | |
| | 794 | $details = array(); |
| | 795 | |
| | 796 | if ($info['hit'] != 0) |
| | 797 | { |
| | 798 | $details[] = $info['hit'].' '.strtolower(l10n('Visits')); |
| | 799 | } |
| | 800 | |
| | 801 | if ($conf['rate'] and !empty($info['rating_score'])) |
| | 802 | { |
| | 803 | $details[] = strtolower(l10n('Rating score')).' '.$info['rating_score']; |
| | 804 | } |
| | 805 | |
| | 806 | if (isset($info['nb_comments']) and $info['nb_comments'] != 0) |
| | 807 | { |
| | 808 | $details[] = l10n_dec('%d comment', '%d comments', $info['nb_comments']); |
| | 809 | } |
| | 810 | |
| | 811 | if (count($details) > 0) |
| | 812 | { |
| | 813 | $title.= ' ('.implode(', ', $details).')'; |
| | 814 | } |
| | 815 | |
| | 816 | if (!empty($info['comment'])) |
| | 817 | { |
| | 818 | $title.= ' '.$info['comment']; |
| | 819 | } |
| | 820 | |
| | 821 | $title = strip_tags($title); |
| | 822 | |
| | 823 | $title = trigger_event('get_thumbnail_title', $title, $info); |
| | 824 | |
| | 825 | return $title; |