View Single Post
  #1  
Old 07-10-2013, 08:38 AM
  websupport's Avatar 
websupport websupport is offline
 

Advanced Member
  
Join Date: May 2005
Posts: 32
 

Default Custom Module Image upload field

I am trying to add an image upload field using the native edit_image.tpl file in xcart. But I am having trouble with it right now. I cannot get the popup box to appear. I can get the fields in place, but when I click on change image it doesn't do anything.

Here is some of my coding:

{foreach from=$mcollections item="m"}
<tr>
<td><input type="checkbox" name="mcoll_del[{$m.id}]"></td>
<td>{include file="modules/Minnie_Rose/edit_image.tpl" type="mr_coll_cats" idtag='mr_coll' id=$m.id button_name=$lng.lbl_txs_xg_update no_delete="Y" }</td>
<td align="center"><input type="text" name="mcoll[{$m.id}][desc]" value="{$m.name}" style="width:95%" /></td>
<td><input type="text" name="mcoll[{$m.id}][orderby]" value="{$m.desc}" style="width:100%;" /></td>
<td align="center"><input type="text" name="mcoll[{$m.id}][orderby]" value="{$m.orderby|default:0}" style="width:50px;" /></td>
<td align="center"><input type="checkbox" name="mcoll[{$m.id}][status]" {if $m.status eq 'Y'}checked{/if} /></td>
<td align="center">
[<a href="mr.php?section=collection&mcollid={$m.id}">{ $m.num}</a>]
</td>
</tr>
{/foreach}

And here is the edit_image.tpl file:

{if $idtag eq ''}
{assign var="idtag" value="edit_image"}
{/if}

<img id="{$idtag}" src="{$xcart_web_dir}/image.php?type={$type}&amp;id={$id}&amp;ts={$smart y.now}{if $already_loaded}&amp;tmp=Y{/if}"{if $image_x ne 0} width="{$image_x}"{/if}{if $image_y ne 0} height="{$image_y}"{/if} alt="{include file="main/image_property.tpl"}"/>

<table cellpadding="0" cellspacing="0">
<tr>
<td>
<input type="button" value="{$lng.lbl_change_image|strip_tags:false|esc ape}" onclick='javascript: popup_image_selection("{$type}", "{$id}", "{$idtag}");' />
{if $id ne '' && $no_delete eq ''}
&nbsp;&nbsp;
<input id="{$idtag}_delete" type="button" value="{$lng.lbl_delete_image|strip_tags:false|esc ape}" onclick="javascript: {if $delete_js ne ''}{$delete_js|replace:'"':'\"'}{else}self.locatio n='{$delete_url}';{/if}" />
{/if}
<span style="{if !$already_loaded}display: none; {/if}padding-left: 10px;" id="{$idtag}_reset">
<input type="button" value="{$lng.lbl_reset|strip_tags:false|escape}" onclick="javascript: popup_image_selection_reset('{$type}', '{$id}', '{$idtag}');" />
<input id="skip_image_{$type}" type="hidden" name="skip_image[{$type}]" value="" />
</span>
</td>
</tr>
<tr style="display: none;" id="{$idtag}_text">
{if $button_name eq ''}
{assign var="button_name" value=$lng.lbl_submit}
{/if}
<td style="padding-top: 10px;">{$lng.txt_image_note|substitute:"button_nam e":$button_name}</td>
</tr>
</table>

Anyone have any suggestions?
Reply With Quote