Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Implementing Imagemanager


Guest

Recommended Posts

I want to implement PHP Imagemanager standalone. But I have a problem, to implement the imagemanager i must insert "onclick="ImageSelector.select('file');" " to tep_draw_file_field

 

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 the help!

 

You maybe can do a contributition from it..it's very easy

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...