Opened 13 years ago

Last modified 13 years ago

#1024 closed enhancement

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

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

Description

(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() { ImagePicker(document.getElementById('idOfTheInputField')); }
</script>

Change History (0)

Note: See TracTickets for help on using tickets.