From: Yves K. <yku...@us...> - 2004-11-09 19:27:12
|
Update of /cvsroot/phpwebsite-comm/modules/xwysiwyg/mod/xwysiwyg/_htmlarea/plugins/ImageManager In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11248/modules/xwysiwyg/mod/xwysiwyg/_htmlarea/plugins/ImageManager Modified Files: README.txt editor.php editorFrame.php images.php manager.php newFolder.html thumbs.php Log Message: unix saving Index: README.txt =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/xwysiwyg/mod/xwysiwyg/_htmlarea/plugins/ImageManager/README.txt,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** README.txt 25 Oct 2004 18:16:08 -0000 1.1.1.1 --- README.txt 9 Nov 2004 19:26:15 -0000 1.2 *************** *** 1,12 **** ! This is a plug-in for HTMLArea 3.0 ! ! The PHP ImageManager + Editor provides an interface to ! browser for image files on your web server. The Editor ! allows some basic image manipulations such as, cropping, ! rotation, flip, and scaling. ! ! Further and up-to-date documentation can be found at ! http://www.zhuo.org/htmlarea/docs/index.html ! ! Cheer, Wei \ No newline at end of file --- 1,12 ---- ! This is a plug-in for HTMLArea 3.0 ! ! The PHP ImageManager + Editor provides an interface to ! browser for image files on your web server. The Editor ! allows some basic image manipulations such as, cropping, ! rotation, flip, and scaling. ! ! Further and up-to-date documentation can be found at ! http://www.zhuo.org/htmlarea/docs/index.html ! ! Cheer, Wei \ No newline at end of file Index: manager.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/xwysiwyg/mod/xwysiwyg/_htmlarea/plugins/ImageManager/manager.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** manager.php 25 Oct 2004 18:16:07 -0000 1.1.1.1 --- manager.php 9 Nov 2004 19:26:16 -0000 1.2 *************** *** 1,129 **** ! <? ! /** ! * The main GUI for the ImageManager. ! * @author $Author$ ! * @version $Id$ ! * @package ImageManager ! */ ! ! require_once('config.inc.php'); ! require_once('Classes/ImageManager.php'); ! ! $manager = new ImageManager($IMConfig); ! $dirs = $manager->getDirs(); ! ! ?> ! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ! ! <html> ! <head> ! <title>Insert Image</title> ! <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> ! <link href="assets/manager.css" rel="stylesheet" type="text/css" /> ! <script type="text/javascript" src="assets/popup.js"></script> ! <script type="text/javascript" src="assets/dialog.js"></script> ! <script type="text/javascript"> ! /*<![CDATA[*/ ! window.resizeTo(600, 460); ! ! if(window.opener) ! I18N = window.opener.ImageManager.I18N; ! ! var thumbdir = "<? echo $IMConfig['thumbnail_dir']; ?>"; ! var base_url = "<? echo $manager->getBaseURL(); ?>"; ! /*]]>*/ ! </script> ! <script type="text/javascript" src="assets/manager.js"></script> ! </head> ! <body> ! <div class="title">Insert Image</div> ! <form action="images.php" id="uploadForm" method="post" enctype="multipart/form-data"> ! <fieldset><legend>Image Manager</legend> ! <div class="dirs"> ! <label for="dirPath">Directory</label> ! <select name="dir" class="dirWidth" id="dirPath" onchange="updateDir(this)"> ! <option value="/">/</option> ! <? foreach($dirs as $relative=>$fullpath) { ?> ! <option value="<? echo rawurlencode($relative); ?>"><? echo $relative; ?></option> ! <? } ?> ! </select> ! <a href="#" onclick="javascript: goUpDir();" title="Directory Up"><img src="img/btnFolderUp.gif" height="15" width="15" alt="Directory Up" /></a> ! <? if($IMConfig['safe_mode'] == false && $IMConfig['allow_new_dir']) { ?> ! <a href="#" onclick="newFolder();" title="New Folder"><img src="img/btnFolderNew.gif" height="15" width="15" alt="New Folder" /></a> ! <? } ?> ! <div id="messages" style="display: none;"><span id="message"></span><img SRC="img/dots.gif" width="22" height="12" alt="..." /></div> ! <iframe src="images.php" name="imgManager" id="imgManager" class="imageFrame" scrolling="auto" title="Image Selection" frameborder="0"></iframe> ! </div> ! </fieldset> ! <!-- image properties --> ! <table class="inputTable"> ! <tr> ! <td align="right"><label for="f_url">Image File</label></td> ! <td><input type="text" id="f_url" class="largelWidth" value="" /></td> ! <td rowspan="3" align="right"> </td> ! <td align="right"><label for="f_width">Width</label></td> ! <td><input type="text" id="f_width" class="smallWidth" value="" onchange="javascript:checkConstrains('width');"/></td> ! <td rowspan="2" align="right"><img src="img/locked.gif" id="imgLock" width="25" height="32" alt="Constrained Proportions" /></td> ! <td rowspan="3" align="right"> </td> ! <td align="right"><label for="f_vert">V Space</label></td> ! <td><input type="text" id="f_vert" class="smallWidth" value="" /></td> ! </tr> ! <tr> ! <td align="right"><label for="f_alt">Alt</label></td> ! <td><input type="text" id="f_alt" class="largelWidth" value="" /></td> ! <td align="right"><label for="f_height">Height</label></td> ! <td><input type="text" id="f_height" class="smallWidth" value="" onchange="javascript:checkConstrains('height');"/></td> ! <td align="right"><label for="f_horiz">H Space</label></td> ! <td><input type="text" id="f_horiz" class="smallWidth" value="" /></td> ! </tr> ! <tr> ! <? if($IMConfig['allow_upload'] == true) { ?> ! <td align="right"><label for="upload">Upload</label></td> ! <td> ! <table cellpadding="0" cellspacing="0" border="0"> ! <tr> ! <td><input type="file" name="upload" id="upload"/></td> ! <td> <button type="submit" name="submit" onclick="doUpload();"/>Upload</button></td> ! </tr> ! </table> ! </td> ! <? } else { ?> ! <td colspan="2"></td> ! <? } ?> ! <td align="right"><label for="f_align">Align</label></td> ! <td colspan="2"> ! <select size="1" id="f_align" title="Positioning of this image"> ! <option value="" >Not Set</option> ! <option value="left" >Left</option> ! <option value="right" >Right</option> ! <option value="texttop" >Texttop</option> ! <option value="absmiddle" >Absmiddle</option> ! <option value="baseline" selected="selected" >Baseline</option> ! <option value="absbottom" >Absbottom</option> ! <option value="bottom" >Bottom</option> ! <option value="middle" >Middle</option> ! <option value="top" >Top</option> ! </select> ! </td> ! <td align="right"><label for="f_border">Border</label></td> ! <td><input type="text" id="f_border" class="smallWidth" value="" /></td> ! </tr> ! <tr> ! <td colspan="4" align="right"> ! <input type="hidden" id="orginal_width" /> ! <input type="hidden" id="orginal_height" /> ! <input type="checkbox" id="constrain_prop" checked="checked" onclick="javascript:toggleConstrains(this);" /> ! </td> ! <td colspan="5"><label for="constrain_prop">Constrain Proportions</label></td> ! </tr> ! </table> ! <!--// image properties --> ! <div style="text-align: right;"> ! <hr /> ! <button type="button" class="buttons" onclick="return refresh();">Refresh</button> ! <button type="button" class="buttons" onclick="return onOK();">OK</button> ! <button type="button" class="buttons" onclick="return onCancel();">Cancel</button> ! </div> ! </form> ! </body> </html> \ No newline at end of file --- 1,129 ---- ! <? ! /** ! * The main GUI for the ImageManager. ! * @author $Author$ ! * @version $Id$ ! * @package ImageManager ! */ ! ! require_once('config.inc.php'); ! require_once('Classes/ImageManager.php'); ! ! $manager = new ImageManager($IMConfig); ! $dirs = $manager->getDirs(); ! ! ?> ! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ! ! <html> ! <head> ! <title>Insert Image</title> ! <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> ! <link href="assets/manager.css" rel="stylesheet" type="text/css" /> ! <script type="text/javascript" src="assets/popup.js"></script> ! <script type="text/javascript" src="assets/dialog.js"></script> ! <script type="text/javascript"> ! /*<![CDATA[*/ ! window.resizeTo(600, 460); ! ! if(window.opener) ! I18N = window.opener.ImageManager.I18N; ! ! var thumbdir = "<? echo $IMConfig['thumbnail_dir']; ?>"; ! var base_url = "<? echo $manager->getBaseURL(); ?>"; ! /*]]>*/ ! </script> ! <script type="text/javascript" src="assets/manager.js"></script> ! </head> ! <body> ! <div class="title">Insert Image</div> ! <form action="images.php" id="uploadForm" method="post" enctype="multipart/form-data"> ! <fieldset><legend>Image Manager</legend> ! <div class="dirs"> ! <label for="dirPath">Directory</label> ! <select name="dir" class="dirWidth" id="dirPath" onchange="updateDir(this)"> ! <option value="/">/</option> ! <? foreach($dirs as $relative=>$fullpath) { ?> ! <option value="<? echo rawurlencode($relative); ?>"><? echo $relative; ?></option> ! <? } ?> ! </select> ! <a href="#" onclick="javascript: goUpDir();" title="Directory Up"><img src="img/btnFolderUp.gif" height="15" width="15" alt="Directory Up" /></a> ! <? if($IMConfig['safe_mode'] == false && $IMConfig['allow_new_dir']) { ?> ! <a href="#" onclick="newFolder();" title="New Folder"><img src="img/btnFolderNew.gif" height="15" width="15" alt="New Folder" /></a> ! <? } ?> ! <div id="messages" style="display: none;"><span id="message"></span><img SRC="img/dots.gif" width="22" height="12" alt="..." /></div> ! <iframe src="images.php" name="imgManager" id="imgManager" class="imageFrame" scrolling="auto" title="Image Selection" frameborder="0"></iframe> ! </div> ! </fieldset> ! <!-- image properties --> ! <table class="inputTable"> ! <tr> ! <td align="right"><label for="f_url">Image File</label></td> ! <td><input type="text" id="f_url" class="largelWidth" value="" /></td> ! <td rowspan="3" align="right"> </td> ! <td align="right"><label for="f_width">Width</label></td> ! <td><input type="text" id="f_width" class="smallWidth" value="" onchange="javascript:checkConstrains('width');"/></td> ! <td rowspan="2" align="right"><img src="img/locked.gif" id="imgLock" width="25" height="32" alt="Constrained Proportions" /></td> ! <td rowspan="3" align="right"> </td> ! <td align="right"><label for="f_vert">V Space</label></td> ! <td><input type="text" id="f_vert" class="smallWidth" value="" /></td> ! </tr> ! <tr> ! <td align="right"><label for="f_alt">Alt</label></td> ! <td><input type="text" id="f_alt" class="largelWidth" value="" /></td> ! <td align="right"><label for="f_height">Height</label></td> ! <td><input type="text" id="f_height" class="smallWidth" value="" onchange="javascript:checkConstrains('height');"/></td> ! <td align="right"><label for="f_horiz">H Space</label></td> ! <td><input type="text" id="f_horiz" class="smallWidth" value="" /></td> ! </tr> ! <tr> ! <? if($IMConfig['allow_upload'] == true) { ?> ! <td align="right"><label for="upload">Upload</label></td> ! <td> ! <table cellpadding="0" cellspacing="0" border="0"> ! <tr> ! <td><input type="file" name="upload" id="upload"/></td> ! <td> <button type="submit" name="submit" onclick="doUpload();"/>Upload</button></td> ! </tr> ! </table> ! </td> ! <? } else { ?> ! <td colspan="2"></td> ! <? } ?> ! <td align="right"><label for="f_align">Align</label></td> ! <td colspan="2"> ! <select size="1" id="f_align" title="Positioning of this image"> ! <option value="" >Not Set</option> ! <option value="left" >Left</option> ! <option value="right" >Right</option> ! <option value="texttop" >Texttop</option> ! <option value="absmiddle" >Absmiddle</option> ! <option value="baseline" selected="selected" >Baseline</option> ! <option value="absbottom" >Absbottom</option> ! <option value="bottom" >Bottom</option> ! <option value="middle" >Middle</option> ! <option value="top" >Top</option> ! </select> ! </td> ! <td align="right"><label for="f_border">Border</label></td> ! <td><input type="text" id="f_border" class="smallWidth" value="" /></td> ! </tr> ! <tr> ! <td colspan="4" align="right"> ! <input type="hidden" id="orginal_width" /> ! <input type="hidden" id="orginal_height" /> ! <input type="checkbox" id="constrain_prop" checked="checked" onclick="javascript:toggleConstrains(this);" /> ! </td> ! <td colspan="5"><label for="constrain_prop">Constrain Proportions</label></td> ! </tr> ! </table> ! <!--// image properties --> ! <div style="text-align: right;"> ! <hr /> ! <button type="button" class="buttons" onclick="return refresh();">Refresh</button> ! <button type="button" class="buttons" onclick="return onOK();">OK</button> ! <button type="button" class="buttons" onclick="return onCancel();">Cancel</button> ! </div> ! </form> ! </body> </html> \ No newline at end of file Index: newFolder.html =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/xwysiwyg/mod/xwysiwyg/_htmlarea/plugins/ImageManager/newFolder.html,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** newFolder.html 25 Oct 2004 18:16:04 -0000 1.1.1.1 --- newFolder.html 9 Nov 2004 19:26:16 -0000 1.2 *************** *** 1,78 **** ! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ! <html> ! <head> ! <title>New Folder</title> ! <style type="text/css"> ! /*<![CDATA[*/ ! html, body { background-color: ButtonFace; color: ButtonText; font: 11px Tahoma,Verdana,sans-serif; margin: 0; padding: 0;} ! body { padding: 5px; } ! .title { background-color: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px; border-bottom: 1px solid black; letter-spacing: 2px;} ! select, input, button { font: 11px Tahoma,Verdana,sans-serif; } ! .buttons { width: 70px; text-align: center; } ! form { padding: 0px; margin: 0;} ! form .elements{ ! padding: 10px; text-align: center; ! } ! /*]]>*/ ! </style> ! <script type="text/javascript" src="assets/popup.js"></script> ! <script type="text/javascript"> ! /*<![CDATA[*/ ! window.resizeTo(300, 160); ! ! if(window.opener) ! I18N = window.opener.I18N; ! ! init = function () ! { ! __dlg_init(); ! __dlg_translate(I18N); ! document.getElementById("f_foldername").focus(); ! } ! ! function onCancel() ! { ! __dlg_close(null); ! return false; ! } ! ! function onOK() ! { ! // pass data back to the calling window ! var fields = ["f_foldername"]; ! var param = new Object(); ! for (var i in fields) { ! var id = fields[i]; ! var el = document.getElementById(id); ! param[id] = el.value; ! } ! __dlg_close(param); ! return false; ! } ! ! function addEvent(obj, evType, fn) ! { ! if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; } ! else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; } ! else { return false; } ! } ! ! addEvent(window, 'load', init); ! //--> ! </script> ! </head> ! <body > ! <div class="title">New Folder</div> ! <form action=""> ! <div class="elements"> ! <label for="f_foldername">Folder Name:</label> ! <input type="text" id="f_foldername" /> ! </div> ! <div style="text-align: right;"> ! <hr /> ! <button type="button" class="buttons" onclick="return onOK();">OK</button> ! <button type="button" class="buttons" onclick="return onCancel();">Cancel</button> ! </div> ! </form> ! </body> </html> \ No newline at end of file --- 1,78 ---- ! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ! <html> ! <head> ! <title>New Folder</title> ! <style type="text/css"> ! /*<![CDATA[*/ ! html, body { background-color: ButtonFace; color: ButtonText; font: 11px Tahoma,Verdana,sans-serif; margin: 0; padding: 0;} ! body { padding: 5px; } ! .title { background-color: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px; border-bottom: 1px solid black; letter-spacing: 2px;} ! select, input, button { font: 11px Tahoma,Verdana,sans-serif; } ! .buttons { width: 70px; text-align: center; } ! form { padding: 0px; margin: 0;} ! form .elements{ ! padding: 10px; text-align: center; ! } ! /*]]>*/ ! </style> ! <script type="text/javascript" src="assets/popup.js"></script> ! <script type="text/javascript"> ! /*<![CDATA[*/ ! window.resizeTo(300, 160); ! ! if(window.opener) ! I18N = window.opener.I18N; ! ! init = function () ! { ! __dlg_init(); ! __dlg_translate(I18N); ! document.getElementById("f_foldername").focus(); ! } ! ! function onCancel() ! { ! __dlg_close(null); ! return false; ! } ! ! function onOK() ! { ! // pass data back to the calling window ! var fields = ["f_foldername"]; ! var param = new Object(); ! for (var i in fields) { ! var id = fields[i]; ! var el = document.getElementById(id); ! param[id] = el.value; ! } ! __dlg_close(param); ! return false; ! } ! ! function addEvent(obj, evType, fn) ! { ! if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; } ! else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; } ! else { return false; } ! } ! ! addEvent(window, 'load', init); ! //--> ! </script> ! </head> ! <body > ! <div class="title">New Folder</div> ! <form action=""> ! <div class="elements"> ! <label for="f_foldername">Folder Name:</label> ! <input type="text" id="f_foldername" /> ! </div> ! <div style="text-align: right;"> ! <hr /> ! <button type="button" class="buttons" onclick="return onOK();">OK</button> ! <button type="button" class="buttons" onclick="return onCancel();">Cancel</button> ! </div> ! </form> ! </body> </html> \ No newline at end of file Index: editorFrame.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/xwysiwyg/mod/xwysiwyg/_htmlarea/plugins/ImageManager/editorFrame.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** editorFrame.php 25 Oct 2004 18:15:59 -0000 1.1.1.1 --- editorFrame.php 9 Nov 2004 19:26:16 -0000 1.2 *************** *** 1,69 **** ! <? ! ! /** ! * The frame that contains the image to be edited. ! * @author $Author$ ! * @version $Id$ ! * @package ImageManager ! */ ! ! require_once('config.inc.php'); ! require_once('Classes/ImageManager.php'); ! require_once('Classes/ImageEditor.php'); ! ! $manager = new ImageManager($IMConfig); ! $editor = new ImageEditor($manager); ! $imageInfo = $editor->processImage(); ! ! ?> ! ! <html> ! <head> ! <title></title> ! <link href="assets/editorFrame.css" rel="stylesheet" type="text/css" /> ! <script type="text/javascript" src="assets/wz_jsgraphics.js"></script> ! <script type="text/javascript" src="assets/EditorContent.js"></script> ! <script type="text/javascript"> ! if(window.top) ! I18N = window.top.I18N; ! ! function i18n(str) { ! if(I18N) ! return (I18N[str] || str); ! else ! return str; ! }; ! ! var mode = "<? echo $editor->getAction(); ?>" //crop, scale, measure ! ! var currentImageFile = "<? if(count($imageInfo)>0) echo rawurlencode($imageInfo['file']); ?>"; ! ! <? if ($editor->isFileSaved() == 1) { ?> ! alert(i18n('File saved.')); ! <? } else if ($editor->isFileSaved() == -1) { ?> ! alert(i18n('File was not saved.')); ! <? } ?> ! ! </script> ! <script type="text/javascript" src="assets/editorFrame.js"></script> ! </head> ! ! <body> ! <div id="status"></div> ! <div id="ant" class="selection" style="visibility:hidden"><img src="img/spacer.gif" width="0" height="0" border="0" alt="" id="cropContent"></div> ! <? if ($editor->isGDEditable() == -1) { ?> ! <div style="text-align:center; padding:10px;"><span class="error">GIF format is not supported, image editing not supported.</span></div> ! <? } ?> ! <table height="100%" width="100%"> ! <tr> ! <td> ! <? if(count($imageInfo) > 0 && is_file($imageInfo['fullpath'])) { ?> ! <span id="imgCanvas" class="crop"><img src="<? echo $imageInfo['src']; ?>" <? echo $imageInfo['dimensions']; ?> alt="" id="theImage" name="theImage"></span> ! <? } else { ?> ! <span class="error">No Image Available</span> ! <? } ?> ! </td> ! </tr> ! </table> ! </body> ! </html> --- 1,69 ---- ! <? ! ! /** ! * The frame that contains the image to be edited. ! * @author $Author$ ! * @version $Id$ ! * @package ImageManager ! */ ! ! require_once('config.inc.php'); ! require_once('Classes/ImageManager.php'); ! require_once('Classes/ImageEditor.php'); ! ! $manager = new ImageManager($IMConfig); ! $editor = new ImageEditor($manager); ! $imageInfo = $editor->processImage(); ! ! ?> ! ! <html> ! <head> ! <title></title> ! <link href="assets/editorFrame.css" rel="stylesheet" type="text/css" /> ! <script type="text/javascript" src="assets/wz_jsgraphics.js"></script> ! <script type="text/javascript" src="assets/EditorContent.js"></script> ! <script type="text/javascript"> ! if(window.top) ! I18N = window.top.I18N; ! ! function i18n(str) { ! if(I18N) ! return (I18N[str] || str); ! else ! return str; ! }; ! ! var mode = "<? echo $editor->getAction(); ?>" //crop, scale, measure ! ! var currentImageFile = "<? if(count($imageInfo)>0) echo rawurlencode($imageInfo['file']); ?>"; ! ! <? if ($editor->isFileSaved() == 1) { ?> ! alert(i18n('File saved.')); ! <? } else if ($editor->isFileSaved() == -1) { ?> ! alert(i18n('File was not saved.')); ! <? } ?> ! ! </script> ! <script type="text/javascript" src="assets/editorFrame.js"></script> ! </head> ! ! <body> ! <div id="status"></div> ! <div id="ant" class="selection" style="visibility:hidden"><img src="img/spacer.gif" width="0" height="0" border="0" alt="" id="cropContent"></div> ! <? if ($editor->isGDEditable() == -1) { ?> ! <div style="text-align:center; padding:10px;"><span class="error">GIF format is not supported, image editing not supported.</span></div> ! <? } ?> ! <table height="100%" width="100%"> ! <tr> ! <td> ! <? if(count($imageInfo) > 0 && is_file($imageInfo['fullpath'])) { ?> ! <span id="imgCanvas" class="crop"><img src="<? echo $imageInfo['src']; ?>" <? echo $imageInfo['dimensions']; ?> alt="" id="theImage" name="theImage"></span> ! <? } else { ?> ! <span class="error">No Image Available</span> ! <? } ?> ! </td> ! </tr> ! </table> ! </body> ! </html> Index: thumbs.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/xwysiwyg/mod/xwysiwyg/_htmlarea/plugins/ImageManager/thumbs.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** thumbs.php 25 Oct 2004 18:16:11 -0000 1.1.1.1 --- thumbs.php 9 Nov 2004 19:26:16 -0000 1.2 *************** *** 1,82 **** ! <? ! /** ! * On the fly Thumbnail generation. ! * Creates thumbnails given by thumbs.php?img=/relative/path/to/image.jpg ! * relative to the base_dir given in config.inc.php ! * @author $Author$ ! * @version $Id$ ! * @package ImageManager ! */ ! ! require_once('config.inc.php'); ! require_once('Classes/ImageManager.php'); ! require_once('Classes/Thumbnail.php'); ! ! //check for img parameter in the url ! if(!isset($_GET['img'])) ! exit(); ! ! ! $manager = new ImageManager($IMConfig); ! ! //get the image and the full path to the image ! $image = rawurldecode($_GET['img']); ! $fullpath = Files::makeFile($manager->getBaseDir(),$image); ! ! //not a file, so exit ! if(!is_file($fullpath)) ! exit(); ! ! $imgInfo = @getImageSize($fullpath); ! ! //Not an image, send default thumbnail ! if(!is_array($imgInfo)) ! { ! //show the default image, otherwise we quit! ! $default = $manager->getDefaultThumb(); ! if($default) ! { ! header('Location: '.$default); ! exit(); ! } ! } ! //if the image is less than the thumbnail dimensions ! //send the original image as thumbnail ! if ($imgInfo[0] <= $IMConfig['thumbnail_width'] ! && $imgInfo[1] <= $IMConfig['thumbnail_height']) ! { ! header('Location: '.$manager->getFileURL($image)); ! exit(); ! } ! ! //Check for thumbnails ! $thumbnail = $manager->getThumbName($fullpath); ! if(is_file($thumbnail)) ! { ! //if the thumbnail is newer, send it ! if(filemtime($thumbnail) >= filemtime($fullpath)) ! { ! header('Location: '.$manager->getThumbURL($image)); ! exit(); ! } ! } ! ! //creating thumbnails ! $thumbnailer = new Thumbnail($IMConfig['thumbnail_width'],$IMConfig['thumbnail_height']); ! $thumbnailer->createThumbnail($fullpath, $thumbnail); ! ! //Check for NEW thumbnails ! if(is_file($thumbnail)) ! { ! //send the new thumbnail ! header('Location: '.$manager->getThumbURL($image)); ! exit(); ! } ! else ! { ! //show the default image, otherwise we quit! ! $default = $manager->getDefaultThumb(); ! if($default) ! header('Location: '.$default); ! } ?> \ No newline at end of file --- 1,82 ---- ! <? ! /** ! * On the fly Thumbnail generation. ! * Creates thumbnails given by thumbs.php?img=/relative/path/to/image.jpg ! * relative to the base_dir given in config.inc.php ! * @author $Author$ ! * @version $Id$ ! * @package ImageManager ! */ ! ! require_once('config.inc.php'); ! require_once('Classes/ImageManager.php'); ! require_once('Classes/Thumbnail.php'); ! ! //check for img parameter in the url ! if(!isset($_GET['img'])) ! exit(); ! ! ! $manager = new ImageManager($IMConfig); ! ! //get the image and the full path to the image ! $image = rawurldecode($_GET['img']); ! $fullpath = Files::makeFile($manager->getBaseDir(),$image); ! ! //not a file, so exit ! if(!is_file($fullpath)) ! exit(); ! ! $imgInfo = @getImageSize($fullpath); ! ! //Not an image, send default thumbnail ! if(!is_array($imgInfo)) ! { ! //show the default image, otherwise we quit! ! $default = $manager->getDefaultThumb(); ! if($default) ! { ! header('Location: '.$default); ! exit(); ! } ! } ! //if the image is less than the thumbnail dimensions ! //send the original image as thumbnail ! if ($imgInfo[0] <= $IMConfig['thumbnail_width'] ! && $imgInfo[1] <= $IMConfig['thumbnail_height']) ! { ! header('Location: '.$manager->getFileURL($image)); ! exit(); ! } ! ! //Check for thumbnails ! $thumbnail = $manager->getThumbName($fullpath); ! if(is_file($thumbnail)) ! { ! //if the thumbnail is newer, send it ! if(filemtime($thumbnail) >= filemtime($fullpath)) ! { ! header('Location: '.$manager->getThumbURL($image)); ! exit(); ! } ! } ! ! //creating thumbnails ! $thumbnailer = new Thumbnail($IMConfig['thumbnail_width'],$IMConfig['thumbnail_height']); ! $thumbnailer->createThumbnail($fullpath, $thumbnail); ! ! //Check for NEW thumbnails ! if(is_file($thumbnail)) ! { ! //send the new thumbnail ! header('Location: '.$manager->getThumbURL($image)); ! exit(); ! } ! else ! { ! //show the default image, otherwise we quit! ! $default = $manager->getDefaultThumb(); ! if($default) ! header('Location: '.$default); ! } ?> \ No newline at end of file Index: images.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/xwysiwyg/mod/xwysiwyg/_htmlarea/plugins/ImageManager/images.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** images.php 25 Oct 2004 18:16:04 -0000 1.1.1.1 --- images.php 9 Nov 2004 19:26:16 -0000 1.2 *************** *** 1,205 **** ! <? ! /** ! * Show a list of images in a long horizontal table. ! * @author $Author$ ! * @version $Id$ ! * @package ImageManager ! */ ! ! require_once('config.inc.php'); ! require_once('Classes/ImageManager.php'); ! ! //default path is / ! $relative = '/'; ! $manager = new ImageManager($IMConfig); ! ! //process any file uploads ! $manager->processUploads(); ! ! $manager->deleteFiles(); ! ! $refreshDir = false; ! //process any directory functions ! if($manager->deleteDirs() || $manager->processNewDir()) ! $refreshDir = true; ! ! //check for any sub-directory request ! //check that the requested sub-directory exists ! //and valid ! if(isset($_REQUEST['dir'])) ! { ! $path = rawurldecode($_REQUEST['dir']); ! if($manager->validRelativePath($path)) ! $relative = $path; ! } ! ! ! $manager = new ImageManager($IMConfig); ! ! ! //get the list of files and directories ! $list = $manager->getFiles($relative); ! ! ! /* ================= OUTPUT/DRAW FUNCTIONS ======================= */ ! ! /** ! * Draw the files in an table. ! */ ! function drawFiles($list, &$manager) ! { ! global $relative; ! ! foreach($list as $entry => $file) ! { ?> ! <td><table width="100" cellpadding="0" cellspacing="0"><tr><td class="block"> ! <a href="javascript:;" onclick="selectImage('<? echo $file['relative'];?>', '<? echo $entry; ?>', <? echo $file['image'][0];?>, <? echo $file['image'][1]; ?>);"title="<? echo $entry; ?> - <? echo Files::formatSize($file['stat']['size']); ?>"><img src="<? echo $manager->getThumbnail($file['relative']); ?>" alt="<? echo $entry; ?> - <? echo Files::formatSize($file['stat']['size']); ?>"/></a> ! </td></tr><tr><td class="edit"> ! <a href="images.php?dir=<? echo $relative; ?>&delf=<? echo rawurlencode($file['relative']);?>" title="Trash" onclick="return confirmDeleteFile('<? echo $entry; ?>');"><img src="img/edit_trash.gif" height="15" width="15" alt="Trash"/></a><a href="javascript:;" title="Edit" onclick="editImage('<? echo rawurlencode($file['relative']);?>');"><img src="img/edit_pencil.gif" height="15" width="15" alt="Edit"/></a> ! <? if($file['image']){ echo $file['image'][0].'x'.$file['image'][1]; } else echo $entry;?> ! </td></tr></table></td> ! <? ! }//foreach ! }//function drawFiles ! ! ! /** ! * Draw the directory. ! */ ! function drawDirs($list, &$manager) ! { ! global $relative; ! ! foreach($list as $path => $dir) ! { ?> ! <td><table width="100" cellpadding="0" cellspacing="0"><tr><td class="block"> ! <a href="images.php?dir=<? echo rawurlencode($path); ?>" onclick="updateDir('<? echo $path; ?>')" title="<? echo $dir['entry']; ?>"><img src="img/folder.gif" height="80" width="80" alt="<? echo $dir['entry']; ?>" /></a> ! </td></tr><tr> ! <td class="edit"> ! <a href="images.php?dir=<? echo $relative; ?>&deld=<? echo rawurlencode($path); ?>" title="Trash" onclick="return confirmDeleteDir('<? echo $dir['entry']; ?>', <? echo $dir['count']; ?>);"><img src="img/edit_trash.gif" height="15" width="15" alt="Trash"/></a> ! <? echo $dir['entry']; ?> ! </td> ! </tr></table></td> ! <? ! } //foreach ! }//function drawDirs ! ! ! /** ! * No directories and no files. ! */ ! function drawNoResults() ! { ! ?> ! <table width="100%"> ! <tr> ! <td class="noResult">No Images Found</td> ! </tr> ! </table> ! <? ! } ! ! /** ! * No directories and no files. ! */ ! function drawErrorBase(&$manager) ! { ! ?> ! <table width="100%"> ! <tr> ! <td class="error">Invalid base directory: <? echo $manager->config['base_dir']; ?></td> ! </tr> ! </table> ! <? ! } ! ! ?> ! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ! ! <html> ! <head> ! <title>Image List</title> ! <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> ! <link href="assets/imagelist.css" rel="stylesheet" type="text/css" /> ! <script type="text/javascript" src="assets/dialog.js"></script> ! <script type="text/javascript"> ! /*<![CDATA[*/ ! ! if(window.top) ! I18N = window.top.I18N; ! ! function hideMessage() ! { ! var topDoc = window.top.document; ! var messages = topDoc.getElementById('messages'); ! if(messages) ! messages.style.display = "none"; ! } ! ! init = function() ! { ! hideMessage(); ! var topDoc = window.top.document; ! ! <? ! //we need to refesh the drop directory list ! //save the current dir, delete all select options ! //add the new list, re-select the saved dir. ! if($refreshDir) ! { ! $dirs = $manager->getDirs(); ! ?> ! var selection = topDoc.getElementById('dirPath'); ! var currentDir = selection.options[selection.selectedIndex].text; ! ! while(selection.length > 0) ! { selection.remove(0); } ! ! selection.options[selection.length] = new Option("/","<? echo rawurlencode('/'); ?>"); ! <? foreach($dirs as $relative=>$fullpath) { ?> ! selection.options[selection.length] = new Option("<? echo $relative; ?>","<? echo rawurlencode($relative); ?>"); ! <? } ?> ! ! for(var i = 0; i < selection.length; i++) ! { ! var thisDir = selection.options[i].text; ! if(thisDir == currentDir) ! { ! selection.selectedIndex = i; ! break; ! } ! } ! <? } ?> ! } ! ! function editImage(image) ! { ! var url = "editor.php?img="+image; ! Dialog(url, function(param) ! { ! if (!param) // user must have pressed Cancel ! return false; ! else ! { ! return true; ! } ! }, null); ! } ! ! /*]]>*/ ! </script> ! <script type="text/javascript" src="assets/images.js"></script> ! </head> ! ! <body> ! <? if ($manager->isValidBase() == false) { drawErrorBase($manager); } ! elseif(count($list[0]) > 0 || count($list[1]) > 0) { ?> ! <table> ! <tr> ! <? drawDirs($list[0], $manager); ?> ! <? drawFiles($list[1], $manager); ?> ! </tr> ! </table> ! <? } else { drawNoResults(); } ?> ! </body> ! </html> --- 1,205 ---- ! <? ! /** ! * Show a list of images in a long horizontal table. ! * @author $Author$ ! * @version $Id$ ! * @package ImageManager ! */ ! ! require_once('config.inc.php'); ! require_once('Classes/ImageManager.php'); ! ! //default path is / ! $relative = '/'; ! $manager = new ImageManager($IMConfig); ! ! //process any file uploads ! $manager->processUploads(); ! ! $manager->deleteFiles(); ! ! $refreshDir = false; ! //process any directory functions ! if($manager->deleteDirs() || $manager->processNewDir()) ! $refreshDir = true; ! ! //check for any sub-directory request ! //check that the requested sub-directory exists ! //and valid ! if(isset($_REQUEST['dir'])) ! { ! $path = rawurldecode($_REQUEST['dir']); ! if($manager->validRelativePath($path)) ! $relative = $path; ! } ! ! ! $manager = new ImageManager($IMConfig); ! ! ! //get the list of files and directories ! $list = $manager->getFiles($relative); ! ! ! /* ================= OUTPUT/DRAW FUNCTIONS ======================= */ ! ! /** ! * Draw the files in an table. ! */ ! function drawFiles($list, &$manager) ! { ! global $relative; ! ! foreach($list as $entry => $file) ! { ?> ! <td><table width="100" cellpadding="0" cellspacing="0"><tr><td class="block"> ! <a href="javascript:;" onclick="selectImage('<? echo $file['relative'];?>', '<? echo $entry; ?>', <? echo $file['image'][0];?>, <? echo $file['image'][1]; ?>);"title="<? echo $entry; ?> - <? echo Files::formatSize($file['stat']['size']); ?>"><img src="<? echo $manager->getThumbnail($file['relative']); ?>" alt="<? echo $entry; ?> - <? echo Files::formatSize($file['stat']['size']); ?>"/></a> ! </td></tr><tr><td class="edit"> ! <a href="images.php?dir=<? echo $relative; ?>&delf=<? echo rawurlencode($file['relative']);?>" title="Trash" onclick="return confirmDeleteFile('<? echo $entry; ?>');"><img src="img/edit_trash.gif" height="15" width="15" alt="Trash"/></a><a href="javascript:;" title="Edit" onclick="editImage('<? echo rawurlencode($file['relative']);?>');"><img src="img/edit_pencil.gif" height="15" width="15" alt="Edit"/></a> ! <? if($file['image']){ echo $file['image'][0].'x'.$file['image'][1]; } else echo $entry;?> ! </td></tr></table></td> ! <? ! }//foreach ! }//function drawFiles ! ! ! /** ! * Draw the directory. ! */ ! function drawDirs($list, &$manager) ! { ! global $relative; ! ! foreach($list as $path => $dir) ! { ?> ! <td><table width="100" cellpadding="0" cellspacing="0"><tr><td class="block"> ! <a href="images.php?dir=<? echo rawurlencode($path); ?>" onclick="updateDir('<? echo $path; ?>')" title="<? echo $dir['entry']; ?>"><img src="img/folder.gif" height="80" width="80" alt="<? echo $dir['entry']; ?>" /></a> ! </td></tr><tr> ! <td class="edit"> ! <a href="images.php?dir=<? echo $relative; ?>&deld=<? echo rawurlencode($path); ?>" title="Trash" onclick="return confirmDeleteDir('<? echo $dir['entry']; ?>', <? echo $dir['count']; ?>);"><img src="img/edit_trash.gif" height="15" width="15" alt="Trash"/></a> ! <? echo $dir['entry']; ?> ! </td> ! </tr></table></td> ! <? ! } //foreach ! }//function drawDirs ! ! ! /** ! * No directories and no files. ! */ ! function drawNoResults() ! { ! ?> ! <table width="100%"> ! <tr> ! <td class="noResult">No Images Found</td> ! </tr> ! </table> ! <? ! } ! ! /** ! * No directories and no files. ! */ ! function drawErrorBase(&$manager) ! { ! ?> ! <table width="100%"> ! <tr> ! <td class="error">Invalid base directory: <? echo $manager->config['base_dir']; ?></td> ! </tr> ! </table> ! <? ! } ! ! ?> ! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ! ! <html> ! <head> ! <title>Image List</title> ! <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> ! <link href="assets/imagelist.css" rel="stylesheet" type="text/css" /> ! <script type="text/javascript" src="assets/dialog.js"></script> ! <script type="text/javascript"> ! /*<![CDATA[*/ ! ! if(window.top) ! I18N = window.top.I18N; ! ! function hideMessage() ! { ! var topDoc = window.top.document; ! var messages = topDoc.getElementById('messages'); ! if(messages) ! messages.style.display = "none"; ! } ! ! init = function() ! { ! hideMessage(); ! var topDoc = window.top.document; ! ! <? ! //we need to refesh the drop directory list ! //save the current dir, delete all select options ! //add the new list, re-select the saved dir. ! if($refreshDir) ! { ! $dirs = $manager->getDirs(); ! ?> ! var selection = topDoc.getElementById('dirPath'); ! var currentDir = selection.options[selection.selectedIndex].text; ! ! while(selection.length > 0) ! { selection.remove(0); } ! ! selection.options[selection.length] = new Option("/","<? echo rawurlencode('/'); ?>"); ! <? foreach($dirs as $relative=>$fullpath) { ?> ! selection.options[selection.length] = new Option("<? echo $relative; ?>","<? echo rawurlencode($relative); ?>"); ! <? } ?> ! ! for(var i = 0; i < selection.length; i++) ! { ! var thisDir = selection.options[i].text; ! if(thisDir == currentDir) ! { ! selection.selectedIndex = i; ! break; ! } ! } ! <? } ?> ! } ! ! function editImage(image) ! { ! var url = "editor.php?img="+image; ! Dialog(url, function(param) ! { ! if (!param) // user must have pressed Cancel ! return false; ! else ! { ! return true; ! } ! }, null); ! } ! ! /*]]>*/ ! </script> ! <script type="text/javascript" src="assets/images.js"></script> ! </head> ! ! <body> ! <? if ($manager->isValidBase() == false) { drawErrorBase($manager); } ! elseif(count($list[0]) > 0 || count($list[1]) > 0) { ?> ! <table> ! <tr> ! <? drawDirs($list[0], $manager); ?> ! <? drawFiles($list[1], $manager); ?> ! </tr> ! </table> ! <? } else { drawNoResults(); } ?> ! </body> ! </html> Index: editor.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/xwysiwyg/mod/xwysiwyg/_htmlarea/plugins/ImageManager/editor.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** editor.php 25 Oct 2004 18:16:11 -0000 1.1.1.1 --- editor.php 9 Nov 2004 19:26:15 -0000 1.2 *************** *** 1,144 **** ! <? ! /** ! * The PHP Image Editor user interface. ! * @author $Author$ ! * @version $Id$ ! * @package ImageManager ! */ ! ! require_once('config.inc.php'); ! require_once('Classes/ImageManager.php'); ! require_once('Classes/ImageEditor.php'); ! ! $manager = new ImageManager($IMConfig); ! $editor = new ImageEditor($manager); ! ! ?> ! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ! ! <html> ! <head> ! <title></title> ! <link href="assets/editor.css" rel="stylesheet" type="text/css" /> ! <script type="text/javascript" src="assets/slider.js"></script> ! <script type="text/javascript" src="assets/popup.js"></script> ! <script type="text/javascript"> ! /*<![CDATA[*/ ! window.resizeTo(673, 531); ! if(window.opener) ! I18N = window.opener.I18N; ! /*]]>*/ ! </script> ! <script type="text/javascript" src="assets/editor.js"></script> ! </head> ! ! <body> ! <div id="indicator"> ! <img src="img/spacer.gif" id="indicator_image" height="20" width="20" alt="" /> ! </div> ! <div id="tools"> ! <div id="tools_crop" style="display:none;"> ! <div id="tool_inputs"> ! <label for="cx">Start X:</label><input type="text" id="cx" class="textInput" onchange="updateMarker('crop')"/> ! <label for="cy">Start Y:</label><input type="text" id="cy" class="textInput" onchange="updateMarker('crop')"/> ! <label for="cw">Width:</label><input type="text" id="cw" class="textInput" onchange="updateMarker('crop')"/> ! <label for="ch">Height:</label><input type="text" id="ch" class="textInput" onchange="updateMarker('crop')"/> ! <img src="img/div.gif" height="30" width="2" class="div" alt="|" /> ! </div> ! <a href="javascript: editor.doSubmit('crop');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a> ! <a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a> ! </div> ! <div id="tools_scale" style="display:none;"> ! <div id="tool_inputs"> ! <label for="sw">Width:</label><input type="text" id="sw" class="textInput" onchange="checkConstrains('width')"/> ! <a href="javascript:toggleConstraints();" title="Lock"><img src="img/islocked2.gif" id="scaleConstImg" height="14" width="8" alt="Lock" class="div" /></a><label for="sh">Height:</label> ! <input type="text" id="sh" class="textInput" onchange="checkConstrains('height')"/> ! <input type="checkbox" id="constProp" value="1" checked="checked" onclick="toggleConstraints()"/> ! <label for="constProp">Constrain Proportions</label> ! <img src="img/div.gif" height="30" width="2" class="div" alt="|" /> ! </div> ! <a href="javascript: editor.doSubmit('scale');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a> ! <a href="javascript: editor.reset();" class="buttons" title="Cancle"><img src="img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a> ! </div> ! <div id="tools_rotate" style="display:none;"> ! <div id="tool_inputs"> ! <select id="flip" name="flip" style="margin-left: 10px; vertical-align: middle;"> ! <option selected>Flip Image</option> ! <option>-----------------</option> ! <option value="hoz">Flip Horizontal</option> ! <option value="ver">Flip Virtical</option> ! </select> ! <select name="rotate" onchange="rotatePreset(this)" style="margin-left: 20px; vertical-align: middle;"> ! <option selected>Rotate Image</option> ! <option>-----------------</option> ! ! <option value="180">Rotate 180 °</option> ! <option value="90">Rotate 90 ° CW</option> ! <option value="-90">Rotate 90 ° CCW</option> ! </select> ! <label for="ra">Angle:</label><input type="text" id="ra" class="textInput" /> ! <img src="img/div.gif" height="30" width="2" class="div" alt="|" /> ! </div> ! <a href="javascript: editor.doSubmit('rotate');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a> ! <a href="javascript: editor.reset();" class="buttons" title="Cancle"><img src="img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a> ! </div> ! <div id="tools_measure" style="display:none;"> ! <div id="tool_inputs"> ! <label>X:</label><input type="text" class="measureStats" id="sx" /> ! <label>Y:</label><input type="text" class="measureStats" id="sy" /> ! <img src="img/div.gif" height="30" width="2" class="div" alt="|" /> ! <label>W:</label><input type="text" class="measureStats" id="mw" /> ! <label>H:</label><input type="text" class="measureStats" id="mh" /> ! <img src="img/div.gif" height="30" width="2" class="div" alt="|" /> ! <label>A:</label><input type="text" class="measureStats" id="ma" /> ! <label>D:</label><input type="text" class="measureStats" id="md" /> ! <img src="img/div.gif" height="30" width="2" class="div" alt="|" /> ! <button type="button" onclick="editor.reset();" >Clear</button> ! </div> ! </div> ! <div id="tools_save" style="display:none;"> ! <div id="tool_inputs"> ! <label for="save_filename">Filename:</label><input type="text" id="save_filename" value="<? echo $editor->getDefaultSaveFile();?>"/> ! <select name="format" id="save_format" style="margin-left: 10px; vertical-align: middle;" onchange="updateFormat(this)"> ! <option value="" selected>Image Format</option> ! <option value="">---------------------</option> ! <option value="jpeg,85">JPEG High</option> ! <option value="jpeg,60">JPEG Medium</option> ! <option value="jpeg,35">JPEG Low</option> ! <option value="png">PNG</option> ! <? if($editor->isGDGIFAble() != -1) { ?> ! <option value="gif">GIF</option> ! <? } ?> ! </select> ! <label>Quality:</label> ! <table style="display: inline; vertical-align: middle;" cellpadding="0" cellspacing="0"> ! <tr> ! <td> ! <div id="slidercasing"> ! <div id="slidertrack" style="width:100px"><img src="img/spacer.gif" width="1" height="1" border="0" alt="track"></div> ! <div id="sliderbar" style="left:85px" onmousedown="captureStart();"><img src="img/spacer.gif" width="1" height="1" border="0" alt="track"></div> ! </div> ! </td> ! </tr> ! </table> ! <input type="text" id="quality" onchange="updateSlider(this.value)" style="width: 2em;" value="85"/> ! <img src="img/div.gif" height="30" width="2" class="div" alt="|" /> ! </div> ! <a href="javascript: editor.doSubmit('save');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a> ! <a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a> ! </div> ! </div> ! <div id="toolbar"> ! <a href="javascript:toggle('crop')" id="icon_crop" title="Crop"><img src="img/crop.gif" height="20" width="20" alt="Crop" /><span>Crop</span></a> ! <a href="javascript:toggle('scale')" id="icon_scale" title="Resize"><img src="img/scale.gif" height="20" width="20" alt="Resize" /><span>Resize</span></a> ! <a href="javascript:toggle('rotate')" id="icon_rotate" title="Rotate"><img src="img/rotate.gif" height="20" width="20" alt="Rotate" /><span>Rotate</span></a> ! <a href="javascript:toggle('measure')" id="icon_measure" title="Measure"><img src="img/measure.gif" height="20" width="20" alt="Measure" /><span>Measure</span></a> ! <a href="javascript: toggleMarker();" title="Marker"><img id="markerImg" src="img/t_black.gif" height="20" width="20" alt="Marker" /><span>Marker</span></a> ! <a href="javascript:toggle('save')" id="icon_save" title="Save"><img src="img/save.gif" height="20" width="20" alt="Save" /><span>Save</span></a> ! </div> ! <div id="contents"> ! <iframe src="editorFrame.php?img=<? if(isset($_GET['img'])) echo rawurlencode($_GET['img']); ?>" name="editor" id="editor" scrolling="auto" title="Image Editor" frameborder="0"></iframe> ! </div> ! <div id="bottom"></div> ! </body> ! </html> --- 1,144 ---- ! <? ! /** ! * The PHP Image Editor user interface. ! * @author $Author$ ! * @version $Id$ ! * @package ImageManager ! */ ! ! require_once('config.inc.php'); ! require_once('Classes/ImageManager.php'); ! require_once('Classes/ImageEditor.php'); ! ! $manager = new ImageManager($IMConfig); ! $editor = new ImageEditor($manager); ! ! ?> ! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ! ! <html> ! <head> ! <title></title> ! <link href="assets/editor.css" rel="stylesheet" type="text/css" /> ! <script type="text/javascript" src="assets/slider.js"></script> ! <script type="text/javascript" src="assets/popup.js"></script> ! <script type="text/javascript"> ! /*<![CDATA[*/ ! window.resizeTo(673, 531); ! if(window.opener) ! I18N = window.opener.I18N; ! /*]]>*/ ! </script> ! <script type="text/javascript" src="assets/editor.js"></script> ! </head> ! ! <body> ! <div id="indicator"> ! <img src="img/spacer.gif" id="indicator_image" height="20" width="20" alt="" /> ! </div> ! <div id="tools"> ! <div id="tools_crop" style="display:none;"> ! <div id="tool_inputs"> ! <label for="cx">Start X:</label><input type="text" id="cx" class="textInput" onchange="updateMarker('crop')"/> ! <label for="cy">Start Y:</label><input type="text" id="cy" class="textInput" onchange="updateMarker('crop')"/> ! <label for="cw">Width:</label><input type="text" id="cw" class="textInput" onchange="updateMarker('crop')"/> ! <label for="ch">Height:</label><input type="text" id="ch" class="textInput" onchange="updateMarker('crop')"/> ! <img src="img/div.gif" height="30" width="2" class="div" alt="|" /> ! </div> ! <a href="javascript: editor.doSubmit('crop');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a> ! <a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a> ! </div> ! <div id="tools_scale" style="display:none;"> ! <div id="tool_inputs"> ! <label for="sw">Width:</label><input type="text" id="sw" class="textInput" onchange="checkConstrains('width')"/> ! <a href="javascript:toggleConstraints();" title="Lock"><img src="img/islocked2.gif" id="scaleConstImg" height="14" width="8" alt="Lock" class="div" /></a><label for="sh">Height:</label> ! <input type="text" id="sh" class="textInput" onchange="checkConstrains('height')"/> ! <input type="checkbox" id="constProp" value="1" checked="checked" onclick="toggleConstraints()"/> ! <label for="constProp">Constrain Proportions</label> ! <img src="img/div.gif" height="30" width="2" class="div" alt="|" /> ! </div> ! <a href="javascript: editor.doSubmit('scale');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a> ! <a href="javascript: editor.reset();" class="buttons" title="Cancle"><img src="img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a> ! </div> ! <div id="tools_rotate" style="display:none;"> ! <div id="tool_inputs"> ! <select id="flip" name="flip" style="margin-left: 10px; vertical-align: middle;"> ! <option selected>Flip Image</option> ! <option>-----------------</option> ! <option value="hoz">Flip Horizontal</option> ! <option value="ver">Flip Virtical</option> ! </select> ! <select name="rotate" onchange="rotatePreset(this)" style="margin-left: 20px; vertical-align: middle;"> ! <option selected>Rotate Image</option> ! <option>-----------------</option> ! ! <option value="180">Rotate 180 °</option> ! <option value="90">Rotate 90 ° CW</option> ! <option value="-90">Rotate 90 ° CCW</option> ! </select> ! <label for="ra">Angle:</label><input type="text" id="ra" class="textInput" /> ! <img src="img/div.gif" height="30" width="2" class="div" alt="|" /> ! </div> ! <a href="javascript: editor.doSubmit('rotate');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a> ! <a href="javascript: editor.reset();" class="buttons" title="Cancle"><img src="img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a> ! </div> ! <div id="tools_measure" style="display:none;"> ! <div id="tool_inputs"> ! <label>X:</label><input type="text" class="measureStats" id="sx" /> ! <label>Y:</label><input type="text" class="measureStats" id="sy" /> ! <img src="img/div.gif" height="30" width="2" class="div" alt="|" /> ! <label>W:</label><input type="text" class="measureStats" id="mw" /> ! <label>H:</label><input type="text" class="measureStats" id="mh" /> ! <img src="img/div.gif" height="30" width="2" class="div" alt="|" /> ! <label>A:</label><input type="text" class="measureStats" id="ma" /> ! <label>D:</label><input type="text" class="measureStats" id="md" /> ! <img src="img/div.gif" height="30" width="2" class="div" alt="|" /> ! <button type="button" onclick="editor.reset();" >Clear</button> ! </div> ! </div> ! <div id="tools_save" style="display:none;"> ! <div id="tool_inputs"> ! <label for="save_filename">Filename:</label><input type="text" id="save_filename" value="<? echo $editor->getDefaultSaveFile();?>"/> ! <select name="format" id="save_format" style="margin-left: 10px; vertical-align: middle;" onchange="updateFormat(this)"> ! <option value="" selected>Image Format</option> ! <option value="">---------------------</option> ! <option value="jpeg,85">JPEG High</option> ! <option value="jpeg,60">JPEG Medium</option> ! <option value="jpeg,35">JPEG Low</option> ! <option value="png">PNG</option> ! <? if($editor->isGDGIFAble() != -1) { ?> ! <option value="gif">GIF</option> ! <? } ?> ! </select> ! <label>Quality:</label> ! <table style="display: inline; vertical-align: middle;" cellpadding="0" cellspacing="0"> ! <tr> ! <td> ! <div id="slidercasing"> ! <div id="slidertrack" style="width:100px"><img src="img/spacer.gif" width="1" height="1" border="0" alt="track"></div> ! <div id="sliderbar" style="left:85px" onmousedown="captureStart();"><img src="img/spacer.gif" width="1" height="1" border="0" alt="track"></div> ! </div> ! </td> ! </tr> ! </table> ! <input type="text" id="quality" onchange="updateSlider(this.value)" style="width: 2em;" value="85"/> ! <img src="img/div.gif" height="30" width="2" class="div" alt="|" /> ! </div> ! <a href="javascript: editor.doSubmit('save');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a> ! <a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a> ! </div> ! </div> ! <div id="toolbar"> ! <a href="javascript:toggle('crop')" id="icon_crop" title="Crop"><img src="img/crop.gif" height="20" width="20" alt="Crop" /><span>Crop</span></a> ! <a href="javascript:toggle('scale')" id="icon_scale" title="Resize"><img src="img/scale.gif" height="20" width="20" alt="Resize" /><span>Resize</span></a> ! <a href="javascript:toggle('rotate')" id="icon_rotate" title="Rotate"><img src="img/rotate.gif" height="20" width="20" alt="Rotate" /><span>Rotate</span></a> ! <a href="javascript:toggle('measure')" id="icon_measure" title="Measure"><img src="img/measure.gif" height="20" width="20" alt="Measure" /><span>Measure</span></a> ! <a href="javascript: toggleMarker();" title="Marker"><img id="markerImg" src="img/t_black.gif" height="20" width="20" alt="Marker" /><span>Marker</span></a> ! <a href="javascript:toggle('save')" id="icon_save" title="Save"><img src="img/save.gif" height="20" width="20" alt="Save" /><span>Save</span></a> ! </div> ! <div id="contents"> ! <iframe src="editorFrame.php?img=<? if(isset($_GET['img'])) echo rawurlencode($_GET['img']); ?>" name="editor" id="editor" scrolling="auto" title="Image Editor" frameborder="0"></iframe> ! </div> ! <div id="bottom"></div> ! </body> ! </html> |