From: <jon...@us...> - 2011-04-04 16:04:28
|
Revision: 33818 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=33818&view=rev Author: jonnybradley Date: 2011-04-04 16:04:17 +0000 (Mon, 04 Apr 2011) Log Message: ----------- [FIX] trackers: Image - Use corrected resizing for input Modified Paths: -------------- branches/7.x/lib/core/Tracker/Field/Image.php branches/7.x/templates/trackerinput/image.tpl Modified: branches/7.x/lib/core/Tracker/Field/Image.php =================================================================== --- branches/7.x/lib/core/Tracker/Field/Image.php 2011-04-04 15:49:11 UTC (rev 33817) +++ branches/7.x/lib/core/Tracker/Field/Image.php 2011-04-04 16:04:17 UTC (rev 33818) @@ -46,7 +46,7 @@ $smarty = TikiLib::lib('smarty'); $val = $this->getConfiguration('value'); - $list_mode = $context['list_mode']; + $list_mode = !empty($context['list_mode']) ? $context['list_mode'] : 'n'; if ($list_mode == 'csv') { return $val; // return the filename } @@ -99,6 +99,7 @@ function renderInput($context = array()) { + $context['image_tag'] = $this->renderInnerOutput($context); return $this->renderTemplate('trackerinput/image.tpl', $context); } Modified: branches/7.x/templates/trackerinput/image.tpl =================================================================== --- branches/7.x/templates/trackerinput/image.tpl 2011-04-04 15:49:11 UTC (rev 33817) +++ branches/7.x/templates/trackerinput/image.tpl 2011-04-04 16:04:17 UTC (rev 33818) @@ -1,7 +1,7 @@ <input type="file" name="{$field.ins_id}"{if isset($input_err)} value="{$field.value}"{/if} /> {if $field.value ne ''} <br /> - <img src="{$field.value}" alt="" width="{$field.options_array[2]}" height="{$field.options_array[3]}" /> + {if $context.image_tag}{$context.image_tag}{/if} {if $field.isMandatory ne 'y'} <a href="{$smarty.server.PHP_SELF}?{query removeImage='y' fieldId=`$field.fieldId` itemId=`$item.itemId` trackerId=`$item.trackerId` fieldName=`$field.name`}" class="trkRemoveImage">{icon _id='cross' alt="{tr}Remove Image{/tr}"}</a> {jq}$(".trkRemoveImage").click(function(){return confirm("{tr}Are you sure you want to delete this image?{/tr}");});{/jq} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |