Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2006-09-29 05:31:16

mjpg
Xinha Community Member
Registered: 2006-09-28
Posts: 13

How to configure EFM with php-xinha.php

A few questions realated to EFM config.

I am currently changing the EFM/config.inc.php directly. Howvere I'd prefer to do it from the JS in the editor page.

1. Can I use the IM syntax? - eg:

with(xinha_config.ImageManager)
{
  <?php
     require_once('/path/to/xinha/contrib/php-xinha.php');
     xinha_pass_to_php_backend(
       array(
         'images_dir' => '/path/to/images',
         'images_url' => '/images'
       )
     );
   ?>
}

2. My editor uses a templating system, so the PHP above is not being parsed.

In php-xinha.php, xinha_pass_to_php_backend() echoes the string for JS, so I cannot pass it as a variable to the templating system - has anyone used a different method to get the code out of php-xinha.php?

Offline

#2 2006-09-29 09:24:19

koto
Xinha Pro
Registered: 2006-01-09
Posts: 58

Re: How to configure EFM with php-xinha.php

#1

If you're asking if you can do with(xinha_config.ExtendedFileManager) {} block, the answer is yes. Plugin supports the xinha_pass_to_php_backend() function. You could pass static values to it like you presented in the snippet, or just about any PHP-generated array - like presented in readme.txt file.

If you're asking about configuring both plugins in a one place - I'm not 100% sure (ray did this changes if I remember correctly), but I think the easiest way would be simply putting

xinha_config.ExtendedFileManager = xinha_config.ImageManager

after the block.
Take into consideration that ImageManager supports only subset of config values supported by EFM, so I'd rather do the opposite:

with (xinha_config.ExtendedFileManager) {
...
}
xinha_config.ImageManager = xinha_config.ExtendedFileManager;

just to be sure wink

Offline

#3 2006-09-29 09:44:04

koto
Xinha Pro
Registered: 2006-01-09
Posts: 58

Re: How to configure EFM with php-xinha.php

2. My editor uses a templating system, so the PHP above is not being parsed.

In php-xinha.php, xinha_pass_to_php_backend() echoes the string for JS, so I cannot pass it as a variable to the templating system - has anyone used a different method to get the code out of php-xinha.php?

Please elaborate on what you want to achieve, I can at this point only explain this:
  xinha_pass_to_php_backend does 2 things:
1) stores the configuration checksum in PHP session for the plugin backend to fetch
2) echoes the transformed (signed) configuration as Javascript code

You can capture the output from the function using ob_start() / ob_get_contents() / ob_end_clean(), but I don't know why would you need that. If you cannot execute PHP code in the place where you configure Xinha, you can modify config.inc.php
or implement some PHP-generated JS files like this:

<script type="text/javascript" src="js.php?user={template_variable}&folder={template_variable}"></script>

Offline

#4 2006-09-29 10:02:27

mjpg
Xinha Community Member
Registered: 2006-09-28
Posts: 13

Re: How to configure EFM with php-xinha.php

Thanks. This is helpful.

Offline

Board footer

Powered by FluxBB