Ignore:
Timestamp:
05/18/05 21:15:06 (15 years ago)
Author:
yermol
Message:

htmlarea.js

. added workaround fix for NASTY FIREFOX BUG resulting in the infamous

uneditable area problem (exception on designMode="on" issue -
refer to bug:


https://bugzilla.mozilla.org/show_bug.cgi?id=207842


and this thread:


http://xinha.gogo.co.nz/punbb/viewtopic.php?id=229


. trailing <BR>'s are no longer stripped out of the document. This

was wreaking havoc on EnterParagraphs?. It's not clear whether or not
this is going to have unanticipated side-effects.

plugins/EnterParagraphs/enter-paragraphs.js

NOT FULLY FUNCTIONAL YET - DOESN'T HANDLE ALL CASES CORRECTLY,
but it's much better than it was I think.

. largely reworked.
. changed obfuscated variables names to make it more readable.
. expanded out nested (x ? y : z) constructs to make it more readable.
. added alot of comments.
. fixed a serious bug in findEachNodeUnder() that was not correctly

handling beginning and end node conditions.

. fixed design flaw that selected a non-existent insertion point for

placing the cursor.

. fixed several exceptions.
. now correctly handles lists by passing the back back to the Gecko

engine if we are in a list with the exception of being at the
first position in the first element in which case we insert
a paragraph before the list and move the cursor back to the first
item on the list.

File:
1 edited

Legend:

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

    r121 r172  
    1 <? 
     1<?php 
     2 
    23/** 
    34 * Show a list of images in a long horizontal table. 
     
    89 
    910require_once('config.inc.php'); 
    10 require_once(XINHA_INSTALL_ROOT . '/ddt/ddt.php'); 
     11 
     12// we may already have a definition of _ddt().  
     13 
     14if ( ! function_exists( "_ddt" ) ) 
     15        { 
     16        require_once(XINHA_INSTALL_ROOT . '/ddt/ddt.php'); 
     17        } 
     18 
    1119require_once('Classes/ImageManager.php'); 
    1220 
     
    1523// _ddtOn(); 
    1624 
    17 //default path is / 
     25_ddt( __FILE__, __LINE__, "images.php - base_url is '" . $IMConfig['base_url'] . "'" ); 
     26 
     27// default path is / 
     28 
    1829$relative = '/'; 
    1930$manager = new ImageManager($IMConfig); 
    2031 
    21 //process any file uploads 
     32// process any file uploads 
     33 
    2234$manager->processUploads(); 
    2335 
     
    2537 
    2638$refreshDir = false; 
    27 //process any directory functions 
     39 
     40// process any directory functions 
     41 
    2842if($manager->deleteDirs() || $manager->processNewDir()) 
    2943        $refreshDir = true; 
    3044 
    31 //check for any sub-directory request 
    32 //check that the requested sub-directory exists 
    33 //and valid 
    34 if(isset($_REQUEST['dir'])) 
    35 { 
     45// check for any sub-directory request 
     46// check that the requested sub-directory exists 
     47// and valid 
     48 
     49if (isset($_REQUEST['dir'])) 
     50        { 
    3651        $path = rawurldecode($_REQUEST['dir']); 
    3752        if($manager->validRelativePath($path)) 
    3853                $relative = $path; 
    39 } 
     54        } 
    4055 
    4156 
    4257$manager = new ImageManager($IMConfig); 
    4358 
    44 //get the list of files and directories 
     59// get the list of files and directories 
     60 
    4561$list = $manager->getFiles($relative); 
    4662 
     
    5066 * Draw the files in an table. 
    5167 */ 
     68 
    5269function drawFiles($list, &$manager) 
    5370{ 
    5471        global $relative; 
    55         global $IMConfig; 
     72 
     73        // we used to have the global $IMConfig here but for some reason the global 
     74        // reference was getting dropped. Pulling it from inside manager is probably 
     75        // cleaner. 
     76 
     77        _ddt( __FILE__, __LINE__, "drawFiles(): config['base_url'] is '" . $manager->config['base_url'] . "'" ); 
    5678 
    5779        foreach($list as $entry => $file)  
     
    6688                <a href="javascript:;" onclick="selectImage('<?php echo $file['relative'];?>', '<?php echo $entry; ?>', <?php echo $file['image'][0];?>, <?php echo $file['image'][1]; ?>);"title="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>"><img src="<?php print $manager->getThumbnail($file['relative']); ?>" alt="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>"/></a> 
    6789                </td></tr><tr><td class="edit"> 
    68                         <a href="<?php echo $IMConfig['backend_url']; ?>__function=images&dir=<?php echo $relative; ?>&amp;delf=<?php echo rawurlencode($file['relative']);?>" title="Trash" onclick="return confirmDeleteFile('<?php echo $entry; ?>');"><img src="<?php print $IMConfig['base_url'];?>img/edit_trash.gif" height="15" width="15" alt="Trash"/></a><a href="javascript:;" title="Edit" onclick="editImage('<?php echo rawurlencode($file['relative']);?>');"><img src="<?php print $IMConfig['base_url'];?>img/edit_pencil.gif" height="15" width="15" alt="Edit"/></a> 
     90                        <a href="<?php print $IMConfig['backend_url']; ?>__function=images&dir=<?php echo $relative; ?>&amp;delf=<?php echo rawurlencode($file['relative']);?>" title="Trash" onclick="return confirmDeleteFile('<?php echo $entry; ?>');"><img src="<?php  
     91                         
     92                        _ddt( __FILE__, __LINE__, "images.php - base_url is '" . $manager->config['base_url'] . "'" ); 
     93                         
     94                        echo $manager->config['base_url'];?>img/edit_trash.gif" height="15" width="15" alt="Trash"/></a><a href="javascript:;" title="Edit" onclick="editImage('<?php echo rawurlencode($file['relative']);?>');"><img src="<?php print $manager->config['base_url'];?>img/edit_pencil.gif" height="15" width="15" alt="Edit"/></a> 
    6995                <?php if($file['image']){ echo $file['image'][0].'x'.$file['image'][1]; } else echo $entry;?> 
    7096                </td></tr></table></td>  
     
    81107{ 
    82108        global $relative; 
    83    global $IMConfig; 
    84109 
    85110        foreach($list as $path => $dir)  
    86111        { ?> 
    87112                <td><table width="100" cellpadding="0" cellspacing="0"><tr><td class="block"> 
    88                 <a href="<?php print $IMConfig['backend_url']; ?>__function=images&dir=<?php echo rawurlencode($path); ?>" onclick="updateDir('<?php echo $path; ?>')" title="<?php echo $dir['entry']; ?>"><img src="<?php print $IMConfig['base_url'];?>img/folder.gif" height="80" width="80" alt="<?php echo $dir['entry']; ?>" /></a> 
     113                <a href="<?php print $manager->config['backend_url']; ?>__function=images&dir=<?php echo rawurlencode($path); ?>" onclick="updateDir('<?php echo $path; ?>')" title="<?php echo $dir['entry']; ?>"><img src="<?php print $manager->config['base_url'];?>img/folder.gif" height="80" width="80" alt="<?php echo $dir['entry']; ?>" /></a> 
    89114                </td></tr><tr> 
    90115                <td class="edit"> 
    91                         <a href="<?php print $IMConfig['backend_url']; ?>__function=editor&dir=<?php echo $relative; ?>&amp;deld=<?php echo rawurlencode($path); ?>" title="Trash" onclick="return confirmDeleteDir('<?php echo $dir['entry']; ?>', <?php echo $dir['count']; ?>);"><img src="<?php print $IMConfig['base_url'];?>img/edit_trash.gif" height="15" width="15" alt="Trash"/></a> 
     116                        <a href="<?php print $$manager->config['backend_url']; ?>__function=editor&dir=<?php echo $relative; ?>&amp;deld=<?php echo rawurlencode($path); ?>" title="Trash" onclick="return confirmDeleteDir('<?php echo $dir['entry']; ?>', <?php echo $dir['count']; ?>);"><img src="<?php  
     117 
     118                        _ddt( __FILE__, __LINE__, "images.php - base_url is '" . $manager->config['base_url'] . "'" ); 
     119                         
     120                        print $manager->config['base_url'];?>img/edit_trash.gif" height="15" width="15" alt="Trash"/></a> 
    92121                        <?php echo $dir['entry']; ?> 
    93122                </td> 
Note: See TracChangeset for help on using the changeset viewer.