Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Custom Module Image upload field

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #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
  #2  
Old 07-23-2013, 06:49 AM
  websupport's Avatar 
websupport websupport is offline
 

Advanced Member
  
Join Date: May 2005
Posts: 32
 

Default Re: Custom Module Image upload field

Well I went with just making my own upload script and ajax method. But I wish xcart was a little more intuitive with its scripting.
__________________
Sizzle Factor @ www.sizzlefactor.com
Simply X-Cart @ www.simplyxcart.com
VitalBGS @ www.vitalbgs.com
For all of your X-Cart solutions!
X-Cart versions 4.4.0 to 5.0
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 10:19 AM.

   

 
X-Cart forums © 2001-2020