Revision [4278]

This is an old revision of FileManagerHack made by ChiWaWa on 2005-01-08 22:46:57.

 

File Manager

How to add file upload/management in wikka

Why

I've setup a wikka site for my company in order to store the knoweldge base and allow every users to read/write doc without leaving their workstations to find an old doc in the company's archives.
My problem was quite simple, I need users to add screenshots in wiki pages. Letting them doing so by ftp would be a loss of time for them, they need something quick and simple. I also had less than 1hr to add this feature.

What

I want a file manager, with upload, rename, moove, directory support and so on. Once gently asked for that, google pointed me on a script called webadmin
This script is a single file doing everything a file manager is supposed to do. Now let's add it to wikka to allow my users to work more efficiently.

How

First, I want to add a 4th button in the edit handler, right after the textbox. Here is what i've modified in /handlers/page/edit.php :
$output .=
    $this->FormOpen("edit").
    "<input type=\"hidden\" name=\"previous\" value=\"".$previous."\" />\n".
     "<textarea onKeyDown=\"fKeyDown()\" id=\"body\" name=\"body\" style=\"width: 100%; height: 500px\">".htmlspecialchars($body)."</textarea><br />\n".
    //note add Edit
     "<input size=\"40\" type=\"text\" name=\"note\" value=\"".htmlspecialchars($note)."\" /> Please add a note on youredit.<br />\n".
    //finsih
    "<input name=\"submit\" type=\"submit\" value=\"Store\" accesskey=\"s\" /> <input name=\"submit\" type=\"submit\" value=\"Preview\" accesskey=\"p\" /> <input type=\"button\" value=\"Cancel\" onclick=\"document.location='".$this->href("")."';\" /> ".
    //ChiWaWa's little FileManagerHack
    "<input type=\"button\" value=\"Manage Files\" onclick=\"window.open('/handlers/3rdparty/webadmin.php','FileManagement','height=600,width=800,toolbar=yes,location=1')\" />\n".
    $this->FormClose();


Notes :

Next step : add the script on wikka's tree
  1. Create the /handlers/3rdparty directory
  1. copy webadmin.php in it
  1. Important (i've lost a long time trying to fix that) : copy /images/.htaccess in /handlers/3rdparty
not doing so will result in wikka trying to access to a page named handler/3rdparty/webadmin.php.php, I still don't understand why :p

Finally edit webadmin.php to change some parameters :
There is one comment on this page. [Display comment]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki