- made UploadImage finally working

- integrated with egroupware using appsession vars
- added max sizes when uploading
- added this CHANGELOG
- added the README for developer instructions
- checked copyrights
- changed icon
This commit is contained in:
Pim Snel 2004-09-20 20:40:50 +00:00
parent 7a28a6bcd0
commit 80cd655e2c
10 changed files with 872 additions and 694 deletions

View File

@ -0,0 +1,9 @@
Mon Sep 20 22:23:52 CEST 2004
-----------------------------
- made UploadImage finally working
- integrated with egroupware using appsession vars
- added max sizes when uploading
- added this CHANGELOG
- added the README for developer instructions
- checked copyrights
- changed icon

View File

@ -0,0 +1,48 @@
UploadImage for HtmlArea in eGroupWare
-----------------------------------------------------------
Original Author: Xiang Wei ZHUO <wei@zhuo.org>
Author for eGW: Pim Snel <pim@lingewoud.nl>
Last Updated: Mon Sep 20 19:55:03 CEST 2004
Requirements: eGroupWare 1.x, htmlArea 3rc or higher
Note: UploadImage only works as plugin for htmlArea in eGroupWare.
-----------------------------------------------------------
UploadImage adds an image_upload-icon in the htmlArea-toolbar. When the icon is clicked
the user can Select an image from the Upload Directory or upload an Image to the directory
the upload directory eGW-developer has specified. After insertion the image is shown in the
htmlarea. Future features will be: resizing images, cropping images, rotating images etc ....
To use the plugin you have to do the following:
// thirst setup the sessionvariables UploadImage Need
$sessdata = array(
'UploadImageBaseDir' => /path/to/eg/egw/images , // absolute path to the base directory
'UploadImageBaseURL' => http://yourhost/egw/images, // the complete URL to the base images directory
'UploadImageMaxWidth' => 500, // max, image width in pixels
'UploadImageMaxHeight' => 500 // max. image height in pixels
);
$GLOBALS['phpgw']->session->appsession('UploadImage','phpgwapi',$sessdata);
// then init the html class and call the htmlarea class-method with the UploadPlugin as argument
if (!is_object($GLOBALS['phpgw']->html))
{
$GLOBALS['phpgw']->html = CreateObject('phpgwapi.html');
}
$htmlarea = $GLOBALS['phpgw']->html->htmlarea($field_name, $value,$style,false,'UploadImage',$custom_toolbar);
-----------------------------------------------------------
SECURITY WARNING!!!
-----------------------------------------------------------
When you are implementing the UploadImage plugin make sure
your UploadImageBaseDir is set correctly because else it
might give access to other directories apache has access to.
-----------------------------------------------------------
Known issues:
- Create directory doesn't work
- In some cases the OK and cancel buttons won't work anymore (javascript issue)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 B

After

Width:  |  Height:  |  Size: 181 B

View File

@ -1,46 +1,69 @@
<? <?php
/**************************************************************************\
* eGroupWare - UploadImage-plugin for htmlArea *
* http://www.eGroupWare.org *
* Written and (c) by Xiang Wei ZHUO <wei@zhuo.org> *
* Modified for eGW by and (c) by Pim Snel <pim@lingewoud.nl> *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; version 2 of the License. *
\**************************************************************************/
//************************** BEGIN CONFIGURATION *****************************// /* $id$ */
//example, this is the actual file system path // FIXME: remove imageMagick shit, we only use gdlib
//of the web server document root. e.g. // FIXME: autodetect safe_mode
// Filesystem == /home/web/www.yourdomain.com // FIXME set current app to the calling app
$BASE_DIR = $GLOBALS[UploadImageBaseDir]; // FIXME include header nicer
$BASE_URL = $GLOBALS[UploadImageBaseURL];
$BASE_ROOT = $GLOBALS[UploadImageRelativePath];
var_dump($BASE_DIR); $phpgw_flags = Array(
var_dump($BASE_URL); 'currentapp' => 'jinn',
var_dump($BASE_ROOT); 'noheader' => True,
'nonavbar' => True,
'noappheader' => True,
'noappfooter' => True,
'nofooter' => True
);
//$BASE_DIR = $_SERVER['DOCUMENT_ROOT']; $GLOBALS['phpgw_info']['flags'] = $phpgw_flags;
//$BASE_DIR = '/home/www';
//the path where the browser sees the document root (i.e. http://www.yourdomain.com/) if(@include('../../../../../../header.inc.php'))
//$BASE_URL = 'https://192.168.0.2/'; {
// I know this is very ugly
}
else
{
@include('../../../../../../../header.inc.php');
}
//this is where the images will be stored relative to the $BASE_DIR (and $BASE_URL) define('IMAGE_CLASS', 'GD');
//this directory MUST be readable AND writable by the web server.
//$BASE_ROOT = ''; //In safe mode, directory creation is not permitted.
$SAFE_MODE = false;
$sessdata = $GLOBALS['phpgw']->session->appsession('UploadImage','phpgwapi');
$BASE_DIR = $sessdata[UploadImageBaseDir];
$BASE_URL = $sessdata[UploadImageBaseURL];
$MAX_HEIGHT = $sessdata[UploadImageMaxHeight];
$MAX_WIDTH = $sessdata[UploadImageMaxWidth];
if(!$MAX_HEIGHT) $MAX_HEIGHT = 10000;
if(!$MAX_WIDTH) $MAX_WIDTH = 10000;
// _debug_array($sessdata);
//die();
//The image manipulation library to use, either GD or ImageMagick or NetPBM
//valid definitions are 'GD' or 'IM' or 'NetPBM'.
define('IMAGE_CLASS', 'GD'); //
//After defining which library to use, if it is NetPBM or IM, you need to //After defining which library to use, if it is NetPBM or IM, you need to
//specify where the binary for the selected library are. And of course //specify where the binary for the selected library are. And of course
//your server and PHP must be able to execute them (i.e. safe mode is OFF). //your server and PHP must be able to execute them (i.e. safe mode is OFF).
//If you have safe mode ON, or don't have the binaries, your choice is //If you have safe mode ON, or don't have the binaries, your choice is
//GD only. GD does not require the following definition. //GD only. GD does not require the following definition.
define('IMAGE_TRANSFORM_LIB_PATH', '/usr/bin/netpbm/'); //define('IMAGE_TRANSFORM_LIB_PATH', '/usr/bin/netpbm/');
//define('IMAGE_TRANSFORM_LIB_PATH', '"D:\\Program Files\\ImageMagick\\'); //define('IMAGE_TRANSFORM_LIB_PATH', '"D:\\Program Files\\ImageMagick\\');
$BASE_ROOT = '';
//In safe mode, directory creation is not permitted.
$SAFE_MODE = false;
//************************** END CONFIGURATION *****************************//
$IMG_ROOT = $BASE_ROOT; $IMG_ROOT = $BASE_ROOT;
if(strrpos($BASE_DIR, '/')!= strlen($BASE_DIR)-1) if(strrpos($BASE_DIR, '/')!= strlen($BASE_DIR)-1)

View File

@ -1,21 +1,34 @@
<? <?php
/*********************************************************************** /**************************************************************************\
** Title.........: Image Manager, draws the thumbnails and directies * eGroupWare - UploadImage-plugin for htmlArea *
** Version.......: 1.01 * http://www.eGroupWare.org *
** Author........: Xiang Wei ZHUO <wei@zhuo.org> * Written and (c) by Xiang Wei ZHUO <wei@zhuo.org> *
** Filename......: images.php * Modified for eGW by and (c) by Pim Snel <pim@lingewoud.nl> *
** Last changed..: 8 Mar 2003 * -------------------------------------------- *
** Notes.........: Configuration in config.inc.php * This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; version 2 of the License. *
* -------------------------------------------- *
* Title.........: Image Manager, draws the thumbnails and directies *
* Version.......: 1.01 *
* Author........: Xiang Wei ZHUO <wei@zhuo.org> *
* Notes.........: Configuration in config.inc.php *
* *
* Functions *
* - create a new folder, *
* - delete folder, *
* - upload new image *
* - use cached thumbnail views *
\**************************************************************************/
Functions /* $id */
- create a new folder,
- delete folder,
- upload new image
- use cached thumbnail views
***********************************************************************/ // FIXME move all php functions to a main file
// FIXME better directory-structure
include 'config.inc.php'; include 'config.inc.php';
require_once 'std_functions.inc.php';
require_once '../ImageEditor/Transform.php';
if(isset($_GET['dir'])) { if(isset($_GET['dir'])) {
$dirParam = $_GET['dir']; $dirParam = $_GET['dir'];
@ -35,7 +48,6 @@ $clearUploads = false;
if(strrpos($IMG_ROOT, '/')!= strlen($IMG_ROOT)-1) if(strrpos($IMG_ROOT, '/')!= strlen($IMG_ROOT)-1)
$IMG_ROOT .= '/'; $IMG_ROOT .= '/';
if(isset($_GET['create']) && isset($_GET['dir']) && $SAFE_MODE == false) if(isset($_GET['create']) && isset($_GET['dir']) && $SAFE_MODE == false)
{ {
create_folder(); create_folder();
@ -53,7 +65,6 @@ if(isset($_GET['delFolder']) && isset($_GET['dir']))
if(isset($_FILES['upload']) && is_array($_FILES['upload']) && isset($_POST['dirPath'])) if(isset($_FILES['upload']) && is_array($_FILES['upload']) && isset($_POST['dirPath']))
{ {
$dirPathPost = $_POST['dirPath']; $dirPathPost = $_POST['dirPath'];
if(strlen($dirPathPost) > 0) if(strlen($dirPathPost) > 0)
@ -67,33 +78,80 @@ if(isset($_FILES['upload']) && is_array($_FILES['upload']) && isset($_POST['dirP
if(strrpos($IMG_ROOT, '/')!= strlen($IMG_ROOT)-1) if(strrpos($IMG_ROOT, '/')!= strlen($IMG_ROOT)-1)
$IMG_ROOT .= '/'; $IMG_ROOT .= '/';
do_upload($_FILES['upload'], $BASE_DIR.$BASE_ROOT.$dirPathPost.'/'); // do_upload($_FILES['upload'], $BASE_DIR.$BASE_ROOT.$dirPathPost.'/');
do_upload($_FILES['upload'], $BASE_DIR.$dirPathPost.'/');
} }
function do_upload($file, $dest_dir) function do_upload($file, $dest_dir)
{ {
global $clearUploads; global $clearUploads,$MAX_WIDTH,$MAX_HEIGHT;
if(is_file($file['tmp_name'])) if(is_file($file['tmp_name']))
{ {
//var_dump($file); echo "DIR:$dest_dir"; $img_info = getimagesize($file['tmp_name']);
//_debug_array($img_info);
if(is_array($img_info))
{
$w = $img_info[0];
$h = $img_info[1];
if( $w > $MAX_WIDTH || $h > $MAX_HEIGHT )
{
adapt_size($file['tmp_name'],$dest_dir.$file['name']);
}
else
{
move_uploaded_file($file['tmp_name'], $dest_dir.$file['name']); move_uploaded_file($file['tmp_name'], $dest_dir.$file['name']);
}
chmod($dest_dir.$file['name'], 0666); chmod($dest_dir.$file['name'], 0666);
} }
}
$clearUploads = true; $clearUploads = true;
} }
function adapt_size($img,$dest_file)
{
global $BASE_DIR, $BASE_URL,$MAX_WIDTH,$MAX_HEIGHT;
$path_info = pathinfo($img);
$path = $path_info['dirname']."/";
$img_file = $path_info['basename'];
$img_info = getimagesize($path.$img_file);
$w = $img_info[0]; $h = $img_info[1];
$nw = $MAX_WIDTH; $nh = $MAX_HEIGHT;
$img_resize = Image_Transform::factory(IMAGE_CLASS);
$img_resize->load($path.$img_file);
if ($w > $h)
$nh = unpercent(percent($nw, $w), $h);
else if ($h > $w)
$nw = unpercent(percent($nh, $h), $w);
$img_resize->resize($nw, $nh);
$img_resize->save($dest_file);
$img_resize->free();
chmod($dest_file, 0666);
}
function delete_folder($folder) function delete_folder($folder)
{ {
global $BASE_DIR, $refresh_dirs; global $BASE_DIR, $refresh_dirs;
//var_dump($BASE_DIR);
$del_folder = dir_name($BASE_DIR).$folder; $del_folder = dir_name($BASE_DIR).$folder;
//echo $del_folder;
if(is_dir($del_folder) && num_files($del_folder) <= 0) { if(is_dir($del_folder) && num_files($del_folder) <= 0)
//echo $del_folder.'<br>'; {
rm_all_dir($del_folder); rm_all_dir($del_folder);
$refresh_dirs = true; $refresh_dirs = true;
} }
@ -133,17 +191,18 @@ function rm_all_dir($dir)
function delete_file($file) function delete_file($file)
{ {
global $BASE_DIR; global $BASE_DIR,$IMG_ROOT;
$del_image = dir_name($BASE_DIR).$file; $del_image = dir_name($BASE_DIR).$IMG_ROOT.$file;
$del_thumb = dir_name($BASE_DIR).$IMG_ROOT.$file;
$del_thumb = dir_name($del_image).'.'.basename($del_image); if(is_file($del_image))
{
if(is_file($del_image)) {
unlink($del_image); unlink($del_image);
} }
if(is_file($del_thumb)) { if(is_file($del_thumb))
{
unlink($del_thumb); unlink($del_thumb);
} }
} }
@ -256,14 +315,14 @@ function show_image($img, $file, $info, $size)
<td width="1%" class="buttonOut" onMouseOver="pviiClassNew(this,'buttonHover')" onMouseOut="pviiClassNew(this,'buttonOut')"> <td width="1%" class="buttonOut" onMouseOver="pviiClassNew(this,'buttonHover')" onMouseOut="pviiClassNew(this,'buttonOut')">
<a href="javascript:;" onClick="javascript:preview('<? echo $img_url; ?>', '<? echo $file; ?>', ' <? echo $filesize; ?>',<? echo $info[0].','.$info[1]; ?>);"><img src="edit_pencil.gif" width="15" height="15" border="0"></a></td> <a href="javascript:;" onClick="javascript:preview('<? echo $img_url; ?>', '<? echo $file; ?>', ' <? echo $filesize; ?>',<? echo $info[0].','.$info[1]; ?>);"><img src="edit_pencil.gif" width="15" height="15" border="0"></a></td>
<td width="1%" class="buttonOut" onMouseOver="pviiClassNew(this,'buttonHover')" onMouseOut="pviiClassNew(this,'buttonOut')"> <td width="1%" class="buttonOut" onMouseOver="pviiClassNew(this,'buttonHover')" onMouseOut="pviiClassNew(this,'buttonOut')">
<a href="images.php?delFile=<? echo $img_url; ?>&dir=<? echo $newPath; ?>" onClick="return deleteImage('<? echo $file; ?>');"><img src="edit_trash.gif" width="15" height="15" border="0"></a></td> <a href="images.php?delFile=<? echo $file; ?>&dir=<? echo $newPath; ?>" onClick="return deleteImage('<? echo $file; ?>');"><img src="edit_trash.gif" width="15" height="15" border="0"></a></td>
<td width="98%" class="imgCaption"><? echo $info[0].'x'.$info[1]; ?></td> <td width="98%" class="imgCaption"><? echo $info[0].'x'.$info[1]; ?></td>
</tr> </tr>
</table></td> </table></td>
</tr> </tr>
</table> </table>
</td> </td>
<? <?php
} }
function show_dir($path, $dir) function show_dir($path, $dir)
@ -308,11 +367,11 @@ function draw_no_results()
function draw_no_dir() function draw_no_dir()
{ {
global $BASE_DIR, $BASE_ROOT; global $BASE_DIR;
?> ?>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"> <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr> <tr>
<td><div align="center" style="font-size:small;font-weight:bold;color:#CC0000;font-family: Helvetica, sans-serif;">Configuration Problem: &quot;<? echo $BASE_DIR.$BASE_ROOT; ?>&quot; does not exist.</div></td> <td><div align="center" style="font-size:small;font-weight:bold;color:#CC0000;font-family: Helvetica, sans-serif;">Configuration Problem: &quot;<? echo $BASE_DIR; ?>&quot; does not exist.</div></td>
</tr> </tr>
</table> </table>
<? <?
@ -376,8 +435,9 @@ function draw_table_footer()
--> -->
</style> </style>
<? <?php
$dirPath = eregi_replace($BASE_ROOT,'',$IMG_ROOT); // $dirPath = eregi_replace($BASE_ROOT,'',$IMG_ROOT);
$dirPath=$IMG_ROOT;
$paths = explode('/', $dirPath); $paths = explode('/', $dirPath);
$upDirPath = '/'; $upDirPath = '/';
@ -422,7 +482,8 @@ function newFolder(oldDir, newFolder)
function updateDir() function updateDir()
{ {
var newPath = "<? echo $newPath; ?>"; var newPath = "<?php echo $newPath; ?>";
// alert('<?php echo $newPath; ?>');
if(window.top.document.forms[0] != null) { if(window.top.document.forms[0] != null) {
var allPaths = window.top.document.forms[0].dirPath.options; var allPaths = window.top.document.forms[0].dirPath.options;
@ -455,7 +516,7 @@ function updateDir()
function refreshDirs() function refreshDirs()
{ {
var allPaths = window.top.document.forms[0].dirPath.options; var allPaths = window.top.document.forms[0].dirPath.options;
var fields = ["/" <? dirs($BASE_DIR.$BASE_ROOT,'');?>]; var fields = ["/" <? dirs($BASE_DIR,'');?>];
var newPath = "<? echo $newPath; ?>"; var newPath = "<? echo $newPath; ?>";
@ -499,6 +560,12 @@ function imageSelected(filename, width, height, alt)
function preview(file, image, size, width, height) function preview(file, image, size, width, height)
{ {
alert('Not implemented yet,sorry');
return;
/* /*
var predoc = '<img src="'+file+'" alt="'+image+' ('+width+'x'+height+', '+size+')">'; var predoc = '<img src="'+file+'" alt="'+image+' ('+width+'x'+height+', '+size+')">';
var w = 450; var w = 450;

View File

@ -0,0 +1,25 @@
<?php
/**************************************************************************\
* eGroupWare - UploadImage-plugin for htmlArea *
* http://www.eGroupWare.org *
* Written and (c) by Xiang Wei ZHUO <wei@zhuo.org> *
* Modified for eGW by and (c) by Pim Snel <pim@lingewoud.nl> *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; version 2 of the License. *
\**************************************************************************/
function percent($p, $w)
{
return (real)(100 * ($p / $w));
}
function unpercent($percent, $whole)
{
return (real)(($percent * $whole) / 100);
}
?>

View File

@ -1,19 +1,28 @@
<?php <?php
/*********************************************************************** /**************************************************************************\
** Title.........: Thumbnail generator, with cache. * eGroupWare - UploadImage-plugin for htmlArea *
** Version.......: 1.0 * http://www.eGroupWare.org *
** Author........: Xiang Wei ZHUO <wei@zhuo.org> * Written and (c) by Xiang Wei ZHUO <wei@zhuo.org> *
** Filename......: thumbs.php * Modified for eGW by and (c) by Pim Snel <pim@lingewoud.nl> *
** Last changed..: 1 Mar 2003 * -------------------------------------------- *
** Notes.........: Configuration in config.inc.php * This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; version 2 of the License. *
* -------------------------------------------- *
* Title.........: Thumbnail generator, with cache. *
* Version.......: 1.01 *
* Author........: Xiang Wei ZHUO <wei@zhuo.org> *
* Notes.........: Configuration in config.inc.php *
* *
* Functions *
* - if the thumbnail does not exists or the source file is newer, create a *
* new thumbnail. *
\**************************************************************************/
- if the thumbnail does not exists or the source /* $id */
file is newer, create a new thumbnail.
***********************************************************************/ require_once 'config.inc.php';
require_once 'std_functions.inc.php';
include 'config.inc.php';
require_once '../ImageEditor/Transform.php'; require_once '../ImageEditor/Transform.php';
$img = $BASE_DIR.urldecode($_GET['img']); $img = $BASE_DIR.urldecode($_GET['img']);
@ -22,12 +31,10 @@ if(is_file($img)) {
make_thumbs(urldecode($_GET['img'])); make_thumbs(urldecode($_GET['img']));
} }
function make_thumbs($img) function make_thumbs($img)
{ {
global $BASE_DIR, $BASE_URL; global $BASE_DIR, $BASE_URL;
$path_info = pathinfo($img); $path_info = pathinfo($img);
$path = $path_info['dirname']."/"; $path = $path_info['dirname']."/";
$img_file = $path_info['basename']; $img_file = $path_info['basename'];
@ -59,7 +66,6 @@ function make_thumbs($img)
$img_thumbs = Image_Transform::factory(IMAGE_CLASS); $img_thumbs = Image_Transform::factory(IMAGE_CLASS);
$img_thumbs->load($BASE_DIR.$path.$img_file); $img_thumbs->load($BASE_DIR.$path.$img_file);
if ($w > $h) if ($w > $h)
$nh = unpercent(percent($nw, $w), $h); $nh = unpercent(percent($nw, $w), $h);
else if ($h > $w) else if ($h > $w)
@ -73,19 +79,9 @@ function make_thumbs($img)
chmod($BASE_DIR.$thumb, 0666); chmod($BASE_DIR.$thumb, 0666);
if(is_file($BASE_DIR.$thumb)) { if(is_file($BASE_DIR.$thumb)) {
//echo "Made:".$BASE_URL.$path.'.'.$img_file;
header('Location: '.$BASE_URL.$path.'.'.$img_file); header('Location: '.$BASE_URL.$path.'.'.$img_file);
exit(); exit();
} }
} }
function percent($p, $w)
{
return (real)(100 * ($p / $w));
}
function unpercent($percent, $whole)
{
return (real)(($percent * $whole) / 100);
}
?> ?>

View File

@ -7,15 +7,49 @@
** Last changed..: 8 Mar 2003 ** Last changed..: 8 Mar 2003
** Notes.........: Configuration in config.inc.php ** Notes.........: Configuration in config.inc.php
- Only compatible with IE 5.5+ - FIXME Only compatible with IE 5.5+
***********************************************************************/ ***********************************************************************/
/* $id */
include 'ImageManager/config.inc.php'; include 'ImageManager/config.inc.php';
$no_dir = false; $no_dir = false;
if(!is_dir($BASE_DIR.$BASE_ROOT)) { if(!is_dir($BASE_DIR)) {
$no_dir = true; $no_dir = true;
} }
// _debug_array($_GET);
// die();
function dirs($dir,$abs_path)
{
$d = dir($dir);
$dirs = array();
while (false !== ($entry = $d->read()))
{
if(is_dir($dir.'/'.$entry) && substr($entry,0,1) != '.')
{
$path['path'] = $dir.'/'.$entry;
$path['name'] = $entry;
$dirs[$entry] = $path;
}
}
$d->close();
ksort($dirs);
for($i=0; $i<count($dirs); $i++)
{
$name = key($dirs);
$current_dir = $abs_path.'/'.$dirs[$name]['name'];
echo "<option value=\"$current_dir\">$current_dir</option>\n";
dirs($dirs[$name]['path'],$current_dir);
next($dirs);
}
}
?> ?>
<html style="width: 580; height: 440;"> <html style="width: 580; height: 440;">
<head> <head>
@ -326,36 +360,10 @@ function toggleConstrains(constrains)
<td> <td>
<select name="dirPath" id="dirPath" style="width:30em" onChange="updateDir(this)"> <select name="dirPath" id="dirPath" style="width:30em" onChange="updateDir(this)">
<option value="/">/</option> <option value="/">/</option>
<? <?php
if($no_dir == false)
function dirs($dir,$abs_path)
{ {
$d = dir($dir); dirs($BASE_DIR,'');
$dirs = array();
while (false !== ($entry = $d->read())) {
if(is_dir($dir.'/'.$entry) && substr($entry,0,1) != '.')
{
$path['path'] = $dir.'/'.$entry;
$path['name'] = $entry;
$dirs[$entry] = $path;
}
}
$d->close();
ksort($dirs);
for($i=0; $i<count($dirs); $i++)
{
$name = key($dirs);
$current_dir = $abs_path.'/'.$dirs[$name]['name'];
echo "<option value=\"$current_dir\">$current_dir</option>\n";
dirs($dirs[$name]['path'],$current_dir);
next($dirs);
}
}
if($no_dir == false) {
dirs($BASE_DIR.$BASE_ROOT,'');
} }
?> ?>
</select> </select>

View File

@ -1,16 +1,18 @@
// UploadImage Plugin for HTMLArea-3.0 /**************************************************************************\
// Implementation by Mihai Bazon. Sponsored by http://thycotic.com * eGroupWare - UploadImage-plugin for htmlArea in eGroupWare *
// * http://www.eGroupWare.org *
// htmlArea v3.0 - Copyright (c) 2002 interactivetools.com, inc. * Written and (c) by Xiang Wei ZHUO <wei@zhuo.org> *
// This notice MUST stay intact for use (see license.txt). * Used code fragments from plugins by Mihai Bazon *
// * Modified for eGW by and (c) by Pim Snel <pim@lingewoud.nl> *
// A free WYSIWYG editor replacement for <textarea> fields. * -------------------------------------------- *
// For full source code and docs, visit http://www.interactivetools.com/ * This program is free software; you can redistribute it and/or modify it *
// * under the terms of the GNU General Public License as published by the *
// Version 3.0 developed by Mihai Bazon for InteractiveTools. * Free Software Foundation; version 2 of the License. *
// http://dynarch.com/mishoo \**************************************************************************/
//
// $Id$ // $id$
// FIXME: clean up code
function UploadImage(editor) { function UploadImage(editor) {
this.editor = editor; this.editor = editor;
@ -36,12 +38,12 @@ function UploadImage(editor) {
}; };
UploadImage._pluginInfo = { UploadImage._pluginInfo = {
name : "UploadImage", name : "UploadImage for eGroupWare",
version : "1.0", version : "1.0",
developer : "Pim Snel", developer : "Pim Snel",
developer_url : "http://lingewoud.com", developer_url : "http://lingewoud.com",
c_owner : "Mihai Bazon", c_owner : "Pim Snel, Xiang Wei ZHUO, Mihai Bazon",
sponsor : "Lingewoud b.v. - Netherlands", sponsor : "Lingewoud bv., Netherlands",
sponsor_url : "http://lingewoud.com", sponsor_url : "http://lingewoud.com",
license : "GPL" license : "GPL"
}; };