[svn r10587] update for the fckeditor (Image manager, mp3 upload and flash upload)

skala
Eric Marguin 19 years ago
parent b65f543dbc
commit ec92ac2bba
  1. 18
      main/inc/lib/fckeditor/editor/dialog/fck_flash.php
  2. 22
      main/inc/lib/fckeditor/editor/dialog/fck_flash/fck_flash.js
  3. 2
      main/inc/lib/fckeditor/editor/filemanager/browser/default/connectors/php/connector.php
  4. 119
      main/inc/lib/fckeditor/editor/filemanager/upload/php/upload.php
  5. 7
      main/inc/lib/fckeditor/editor/plugins/ImageManager/Classes/Files.php
  6. 2
      main/inc/lib/fckeditor/editor/plugins/ImageManager/Classes/ImageEditor.php
  7. 35
      main/inc/lib/fckeditor/editor/plugins/ImageManager/Classes/ImageManager.php
  8. 2
      main/inc/lib/fckeditor/editor/plugins/ImageManager/Classes/Thumbnail.php
  9. 30
      main/inc/lib/fckeditor/editor/plugins/ImageManager/config.inc.php
  10. 2
      main/inc/lib/fckeditor/editor/plugins/ImageManager/fckplugin.js
  11. 38
      main/inc/lib/fckeditor/editor/plugins/ImageManager/images.php
  12. 79
      main/inc/lib/fckeditor/editor/plugins/ImageManager/manager.php
  13. 5
      main/inc/lib/fckeditor/editor/plugins/ImageManager/thumbs.php
  14. 6
      main/inc/lib/fckeditor/editor/plugins/MP3/fck_mp3.js
  15. 4
      main/inc/lib/fckeditor/editor/plugins/MP3/fck_mp3.php
  16. 6
      main/inc/lib/fckeditor/fckconfig.js
  17. 2
      main/inc/lib/fckeditor/fckeditor.php
  18. 41
      main/inc/lib/fckeditor/myconfig.js

@ -13,7 +13,7 @@ include('../../../../../inc/global.inc.php');
<script src="fck_flash/fck_flash.js" type="text/javascript"></script>
<link href="common/fck_dialog_common.css" type="text/css" rel="stylesheet">
</head>
<body> <!--scroll="no" style="OVERFLOW: hidden"-->
<body><!--scroll="no" style="OVERFLOW: hidden"-->
<div id="divInfo">
<div id="divExtra1" style="DISPLAY: none">
<table cellspacing="1" cellpadding="1" border="0" width="100%">
@ -23,7 +23,7 @@ include('../../../../../inc/global.inc.php');
<tr>
<td width="100%"><span fckLang="DlgImgURL">URL</span>
</td>
<td id="tdBrowse" style="DISPLAY: none" nowrap rowspan="2"><br><input id="btnBrowse" onClick="BrowseServer();" type="button" value="Browse Server" fckLang="DlgBtnBrowseServer">
<td id="tdBrowse" style="DISPLAY: block" nowrap rowspan="2"><br><input id="btnBrowse" onClick="BrowseServer();" type="button" value="Browse Server" fckLang="DlgBtnBrowseServer">
</td>
</tr>
<tr>
@ -45,7 +45,7 @@ include('../../../../../inc/global.inc.php');
?>
</div>
<div id="divExtra" style="DISPLAY: none"> <!--added by shiv -->
<div id="divExtra"> <!--added by shiv -->
<table cellSpacing="1" cellPadding="1" width="100%" border="0">
<TR>
<TD>
@ -93,8 +93,7 @@ include('../../../../../inc/global.inc.php');
<form id="frmUpload" name="frmUpload" method="post" target="UploadWindow" enctype="multipart/form-data" action="" onSubmit="return CheckUpload();">
<!--<span fckLang="DlgLnkUpload">Upload</span>--><br />
<table cellspacing="1" cellpadding="1" border="0" width="90%" align="center">
<tr><td><input id="txtUploadFile" style="WIDTH: 100%" type="file" size="40" name="NewFile" /></td></tr>
<tr><td><input id="btnUpload" type="submit" value="Send it to the Server" fckLang="DlgLnkBtnUpload" /></td></tr>
<tr><td><input id="txtUploadFile" type="file" size="40" name="NewFile" />&nbsp;<input id="btnUpload" type="submit" value="Send it to the Server" fckLang="DlgLnkBtnUpload" /></td></tr>
</table>
<iframe name="UploadWindow" style="DISPLAY: none" src="../fckblank.html"></iframe>
</form>
@ -133,15 +132,15 @@ include('../../../../../inc/global.inc.php');
&nbsp;
<table cellSpacing="0" cellPadding="0" width="100%" align="center" border="0">
<tr>
<td vAlign="top" width="50%"><span fckLang="DlgGenId">Id</span><br>
<td valign="top" width="50%"><span fckLang="DlgGenId">Id</span><br>
<input id="txtAttId" style="WIDTH: 100%" type="text">
</td>
<td>&nbsp;&nbsp;</td>
<td vAlign="top" nowrap><span fckLang="DlgGenClass">Stylesheet Classes</span><br>
<td valign="top" nowrap><span fckLang="DlgGenClass">Stylesheet Classes</span><br>
<input id="txtAttClasses" style="WIDTH: 100%" type="text">
</td>
<td>&nbsp;&nbsp;</td>
<td vAlign="top" nowrap width="50%">&nbsp;<span fckLang="DlgGenTitle">Advisory Title</span><br>
<td valign="top" nowrap width="50%">&nbsp;<span fckLang="DlgGenTitle">Advisory Title</span><br>
<input id="txtAttTitle" style="WIDTH: 100%" type="text">
</td>
</tr>
@ -149,5 +148,8 @@ include('../../../../../inc/global.inc.php');
<span fckLang="DlgGenStyle">Style</span><br>
<input id="txtAttStyle" style="WIDTH: 100%" type="text">
</div>
<div style="text-align: center;">
<input type="button" value="<?php echo get_lang("Validate");?>" onclick="Ok();">
</div>
</body>
</html>

@ -28,7 +28,8 @@ var FCKConfig = oEditor.FCKConfig ;
if ( FCKConfig.FlashUpload )
window.parent.AddTab( 'Upload', FCKLang.DlgLnkUpload ) ;
window.parent.AddTab( 'Info', oEditor.FCKLang.DlgInfoTab ) ;
if(FCKConfig.UserStatus=="teacher")
window.parent.AddTab( 'Info', oEditor.FCKLang.DlgInfoTab ) ;
//if ( !FCKConfig.FlashDlgHideAdvanced )
@ -67,8 +68,9 @@ window.onload = function()
GetE('tdBrowse').style.display = FCKConfig.FlashBrowser ? '' : 'none' ;
// Set the actual uploader URL.
if ( FCKConfig.FlashUpload )
GetE('frmUpload').action = FCKConfig.FlashUploadURL ;
if ( FCKConfig.FlashUpload ){
GetE('frmUpload').action = FCKConfig.FlashUploadURL+"&uploadPath="+FCKConfig.FlashUploadPath ;
}
window.parent.SetAutoSize( true ) ;
@ -143,7 +145,7 @@ function Ok()
oEditor.FCKUndo.SaveUndoStep() ;
oEditor.FCKFlashProcessor.RefreshView( oFakeImage, oEmbed ) ;
window.parent.close();
return true ;
}
@ -194,14 +196,14 @@ function UpdatePreview()
if ( !ePreview )
return ;
while ( ePreview.firstChild )
ePreview.removeChild( ePreview.firstChild ) ;
//while ( ePreview.firstChild )
//ePreview.removeChild( ePreview.firstChild ) ;
if ( GetE('txtUrl').value.length == 0 )
ePreview.innerHTML = '&nbsp;' ;
else
{
window.parent.SetSelectedTab( 'Info' ) ;
//window.parent.SetSelectedTab( 'Info' ) ;
var oDoc = ePreview.ownerDocument || ePreview.document ;
var e = oDoc.createElement( 'EMBED' ) ;
@ -214,7 +216,6 @@ function UpdatePreview()
}
}
// <embed id="ePreview" src="fck_flash/claims.swf" width="100%" height="100%" style="visibility:hidden" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
function BrowseServer()
{
@ -234,8 +235,8 @@ function SetUrl( url, width, height )
UpdatePreview() ;
//window.parent.SetSelectedTab( 'Info' ) ;
Ok();
window.parent.close();
//Ok();
//window.parent.close();
}
@ -245,6 +246,7 @@ function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
{
case 0 : // No errors
//alert( 'Your file has been successfully uploaded' ) ;
document.getElementById("loader").style.display="none";
break ;
case 1 : // Custom error
alert( customMsg ) ;

@ -29,7 +29,7 @@ if ( !$Config['Enabled'] )
// Get the "UserFiles" path.
$GLOBALS["UserFilesPath"] = '' ;
exit;
if ( isset( $Config['UserFilesPath'] ) )
$GLOBALS["UserFilesPath"] = $Config['UserFilesPath'] ;
else if ( isset( $_GET['ServerPath'] ) )

@ -17,6 +17,7 @@
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
include('../../../../../../global.inc.php');
include_once(api_get_path(INCLUDE_PATH)."lib/fileUpload.lib.php");
@ -69,72 +70,86 @@ $sFileUrl = '' ;
$iCounter = 0 ;
/*
// Get the "UserFiles" path.
$GLOBALS["UserFilesPath"] = '' ;
$currentCourseRepositorySys = api_get_path(SYS_COURSE_PATH) . $_course["path"]."/";
$currentCourseRepositoryWeb = api_get_path(WEB_COURSE_PATH) . $_course["path"]."/";
if ( isset( $Config['UserFilesPath'] ) )
$GLOBALS["UserFilesPath"] = $Config['UserFilesPath'] ;
else if ( isset( $_GET['ServerPath'] ) )
$GLOBALS["UserFilesPath"] = $_GET['ServerPath'] ;
else
$GLOBALS["UserFilesPath"] = '/UserFiles/' ;
$sType=strtolower($sType);
if ( ! ereg( '/$', $GLOBALS["UserFilesPath"] ) )
$GLOBALS["UserFilesPath"] .= '/' ;
if(isset($_SESSION["_course"]["sysCode"])){
if(api_is_allowed_to_edit()){
//En fonction du type, mettre dans audio, flash ou images
if($sType=="mp3"){
$sServerDir = $currentCourseRepositorySys.'document/audio/';
$sserverWebath=$currentCourseRepositoryWeb.'document/audio/';
$sType="audio";
}
elseif($sType=="flash"){
$sServerDir = $currentCourseRepositorySys.'document/flash/';
$sserverWebath=$currentCourseRepositoryWeb.'document/flash/';
}
else{
$sServerDir = $currentCourseRepositorySys.'document/';
$sserverWebath=$currentCourseRepositoryWeb.'document/';
}
}
elseif(isset($_REQUEST['uploadPath']) && $_REQUEST['uploadPath']!=""){
$sServerDir = $currentCourseRepositorySys.$_REQUEST['uploadPath'];
$sserverWebath=$currentCourseRepositoryWeb.$_REQUEST['uploadPath'];
}
else{
$sServerDir = $currentCourseRepositorySys.'upload/';
$sserverWebath=$currentCourseRepositoryWeb.'upload/';
}
}
// The the target directory.
//$sServerDir = GetRootPath() . $GLOBALS["UserFilesPath"];
*/
// Try to add an extension to the file if it has'nt one
$sFileName = add_ext_on_mime(stripslashes($oFile['name']),$oFile['type']);
$currentCourseRepositorySys = api_get_path(SYS_COURSE_PATH) . $_course["path"]."/";
$currentCourseRepositoryWeb = api_get_path(WEB_COURSE_PATH) . $_course["path"]."/";
// Replace dangerous characters
$sFileName = replace_dangerous_char($sFileName,'strict');
$sServerDir = $currentCourseRepositorySys.'document/';
// Transform any .php file in .phps for security
$sFileName = php2phps($sFileName);
//$sFilePath = $sServerDir.$sType."/" . $sFileName ;
// Compose the file path.
if(!is_dir($sServerDir.$sType))
{
mkdir($sServerDir.$sType, 0777);
}
// Try to add an extension to the file if it has'nt one
$sFileName = add_ext_on_mime(stripslashes($oFile['name']),$oFile['type']);
if(!move_uploaded_file( $oFile['tmp_name'], $sServerDir.$sFileName )) $sErrorNumber = '203' ; //check php.ini setting
// Replace dangerous characters
$sFileName = replace_dangerous_char($sFileName,'strict');
if ( is_file( $sServerDir.$sFileName ) )
{
$oldumask = umask(0) ;
chmod( $sFilePath, 0777 ) ;
umask( $oldumask ) ;
}
// Transform any .php file in .phps fo security
$sFileName = php2phps($sFileName);
//If we are in a course and if it's a teacher who did the upload, we record the uploaded file in database
if(isset($_SESSION["_course"]["sysCode"]) && api_is_allowed_to_edit()){
$document_name=utf8_decode($oFile["name"]);
$document_name= strtr($document_name,"ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ","aaaaaaaaaaaaooooooooooooeeeeeeeecciiiiiiiiuuuuuuuuynn");
$document_name=preg_replace('/[^\w\._]/', '_', $document_name);
$document_size=$oFile["size"];
$sFilePath = $sServerDir.$sType."/" . $sFileName ;
// If a file with that name already exists.
/*if ( is_file( $sFilePath ) )
{
$iCounter++ ;
$sFileName = RemoveExtension( $sFileName ) . '(' . $iCounter . ').' . $sExtension ;
$sErrorNumber = '201' ;
include_once(api_get_path(LIBRARY_PATH)."fileUpload.lib.php");
if($sType=="flash"){
$path = "/flash/";
}
else
{*/
if(!move_uploaded_file( $oFile['tmp_name'], $sFilePath )) $sErrorNumber = '203' ; //check php.ini setting
if ( is_file( $sFilePath ) )
{
$oldumask = umask(0) ;
chmod( $sFilePath, 0777 ) ;
umask( $oldumask ) ;
}
if($sType=="audio"){
$path = "/audio/";
}
$doc_id = add_document($_course, $path.$document_name, 'file', $document_size, $document_name);
$sFileUrl = $currentCourseRepositoryWeb . 'document/' . $sType . "/" . $sFileName ;
api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'DocumentCreated', $_user['user_id']);
}
//break ;
//}
SendResults( $sErrorNumber, $sserverWebath.$sFileName, $sFileName ) ;
SendResults( $sErrorNumber, $sFileUrl, $sFileName ) ;
?>
?>

@ -1,4 +1,4 @@
<?
<?php
/**
* File Utilities.
* @author $Author: Wei Zhuo $
@ -34,6 +34,11 @@ class Files
*/
function copyFile($source, $destination_dir, $destination_file, $unique=true)
{
$destination_file=utf8_decode($destination_file);
$destination_file= strtr($destination_file,"ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ","aaaaaaaaaaaaooooooooooooeeeeeeeecciiiiiiiiuuuuuuuuynn");
$destination_file=Files::escape($destination_file);
if(!(file_exists($source) && is_file($source)))
return FILE_ERROR_NO_SOURCE;

@ -1,4 +1,4 @@
<?
<?php
/**
* Image Editor. Editing tools, crop, rotate, scale and save.
* @author $Author: Wei Zhuo $

@ -1,4 +1,4 @@
<?
<?php
/**
* ImageManager, list images, directories, and thumbnails.
* @author $Author: Wei Zhuo $
@ -380,9 +380,34 @@ class ImageManager
//check for the file, and must have valid relative path
if(isset($_FILES['upload']) && $this->validRelativePath($relative))
{
return $this->_processFiles($relative, $_FILES['upload']);
$upload_result=$this->_processFiles($relative, $_FILES['upload']);
return $upload_result;
}
}
/**
* Insert the uploaded picture in the database.
* @param string $relative The path in the document images folder
* @param array $file the uploaded file from $_FILES
* @param String $file_name the correct file name (generated by the function Files::copyFile).
*/
function _insertPictureInDatabase($relative, $file, $file_name){
$image_name=utf8_decode($file_name);
$image_name= strtr($image_name,"ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ","aaaaaaaaaaaaooooooooooooeeeeeeeecciiiiiiiiuuuuuuuuynn");
$image_name=Files::escape($image_name);
$image_size=$file["size"];
$path = "/images/".substr($relative,1);
include(api_get_path(LIBRARY_PATH)."fileUpload.lib.php");
$doc_id = add_document($_course, $path.$image_name, 'file', $image_size, $image_name);
api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'DocumentCreated', $_user['user_id']);
}
/**
* Process upload files. The file must be an
@ -398,7 +423,6 @@ class ImageManager
*/
function _processFiles($relative, $file)
{
if($file['error']!=0)
{
Return false;
@ -434,9 +458,10 @@ class ImageManager
if(!is_int($result))
{
Files::delFile($file['tmp_name']);
$this->_insertPictureInDatabase($relative, $_FILES['upload'],$result);
Return $result;
}
//delete tmp files.
Files::delFile($file['tmp_name']);
Return false;
@ -527,7 +552,7 @@ class ImageManager
//well, no thumbnail was found, so ask the thumbs.php
//to generate the thumbnail on the fly.
Return 'thumbs.php?img='.rawurlencode($relative);
Return 'thumbs.php?img='.rawurlencode($relative).'&uploadPath='.$_GET['uploadPath'];
}
/**

@ -1,4 +1,4 @@
<?
<?php
/**
* Create thumbnails.
* @author $Author: Wei Zhuo $

@ -1,4 +1,4 @@
<?
<?php
/**
* Image Manager configuration file.
* @author $Author: Wei Zhuo $
@ -26,11 +26,31 @@
for this directory (i.e. disable PHP, Perl, CGI). We only want to store assets
in this directory and its subdirectories.
*/
require_once('../../../../../conf/configuration.php');
$IMConfig['base_url'] = $_configuration['root_web'].'main/img/gallery/';
//$IMConfig['base_dir'] = $_SERVER['DOCUMENT_ROOT'].$IMConfig['base_url'];
$IMConfig['base_dir'] = $_configuration['root_sys'].'main/img/gallery/';
include ('../../../../../../inc/global.inc.php');
//The user is in a course
if(isset($_SESSION["_course"]["sysCode"])){
if(api_is_allowed_to_edit()){
$IMConfig['base_dir'] = api_get_path(SYS_COURSE_PATH).$_SESSION["_course"]["path"]."/document/images/";
$IMConfig['base_url'] = api_get_path(WEB_COURSE_PATH).$_SESSION["_course"]["path"]."/document/images/";
}
elseif(isset($_GET['uploadPath']) && $_GET['uploadPath']!=""){
$IMConfig['base_dir'] = api_get_path(SYS_COURSE_PATH).$_SESSION["_course"]["path"]."/".$_GET['uploadPath'];
$IMConfig['base_url'] = api_get_path(WEB_COURSE_PATH).$_SESSION["_course"]["path"]."/".$_GET['uploadPath'];
}
else{
$IMConfig['base_dir'] = api_get_path(SYS_COURSE_PATH).$_SESSION["_course"]["path"]."/upload/";
$IMConfig['base_url'] = api_get_path(WEB_COURSE_PATH).$_SESSION["_course"]["path"]."/upload/";
}
}
//Out of any course (admin)
else{
$IMConfig['base_dir'] = $_configuration['root_sys'].'main/img/fckeditor/';
$IMConfig['base_url'] = $_configuration['root_web'].'main/img/fckeditor/';
}
$IMConfig['server_name'] = $_SERVER['SERVER_NAME'];
/*

@ -133,7 +133,7 @@ ImageManager.prototype.insert = function(outparam)
// show image manager
else
{
var manager = FCKConfig.PluginsPath+'ImageManager/manager.php';
var manager = FCKConfig.PluginsPath+'ImageManager/manager.php?uploadPath='+FCKConfig.IMUploadPath;
Dialog(manager, function(param) {

@ -1,4 +1,4 @@
<?
<?php
/**
* Show a list of images in a long horizontal table.
* @author $Author: Wei Zhuo $
@ -14,7 +14,7 @@ $relative = '/';
$manager = new ImageManager($IMConfig);
//process any file uploads
$manager->processUploads();
$upload_result=$manager->processUploads();
$manager->deleteFiles();
@ -55,6 +55,7 @@ function drawFiles($list, &$manager)
{ ?>
<td><table width="100" cellpadding="0" cellspacing="0"><tr><td class="block">
<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 echo $manager->getThumbnail($file['relative']); ?>" alt="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>"/></a>
<!--<iframe src="<?php echo $manager->getThumbnail($file['relative']); ?>"></iframe>-->
</td></tr><tr><td class="edit">
<?php if($IMConfig['allow_delete'] == true) { ?>
<a href="images.php?dir=<?php echo $relative; ?>&amp;delf=<?php echo rawurlencode($file['relative']);?>" title="Trash" onclick="return confirmDeleteFile('<?php echo $entry; ?>');"><img src="img/edit_trash.gif" height="15" width="15" alt="Trash"/></a>
@ -100,7 +101,7 @@ function drawNoResults()
<td class="noResult">No Images Found</td>
</tr>
</table>
<?
<?php
}
/**
@ -114,7 +115,7 @@ function drawErrorBase(&$manager)
<td class="error">Invalid base directory: <?php echo $manager->config['base_dir']; ?></td>
</tr>
</table>
<?
<?php
}
?>
@ -189,6 +190,11 @@ function drawErrorBase(&$manager)
}
}, null);
}
function closeWindowAfterUpload(path, name, width, height){
selectImage(path, name, width, height);
window.parent.onOK();
}
/*]]>*/
</script>
@ -202,8 +208,30 @@ function drawErrorBase(&$manager)
<tr>
<?php drawDirs($list[0], $manager); ?>
<?php drawFiles($list[1], $manager); ?>
<?php closeWindowAfterUpload($list[1]); ?>
</tr>
</table>
<?php } else { drawNoResults(); } ?>
<?php
}
else {
drawNoResults();
}
function closeWindowAfterUpload($list){
if(!api_is_allowed_to_edit() && isset($_FILES['upload'])){
foreach($list as $entry => $file) {
echo "<script>closeWindowAfterUpload('".$file['relative']."','".$entry."','".$file['image'][0]."','".$file['image'][1]."');</script>";
return;
}
}
}
if(api_is_allowed_to_edit() && isset($_FILES['upload']) && !is_int($upload_result)){
$width=$list[1][$upload_result]['image'][0];
$height=$list[1][$upload_result]['image'][1];
echo "<script text='text/javascript'>selectImage('$relative$upload_result','$upload_result', '$width', '$height');</script>";
}
?>
</body>
</html>

@ -1,4 +1,4 @@
<?
<?php
/**
* The main GUI for the ImageManager.
* @author $Author: Wei Zhuo $
@ -6,11 +6,11 @@
* @package ImageManager
*/
require_once('config.inc.php');
require_once('Classes/ImageManager.php');
$manager = new ImageManager($IMConfig);
$dirs = $manager->getDirs();
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">
@ -22,13 +22,21 @@
<link href="assets/manager.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
/*<![CDATA[*/
var thumbdir = "<?php echo $IMConfig['thumbnail_dir']; ?>";
var base_url = "<?php echo $manager->getBaseURL(); ?>";
var server_name = "<?php echo $IMConfig['server_name']; ?>";
window.resizeTo(600, 330);
<?php
//It's a teacher
if(api_is_allowed_to_edit()){
echo "window.resizeTo(600, 430);";
}
else{
echo "window.resizeTo(600, 125);";
}
?>
if(window.opener.ImageManager && window.opener.ImageManager.I18N)
{
@ -41,12 +49,19 @@
// Read it now - copy in next script block
document.write('<script type="text/javascript" src="lang/' + window.opener._editor_lang + '.js"><\/script>');
}
/*]]>*/
function showAdvancedSettings(){
if(document.getElementById("advanced_settings").style.display=="none"){
document.getElementById("advanced_settings").style.display="block";
}
else{
document.getElementById("advanced_settings").style.display="none";
}
}
</script>
<script type="text/javascript">
/*<![CDATA[*/
// now copy the language object of the included script - needed a seperate new script block to be able to do so
if (!this.I18N)
@ -54,7 +69,6 @@
I18N = this.ImageManager.I18N;
}
/*]]>*/
</script>
<script type="text/javascript" src="assets/popup.js"></script>
@ -65,8 +79,9 @@
<body>
<div class="title">Insert Image</div>
<form action="images.php" id="uploadForm" method="post" enctype="multipart/form-data">
<fieldset><legend>Image Manager</legend>
<form action="images.php<?php if(isset($_GET['uploadPath']) && $_GET['uploadPath']!="") echo "?uploadPath=".$_GET['uploadPath']; ?>" id="uploadForm" method="post" enctype="multipart/form-data">
<fieldset <?php if(!api_is_allowed_to_edit()) echo "style='display: none;'"; ?>><legend>Image Manager</legend>
<div class="dirs">
<label for="dirPath">Directory</label>
<select name="dir" class="dirWidth" id="dirPath" onchange="updateDir(this)">
@ -80,16 +95,27 @@
<a href="#" onclick="newFolder();" title="New Folder"><img src="img/btnFolderNew.gif" height="15" width="15" alt="New Folder" /></a>
<?php } ?>
<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>
<iframe src="images.php<?php if(isset($_GET['uploadPath']) && $_GET['uploadPath']!="") echo "?uploadPath=".$_GET['uploadPath']; ?>" name="imgManager" id="imgManager" class="imageFrame" scrolling="auto" title="Image Selection" frameborder="0"></iframe>
</div>
</fieldset>
<!-- image properties -->
<input type="file" name="upload" id="upload"/>&nbsp;<button type="submit" name="submit" onclick="doUpload();"/>Upload</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button type="button" class="buttons" onclick="return refresh();" style="visibility:hidden;">Refresh</button>
<button type="button" class="buttons" onclick="return refresh();" style="display: none">Refresh</button>
<button type="button" class="buttons" onclick="return onOK();">OK</button>
<button type="button" class="buttons" onclick="return onCancel();">Cancel</button>
<table class="inputTable" style="display:none;">
<?php
if(api_is_allowed_to_edit()){
?>
<span style="cursor: pointer" onclick="showAdvancedSettings();"><?php echo get_lang("AdvancedSettings");?></span>
<?php
}
?>
<table class="inputTable" style="display: none" id="advanced_settings">
<tr>
<td align="right"><label for="f_url">Image File</label></td>
<td><input type="text" id="f_url" class="largelWidth" value="" /></td>
@ -111,15 +137,7 @@
</tr>
<tr>
<?php 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>&nbsp;<button type="submit" name="submit" onclick="doUpload();"/>Upload</button></td>
</tr>
</table>
</td>
<?php } else { ?>
<td colspan="2"></td>
<?php } ?>
@ -150,10 +168,7 @@
<td colspan="5"><label for="constrain_prop">Constrain Proportions</label></td>
</tr>
</table>
<!--// image properties -->
<div style="text-align: right;">
<hr />
</div>
<input type="hidden" id="f_file" name="f_file" />
</form>
</body>

@ -1,4 +1,4 @@
<?
<?php
/**
* On the fly Thumbnail generation.
* Creates thumbnails given by thumbs.php?img=/relative/path/to/image.jpg
@ -7,11 +7,10 @@
* @version $Id: thumbs.php 26 2004-03-31 02:35:21Z Wei Zhuo $
* @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();

@ -41,8 +41,9 @@ function window_onload()
GetE('tdBrowse').style.display = FCKConfig.MP3Browser ? '' : 'none' ;
// Set the actual uploader URL.
if ( FCKConfig.MP3Upload )
if ( FCKConfig.MP3Upload ){
GetE('frmUpload').action = FCKConfig.MP3UploadURL ;
}
window.parent.SetAutoSize( true ) ;
@ -307,6 +308,7 @@ function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
window.location.href=FCKConfig.PluginsPath + 'MP3/fck_mp3.php';
return ;
}
document.getElementById("loader").style.display="none";
SetUrl( fileUrl ) ;
GetE('frmUpload').reset() ;
@ -336,7 +338,7 @@ function CheckUpload()
return false ;
}
document.getElementById('eUploadMessage').innerHTML = 'Upload in progress, please wait...' ;
//document.getElementById('eUploadMessage').innerHTML = 'Upload in progress, please wait...' ;
document.getElementById('btnUpload').disabled = true ;
return true ;

@ -34,8 +34,8 @@ include('../../../../../../inc/global.inc.php');
</tr>
</table>
</div>
<?php
<?php
$sType = "MP3";
include(api_get_path(INCLUDE_PATH).'course_document.inc.php');

@ -42,8 +42,8 @@ FCKConfig.ProtectedSource.Add( /<script[\s\S]*?\/script>/gi ) ; // <SCRIPT> tags
// FCKConfig.ProtectedSource.Add( /<\?[\s\S]*?\?>/g ) ; // PHP style server side code <?...?>
// FCKConfig.ProtectedSource.Add( /(<asp:[^\>]+>[\s|\S]*?<\/asp:[^\>]+>)|(<asp:[^\>]+\/>)/gi ) ; // ASP.Net style tags <asp:control>
FCKConfig.AutoDetectLanguage = true ;
FCKConfig.DefaultLanguage = 'en' ;
FCKConfig.AutoDetectLanguage = false ;
FCKConfig.DefaultLanguage = 'fr' ;
FCKConfig.ContentLangDirection = 'ltr' ;
FCKConfig.EnableXHTML = true ; // Unsupported: Do not change.
@ -200,7 +200,7 @@ FCKConfig.FlashUploadAllowedExtensions = ".(swf)$" ; // empty for all
FCKConfig.FlashUploadDeniedExtensions = "" ; // empty for no one
FCKConfig.MP3Upload = true ;
FCKConfig.MP3UploadURL = FCKConfig.BasePath + 'filemanager/upload/' + FCKConfig.QuickUploadLanguage + '/upload.' + _QuickUploadLanguage + '?Type=MP3' ;
//FCKConfig.MP3UploadURL = FCKConfig.BasePath + 'filemanager/upload/' + FCKConfig.QuickUploadLanguage + '/upload.' + _QuickUploadLanguage + '?Type=MP3' ;
FCKConfig.MP3UploadAllowedExtensions = ".(mp3)$" ; // empty for all
FCKConfig.MP3UploadDeniedExtensions = "" ; // empty for no one

@ -29,7 +29,7 @@ class FCKeditor
var $Height ;
var $ToolbarSet ;
var $Value ;
var $Config ;
var $Config;
// PHP 5 Constructor (by Marcus Bointon <coolbru@users.sourceforge.net>)
function __construct( $instanceName )

@ -1,25 +1,13 @@
//FCKConfig.SmileyWindowWidth = 500 ;
//FCKConfig.SmileyWindowHeight = 500 ;
//FCKConfig.ImageUpload = false ;
FCKConfig.ToolbarSets["PluginTest"] = [
['Source','DocProps','-','Save','NewPage','Preview','-','Templates'],
['Cut','Copy','Paste','PasteText','PasteWord','-','Print','SpellCheck'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
['OrderedList','UnorderedList','-','Outdent','Indent'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink','Anchor'],
['Image','Flash','Video','MP3','Table','Rule','Smiley','SpecialChar','UniversalKey'],
['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],
'/',
['Style','FontFormat','FontName','FontSize'],
['TextColor','BGColor'],
['About'],['Attachment']
] ;
FCKConfig.IMUploadPath = '';
FCKConfig.FlashUploadPath = '' ;
FCKConfig.AudioUploadPath = '' ;
FCKConfig.UserStatus = 'teacher' ;
FCKConfig.ToolbarSets["Question"] = [
['Source','DocProps','-','Save','NewPage','Preview','-','Templates'],
['Source','DocProps','-','NewPage','Preview','-','Templates'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
['OrderedList','UnorderedList','-','Outdent','Indent'],
@ -32,26 +20,37 @@ FCKConfig.ToolbarSets["Question"] = [
] ;
FCKConfig.ToolbarSets["Middle"] = [
['FontSize','Bold','Italic','TextColor','-','OrderedList','UnorderedList','-','Rule','Link','Table','-','Image','Flash']
['FontSize','Bold','Italic','TextColor','-','OrderedList','UnorderedList','-','Rule','Link','Table','-','ImageManager','Flash']
] ;
FCKConfig.ToolbarSets["Small"] = [
['Bold','Italic','Underline','StrikeThrough','Link','Image','Flash','OrderedList','UnorderedList','Table']
['Bold','Italic','Underline','StrikeThrough','Link','ImageManager','Flash','OrderedList','UnorderedList','Table']
] ;
FCKConfig.ToolbarSets["Blog"] = [
['Bold','Italic','Underline','StrikeThrough','Link','ImageManager','OrderedList','UnorderedList','Table']
] ;
FCKConfig.ToolbarSets["Announcements"] = [
['Bold','Italic','Underline','StrikeThrough','Link','Image','OrderedList','UnorderedList','Table']
['Bold','Italic','Underline','StrikeThrough','Link','ImageManager','OrderedList','UnorderedList','Table']
] ;
FCKConfig.ToolbarSets["Full"] = [
['Save','Templates','PasteWord','Link','-','Image','Flash','Video','MP3','Table','Rule','-','Subscript', 'Superscript','-','OrderedList','UnorderedList','Outdent','Indent','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],'/',['FontName','FontSize','Bold','Italic','Underline','StrikeThrough','TextColor', 'BGColor','-','Source']
['Templates','PasteWord','Link','-','ImageManager','Flash','Video','MP3','Table','Rule','-','Subscript', 'Superscript','-','OrderedList','UnorderedList','Outdent','Indent','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],'/',['FontName','FontSize','Bold','Italic','Underline','StrikeThrough','TextColor', 'BGColor','-','Source']
] ;
FCKConfig.ToolbarSets["Comment"] = [
['Bold','Italic','Underline','StrikeThrough']
] ;
FCKConfig.ToolbarSets["ForumLight"] = [
['Bold','Italic','Underline','StrikeThrough']
] ;
FCKConfig.ToolbarSets["NewTest"] = [
['Bold','Italic','Underline','StrikeThrough','Link','ImageManager','Flash','MP3','OrderedList','UnorderedList','Table']
] ;
var sOtherPluginPath = FCKConfig.BasePath.substr(0, FCKConfig.BasePath.length - 7) + 'editor/plugins/' ;
FCKConfig.Plugins.Add("MP3", "en,it", sOtherPluginPath ) ;
FCKConfig.Plugins.Add("Video", "en,it", sOtherPluginPath ) ;

Loading…
Cancel
Save