[svn r22369] FS#2867 - The online editor, the Image manager: Visual fixes for the in-dialog mode.

skala
Ivan Tcholakov 17 years ago
parent f5d27acf0a
commit 3b711b883a
  1. 30
      main/inc/lib/fckeditor/editor/fckdialog.html
  2. 50
      main/inc/lib/fckeditor/editor/plugins/ImageManager/Classes/ImageManager.php
  3. 6
      main/inc/lib/fckeditor/editor/plugins/ImageManager/assets/manager.css
  4. 2
      main/inc/lib/fckeditor/editor/plugins/ImageManager/fckplugin.js
  5. 41
      main/inc/lib/fckeditor/editor/plugins/ImageManager/manager.php

@ -416,7 +416,10 @@ var Selection =
// Move the focus to the Cancel button so even if the dialog contains a
// contentEditable element the selection is properly restored in the editor #2496
window.focus() ;
$( 'btnCancel' ).focus() ;
if ( $( 'btnCancel' ) )
{
$( 'btnCancel' ).focus() ;
}
FCK.Selection.Restore() ;
},
@ -584,6 +587,21 @@ var onReadyRegister = function()
{
$( 'contents' ).dir = langDir;
var src = Args().Page ;
if ( src.indexOf( 'manager.php' ) != -1 )
{
var PopupButtons = $( 'PopupButtons' ) ;
while ( PopupButtons && PopupButtons.firstChild )
{
PopupButtons.removeChild( PopupButtons.firstChild ) ;
}
PopupButtons.style.border = '0px';
if ( FCKBrowserInfo.IsIE && !FCKBrowserInfo.IsIE7 )
{
PopupButtons.style.width = '100%';
}
}
// Start the throbber timer.
Throbber.Show( 1000 ) ;
@ -789,7 +807,7 @@ var onReadyRegister = function()
// ]]>
</script>
</head>
<body onload="Init();" class="PopupBody">
<body onload="javascript: Init();" class="PopupBody">
<div class="contents" id="contents">
<div id="header">
<div id="TitleArea" class="PopupTitle PopupTitleBorder">
@ -810,14 +828,14 @@ document.write( Args().Title ) ;
</div>
</div>
<div id="innerContents"></div>
<div id="PopupButtons" class="PopupButtons">
<div id="PopupButtons" class="PopupButtons" style="visibility: hidden;">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="100%">&nbsp;</td>
<td nowrap="nowrap">
<button id="btnOk" style="visibility: hidden;" value="Ok" class="save" onclick="Ok();" fckLang="DlgBtnOK" >Ok</button>
<button id="btnOk" style="visibility: hidden;" value="Ok" class="save" onclick="javascript: Ok();" fckLang="DlgBtnOK" >Ok</button>
&nbsp;
<button id="btnCancel" value="Cancel" class="cancel" onclick="Cancel();" fckLang="DlgBtnCancel" >Cancel</button>
<button id="btnCancel" value="Cancel" class="cancel" onclick="javascript: Cancel();" fckLang="DlgBtnCancel" >Cancel</button>
</td>
</tr>
</table>
@ -832,7 +850,7 @@ document.write( Args().Title ) ;
<div class="bc"></div>
<div class="br"></div>
<div class="cover" id="cover" style="display:none"></div>
<div id="throbberBlock" style="position: absolute; visibility: hidden"></div>
<div id="throbberBlock" style="position: absolute; visibility: hidden;"></div>
<script type="text/javascript">
// <![CDATA[
// Set the class name for language direction.

@ -84,7 +84,7 @@ class ImageManager
{
$dirs = $this->_dirs($this->getBaseDir(),'/');
ksort($dirs);
$this->dirs = $dirs;
}
return $this->dirs;
@ -116,7 +116,7 @@ class ImageManager
$group_directory = $group_directory[count($group_directory) - 1];
}
$user_id = api_get_user_id();
$user_id = api_get_user_id();
while (false !== ($entry = $d->read()))
{
//If it is a directory, and it doesn't start with
@ -148,10 +148,10 @@ class ImageManager
//Teachers can access to hidden files and directories as they can in the tool documents
/*
if ($visible_status=='0' || $visible_status=='-1') {
continue;
continue;
}
*/
/* if (strpos($fullpath, '/shared_folder/') !== false) {
if (!preg_match('/.*\/shared_folder\/$/', $fullpath)) {
//all students can see the shared_folder
@ -159,8 +159,8 @@ class ImageManager
continue;
}
}
}
*/
}
*/
$dirs[$relative] = $fullpath;
$dirs = array_merge($dirs, $this->_dirs($fullpath, $relative));
}
@ -195,14 +195,14 @@ class ImageManager
$d = @dir($fullpath);
if(empty($d)) {
if(empty($d)) {
$path = Files::fixPath('/');
$base = Files::fixPath($this->getBaseDir());
$fullpath = Files::makePath($base,$path);
$d = @dir($fullpath);
$fullpath = Files::makePath($base,$path);
$d = @dir($fullpath);
}
$in_group = api_is_in_group();
$user_id = api_get_user_id();
@ -247,9 +247,9 @@ class ImageManager
}
}
*/
}
}
if($is_dir && $this->isThumbDir($entry) == false) {
if($is_dir && $this->isThumbDir($entry) == false) {
global $_course;
if (isset($_course['dbName']) && $_course<>'-1') {
//checking visibility
@ -262,9 +262,9 @@ class ImageManager
//Teachers can access to hidden files and directories as they can in the tool documents
/*
if ($visible_status=='0' || $visible_status=='-1') {
continue;
continue;
}
*/
*/
$relative = Files::fixPath($path.$entry);
$full = Files::fixPath($fullpath.$entry);
$count = $this->countFiles($full);
@ -284,15 +284,15 @@ class ImageManager
$doc_id = DocumentManager::get_document_id($_course, $new_dir );
$visible_status= api_get_item_visibility($_course,TOOL_DOCUMENT,$doc_id);
}
//Teachers can access to hidden files and directories as they can in the tool documents
/*
if ($visible_status=='0' || $visible_status=='-1') {
continue;
continue;
}
*/
$file['url'] = Files::makePath($this->config['base_url'],$path).$entry;
$file['url'] = Files::makePath($this->config['base_url'],$path).$entry;
$file['relative'] = $path.$entry;
$file['fullpath'] = $fullpath.$entry;
$file['image'] = $img;
@ -581,15 +581,15 @@ class ImageManager
}
//now copy the file
$path = Files::makePath($this->getBaseDir(),$relative);
$path = Files::makePath($this->getBaseDir(),$relative);
$result = Files::copyFile($file['tmp_name'], $path, $file['name']);
//no copy error
if (!is_int($result)) {
if (!is_int($result)) {
if (isset($_course['dbName']) && $_course<>'-1') {
if (isset($_course['dbName']) && $_course<>'-1') {
//adding the document to the DB
global $to_group_id;
global $to_group_id;
// looking for the /document/ folder
$document_path = substr($path, strpos($path,'/document/')+9, strlen($path)); // /shared_folder/4/name
@ -609,7 +609,7 @@ class ImageManager
if (!(api_is_platform_admin() || api_is_course_admin())) {
//setting invisible by default for the students
api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'invisible', api_get_user_id());
}
}
*/
$dimensionsIndex = isset($_REQUEST['uploadSize']) ? $_REQUEST['uploadSize'] : 0;
// If maximum size is specified, constrain image to it.

@ -25,14 +25,14 @@ select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
border-bottom: #cec6b5 1px solid;
background-color: #dedede;
padding: 3px 10px 3px 10px;
margin-bottom: 15px;
/* margin-bottom: 15px; */
}
.PopupButtons
{
position: absolute;
/* right: 0px;
left: 0px; */
right: 0px;
left: 0px;
bottom: 0px;
border-top: #cec6b5 1px solid;
background-color: #dedede;

@ -209,7 +209,7 @@ ImageManager.prototype.insert = function(outparam)
return;
//}, outparam);
}, outparam, 'FCKDialog_ImageManager', 'Insert Image', 800, 600 );
}, outparam, 'FCKDialog_ImageManager', 'Insert Image', 850, 500 );
}
};

@ -35,7 +35,7 @@
var thumbdir = "<?php echo $IMConfig['thumbnail_dir']; ?>";
var base_url = "<?php echo $manager->getBaseURL(); ?>";
var base_url_alt= "<?php echo $base_url_alt.'images/gallery/'; ?>";
var server_name = "<?php echo $IMConfig['server_name']; ?>";
@ -50,7 +50,7 @@
var _editor_lang = 'en' ;
if ( window.opener )
{
window.resizeTo( 800, 500 ) ;
window.resizeTo( 850, 500 ) ;
if ( window.opener.ImageManager && window.opener.ImageManager.I18N )
{
@ -72,7 +72,7 @@
}
// Language object not found?
if (!this.I18N)
if ( !this.I18N )
{
// Read it now - copy in next script block
document.write( '<script type="text/javascript" src="lang/' + _editor_lang + '.js"><\/script>' );
@ -90,6 +90,14 @@
I18N = this.ImageManager.I18N;
}
function Init()
{
if (window.opener)
{
document.getElementById('dialog_title').style.visibility = '' ;
}
}
/*]]>*/
</script>
@ -101,26 +109,27 @@
/*<![CDATA[*/
body {
padding: 0px;
overflow: hidden;
}
/*]]>*/
</style>
</head>
<body>
<div class="PopupTitle">Insert Image</div>
<body onload='javascript: Init();'>
<div id="dialog_title" class="PopupTitle" style="visibility: hidden;">Insert Image</div>
<form action="images.php" id="uploadForm" method="post" enctype="multipart/form-data">
<fieldset style="margin-left: 15px; margin-right: 15px;"><legend>Image Manager</legend>
<div class="dirs">
<label for="dirPath">Directory</label>
<select name="dir" class="dirWidth" id="dirPath" onchange="updateDir(this)" style="width: 400px;">
<select name="dir" class="dirWidth" id="dirPath" onchange="javascript: updateDir(this);" style="width: 400px;">
<option value="/">/</option>
<?php
foreach($dirs as $relative=>$fullpath) { ?>
<?php if($relative == '/images/gallery/') {?>
<option value="<?php echo rawurlencode($relative); ?>" selected="selected"><?php echo $relative; ?></option>
<?php } else {?>
<option value="<?php echo rawurlencode($relative); ?>"><?php echo $relative; ?></option>
<option value="<?php echo rawurlencode($relative); ?>"><?php echo $relative; ?></option>
<?php } ?>
<?php } ?>
</select>
@ -139,7 +148,7 @@ body {
<td><input type="text" id="f_url" class="largelWidth" value="" /></td>
<td rowspan="3" align="right">&nbsp;</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><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">&nbsp;</td>
<td align="right"><label for="f_vert">V Space</label></td>
@ -149,7 +158,7 @@ body {
<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><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>
@ -160,7 +169,7 @@ body {
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td><input type="file" name="upload" id="upload"/></td>
<td>&nbsp;<button type="submit" class="upload" name="submit" onclick="doUpload();"/>Upload</button></td>
<td>&nbsp;<button type="submit" class="upload" name="submit" onclick="javascript: doUpload();"/>Upload</button></td>
</tr>
</table>
</td>
@ -169,7 +178,7 @@ body {
<?php } ?>
<td align="right"><label for="f_align">Align</label></td>
<td colspan="2">
<select size="1" id="f_align" title="Positioning of this image">
<select size="1" id="f_align" title="Positioning of this image" style="width: 130px;">
<option value="" >Not Set</option>
<option value="left" >Left</option>
<option value="right" >Right</option>
@ -211,17 +220,17 @@ body {
<?php } ?>
<input type="hidden" id="orginal_width" />
<input type="hidden" id="orginal_height" />
<input type="checkbox" id="constrain_prop" checked="checked" onclick="javascript:toggleConstrains(this);" />
<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 class="PopupButtons" style="width: 100%;">
<div style="text-align: right; margin-left: 15px; margin-right: 15px;">
<button type="button" class="refresh" onclick="return refresh();">Refresh</button>&nbsp;
<button type="button" class="save" onclick="return onOK();">Ok</button>&nbsp;
<button type="button" class="cancel" onclick="return onCancel();">Cancel</button>
<div style="float: right; white-space: nowrap; margin-right: 25px;">
<button type="button" class="refresh" onclick="javascript: return refresh();">Refresh</button>&nbsp;
<button type="button" class="save" onclick="javascript: return onOK();">Ok</button>&nbsp;
<button type="button" class="cancel" onclick="javascript: return onCancel();">Cancel</button>
</div>
</div>
<input type="hidden" id="f_file" name="f_file" />

Loading…
Cancel
Save