Ignore:
Timestamp:
05/07/05 21:19:31 (14 years ago)
Author:
yermol
Message:

htmlarea.js

. more debugging messages added.
. added HTMLArea.Config.linkReplacementMode which can be either

fullyqualified (the old default behavior) or absolute.


When set to fullyqualified all absolute links (e.g. /somepath) will be changed to fullyqualified URLS (e.g. http://yoursite/somepth).


When set to absolute, all fullyqualified urls back to the current site
will be changed to absolute (e.g. httpyoursite/somepath to /somepath)
making the Xinha generated content portable between sites.


( see HTMLArea.prototype.outwardHtml() )


. bugfix - if plugin .js file has a parse error htmlarea will only try to load

it a configurable number of times before popping up an error message.


backends/backend.php

. initial unified backend created. Requests to this backend are routed

to the corresponding plugin specific backend.php file.


backends/backend_conf.php

. a central server side configuration file has been created for the use

of plugin serverside code.

. all backends hooked into this scheme must include the central config file.

ImageManager?

. modified the config to allow overriding default values.
. default image directory is now xinha/examples/images
. added debugging trace messages which are tagged with the ImageManager? name.
. now uses unified backend.

Linker

. includes central config.
. default directory is now the xinha/examples directory (to avoid scan.php security

problem)

. added debugging trace messages which are tagged with the Linker name.
. links selected from the tree are now displayed in absolute instead of fully qualified

fashion.

. on edit the link that was previously selected is highlighted.
. on edit the selected link is scrolled to if it's outside the viewable area.
. if scan.php returns some kind of error or invalid javascript Linker now pops up

a nice descriptive error message.


. bugfix - same pattern as in loading plugins. If there is some error in loading the directory listing Linker will only attempt it a few times before giving up and

displaying a nice error.


dTree.js

. added clear_s() method to clear the selection
. added getNodeElement() method to return the <a ..> element for a given node.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/unified_backend/plugins/ImageManager/editor.php

    r60 r121  
    1 <? 
     1<?php 
    22/** 
    33 * The PHP Image Editor user interface. 
     
    2121        <title></title> 
    2222<script type="text/javascript"> 
    23 _backend_url = "<? print $IMConfig['backend_url']; ?>"; 
     23_backend_url = "<?php print $IMConfig['backend_url']; ?>"; 
     24 
     25// This page is opened by a call to Dialog() in ImageManager/images.php in the  
     26// editImage() js function. (That Dialog() call is defined in ImageManager/assets/dialog.js 
     27// 
     28// The Dialog() call accepts an optional fourth parameter, the editor instance 
     29// that is raising this dialog. From there we can pull out the ImageManager instance and 
     30// get access to the ddt instance. This has an added benefit allowing us to 
     31// put all the previously free standing manager functions into the image manager class. 
     32 
     33_imgManager = window.opener.Dialog._editor.plugins[ "ImageManager" ].instance; 
     34 
     35_imgManager.ddt._ddt( "editor.php", "38", "top of editor.php file." ); 
     36 
    2437</script> 
    25         <link href="<? print $IMConfig['base_url'];?>assets/editor.css" rel="stylesheet" type="text/css" />      
    26 <script type="text/javascript" src="<? print $IMConfig['base_url'];?>assets/slider.js"></script> 
    27 <script type="text/javascript" src="<? print $IMConfig['base_url'];?>assets/popup.js"></script> 
     38        <link href="<?php print $IMConfig['base_url'];?>assets/editor.css" rel="stylesheet" type="text/css" />   
     39<script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/slider.js"></script> 
     40<script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/popup.js"></script> 
    2841<script type="text/javascript"> 
    2942/*<![CDATA[*/ 
     
    3447/*]]>*/ 
    3548</script> 
    36 <script type="text/javascript" src="<? print $IMConfig['base_url'];?>assets/editor.js"></script> 
     49<script type="text/javascript" src="<?php print $IMConfig['base_url'];?>assets/editor.js"></script> 
    3750</head> 
    3851 
    3952<body> 
    4053<div id="indicator"> 
    41 <img src="<? print $IMConfig['base_url'];?>img/spacer.gif" id="indicator_image" height="20" width="20" alt="" /> 
     54<img src="<?php print $IMConfig['base_url'];?>img/spacer.gif" id="indicator_image" height="20" width="20" alt="" /> 
    4255</div> 
    4356<div id="tools"> 
     
    4861                        <label for="cw">Width:</label><input type="text" id="cw" class="textInput" onchange="updateMarker('crop')"/> 
    4962                        <label for="ch">Height:</label><input type="text" id="ch" class="textInput" onchange="updateMarker('crop')"/> 
    50                         <img src="<? print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" /> 
     63                        <img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" /> 
    5164                </div>   
    52                 <a href="javascript: editor.doSubmit('crop');" class="buttons" title="OK"><img src="<? print $IMConfig['base_url'];?>img/btn_ok.gif" height="30" width="30" alt="OK" /></a> 
    53                 <a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="<? print $IMConfig['base_url'];?>img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>           
     65                <a href="javascript: editor.doSubmit('crop');" class="buttons" title="OK"><img src="<?php print $IMConfig['base_url'];?>img/btn_ok.gif" height="30" width="30" alt="OK" /></a> 
     66                <a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="<?php print $IMConfig['base_url'];?>img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>                
    5467        </div>   
    5568        <div id="tools_scale" style="display:none;"> 
    5669                <div id="tool_inputs"> 
    5770                        <label for="sw">Width:</label><input type="text" id="sw" class="textInput" onchange="checkConstrains('width')"/> 
    58                         <a href="javascript:toggleConstraints();" title="Lock"><img src="<? print $IMConfig['base_url'];?>img/islocked2.gif" id="scaleConstImg" height="14" width="8" alt="Lock" class="div" /></a><label for="sh">Height:</label> 
     71                        <a href="javascript:toggleConstraints();" title="Lock"><img src="<?php print $IMConfig['base_url'];?>img/islocked2.gif" id="scaleConstImg" height="14" width="8" alt="Lock" class="div" /></a><label for="sh">Height:</label> 
    5972                        <input type="text" id="sh" class="textInput" onchange="checkConstrains('height')"/> 
    6073                        <input type="checkbox" id="constProp" value="1" checked="checked" onclick="toggleConstraints()"/> 
    6174                        <label for="constProp">Constrain Proportions</label> 
    62                         <img src="<? print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" /> 
     75                        <img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" /> 
    6376                </div>   
    64                 <a href="javascript: editor.doSubmit('scale');" class="buttons" title="OK"><img src="<? print $IMConfig['base_url'];?>img/btn_ok.gif" height="30" width="30" alt="OK" /></a> 
    65                 <a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="<? print $IMConfig['base_url'];?>img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>           
     77                <a href="javascript: editor.doSubmit('scale');" class="buttons" title="OK"><img src="<?php print $IMConfig['base_url'];?>img/btn_ok.gif" height="30" width="30" alt="OK" /></a> 
     78                <a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="<?php print $IMConfig['base_url'];?>img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>                
    6679        </div>   
    6780        <div id="tools_rotate" style="display:none;"> 
     
    8295         </select> 
    8396                        <label for="ra">Angle:</label><input type="text" id="ra" class="textInput" /> 
    84                         <img src="<? print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" /> 
     97                        <img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" /> 
    8598                </div>   
    86                 <a href="javascript: editor.doSubmit('rotate');" class="buttons" title="OK"><img src="<? print $IMConfig['base_url'];?>img/btn_ok.gif" height="30" width="30" alt="OK" /></a> 
    87                 <a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="<? print $IMConfig['base_url'];?>img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>           
     99                <a href="javascript: editor.doSubmit('rotate');" class="buttons" title="OK"><img src="<?php print $IMConfig['base_url'];?>img/btn_ok.gif" height="30" width="30" alt="OK" /></a> 
     100                <a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="<?php print $IMConfig['base_url'];?>img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>                
    88101        </div>           
    89102        <div id="tools_measure" style="display:none;"> 
     
    91104                        <label>X:</label><input type="text" class="measureStats" id="sx" /> 
    92105                        <label>Y:</label><input type="text" class="measureStats" id="sy" /> 
    93                         <img src="<? print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" /> 
     106                        <img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" /> 
    94107                        <label>W:</label><input type="text" class="measureStats" id="mw" /> 
    95108                        <label>H:</label><input type="text" class="measureStats" id="mh" /> 
    96                         <img src="<? print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" /> 
     109                        <img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" /> 
    97110                        <label>A:</label><input type="text" class="measureStats" id="ma" />              
    98111                        <label>D:</label><input type="text" class="measureStats" id="md" />              
    99                         <img src="<? print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" /> 
     112                        <img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" /> 
    100113                        <button type="button" onclick="editor.reset();" >Clear</button> 
    101114                </div>   
     
    103116        <div id="tools_save" style="display:none;"> 
    104117                <div id="tool_inputs"> 
    105                         <label for="save_filename">Filename:</label><input type="text" id="save_filename" value="<? echo $editor->getDefaultSaveFile();?>"/> 
     118                        <label for="save_filename">Filename:</label><input type="text" id="save_filename" value="<?php echo $editor->getDefaultSaveFile();?>"/> 
    106119                        <select name="format" id="save_format" style="margin-left: 10px; vertical-align: middle;" onchange="updateFormat(this)"> 
    107120            <option value="" selected>Image Format</option> 
     
    111124            <option value="jpeg,35">JPEG Low</option> 
    112125            <option value="png">PNG</option> 
    113                         <? if($editor->isGDGIFAble() != -1) { ?> 
     126                        <?php if($editor->isGDGIFAble() != -1) { ?> 
    114127            <option value="gif">GIF</option> 
    115                         <? } ?> 
     128                        <?php } ?> 
    116129         </select> 
    117130                        <label>Quality:</label> 
     
    120133                                <td> 
    121134                                        <div id="slidercasing">  
    122                                 <div id="slidertrack" style="width:100px"><img src="<? print $IMConfig['base_url'];?>img/spacer.gif" width="1" height="1" border="0" alt="track"></div> 
    123             <div id="sliderbar" style="left:85px" onmousedown="captureStart();"><img src="<? print $IMConfig['base_url'];?>img/spacer.gif" width="1" height="1" border="0" alt="track"></div> 
     135                                <div id="slidertrack" style="width:100px"><img src="<?php print $IMConfig['base_url'];?>img/spacer.gif" width="1" height="1" border="0" alt="track"></div> 
     136            <div id="sliderbar" style="left:85px" onmousedown="captureStart();"><img src="<?php print $IMConfig['base_url'];?>img/spacer.gif" width="1" height="1" border="0" alt="track"></div> 
    124137                        </div>   
    125138                                </td> 
     
    127140                        </table>                                 
    128141                        <input type="text" id="quality" onchange="updateSlider(this.value)" style="width: 2em;" value="85"/> 
    129                         <img src="<? print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" /> 
     142                        <img src="<?php print $IMConfig['base_url'];?>img/div.gif" height="30" width="2" class="div" alt="|" /> 
    130143                </div>   
    131                 <a href="javascript: editor.doSubmit('save');" class="buttons" title="OK"><img src="<? print $IMConfig['base_url'];?>img/btn_ok.gif" height="30" width="30" alt="OK" /></a> 
    132                 <a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="<? print $IMConfig['base_url'];?>img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>           
     144                <a href="javascript: editor.doSubmit('save');" class="buttons" title="OK"><img src="<?php print $IMConfig['base_url'];?>img/btn_ok.gif" height="30" width="30" alt="OK" /></a> 
     145                <a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="<?php print $IMConfig['base_url'];?>img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>                
    133146        </div>   
    134147</div> 
    135148<div id="toolbar"> 
    136 <a href="javascript:toggle('crop')" id="icon_crop" title="Crop"><img src="<? print $IMConfig['base_url'];?>img/crop.gif" height="20" width="20" alt="Crop" /><span>Crop</span></a> 
    137 <a href="javascript:toggle('scale')" id="icon_scale" title="Resize"><img src="<? print $IMConfig['base_url'];?>img/scale.gif" height="20" width="20" alt="Resize" /><span>Resize</span></a> 
    138 <a href="javascript:toggle('rotate')" id="icon_rotate" title="Rotate"><img src="<? print $IMConfig['base_url'];?>img/rotate.gif" height="20" width="20" alt="Rotate" /><span>Rotate</span></a> 
    139 <a href="javascript:toggle('measure')" id="icon_measure" title="Measure"><img src="<? print $IMConfig['base_url'];?>img/measure.gif" height="20" width="20" alt="Measure" /><span>Measure</span></a> 
    140 <a href="javascript: toggleMarker();" title="Marker"><img id="markerImg" src="<? print $IMConfig['base_url'];?>img/t_black.gif" height="20" width="20" alt="Marker" /><span>Marker</span></a> 
    141 <a href="javascript:toggle('save')" id="icon_save" title="Save"><img src="<? print $IMConfig['base_url'];?>img/save.gif" height="20" width="20" alt="Save" /><span>Save</span></a> 
     149<a href="javascript:toggle('crop')" id="icon_crop" title="Crop"><img src="<?php print $IMConfig['base_url'];?>img/crop.gif" height="20" width="20" alt="Crop" /><span>Crop</span></a> 
     150<a href="javascript:toggle('scale')" id="icon_scale" title="Resize"><img src="<?php print $IMConfig['base_url'];?>img/scale.gif" height="20" width="20" alt="Resize" /><span>Resize</span></a> 
     151<a href="javascript:toggle('rotate')" id="icon_rotate" title="Rotate"><img src="<?php print $IMConfig['base_url'];?>img/rotate.gif" height="20" width="20" alt="Rotate" /><span>Rotate</span></a> 
     152<a href="javascript:toggle('measure')" id="icon_measure" title="Measure"><img src="<?php print $IMConfig['base_url'];?>img/measure.gif" height="20" width="20" alt="Measure" /><span>Measure</span></a> 
     153<a href="javascript: toggleMarker();" title="Marker"><img id="markerImg" src="<?php print $IMConfig['base_url'];?>img/t_black.gif" height="20" width="20" alt="Marker" /><span>Marker</span></a> 
     154<a href="javascript:toggle('save')" id="icon_save" title="Save"><img src="<?php print $IMConfig['base_url'];?>img/save.gif" height="20" width="20" alt="Save" /><span>Save</span></a> 
    142155</div> 
    143156<div id="contents"> 
    144 <iframe src="<? print $IMConfig['backend_url']; ?>__function=editorFrame&img=<? if(isset($_GET['img'])) echo rawurlencode($_GET['img']); ?>" name="editor" id="editor"  scrolling="auto" title="Image Editor" frameborder="0"></iframe> 
     157<iframe src="<?php print $IMConfig['backend_url']; ?>__function=editorFrame&img=<?php if(isset($_GET['img'])) echo rawurlencode($_GET['img']); ?>" name="editor" id="editor"  scrolling="auto" title="Image Editor" frameborder="0"></iframe> 
    145158</div> 
    146159<div id="bottom"></div> 
Note: See TracChangeset for help on using the changeset viewer.