Announcement

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

#1 2010-09-09 22:57:24

Darkstar
New member
Registered: 2010-09-09
Posts: 8

Troubles with ExtendedFileManager plugin

Hi -

I am new to using Xinha, and have made quite a bit of progress getting it to work as a web page editor running under a Tomcat server. But I am having troubles getting the ExtendedFileManager plugin operating, so need a bit of insight/guidance from some kind guru....

Basically I am configuring it as indicated in the notes as follows -  (Some of my attempts to get this working have been commented out, but I left in so as to show things I have attempted so far...)

      /** STEP 4 ***************************************************************
       * If you want to change the configuration variables of any of the
       * editors,  this is the place to do that, for example you might want to
       * change the width and height of one of the editors, like this...
       *
       *   xinha_editors.myTextArea.config.width  = 640;
       *   xinha_editors.myTextArea.config.height = 480;
       *
       ************************************************************************/
       //If you don't want to add a button for linking files and use only the advanced ImageManager
       xinha_config.ExtendedFileManager.use_linker = true;
       // pass the configuration to plugin
       if (xinha_config.ExtendedFileManager) {
               with (xinha_config.ExtendedFileManager)
               {
                   alert("Extended File Manager Setup Started\n\n");

                   
                   <?php
                   echo "Starting PHP; \n";
                   syslog(LOG_INFO, "Starting PHP");

                   // define backend configuration for the plugin
                   $IMConfig = array();

                   $IMConfig['allow_upload'] = true;

                   // $IMConfig['images_dir'] = '<images dir>';
                   // $IMConfig['images_dir'] = $_SERVER['DOCUMENT_ROOT'].'/images';
                   // $IMConfig['images_dir'] = '<%= docRootDir %>/images';
                   $IMConfig['images_dir'] = '/home/marc/eclipse/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/webapps/telescope/images';
                   
                   // $IMConfig['images_url'] = '<images url>';
                   $IMConfig['images_url'] = '/images/';
                   
                   // $IMConfig['files_dir'] = '<files dir>';
                   // $IMConfig['files_dir'] = $_SERVER['DOCUMENT_ROOT'].'/images';
                   // $IMConfig['files_dir'] = '<%= docRootDir %>/images';
                    $IMConfig['files_dir'] = '/home/marc/eclipse/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/webapps/telescope/images';
                   
                   // $IMConfig['files_url'] = '<files url>';
                   $IMConfig['files_url'] = '/images/';

                   $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;
                   // maximum size for uploading files in 'insert image' mode (2000 kB here)

                   $IMConfig['max_filesize_kb_link'] = 5000;
                   // maximum size for uploading files in 'insert link' mode (5000 kB here)

                   // 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 '/path/to/xinha/contrib/php-xinha.php';
                   // require_once '/home/marc/eclipse/workspace/xinha/WebContent/contrib/php-xinha.php';
                   // require_once '<%= XinhaDir %>/contrib/php-xinha.php';
                   require_once '/home/marc/eclipse/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/webapps/xinha/contrib/php-xinha.php';
                   xinha_pass_to_php_backend($IMConfig);

                   echo "Ending PHP Section. \n";
                   
                   ?>
               }
       }


When this is executed, I get the following exception/stack walkback -

Sep 9, 2010 7:11:49 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet PhpCGIServlet threw exception
java.lang.RuntimeException: PHP Fatal error:  Call to undefined function ImageCreate() in /home/marc/eclipse/workspace/.metadata/.
plugins/org.eclipse.wst.server.core/tmp0/webapps/xinha/plugins/ImageManager/Classes/GD.php on line 353

And I am not able to find this function - ImageCreate() defined in any of the code for Xinha...  This results in the image dialog box showing the example Demo_Images directory and contents for  the ExtendedFileManager when I click on the button for inserting an image.  Anyone got any ideas why I am getting this exception/behaviour and how to fix it? Thanks in advance for any help/suggestions..

    Marc...

Offline

#2 2010-09-09 23:05:06

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: Troubles with ExtendedFileManager plugin

ImageCreate is a php function within the GD system.  You must add GD to your server.

http://nz.php.net/ImageCreate


James Sleeman

Offline

#3 2010-09-10 01:24:36

Darkstar
New member
Registered: 2010-09-09
Posts: 8

Re: Troubles with ExtendedFileManager plugin

Thanks James, that got me over one issue and now I get images within the insert Image dialog... (Can't say I am an expert on PHP by any means! So had no idea I had to include another package...)  I am no longer getting an exception at least.

Anywise, it appears that the ExtendedFileManager is still ignoring the setup settings, as it still shows the demo_images directory and not the image directory I am specifying. (I presume that must be a default of some kind?) Also I do not get any controls that allow an upload so something is still wrong with the setup. Does anyone have any ideas, from what I showed previously, or do I need to supply some additional information?

Thanks again in advance..  Marc...

Offline

#4 2010-09-10 01:53:29

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: Troubles with ExtendedFileManager plugin

echo "Starting PHP; \n";

I expect that breaks the resulting javascript.


James Sleeman

Offline

#5 2010-09-10 01:54:06

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: Troubles with ExtendedFileManager plugin

As would

                   echo "Ending PHP Section. \n";

You would see that occuring if you open the javascript console I expect.


James Sleeman

Offline

#6 2010-09-10 13:41:26

Darkstar
New member
Registered: 2010-09-09
Posts: 8

Re: Troubles with ExtendedFileManager plugin

Again thanks James for your thoughts..  I removed those echo statements, that was from my attempts to debug/see if this code was being executed (This was a guess, I am NOT a PHP programmer).. Couldn't get any output, but forgot to remove those statements...  Anywise, removing the echo statements did not help.

I looked in the javascript console, but don't see any error messages that are pertinent to this problem..  I do see some warnings however -

Warning: Error in parsing value for 'filter'.  Declaration dropped.
Source File: http://localhost:8086//xinha/Xinha.css
Line: 55

Warning: Unknown property '-moz-opacity'.  Declaration dropped.
Source File: http://localhost:8086//xinha/Xinha.css
Line: 56

Warning: Unknown property 'border-radius'.  Declaration dropped.
Source File: http://localhost:8086//xinha/Xinha.css
Line: 126

Warning: Unknown property 'box-shadow'.  Declaration dropped.
Source File: http://localhost:8086//xinha/Xinha.css
Line: 131

Warning: Unknown property 'box-shadow'.  Declaration dropped.
Source File: http://localhost:8086//xinha/Xinha.css
Line: 136

Warning: Unknown property 'border-radius'.  Declaration dropped.
Source File: http://localhost:8086//xinha/Xinha.css
Line: 144

Warning: Unknown property 'box-shadow'.  Declaration dropped.
Source File: http://localhost:8086//xinha/Xinha.css
Line: 148

Warning: Error in parsing value for 'filter'.  Declaration dropped.
Source File: http://localhost:8086//xinha/Xinha.css
Line: 153

Warning: Unknown property '-moz-opacity'.  Declaration dropped.
Source File: http://localhost:8086//xinha/Xinha.css
Line: 154

Warning: Error in parsing value for 'filter'.  Declaration dropped.
Source File: http://localhost:8086//xinha/Xinha.css
Line: 160

Warning: Unknown property '-moz-opacity'.  Declaration dropped.
Source File: http://localhost:8086//xinha/Xinha.css
Line: 161

Warning: Error in parsing value for 'filter'.  Declaration dropped.
Source File: http://localhost:8086//xinha/Xinha.css
Line: 165

Warning: Unknown property '-moz-opacity'.  Declaration dropped.
Source File: http://localhost:8086//xinha/Xinha.css
Line: 166

Warning: Error in parsing value for 'filter'.  Declaration dropped.
Source File: http://localhost:8086//xinha/Xinha.css
Line: 171

Warning: Error in parsing value for 'filter'.  Declaration dropped.
Source File: http://localhost:8086//xinha/Xinha.css
Line: 174

Warning: Unknown property 'border-radius'.  Declaration dropped.
Source File: http://localhost:8086//xinha/Xinha.css
Line: 198

Warning: Error in parsing value for 'filter'.  Declaration dropped.
Source File: http://localhost:8086//xinha/plugins/ExtendedFileManager/assets/manager.css
Line: 20

Thoughts?     Marc...

Offline

#7 2010-09-10 13:45:22

Darkstar
New member
Registered: 2010-09-09
Posts: 8

Re: Troubles with ExtendedFileManager plugin

I am pretty sure my setup code for the ExtendedFileManager is getting executed, but I wonder if the code to initialize it to default values is getting executed afterwards somehow... Thoughts?

  Marc..

Offline

#8 2010-09-11 02:40:43

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: Troubles with ExtendedFileManager plugin

Check that your PHP session handling is functional, ensure the session name on both ends (inside your application, and inside the Xinha php components) is the same.

You might also want to look at MootoolsFileManager instead of ExtendedFileManager because the EFM is pretty old.


James Sleeman

Offline

#9 2010-09-30 14:20:32

Darkstar
New member
Registered: 2010-09-09
Posts: 8

Re: Troubles with ExtendedFileManager plugin

I ran into some issues with the PHP-Java_Bridge component I am using in order to run the PHP scripts under my Tomcat server, so now have those resolved. But I am still unable to get the ExtendedFileManager to work properly. It appears that the ExtendedFileManager is still ignoring the setup settings, as it still shows the demo_images directory and not the image directory I am specifying.  Here is the inline Javascript code that is being generated by the PHP script in the configuration setup -

      /** STEP 4 ***************************************************************
       * If you want to change the configuration variables of any of the
       * editors,  this is the place to do that, for example you might want to
       * change the width and height of one of the editors, like this...
       *
       *   xinha_editors.myTextArea.config.width  = 640;
       *   xinha_editors.myTextArea.config.height = 480;
       *
       ************************************************************************/
       //If you don't want to add a button for linking files and use only the advanced ImageManager
       xinha_config.ExtendedFileManager.use_linker = true;
       // pass the configuration to plugin
       if (xinha_config.ExtendedFileManager) {
               with (xinha_config.ExtendedFileManager)
               {
                      backend_data = {
'backend_data[data]': 'a:15:\x7Bs:12:\x22allow_upload\x22;b:1;s:10:\x22images_dir\x22;s:105:\x22/home/marc/eclipse/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/webapps/telescope/images\x22;s:10:\x22images_url\x22;s:8:\x22/images/\x22;s:9:\x22files_dir\x22;s:105:\x22/home/marc/eclipse/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/webapps/telescope/images\x22;s:9:\x22files_url\x22;s:8:\x22/images/\x22;s:16:\x22thumbnail_prefix\x22;s:2:\x22t_\x22;s:13:\x22thumbnail_dir\x22;s:1:\x22t\x22;s:14:\x22resized_prefix\x22;s:8:\x22resized_\x22;s:11:\x22resized_dir\x22;s:0:\x22\x22;s:10:\x22tmp_prefix\x22;s:4:\x22_tmp\x22;s:21:\x22max_filesize_kb_image\x22;i:2000;s:20:\x22max_filesize_kb_link\x22;i:5000;s:17:\x22max_foldersize_mb\x22;i:0;s:24:\x22allowed_image_extensions\x22;a:3:\x7Bi:0;s:3:\x22jpg\x22;i:1;s:3:\x22gif\x22;i:2;s:3:\x22png\x22;\x7Ds:23:\x22allowed_link_extensions\x22;a:11:\x7Bi:0;s:3:\x22jpg\x22;i:1;s:3:\x22gif\x22;i:2;s:3:\x22pdf\x22;i:3;s:2:\x22ip\x22;i:4;s:3:\x22txt\x22;i:5;s:3:\x22psd\x22;i:6;s:3:\x22png\x22;i:7;s:4:\x22html\x22;i:8;s:3:\x22swf\x22;i:9;s:3:\x22xml\x22;i:10;s:3:\x22xls\x22;\x7D\x7D',
'backend_data[session_name]': 'PHPSESSID',
'backend_data[key_location]': 'Xinha:BackendKey',
'backend_data[hash]': '324a33d5bd9b58b1715969a440d562b381163f4f',
PHPSESSID: 'iuljm208kurkm55p5ophqmvn9og3ghv7'
};
                      
               }
       }


To my untrained PHP eyes, this looks correct, but perhaps better eyes than mine can tell is something is still wrong. (You may also note that I am developing this under the Eclipse IDE, and want to set it up so that it is working for a telescope webapp. Therefore I want the default image directory to be the image directory for the telescope webapp, NOT the image directory for demo_images which is what it is still doing, when I click on the Insert Image button of the Xinha editor.

> Check that your PHP session handling is functional, ensure the session name on both ends (inside your application, and inside the Xinha php components) is the same.

I am not sure how to do this.  Could someone supply an example, as I am not a PHP expert by any means....

> You might also want to look at MootoolsFileManager instead of ExtendedFileManager because the EFM is pretty old.

I took a look at MootoolsFileManager, but found documentation to be lacking on how to integrate it with an Xinha editor. The example showed this as a completely separate component from Xinha, and what is worse, it requires Flash and mentioned something about enabling it in order to run the demo. I do not know how to do this either, but it does not matter as we will refuse to use Flash within our applications or website. So that may rule out using the MootoolsFileManager altogether.

Again I would much appreciate any and all offers of help in getting the ExtendedFileManager component to work properly. Thanks in advance..

    Marc..

Offline

#10 2010-09-30 19:05:21

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: Troubles with ExtendedFileManager plugin

I took a look at MootoolsFileManager, but found documentation to be lacking on how to integrate it with an Xinha editor

Sorry, look in xinha/plugins/MootoolsFileManager it's right there all integrated.

we will refuse to use Flash within our applications or website

That's a shame, it allows you to do nice things like progress bars for uploads, and perhaps more importantly, multiple uploads at once.

when I click on the Insert Image button of the Xinha editor.

That's probably your problem, EFM is not for inserting images it is for inserting links to files.  You need to configure ImageManager for inserting images.  They are separate plugins. 

MFM on the other hand can do both jobs.


James Sleeman

Offline

#11 2010-10-01 14:54:33

Darkstar
New member
Registered: 2010-09-09
Posts: 8

Re: Troubles with ExtendedFileManager plugin

Thanks gogo for your reply, but I remain confused...

we will refuse to use Flash within our applications or website

That's a shame, it allows you to do nice things like progress bars for uploads, and perhaps more importantly, multiple uploads at once.

Well I can't change our policy, it is the same reasoning that Apple uses as to why they do not to support Flash....

That's probably your problem, EFM is not for inserting images it is for inserting links to files.  You need to configure ImageManager for inserting images.  They are separate plugins.

Uh If I understand you correctly, your statement to use ImageManager for inserting images seems to contradict the documentation which strongly implies one should use the ExtendedFileManager rather than the ImageManager...  Should I use both?  See -

http://trac.xinha.org/wiki/Plugins/ExtendedFileManager
http://trac.xinha.org/wiki/ImageManager

so still stuck...   Marc...

Offline

#12 2010-10-01 15:39:38

Darkstar
New member
Registered: 2010-09-09
Posts: 8

Re: Troubles with ExtendedFileManager plugin

I tried this with both the ImageManager and ExtendedFileManager defined, and with just the ImageManager defined. There was no change in behavior in either case, when clicking on the Insert/Modify Image or Insert File Link buttons, I am still getting the dialog boxes set to show what is in the demo_images directory, and NOT  showing what is in the directory under the webapp that I specify in the images_dir or files_dir settings...

    Marc...

Offline

#13 2010-10-01 22:29:13

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: Troubles with ExtendedFileManager plugin

I used to use EFM and Image Manager togethor, I'm not familar enough with EFM to know if it can ALSO do the IM job.

Did you configure ImageManager?

Try using IM on it's own, without EFM, and be sure you configure it.


James Sleeman

Offline

#14 2010-10-02 14:04:37

Darkstar
New member
Registered: 2010-09-09
Posts: 8

Re: Troubles with ExtendedFileManager plugin

gogo wrote:

I used to use EFM and Image Manager togethor, I'm not familar enough with EFM to know if it can ALSO do the IM job.

Did you configure ImageManager?

Try using IM on it's own, without EFM, and be sure you configure it.

Yes, as I mentioned in my previous post, I tried ImageManager alone, and configured it. I got exactly the same behavior as I did using EFM. When clicking on the insert image button, I was given the image_demo directory, not the directory I configured it to use.

  Marc...

Offline

#15 2010-10-02 18:55:05

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: Troubles with ExtendedFileManager plugin

1. Ensure that error reporting is switched on in your php.ini

2. Using Firebug, Chrome Developer Tools, a network sniffer, whatever, examing the request that results in the popup being opened, you need to see that your configuration is being passed from the browser as part of the request.

3. Add some debugging statements to ImageManager/config.inc.php , particularly you should print_r($_REQUEST) to find out what is getting through to the PHP, and you need to find out if xinha_read_passed_data() is returning an appropriate structure (see the conditional).

My next guess is that your unusual server environment is not passing post/get data to PHP correctly.


James Sleeman

Offline

#16 2010-10-14 06:40:24

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: Troubles with ExtendedFileManager plugin

A 500 error would indicate that your server is causing an error.  Contact your web host for information (or consult the server's error log).  Often times, this can be a server which enforces certain file permissions (no write for group/other) and your file permissions are incorrect (allow write for group/other).


James Sleeman

Offline

Board footer

Powered by FluxBB