Ignore:
Timestamp:
09/13/06 15:50:09 (13 years ago)
Author:
gogo
Message:

Improvements to passing configuration to (php currently) Plugin backends.

This was prompted by #844, and numerous people having trouble with configuring ImageManager?.

A file has been added contrib/php-xinha.php (perhaps should be moved somewhere better),
this file contains functions which make it much easier to trustworthily pass data to
backends from the javascript frontend.

An example is easiest, imagine the following in your xinha setup, step 3...

with (xinha_config.ImageManager?)
{

<?php

require_once('/path/to/xinha/contrib/php-xinha.php');
xinha_pass_to_php_backend
(

array
(

'images_dir' => '/home/your/directory',
'images_url' => '/directory'

)

)

?>

}

that's all you need. It will (should at least) work with non-default session names also.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/ImageManager/config.inc.php

    r494 r565  
    281281 
    282282 
    283  
    284  
    285  
    286 // If config specified from front end, merge it 
    287 if(isset($_REQUEST['backend_config'])) 
     283// Standard PHP Backend Data Passing 
     284//  if data was passed using xinha_pass_to_php_backend() we merge the items 
     285//  provided into the Config 
     286require_once(realpath(dirname(__FILE__) . '/../../contrib/php-xinha.php')); 
     287if($passed_data = xinha_read_passed_data()) 
     288{ 
     289  $IMConfig = array_merge($IMConfig, $passed_data); 
     290  $IMConfig['backend_url'] .= xinha_passed_data_querystring() . '&'; 
     291} 
     292// Deprecated config passing, don't use this way any more! 
     293elseif(isset($_REQUEST['backend_config'])) 
    288294{ 
    289295  if(get_magic_quotes_gpc()) { 
Note: See TracChangeset for help on using the changeset viewer.