Announcement

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

#1 2007-08-24 06:21:55

yannux
New member
Registered: 2007-08-24
Posts: 2

My_Config ImageManager directory

Hye everybody,

I'm trying to use Imagemanager plugin and pass array with config variables. But that doesn't work :s.

Here is my code :

<script type="text/javascript">
_editor_url  = "external/xinha/"  // (preferably absolute) URL (including trailing slash) where Xinha is installed
_editor_lang = "en";      // And the language we need to use in the editor.
</script>
<script type="text/javascript" src="external/xinha/XinhaCore.js"></script>
<script type="text/javascript" src="external/xinha/newsletter_config.js"></script>

external/xinha/newsletter_config.js

xinha_editors = null;
xinha_init    = null;
xinha_config  = null;
xinha_plugins = null;

// This contains the names of textareas we will make into Xinha editors
xinha_init = xinha_init ? xinha_init : function()
{
  xinha_plugins = xinha_plugins ? xinha_plugins :
  [
   'CharacterMap',
   'ContextMenu',
   'ListType',
   'SpellChecker',
   'Stylist',
   'SuperClean',
   'TableOperations',
   'ImageManager'
  ];
         // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING  :)
         if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return;

  xinha_editors = xinha_editors ? xinha_editors :
  [
    'content'
  ];
   xinha_config = xinha_config ? xinha_config() : new Xinha.Config();

   with(xinha_config.ImageManager)
   {

    <?php
      require_once('/data/web/admin/external/xinha/contrib/php-xinha.php');

      xinha_pass_to_php_backend(
        array(
          'images_dir' => '/data/web/pub/'
        )
      );
    ?>
   }
  xinha_editors   = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins);
  Xinha.startEditors(xinha_editors);
}

Xinha._addEvent(window,'load', xinha_init); // this executes the xinha_init function on page load
                                            // and does not interfere with window.onload properties set by other script

It's working when I put directory in config.inc.php  directly :s.

Offline

#2 2007-08-31 07:19:19

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

Re: My_Config ImageManager directory

Hi!

The newsletter_config.js file is just a javascript file for your server. It needs to be parsed by PHP engine for this to work. Rename this file to newsletter_config.js.php (and, of course,  change the src of the <script> tag accordingly).

Cheers,
Chris Kotowicz

Offline

#3 2007-09-03 09:49:48

yannux
New member
Registered: 2007-08-24
Posts: 2

Re: My_Config ImageManager directory

Wahhhh big_smile
I'm stupid boy. Thanks a lot.

Offline

Board footer

Powered by FluxBB