Changeset 13240 for trunk/include/functions.inc.php
- Timestamp:
- Feb 18, 2012, 9:46:46 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions.inc.php
r13234 r13240 817 817 818 818 819 /* Returns the PATH to the thumbnail to be displayed. If the element does not820 * have a thumbnail, the default mime image path is returned. The PATH can be821 * used in the php script, but not sent to the browser.822 * @param array element_info assoc array containing element info from db823 * at least 'path', 'tn_ext' and 'id' should be present824 */825 function get_thumbnail_path($element_info)826 {827 $path = get_thumbnail_location($element_info);828 if ( !url_is_remote($path) )829 {830 $path = PHPWG_ROOT_PATH.$path;831 }832 return $path;833 }834 835 819 /* Returns the URL of the thumbnail to be displayed. If the element does not 836 820 * have a thumbnail, the default mime image url is returned. The URL can be … … 842 826 { 843 827 return DerivativeImage::thumb_url($element_info); 844 }845 846 /* returns the relative path of the thumnail with regards to to the root847 of piwigo (not the current page!).This function is not intended to be848 called directly from code.*/849 function get_thumbnail_location($element_info)850 {851 global $conf;852 if ( !empty( $element_info['tn_ext'] ) )853 {854 $path = substr_replace(855 get_filename_wo_extension($element_info['path']),856 '/'.$conf['dir_thumbnail'].'/'.$conf['prefix_thumbnail'],857 strrpos($element_info['path'],'/'),858 1859 );860 $path.= '.'.$element_info['tn_ext'];861 }862 else863 {864 $path = get_themeconf('mime_icon_dir')865 .strtolower(get_extension($element_info['path'])).'.png';866 // plugins want another location ?867 $path = trigger_event( 'get_thumbnail_location', $path, $element_info);868 }869 return $path;870 828 } 871 829 … … 921 879 * @return string 922 880 */ 923 function l10n($key , $textdomain='messages')881 function l10n($key) 924 882 { 925 883 global $lang, $conf; 926 884 927 if ($conf['debug_l10n'] and !isset($lang[$key]) and !empty($key)) 928 { 929 trigger_error('[l10n] language key "'.$key.'" is not defined', E_USER_WARNING); 930 } 931 932 return isset($lang[$key]) ? $lang[$key] : $key; 885 if ( ($val=@$lang[$key]) == null) 886 { 887 if ($conf['debug_l10n'] and !isset($lang[$key]) and !empty($key)) 888 { 889 trigger_error('[l10n] language key "'.$key.'" is not defined', E_USER_WARNING); 890 } 891 $val = $key; 892 } 893 return $val; 933 894 } 934 895
Note: See TracChangeset
for help on using the changeset viewer.