Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#1024 closed enhancement (fixed)

Add an input field image url picker function to ImageManager — at Version 2

Reported by: gogo Owned by: gogo
Priority: normal Milestone:
Component: Plugin_ImageManager Version: trunk
Severity: normal Keywords:
Cc:

Description (last modified by gogo)

(Tracking ticket, commit to follow)

It would be useful for developers to "hijack" the ImageManager? plugin and use it as a generic image-picker dialog for input fields.

The commit which will follow will do this by adding a "Browse" button after the (usually text) field, and returning the URL of the image selected to the value of the field.

Example Usage

 <script type="text/javascript">_editor_url = '/url/to/xinha';</script>
 <script type="text/javascript" src="/url/to/xinha/plugins/ImageManager/image-picker.js" />
 <script type="text/javascript">
 <?php require_once('/path/to/xinha/contrib/php-xinha.php'); ?>
 with(ImagePicker.prototype)
 {
   <?php 
    $Conf = array
     (
       'images_dir' => '/path/to/images', 
       'images_url' => '/url/to/images', 
       'show_full_options' => false, // Full options are not useful as a URL picker
       // See ImageManager for more configuration options !           
     );
    xinha_pass_to_php_backend($Conf);
   ?>
 }

 window.onload = function() { new ImagePicker(document.getElementById('idOfTheInputField')); }
</script>

Change History (2)

comment:1 Changed 13 years ago by gogo

  • Resolution set to fixed
  • Status changed from new to closed

comment:2 Changed 13 years ago by gogo

  • Description modified (diff)
Note: See TracTickets for help on using tickets.