Announcement

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

#1 2011-03-28 10:35:21

dpapathanasiou
New member
Registered: 2011-03-28
Posts: 3

Extended File Manager or Image Manager plugin without php?

I'd like to use either EFM or ImageManager to allow people to upload images, but I do not have php running on my server.

When I try to use either of them now, the server responds by sending me back the backend.php file, b/c it cannot execute it.

Short of rewriting the plugin entirely, is there a non-php way to use it?

Offline

#2 2011-03-29 02:09:36

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

Re: Extended File Manager or Image Manager plugin without php?

No.  Both require PHP.  We do not have any alternate backends. 

Feel free to write one :-)


James Sleeman

Offline

#3 2011-03-29 09:49:53

dpapathanasiou
New member
Registered: 2011-03-28
Posts: 3

Re: Extended File Manager or Image Manager plugin without php?

Writing the server-side code in Python would be a snap; I'm just not sure how I would interact with the existing plugins.

Are there any guides to writing a plugin? I didn't find much in http://xinha.webfactional.com/wiki/Docu … umentation

Offline

#4 2011-03-29 20:59:12

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

Re: Extended File Manager or Image Manager plugin without php?

For general plugin writing, learn by example...
  SelectCharacter is a very simple plugin which has a dialog

  See contrib/php-xinha.php and plugins/MootoolsFileManager/config.php to see how we pass "backend configuration details" around securly, you would have to implement something similar. 

ImageManager and ExtendedFileManager are VERY php centric, the entire things would have to be rewritten, they are also pretty antiquated, prone to security issues, and unpleasant to use IMHO.

MootoolsFileManager (MFM) on the other hand is not highly coupled to PHP, I've recently created a branch in the subversion with an updated MFM, there are some more (slightly heavy I believe) changes coming to that branch.

Get it by:
  svn co http://svn.xinha.org/branches/MootoolsF … er-Update/

Essentially, in MFM, you'd need to rewrite (here's your reading list, in order :-)):
  plugins/MootoolsFileManager/backend.php
  plugins/MootoolsFileManager/config.php
  plugins/MootoolsFileManager/contrib/php-xinha.php
  plugins/MootoolsFileManager/Assets/Connector/FileManager.php

Broadly speaking...
  your backend.py or whatever needs (in conjuction with FileManager.py or whatever)
    take 'event' as GET/POST, event can be
      list (default if no event)
      create (create directory)
      upload (upload file)
      download (download a file)
      destroy (delete a file)
      move (move a file)
      detail (get information on a file)
  do stuff based on event (including checking permission!) and the data provided to it in get/post
  return a JSON encoded response of appropriate format

I don't have time to dig through and work out the JSON response formats and I don't think it's documented in the mootools-filemanager itself (maybe I will do myself that when I have time to spare), but you should be able to get it from reading the PHP, Javascript, or probably easier, just sniffing the requests on a working mootools-filemanager using Firebug or Chrome Developer Tools (CTRL-SHIFT-J in Chrome, select Network tab).

If you do write a py backend, I'm sure the mootools-filemanager people would like to have it available, and we certainly would in Xinha.

Official version mootools-filemanager:
  https://github.com/cpojer/mootools-filemanager

The version I'm tracking in my Xinha branch:
  https://github.com/sleemanj/mootools-filemanager

The version that is going to be merging a pile of stuff back to cpojer and which I'll pick up:
  https://github.com/GerHobbelt/mootools-filemanager


James Sleeman

Offline

#5 2011-04-04 13:54:40

dpapathanasiou
New member
Registered: 2011-03-28
Posts: 3

Re: Extended File Manager or Image Manager plugin without php?

Many thanks for the information; I'll have a chance to dig into the source later this month.

Offline

Board footer

Powered by FluxBB