Announcement

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

#1 2007-10-28 15:45:35

saxy
Xinha Community Member
Registered: 2006-02-07
Posts: 15

Extended File Manager ignore configuration

Hello,
if I open the popup to insert an image, in the error log is the message:
Fehler: imgManager.changeDir is not a function
Quelldatei: http://localhost/xinha/plugins/ExtendedFileManager/assets/manager.js
Zeile: 309
Is it enough to register the Extended File Manager, or have I to register the image manager too?
I tried it. Now the error message is no longer. But the configuration ist still ignored and I see the demo pictures.
What I am doing wrong?
I use Xinha version 0.94 on a linux server and Firefox 2.0.
Thanks in advance for help.
saxy

Offline

#2 2007-10-29 19:07:04

ray
Xinha Administrator
From: Germany
Registered: 2005-03-23
Posts: 521
Website

Re: Extended File Manager ignore configuration

ExtendedFileManager is a full replace for and advancement of ImageManager. You don't have to and should not enable both. Please check if there are any conditions in that the error occurs and submit a ticket.

Without any information about the configuration that is ignored, I doubt that anybody can give you an answer

Offline

#3 2007-10-30 10:16:21

saxy
Xinha Community Member
Registered: 2006-02-07
Posts: 15

Re: Extended File Manager ignore configuration

Thank you for the answer. You are right, the configuration is importent. Here is it:

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

xinha_init = xinha_init ? xinha_init : function()
{

  xinha_plugins = xinha_plugins ? xinha_plugins :
  [
    'CharacterMap',
    'ContextMenu',
    'ExtendedFileManager',
    'Linker',
    'ListType',
    'Stylist',
    'SuperClean',
    'TableOperations'
  ];
         // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING  :)
  if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return;

  xinha_editors = xinha_editors ? xinha_editors :
  [
    'text-area-1',
    'text-area-2'
  ];

  xinha_config = xinha_config ? xinha_config() : new Xinha.Config();

  xinha_config.stylistLoadStylesheet('/xinha/user.css');

  xinha_config.ExtendedFileManager.use_linker = false;
  with (xinha_config.ExtendedFileManager)
  {
    <?php
      $IMConfig = array();
      $IMConfig['images_dir'] = '/bnPortal/themes/buerostudio/img/';
      $IMConfig['images_url'] = 'http://localhost';
      $IMConfig['allow_new_dir'] = false;
      $IMConfig['allow_edit_image'] = false;
      $IMConfig['allow_cut_copy_paste'] = false;
      $IMConfig['allow_rename'] = false;
      $IMConfig['allow_upload'] = false;
      $IMConfig['thumbnail_prefix'] = 't_';
      $IMConfig['thumbnail_dir'] = 't';
      $IMConfig['resized_prefix'] = 'resized_';
      $IMConfig['resized_dir'] = '';
      $IMConfig['tmp_prefix'] = '_tmp';
      $IMConfig['max_filesize_kb_image'] = 2000;
      $IMConfig['max_filesize_kb_link'] = 5000;
          // Maximum upload folder size in Megabytes.
          // Use 0 to disable limit
      $IMConfig['max_foldersize_mb'] = 0;
      $IMConfig['allowed_image_extensions'] = array("jpg","gif","png");
      $IMConfig['allowed_link_extensions'] = array("jpg","gif","pdf","ip","txt","psd","png","html","swf","xml","xls");
      require_once '/xinha/contrib/php-xinha.php';
      xinha_pass_to_php_backend($IMConfig);
    ?>
  }

  with(xinha_config.Linker)
  {
    <?php
      require_once('/xinha/contrib/php-xinha.php');
      xinha_pass_to_php_backend
      (
        array(
          'dir' => '/bnPortal',
          'include' => '/\.(php|shtml|html|htm|shtm)$/',  // REGEXP or empty
          'exclude' => '', // REGEXP or empty
          'dirinclude' => '', // REGEXP  or empty
          'direxclude' => '/(^|\/)[._]|htmlarea/' // REGEXP or empty
        )
      );
    ?>
  }

  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 scripts

Neither the Extended File Manager nor the Linker shows the right Path.
Thank you for any help.

Offline

#4 2007-10-31 08:02:24

saxy
Xinha Community Member
Registered: 2006-02-07
Posts: 15

Re: Extended File Manager ignore configuration

I made a short example on the server of my ISP, so that everyone can see all the code. You can find it here: http://www.buerostudio-neumann.at/Test/index.html
Neither "DynamicCSS", nor "ExtendedFileManager", nor "Linker" finds the configuration of my_config.js.
What's going wrong?
Thank you for your advice.
saxy

Offline

#5 2007-10-31 08:47:55

hilope
Xinha Community Member
Registered: 2006-06-06
Posts: 26
Website

Re: Extended File Manager ignore configuration

js files will not render php tags!

you have to make an php file in order to get the php as php code.  search the forum ... somewhere i have seen a good introduction to that wink

Offline

#6 2007-10-31 09:48:35

ray
Xinha Administrator
From: Germany
Registered: 2005-03-23
Posts: 521
Website

Re: Extended File Manager ignore configuration

rename your config file to a .php extension
maybe you also have to add

header('Content-type: text/javascript');

at the top of the file

Offline

#7 2007-11-01 15:26:45

saxy
Xinha Community Member
Registered: 2006-02-07
Posts: 15

Re: Extended File Manager ignore configuration

Thanks for your answers. That I understand, that PHP-Code in Javascript files don't work. But unfortunatly to rename the file as my_config.php doesn't work, even if I put the statement header('Content-type: text/javascript'); at the top of the config file. I searched in the forum for this topic, but couldn't find a solution. The configuration is still ignored, without errors in the error log.
Finally I decided to edit the config.inc.php. That works, of course. But if I set the path for the image_dir outside the xinha path, comes the message: Not a valid base dir. Must the image_dir stay inside the xinha path or is it possible to set the image_dir outside?
Thank you for aour answer.
saxy

Offline

#8 2007-11-04 04:50:41

saxy
Xinha Community Member
Registered: 2006-02-07
Posts: 15

Re: Extended File Manager ignore configuration

I found the solution: The image_dir path must be relativ, the image_url path must be absolute. Now it works. Thank vou all for help.
saxy

Offline

Board footer

Powered by FluxBB