Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Implementing Image uploader


Guest

Recommended Posts

I want to implement PHP Imagemanager standalone. But I have a problem. So the script can run I must to insert

 

onclick="ImageSelector.select('file');"

 

in

 

admin/categories.php

<tr>

<td class="main"><?php echo TEXT_PRODUCTS_IMAGE; ?></td>

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_file_field('products_image','') . '<br>' . tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . $pInfo->products_image . tep_draw_hidden_field('products_previous_image', $pInfo->products_image); ?></td>

</tr>

 

Can I put it in admin/includes/functions/html_output.php??

 

admin/includes/functions/html_output.php

// Output a form filefield

function tep_draw_file_field($name,'' , $required = false) {

$field = tep_draw_input_field($name, '', '', $required, 'file');

 

return $field;

}

 

the original script is:

 

<head>

<title>PHP ImageManager + Editor Standalone Demo</title>

<script type="text/javascript" src="../ImageManager/assets/dialog.js"></script>

<script type="text/javascript" src="../ImageManager/IMEStandalone.js"></script>

<script type="text/javascript">

//<![CDATA[

 

//Create a new Imanager Manager, needs the directory where the manager is

//and which language translation to use.

var manager = new ImageManager('../ImageManager','en');

 

//Image Manager wrapper. Simply calls the ImageManager

ImageSelector =

{

//This is called when the user has selected a file

//and clicked OK, see popManager in IMEStandalone to

//see the parameters returned.

update : function(params)

{

if(this.field && this.field.value != null)

{

this.field.value = params.f_file; //params.f_url

}

},

//open the Image Manager, updates the textfield

//value when user has selected a file.

select: function(textfieldID)

{

this.field = document.getElementById(textfieldID);

manager.popManager(this);

}

};

 

//]]>

</script>

<style type="text/css">

/*<![CDATA[*/

<!--

.selectFile { width: 20em; }

body{margin: 2em;}

form{margin: 5em;}

-->

/*]]>*/

</style>

</head>

 

<body>

<h1>PHP ImageManager + Editor Standalone Demo</h1>

<form action="">

<div>

Please select an image file.

<input type="text" id="file" class="selectFile" name="file" />

<input type="button" name="select" value=" File " onclick="ImageSelector.select('file');"/>

</div>

</form>

 

 

I'm sorry for my bad english. Thank you for helping :D

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...