]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - include/Smarty/plugins/function.sugar_image.php
Release 6.5.0
[Github/sugarcrm.git] / include / Smarty / plugins / function.sugar_image.php
1 <?php
2
3 /*
4
5 Modification information for LGPL compliance
6
7 r56990 - 2010-06-16 13:05:36 -0700 (Wed, 16 Jun 2010) - kjing - snapshot "Mango" svn branch to a new one for GitHub sync
8
9 r56989 - 2010-06-16 13:01:33 -0700 (Wed, 16 Jun 2010) - kjing - defunt "Mango" svn dev branch before github cutover
10
11 r55980 - 2010-04-19 13:31:28 -0700 (Mon, 19 Apr 2010) - kjing - create Mango (6.1) based on windex
12
13 r51719 - 2009-10-22 10:18:00 -0700 (Thu, 22 Oct 2009) - mitani - Converted to Build 3  tags and updated the build system 
14
15 r51634 - 2009-10-19 13:32:22 -0700 (Mon, 19 Oct 2009) - mitani - Windex is the branch for Sugar Sales 1.0 development
16
17 r50375 - 2009-08-24 18:07:43 -0700 (Mon, 24 Aug 2009) - dwong - branch kobe2 from tokyo r50372
18
19 r42807 - 2008-12-29 11:16:59 -0800 (Mon, 29 Dec 2008) - dwong - Branch from trunk/sugarcrm r42806 to branches/tokyo/sugarcrm
20
21 r40493 - 2008-10-13 14:10:05 -0700 (Mon, 13 Oct 2008) - jmertic - Globally change theme image access to use SugarTheme::getImageURL() and SugarTheme::getImage(), instead of previous methods of using getImagePath(), get_image(), or using the $image_path global.
22
23 r31169 - 2008-01-21 12:03:26 -0800 (Mon, 21 Jan 2008) - tyoung - Bug 19351 - now check that a subpanel is not getting its data from a datasource function before we add it to the list of editable subpanels. Uses the new altimage parameter to sugar_image to handle subpanels that don't have nice icons.
24 Also added support in the Smarty plugin sugar_image for an altimage parameter to use if the primary icon file is missing - this is used for example when displaying subpanels for which no icon file exists
25
26 r27371 - 2007-09-28 03:58:13 -0700 (Fri, 28 Sep 2007) - tyoung - Added optional parameter to sugar_image - if 'image' is set then use that as the base for the image filename instead of using the value of parameter 'name'. Required for images where the image title to be displayed under the image does not match the image filename, for example, title='Basic Search' and filename='BasicSearch'
27
28 r24875 - 2007-07-31 11:34:56 -0700 (Tue, 31 Jul 2007) - dwheeler - Updated sugar_image smarty function to use the new module image function.
29 Numerous bug fixes to wizard views, crumb fixes in label editor. 
30 Added feedback for saving edited fields in list/subpanel views
31 Added saving of labels in list and subpanel views.
32
33 r24477 - 2007-07-19 18:01:09 -0700 (Thu, 19 Jul 2007) - majed - smarty get_image support
34
35
36 */
37
38
39
40 function smarty_function_sugar_image($params, &$smarty)
41 {
42         
43         if(!isset($params['name'])){
44                 $smarty->trigger_error("sugar_field: missing 'name' parameter");
45                 return;
46         }
47         $height = (!empty($params['height']))?$params['height']:'48';
48         $width = (!empty($params['width']))?$params['width']:'48';
49         $image = (!empty($params['image']))?$params['image']:$params['name'];
50         $altimage = (!empty($params['altimage']))?$params['altimage']:$params['name'];
51         return getStudioIcon($image, $altimage, $height, $width);
52         
53 }