From 7e023d095dc8500281dd6cd0a211a832e515c879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Ra=C3=B1a?= Date: Fri, 2 Jan 2009 22:12:11 +0100 Subject: [PATCH] [svn r17509] last commit integrating ajaxfilemanager into Dokeos --- main/admin/configure_homepage.php | 341 ++++++++++-------- main/document/document.inc.php | 13 +- main/inc/lib/fckeditor/fckconfig.js | 67 +--- main/inc/lib/fckeditor/myconfig.js | 65 ++++ main/inc/lib/fckeditor/myconfig_afm.js | 153 ++++++++ .../lib/formvalidator/Element/html_editor.php | 86 ++++- main/install/dokeos_main.sql | 7 +- 7 files changed, 504 insertions(+), 228 deletions(-) create mode 100644 main/inc/lib/fckeditor/myconfig_afm.js diff --git a/main/admin/configure_homepage.php b/main/admin/configure_homepage.php index f8f575a142..9f66766fcf 100644 --- a/main/admin/configure_homepage.php +++ b/main/admin/configure_homepage.php @@ -1,6 +1,6 @@ -"),strip_tags(stripslashes($_POST['notice_text']),''))); + $notice_text=trim(str_replace(array("\r","\n"),array("","
"),strip_tags(stripslashes($_POST['notice_text']),'
'))); /*if(empty($notice_title)) { $errorMsg=get_lang('PleaseEnterNoticeTitle'); @@ -215,7 +215,7 @@ if(!empty($action)) $fp=fopen($homep.$noticef.'_'.$lang.$ext,"w"); fputs($fp,"$notice_title
\n$notice_text"); fclose($fp); - } + } break; case 'edit_news': //Filter @@ -224,12 +224,12 @@ if(!empty($action)) { $home_news=WCAG_rendering::prepareXHTML(); } else - { + { $home_news=trim(stripslashes($_POST['home_news'])); } //Write if($s_languages_news!="all"){ - + if(file_exists($homep.$newsf.'_'.$s_languages_news.$ext)){ if(is_writable($homep.$newsf.'_'.$s_languages_news.$ext)){ $fp=fopen($homep.$newsf.'_'.$s_languages_news.$ext,"w"); @@ -250,11 +250,11 @@ if(!empty($action)) else //we update all the news file { $_languages=api_get_languages(); - + foreach($_languages["name"] as $key => $value){ - + $english_name=$_languages["folder"][$key]; - + if(file_exists($homep.$newsf.'_'.$english_name.$ext)){ if(is_writable($homep.$newsf.'_'.$english_name.$ext)){ $fp=fopen($homep.$newsf.'_'.$english_name.$ext,"w"); @@ -288,7 +288,7 @@ if(!empty($action)) } $filename=trim(stripslashes($_POST['filename'])); $target_blank=$_POST['target_blank']?true:false; - + if($link_url == 'http://') { $link_url=''; @@ -297,7 +297,7 @@ if(!empty($action)) { $link_url='http://'.$link_url; } - + if(!is_writable($homep.$menuf.'_'.$lang.$ext)) { $errorMsg=get_lang('HomePageFilesNotWritable'); @@ -324,10 +324,10 @@ if(!empty($action)) { $filename=str_replace($ext,'_'.$lang.$ext,$filename); } - // Get the contents of home_menu_en.html (or active menu language + // Get the contents of home_menu_en.html (or active menu language // version) into $home_menu as an array of one entry per line $home_menu=file($homep.$menuf.'_'.$lang.$ext); - // Prepare place to insert the new link into (default is end of file) + // Prepare place to insert the new link into (default is end of file) if($insert_where < -1 || $insert_where > (sizeof($home_menu) - 1)) { $insert_where=sizeof($home_menu) - 1; @@ -337,20 +337,20 @@ if(!empty($action)) { $home_menu[$key]=trim($enreg); } - // If the given link url is empty, then replace the link url by a link to the link file created + // If the given link url is empty, then replace the link url by a link to the link file created if(empty($link_url)) { $link_url=api_get_path(WEB_PATH).'index.php?include='.urlencode($filename); // If the file doesn't exist, then create it and - // fill it with default text + // fill it with default text if(!file_exists(api_get_path(SYS_PATH).'home/'.$filename)) { $fp=@fopen(api_get_path(SYS_PATH).'home/'.$filename,'w'); - + if($fp) { fputs($fp,get_lang('MyTextHere')); - + fclose($fp); } } @@ -360,11 +360,11 @@ if(!empty($action)) if($action == 'edit_link' && !empty($link_html)) { $fp=@fopen(api_get_path(SYS_PATH).'home/'.$filename,'w'); - + if($fp) { fputs($fp,$link_html); - + fclose($fp); } } @@ -384,10 +384,10 @@ if(!empty($action)) break; } } - + $home_menu[$insert_where+1]='
  • '.$link_name.'
  • '; } - else // If the request is about a link edition, change the link + else // If the request is about a link edition, change the link { $home_menu[$link_index]='
  • '.$link_name.'
  • '; } @@ -412,7 +412,7 @@ if(!empty($action)) $fp=fopen($homep.$menuf.'_'.$lang.$ext,"w"); fputs($fp,$home_menu); fclose($fp); - } + } } break; } //end of switch($action) @@ -435,9 +435,9 @@ if(!empty($action)) // A link is deleted by getting the file into an array, removing the // link and re-writing the array to the file $link_index=intval($_GET['link_index']); - + $home_menu=file($homep.$menuf.'_'.$lang.$ext); - + foreach($home_menu as $key=>$enreg) { if($key == $link_index) @@ -449,117 +449,117 @@ if(!empty($action)) $home_menu[$key]=trim($enreg); } } - + $home_menu=implode("\n",$home_menu); - + $fp=fopen($homep.$menuf.'_'.$lang.$ext,'w'); - + fputs($fp,$home_menu); - + fclose($fp); - + header('Location: '.api_get_self()); exit(); break; case 'edit_top': // This request is only the preparation for the update of the home_top $home_top = ''; - if(is_file($homep.$topf.'_'.$lang.$ext) + if(is_file($homep.$topf.'_'.$lang.$ext) && is_readable($homep.$topf.'_'.$lang.$ext)) { - $home_top=file_get_contents($homep.$topf.'_'.$lang.$ext); + $home_top=file_get_contents($homep.$topf.'_'.$lang.$ext); } elseif(is_file($homep.$topf.$lang.$ext) && is_readable($homep.$topf.$lang.$ext)) { - $home_top=file_get_contents($homep.$topf.$lang.$ext); + $home_top=file_get_contents($homep.$topf.$lang.$ext); } else { - $errorMsg=get_lang('HomePageFilesNotReadable'); + $errorMsg=get_lang('HomePageFilesNotReadable'); } break; case 'edit_notice': // This request is only the preparation for the update of the home_notice $home_notice = ''; - if(is_file($homep.$noticef.'_'.$lang.$ext) + if(is_file($homep.$noticef.'_'.$lang.$ext) && is_readable($homep.$noticef.'_'.$lang.$ext)) { - $home_notice=file($homep.$noticef.'_'.$lang.$ext); + $home_notice=file($homep.$noticef.'_'.$lang.$ext); } elseif(is_file($homep.$noticef.$lang.$ext) && is_readable($homep.$noticef.$lang.$ext)) { - $home_notice=file($homep.$noticef.$lang.$ext); + $home_notice=file($homep.$noticef.$lang.$ext); } else { - $errorMsg=get_lang('HomePageFilesNotReadable'); - } + $errorMsg=get_lang('HomePageFilesNotReadable'); + } $notice_title=strip_tags($home_notice[0]); $notice_text=strip_tags(str_replace('
    ',"\n",$home_notice[1]),''); break; case 'edit_news': // This request is the preparation for the update of the home_news page $home_news = ''; - if(is_file($homep.$newsf.'_'.$lang.$ext) + if(is_file($homep.$newsf.'_'.$lang.$ext) && is_readable($homep.$newsf.'_'.$lang.$ext)) { - $home_news=file_get_contents($homep.$newsf.'_'.$lang.$ext); + $home_news=file_get_contents($homep.$newsf.'_'.$lang.$ext); // $home_news=file($homep.$newsf.$ext); // $home_news=implode('',$home_news); } elseif(is_file($homep.$newsf.$lang.$ext) && is_readable($homep.$newsf.$lang.$ext)) { - $home_news=file_get_contents($homep.$newsf.$lang.$ext); + $home_news=file_get_contents($homep.$newsf.$lang.$ext); } else { - $errorMsg=get_lang('HomePageFilesNotReadable'); - } + $errorMsg=get_lang('HomePageFilesNotReadable'); + } break; - case 'insert_link': + case 'insert_link': // This request is the preparation for the addition of an item in home_menu $home_menu = ''; - if(is_file($homep.$menuf.'_'.$lang.$ext) + if(is_file($homep.$menuf.'_'.$lang.$ext) && is_readable($homep.$menuf.'_'.$lang.$ext)) { - $home_menu=file($homep.$menuf.'_'.$lang.$ext); + $home_menu=file($homep.$menuf.'_'.$lang.$ext); } elseif(is_file($homep.$menuf.$lang.$ext) && is_readable($homep.$menuf.$lang.$ext)) { - $home_menu=file($homep.$menuf.$lang.$ext); + $home_menu=file($homep.$menuf.$lang.$ext); } else { - $errorMsg=get_lang('HomePageFilesNotReadable'); + $errorMsg=get_lang('HomePageFilesNotReadable'); } break; case 'edit_link': // This request is the preparation for the edition of the links array $home_menu = ''; - if(is_file($homep.$menuf.'_'.$lang.$ext) + if(is_file($homep.$menuf.'_'.$lang.$ext) && is_readable($homep.$menuf.'_'.$lang.$ext)) { - $home_menu=file($homep.$menuf.'_'.$lang.$ext); + $home_menu=file($homep.$menuf.'_'.$lang.$ext); } elseif(is_file($homep.$menuf.$lang.$ext) && is_readable($homep.$menuf.$lang.$ext)) { - $home_menu=file($homep.$menuf.$lang.$ext); + $home_menu=file($homep.$menuf.$lang.$ext); } else { - $errorMsg=get_lang('HomePageFilesNotReadable'); + $errorMsg=get_lang('HomePageFilesNotReadable'); } - $link_index=intval($_GET['link_index']); + $link_index=intval($_GET['link_index']); $target_blank=false; $link_name=''; $link_url=''; - + // For each line of the home_menu file foreach($home_menu as $key=>$enreg) { @@ -576,22 +576,22 @@ if(!empty($action)) // additional measure in case a link previously contained // unsecure tags) $link_name=strip_tags($enreg); - + // Get the contents of "href" attribute in $link_url $enreg=explode('href="',$enreg); list($link_url)=explode('"',$enreg[sizeof($enreg)-1]); - + // If the link contains the web root of this portal, then strip // it off and keep only the name of the file that needs edition if(strstr($link_url,$_configuration['root_web']) && strstr($link_url,'?include=')) { $link_url=explode('?include=',$link_url); - + $filename=$link_url[sizeof($link_url)-1]; - + if(!strstr($filename,'/') && strstr($filename,'.html')) { - // Get oonly the contents of the link file + // Get oonly the contents of the link file $link_html=file(api_get_path(SYS_PATH).'home/'.$filename); $link_html=implode('',$link_html); $link_url=''; @@ -635,7 +635,7 @@ switch($action){ ?>
    - + '; } - + ?> @@ -660,7 +660,7 @@ switch($action){
    '.get_lang('LetThoseFieldsEmptyToHideTheNotice').''; ?>
    -
    + - + '; } - ?> + ?> @@ -688,39 +688,39 @@ switch($action){ - - - - + - - @@ -728,23 +728,32 @@ switch($action){
    : () :
    :
    ? />
    ' . @@ -770,10 +779,10 @@ switch($action){ ''; } ?> - +
    - + BasePath = api_get_path(WEB_PATH) . 'main/inc/lib/fckeditor/' ; $oFCKeditor->Height = '400'; $oFCKeditor->Width = '100%'; $oFCKeditor->Value = isset($_POST['link_html'])?$_POST['link_html']:$link_html; - $oFCKeditor->Config['CustomConfigurationsPath'] = api_get_path(REL_PATH)."main/inc/lib/fckeditor/myconfig.js"; + + if(api_get_setting('advanced_filemanager')=='true') + { + $oFCKeditor->Config['CustomConfigurationsPath'] = api_get_path(REL_PATH)."main/inc/lib/fckeditor/myconfig_afm.js"; + } + else + { + $oFCKeditor->Config['CustomConfigurationsPath'] = api_get_path(REL_PATH)."main/inc/lib/fckeditor/myconfig.js"; + } + $oFCKeditor->ToolbarSet = "Small"; - + $TBL_LANGUAGES = Database::get_main_table(TABLE_MAIN_LANGUAGE); $sql="SELECT isocode FROM ".$TBL_LANGUAGES." WHERE english_name='".$_SESSION["_user"]["language"]."'"; $result_sql=api_sql_query($sql,__FILE__,__LINE__); @@ -752,16 +761,16 @@ switch($action){ $oFCKeditor->Config['DefaultLanguage'] = $isocode_language; echo $oFCKeditor->CreateHtml(); } - + ?> - +
    - + '; @@ -797,7 +806,7 @@ switch($action){ { Display::display_normal_message($errorMsg); //main API } - + if($action == 'edit_news'){ $_languages=api_get_languages(); echo get_lang("ChooseNewsLanguage")." : "; } ?> - +
    - + '; echo WCAG_Rendering::create_xhtml($open); - - } - else + + } + else { $open=str_replace('{rel_path}',api_get_path(REL_PATH),$open); $oFCKeditor = new FCKeditor($name) ; @@ -834,42 +844,87 @@ switch($action){ $oFCKeditor->Height = '400'; $oFCKeditor->Width = '100%'; $oFCKeditor->Value = $open; - $oFCKeditor->Config['CustomConfigurationsPath'] = api_get_path(REL_PATH)."main/inc/lib/fckeditor/myconfig.js"; + + if(api_get_setting('advanced_filemanager')=='true') + { + $oFCKeditor->Config['CustomConfigurationsPath'] = api_get_path(REL_PATH)."main/inc/lib/fckeditor/myconfig_afm.js"; + } + else + { + $oFCKeditor->Config['CustomConfigurationsPath'] = api_get_path(REL_PATH)."main/inc/lib/fckeditor/myconfig.js"; + } + $oFCKeditor->ToolbarSet = "Full"; - + $TBL_LANGUAGES = Database::get_main_table(TABLE_MAIN_LANGUAGE); $sql="SELECT isocode FROM ".$TBL_LANGUAGES." WHERE english_name='".$_SESSION["_user"]["language"]."'"; $result_sql=api_sql_query($sql,__FILE__,__LINE__); $isocode_language=Database::result($result_sql,0,0); $oFCKeditor->Config['DefaultLanguage'] = $isocode_language; - + //FCKeditor Configuration for the default_course_document - $default_course_path= api_get_path(REL_PATH).'main/default_course_document/'; - $upload_path = api_get_path(REL_PATH).'main/default_course_document/'; - + if(api_get_setting('advanced_filemanager')!='true') + { + $default_course_path= api_get_path(REL_PATH).'main/default_course_document/'; //TODO: Review this line for simple + $upload_path = api_get_path(REL_PATH).'main/default_course_document/'; //TODO: Review this line for simple + } + $oFCKeditor->Config['CreateDocumentDir'] = $upload_path; $oFCKeditor->Config['CreateDocumentWebDir'] = $upload_path; //for images - $oFCKeditor->Config['ImageBrowserURL'] = $oFCKeditor->BasePath . "editor/filemanager/browser/default/browser.html?Type=Images&Connector=connectors/php/connector.php&ServerPath=$default_course_path"; - $oFCKeditor->Config['ImageUploadURL'] = $oFCKeditor->BasePath . "editor/filemanager/upload/php/upload.php?Type=Images&ServerPath=$upload_path" ; - + if(api_get_setting('advanced_filemanager')=='true') + { + $oFCKeditor->Config['ImageBrowserURL'] = $oFCKeditor->BasePath . "editor/plugins/ajaxfilemanager/ajaxfilemanager.php"; + } + else + { + $oFCKeditor->Config['ImageBrowserURL'] = $oFCKeditor->BasePath . "editor/filemanager/browser/default/browser.html?Type=Images&Connector=connectors/php/connector.php&ServerPath=$default_course_path"; + $oFCKeditor->Config['ImageUploadURL'] = $oFCKeditor->BasePath . "editor/filemanager/upload/php/upload.php?Type=Images&ServerPath=$upload_path" ; + } //for flash - $oFCKeditor->Config['FlashBrowserURL'] = $oFCKeditor->BasePath . "editor/filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/php/connector.php&ServerPath=$default_course_path"; - $oFCKeditor->Config['FlashUploadURL'] = $oFCKeditor->BasePath . "editor/filemanager/upload/php/upload.php?Type=Flash&ServerPath=$upload_path" ; - + if(api_get_setting('advanced_filemanager')=='true') + { + $oFCKeditor->Config['FlashBrowserURL'] = $oFCKeditor->BasePath . "editor/plugins/ajaxfilemanager/ajaxfilemanager.php"; + } + else + { + $oFCKeditor->Config['FlashBrowserURL'] = $oFCKeditor->BasePath . "editor/filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/php/connector.php&ServerPath=$default_course_path"; + $oFCKeditor->Config['FlashUploadURL'] = $oFCKeditor->BasePath . "editor/filemanager/upload/php/upload.php?Type=Flash&ServerPath=$upload_path" ; + } //for MP3 - $oFCKeditor->Config['MP3BrowserURL'] = $oFCKeditor->BasePath . "editor/filemanager/browser/default/browser.html?Type=MP3&Connector=connectors/php/connector.php&ServerPath=$default_course_path"; - $oFCKeditor->Config['MP3UploadURL'] = $oFCKeditor->BasePath . "editor/filemanager/upload/php/upload.php?Type=MP3&ServerPath=$upload_path" ; - + if(api_get_setting('advanced_filemanager')=='true') + { + $oFCKeditor->Config['MP3BrowserURL'] = $oFCKeditor->BasePath . "editor/plugins/ajaxfilemanager/ajaxfilemanager.php"; + } + else + { + $oFCKeditor->Config['MP3BrowserURL'] = $oFCKeditor->BasePath . "editor/filemanager/browser/default/browser.html?Type=MP3&Connector=connectors/php/connector.php&ServerPath=$default_course_path"; + $oFCKeditor->Config['MP3UploadURL'] = $oFCKeditor->BasePath . "editor/filemanager/upload/php/upload.php?Type=MP3&ServerPath=$upload_path" ; + } + //for video - $oFCKeditor->Config['VideoBrowserURL'] = $oFCKeditor->BasePath . "editor/filemanager/browser/default/browser.html?Type=Video&Connector=connectors/php/connector.php&ServerPath=$default_course_path"; - $oFCKeditor->Config['VideoUploadURL'] = $oFCKeditor->BasePath . "editor/filemanager/upload/php/upload.php?Type=Video&ServerPath=$upload_path" ; - - // for flv Player (Videos) - $oFCKeditor->Config['MediaBrowserURL'] = $oFCKeditor->BasePath . "editor/filemanager/browser/default/browser.html?Type=Video/flv&Connector=connectors/php/connector.php&ServerPath=$default_course_path"; - $oFCKeditor->Config['MediaUploadURL'] = $oFCKeditor->BasePath . "editor/filemanager/upload/php/upload.php?Type=Video/flv&ServerPath=$upload_path" ; + if(api_get_setting('advanced_filemanager')=='true') + { + $oFCKeditor->Config['VideoBrowserURL'] = $oFCKeditor->BasePath . "editor/plugins/ajaxfilemanager/ajaxfilemanager.php"; + } + else + { + $oFCKeditor->Config['VideoBrowserURL'] = $oFCKeditor->BasePath . "editor/filemanager/browser/default/browser.html?Type=Video&Connector=connectors/php/connector.php&ServerPath=$default_course_path"; + $oFCKeditor->Config['VideoUploadURL'] = $oFCKeditor->BasePath . "editor/filemanager/upload/php/upload.php?Type=Video&ServerPath=$upload_path" ; + } + + // for flv Player (Videos) + if(api_get_setting('advanced_filemanager')=='true') + { + $oFCKeditor->Config['VideoBrowserURL'] = $oFCKeditor->BasePath . "editor/plugins/ajaxfilemanager/ajaxfilemanager.php"; + } + else + { + $oFCKeditor->Config['MediaBrowserURL'] = $oFCKeditor->BasePath . "editor/filemanager/browser/default/browser.html?Type=Video/flv&Connector=connectors/php/connector.php&ServerPath=$default_course_path"; + $oFCKeditor->Config['MediaUploadURL'] = $oFCKeditor->BasePath . "editor/filemanager/upload/php/upload.php?Type=Video/flv&ServerPath=$upload_path" ; + } echo $oFCKeditor->CreateHtml(); } ?> @@ -880,11 +935,11 @@ switch($action){
    - + + ?> @@ -938,7 +993,7 @@ switch($action){ foreach($Categories as $enreg) { echo ''; - } + } unset($Categories); } else @@ -946,12 +1001,12 @@ switch($action){ echo get_lang('NoCategories'); } ?> - +
    @@ -911,11 +966,11 @@ switch($action){ } else { - $home_top_temp=file_get_contents($homep.$topf.$ext); + $home_top_temp=file_get_contents($homep.$topf.$ext); } $open=str_replace('{rel_path}',api_get_path(REL_PATH),$home_top_temp); echo $open; - ?> + ?>
    '.Display::return_icon('opendir.gif').' '.$enreg['name'].'
    - @@ -994,7 +1049,7 @@ switch($action){
    - +
       - +
    - + - +
    - + '5', 'align' => 'middle')); diff --git a/main/inc/lib/fckeditor/fckconfig.js b/main/inc/lib/fckeditor/fckconfig.js index 4124831084..70199d533b 100644 --- a/main/inc/lib/fckeditor/fckconfig.js +++ b/main/inc/lib/fckeditor/fckconfig.js @@ -305,70 +305,9 @@ var _QuickUploadLanguage = 'php' ; // asp | aspx | cfm | lasso | perl | php | py // extension to use for the default File Browser (Perl uses "cgi"). var _FileBrowserExtension = _FileBrowserLanguage == 'perl' ? 'cgi' : _FileBrowserLanguage ; var _QuickUploadExtension = _QuickUploadLanguage == 'perl' ? 'cgi' : _QuickUploadLanguage ; - -FCKConfig.LinkBrowser = true ; - -// -//FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector=' + encodeURIComponent( FCKConfig.BasePath + 'filemanager/connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ) ; -// - -FCKConfig.LinkBrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; // 70% -FCKConfig.LinkBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ; // 70% - -FCKConfig.ImageBrowser = true ; - -// this is set in the main/inc/lib/formvalidator/Element/html_editor.php file very hard to find!! -//FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Image&Connector=' + encodeURIComponent( FCKConfig.BasePath + 'filemanager/connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ) ; - -FCKConfig.ImageBrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; // 70% ; -FCKConfig.ImageBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ; // 70% ; - -// Flash Browsing -FCKConfig.FlashBrowser = true ; - -// this is set in the main/inc/lib/formvalidator/Element/html_editor.php file very hard to find!! -//FCKConfig.FlashBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Flash&Connector=' + encodeURIComponent( FCKConfig.BasePath + 'filemanager/connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ) ; - -FCKConfig.FlashBrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; //70% ; -FCKConfig.FlashBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ; //70% ; - -FCKConfig.MediaBrowser = true ; -// this is set in the main/inc/lib/formvalidator/Element/html_editor.php -//FCKConfig.MediaBrowserURL = FCKConfig.FlashBrowserURL; - -FCKConfig.MediaBrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; //70% ; -FCKConfig.MediaBrowserWindowHeight= FCKConfig.ScreenHeight * 0.7 ; //70% ; - -FCKConfig.LinkUpload = true ; -FCKConfig.LinkUploadURL = FCKConfig.BasePath + 'filemanager/connectors/' + _QuickUploadLanguage + '/upload.' + _QuickUploadExtension ; -FCKConfig.LinkUploadAllowedExtensions = ".(7z|aiff|asf|avi|bmp|csv|doc|fla|flv|gif|gz|gzip|jpeg|jpg|mid|mov|mp3|mp4|mpc|mpeg|mpg|ods|odt|pdf|png|ppt|pxd|qt|ram|rar|rm|rmi|rmvb|rtf|sdc|sitd|swf|sxc|sxw|tar|tgz|tif|tiff|txt|vsd|wav|wma|wmv|xls|xml|zip)$" ; // empty for all -FCKConfig.LinkUploadDeniedExtensions = "" ; // empty for no one - -FCKConfig.ImageUpload = true ; -FCKConfig.ImageUploadURL = FCKConfig.BasePath + 'filemanager/connectors/' + _QuickUploadLanguage + '/upload.' + _QuickUploadExtension + '?Type=Image' ; -FCKConfig.ImageUploadAllowedExtensions = ".(jpg|gif|jpeg|png|bmp)$" ; // empty for all -FCKConfig.ImageUploadDeniedExtensions = "" ; // empty for no one - -// plugin added -/* -FCKConfig.FlashUpload = true ; -FCKConfig.FlashUploadURL = FCKConfig.BasePath + 'filemanager/connectors/' + _QuickUploadLanguage + '/upload.' + _QuickUploadExtension + '?Type=Flash' ; -FCKConfig.FlashUploadAllowedExtensions = ".(swf|flv)$" ; // empty for all -FCKConfig.FlashUploadDeniedExtensions = "" ; // empty for no one -*/ - -// mp3 plugin -FCKConfig.MP3Browser = true ; -// this is set in the main/inc/lib/formvalidator/Element/html_editor.php -//FCKConfig.MP3BrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=MP3&Connector=connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ; -FCKConfig.MP3BrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; //70% ; -FCKConfig.MP3BrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ; //70% ; - -FCKConfig.MP3Upload = true ; -//FCKConfig.MP3UploadURL = FCKConfig.BasePath + 'filemanager/upload/' + FCKConfig.QuickUploadLanguage + '/upload.' + _QuickUploadLanguage + '?Type=MP3' ; -FCKConfig.MP3UploadAllowedExtensions = ".(mp3)$" ; // empty for all -FCKConfig.MP3UploadDeniedExtensions = "" ; // empty for no one - +//// +// moved to myconfig.js and myconfig_afm.js +//// FCKConfig.SmileyPath = FCKConfig.BasePath + 'images/smiley/msn/' ; FCKConfig.SmileyImages = ['regular_smile.gif','sad_smile.gif','wink_smile.gif','teeth_smile.gif','confused_smile.gif','tounge_smile.gif','embaressed_smile.gif','omg_smile.gif','whatchutalkingabout_smile.gif','angry_smile.gif','angel_smile.gif','shades_smile.gif','devil_smile.gif','cry_smile.gif','lightbulb.gif','thumbs_down.gif','thumbs_up.gif','heart.gif','broken_heart.gif','kiss.gif','envelope.gif'] ; FCKConfig.SmileyColumns = 8 ; diff --git a/main/inc/lib/fckeditor/myconfig.js b/main/inc/lib/fckeditor/myconfig.js index 5bb4dad7af..8ad8fcad82 100644 --- a/main/inc/lib/fckeditor/myconfig.js +++ b/main/inc/lib/fckeditor/myconfig.js @@ -112,3 +112,68 @@ FCKConfig.Plugins.Add( 'youtube', 'en' ) ; // reduce format list FCKConfig.FontFormats = 'p;h1;h2;h3;h4;h5' ; + +/////////////////////////////////////////////////////////////////////// moved from fckconfig.js + +FCKConfig.LinkBrowser = true ; + +// +//FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector=' + encodeURIComponent( FCKConfig.BasePath + 'filemanager/connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ) ; +// + +FCKConfig.LinkBrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; // 70% +FCKConfig.LinkBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ; // 70% + +FCKConfig.ImageBrowser = true ; + +// this is set in the main/inc/lib/formvalidator/Element/html_editor.php file very hard to find!! +//FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Image&Connector=' + encodeURIComponent( FCKConfig.BasePath + 'filemanager/connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ) ; + +FCKConfig.ImageBrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; // 70% ; +FCKConfig.ImageBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ; // 70% ; + +// Flash Browsing +FCKConfig.FlashBrowser = true ; + +// this is set in the main/inc/lib/formvalidator/Element/html_editor.php file very hard to find!! +//FCKConfig.FlashBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Flash&Connector=' + encodeURIComponent( FCKConfig.BasePath + 'filemanager/connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ) ; + +FCKConfig.FlashBrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; //70% ; +FCKConfig.FlashBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ; //70% ; + +FCKConfig.MediaBrowser = true ; +// this is set in the main/inc/lib/formvalidator/Element/html_editor.php +//FCKConfig.MediaBrowserURL = FCKConfig.FlashBrowserURL; + +FCKConfig.MediaBrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; //70% ; +FCKConfig.MediaBrowserWindowHeight= FCKConfig.ScreenHeight * 0.7 ; //70% ; + +FCKConfig.LinkUpload = true ; +FCKConfig.LinkUploadURL = FCKConfig.BasePath + 'filemanager/connectors/' + _QuickUploadLanguage + '/upload.' + _QuickUploadExtension ; +FCKConfig.LinkUploadAllowedExtensions = ".(7z|aiff|asf|avi|bmp|csv|doc|fla|flv|gif|gz|gzip|jpeg|jpg|mid|mov|mp3|mp4|mpc|mpeg|mpg|ods|odt|pdf|png|ppt|pxd|qt|ram|rar|rm|rmi|rmvb|rtf|sdc|sitd|swf|sxc|sxw|tar|tgz|tif|tiff|txt|vsd|wav|wma|wmv|xls|xml|zip)$" ; // empty for all +FCKConfig.LinkUploadDeniedExtensions = "" ; // empty for no one + +FCKConfig.ImageUpload = true ; +FCKConfig.ImageUploadURL = FCKConfig.BasePath + 'filemanager/connectors/' + _QuickUploadLanguage + '/upload.' + _QuickUploadExtension + '?Type=Image' ; +FCKConfig.ImageUploadAllowedExtensions = ".(jpg|gif|jpeg|png|bmp)$" ; // empty for all +FCKConfig.ImageUploadDeniedExtensions = "" ; // empty for no one + +// plugin added +/* +FCKConfig.FlashUpload = true ; +FCKConfig.FlashUploadURL = FCKConfig.BasePath + 'filemanager/connectors/' + _QuickUploadLanguage + '/upload.' + _QuickUploadExtension + '?Type=Flash' ; +FCKConfig.FlashUploadAllowedExtensions = ".(swf|flv)$" ; // empty for all +FCKConfig.FlashUploadDeniedExtensions = "" ; // empty for no one +*/ + +// mp3 plugin +FCKConfig.MP3Browser = true ; +// this is set in the main/inc/lib/formvalidator/Element/html_editor.php +//FCKConfig.MP3BrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=MP3&Connector=connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ; +FCKConfig.MP3BrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; //70% ; +FCKConfig.MP3BrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ; //70% ; + +FCKConfig.MP3Upload = true ; +//FCKConfig.MP3UploadURL = FCKConfig.BasePath + 'filemanager/upload/' + FCKConfig.QuickUploadLanguage + '/upload.' + _QuickUploadLanguage + '?Type=MP3' ; +FCKConfig.MP3UploadAllowedExtensions = ".(mp3)$" ; // empty for all +FCKConfig.MP3UploadDeniedExtensions = "" ; // empty for no one \ No newline at end of file diff --git a/main/inc/lib/fckeditor/myconfig_afm.js b/main/inc/lib/fckeditor/myconfig_afm.js new file mode 100644 index 0000000000..bc95714557 --- /dev/null +++ b/main/inc/lib/fckeditor/myconfig_afm.js @@ -0,0 +1,153 @@ +FCKConfig.IMUploadPath = ''; +FCKConfig.FlashUploadPath = '' ; +FCKConfig.AudioUploadPath = '' ; +FCKConfig.UserStatus = 'teacher' ; + +// for ajaxfilemanager add Image to all ToolbarSets + +FCKConfig.ToolbarSets["Question"] = [ + ['Source','DocProps','-','NewPage','Preview','-'], + ['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','MP3','Table','Rule','Smiley','SpecialChar','UniversalKey'], + ['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'], + '/', + ['Style','FontFormat','FontName','FontSize'],['Attachment'] +] ; + +FCKConfig.ToolbarSets["Middle"] = [ + ['Source','FontSize','Bold','Italic','Underline','StrikeThrough','TextColor','-','OrderedList','UnorderedList','-','Rule','Link','Unlink','Table','-','Image','Flash'] +] ; + +FCKConfig.ToolbarSets["Agenda"] = [ + ['FontSize','Bold','Italic','Underline','StrikeThrough','TextColor','-','OrderedList','UnorderedList','-','Rule','Link','Unlink','Table','-','Image'] +] ; + +FCKConfig.ToolbarSets["Small"] = [ + ['Bold','Italic','Underline','StrikeThrough','Link','Unlink','Image','Flash','OrderedList','UnorderedList','Table'] +] ; + +FCKConfig.ToolbarSets["Profil"] = [ + ['Bold','Italic','Underline','StrikeThrough','Link','Unlink','OrderedList','UnorderedList'] +] ; + +FCKConfig.ToolbarSets["Blog"] = [ + ['Bold','Italic','Underline','StrikeThrough','Link','Unlink','Image','OrderedList','UnorderedList','Table'] +] ; + +FCKConfig.ToolbarSets["Announcements"] = [ + ['Bold','Italic','Underline','StrikeThrough','Link','Unlink','Image','OrderedList','UnorderedList','Table'] +] ; + +FCKConfig.ToolbarSets["Full"] = [ + ['FitWindow','PasteWord','Link','Unlink','Anchor','-','Image','flvPlayer','Flash','EmbedMovies','MP3','YouTube','Table','Rule','-','Subscript', 'Superscript','-','OrderedList','UnorderedList','Outdent','Indent','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],'/',['FontFormat','Style','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"] = [ + ['Source','Bold','Italic','Underline','StrikeThrough','Link','Unlink','Image','Flash','MP3','OrderedList','UnorderedList','Table'] +] ; + +FCKConfig.ToolbarSets["TestComment"] = [ + ['Source','FontName','FontSize','TextColor','BGColor'],['Bold','Italic','Underline','StrikeThrough','Subscript', 'Superscript','Link','Unlink','Image','Flash','MP3','OrderedList','UnorderedList','Table'] +] ; + +FCKConfig.ToolbarSets["Test"] = [ + ['Bold','Italic','Underline','StrikeThrough','Subscript','Superscript','Link','Unlink','Image','MP3','OrderedList','UnorderedList','Table'] +] ; + +FCKConfig.ToolbarSets["Survey"] = [ + ['FontSize','Bold','Italic','TextColor','-','OrderedList','UnorderedList','-','Rule','Link','Unlink','Table','-','Image','Source'] +] ; + +FCKConfig.ToolbarSets["Wiki"] = [ + ['NewPage','Templates','Save','Print','PageBreak','Preview','ShowBlocks','-','Cut','Copy','Paste','PasteText','PasteWord','-','Undo','Redo','-','SelectAll','RemoveFormat','-','Find'], + ['Wikilink','Link','Unlink','Anchor','-','Image','imgmapPopup','flvPlayer','Flash','EmbedMovies','MP3','Table','Rule','Smiley','SpecialChar','googlemaps'], + ['FontFormat','FontName','FontSize'], + ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyFull','-','OrderedList','UnorderedList','-','Outdent','Indent','-','TextColor','BGColor','Source'], + ['FitWindow'] + +] ; + +var sOtherPluginPath = FCKConfig.BasePath.substr(0, FCKConfig.BasePath.length - 7) + 'editor/plugins/' ; + +// Plugins + +//Added by Ivan Tcholakov, 18-DEC-2008. +FCKConfig.Plugins.Add( "customizations" ) ; +FCKConfig.Plugins.Add( "dragresizetable" ) ; +FCKConfig.Plugins.Add( "tablecommands" ) ; + +/* +FCKConfig.Plugins.Add("Video", "en", sOtherPluginPath ) ; +FCKConfig.Plugins.Add("Attachment", "en", sOtherPluginPath ) ;*/ + +// added by Julio Montoya +FCKConfig.Plugins.Add("MP3", "en", sOtherPluginPath ) ; +//FCKConfig.Plugins.Add('ImageManager','en') ; +FCKConfig.Plugins.Add('flvPlayer','en') ; + +FCKConfig.Plugins.Add("Flash", "en"); + +FCKConfig.Plugins.Add('fckEmbedMovies'); +FCKConfig.Plugins.Add("wikilink", "en,es", sOtherPluginPath ) ; // support to english, spanish +FCKConfig.Plugins.Add("imgmap", "en,es", sOtherPluginPath ); + +FCKConfig.Plugins.Add("googlemaps", "en,es", sOtherPluginPath ) ; +// This key is for http://localhost. You must get one for each server where you want to use the plugin, +// just get the key for free here after agreeing to the Terms of Use of the GoogleMaps API: +// http://www.google.com/apis/maps/signup.html. // If you leave an empty string then the toolbar icon won't be shown. +FCKConfig.GoogleMaps_Key = 'ABQIAAAAlXu5Pw6DFAUgqM2wQn01gxT2yXp_ZAY8_ufC3CFXhHIE1NvwkxSy5hTGQdsosYD3dz6faZHVrO-02A'; + +//Added by Ivan Tcholakov, 19-DEC-2008. +FCKConfig.Plugins.Add( 'youtube', 'en' ) ; + +// reduce format list +FCKConfig.FontFormats = 'p;h1;h2;h3;h4;h5' ; + +//////////////////////////////////////////////moved from fckconfig.js +// added by Juan Carlos Raņa + +FCKConfig.LinkBrowser = true ; +FCKConfig.LinkBrowserURL =FCKConfig.PluginsPath +'ajaxfilemanager/ajaxfilemanager.php'; +FCKConfig.LinkBrowserWindowWidth = 782; +FCKConfig.LinkBrowserWindowHeight = 440; + + +FCKConfig.ImageBrowser = true ; +FCKConfig.ImageBrowserURL =FCKConfig.PluginsPath +'ajaxfilemanager/ajaxfilemanager.php'; +FCKConfig.ImageBrowserWindowWidth = 782; +FCKConfig.ImageBrowserWindowHeight = 440; + +FCKConfig.FlashBrowser = true ; +FCKConfig.FlashBrowserURL =FCKConfig.PluginsPath +'ajaxfilemanager/ajaxfilemanager.php'; +FCKConfig.FlashBrowserWindowWidth = 782; +FCKConfig.FlashBrowserWindowHeight = 440; + + +FCKConfig.MediaBrowser = true ; +FCKConfig.MediaBrowserURL =FCKConfig.PluginsPath +'ajaxfilemanager/ajaxfilemanager.php'; +FCKConfig.MediaBrowserWindowWidth = 782; +FCKConfig.MediaBrowserWindowHeight = 440; + +// mp3 plugin +FCKConfig.MP3Browser = true ; +FCKConfig.MP3BrowserURL =FCKConfig.PluginsPath +'ajaxfilemanager/ajaxfilemanager.php'; +FCKConfig.MP3BrowserWindowWidth = 782; +FCKConfig.MP3BrowserWindowHeight = 440; + +/// +FCKConfig.LinkUpload = false ; +FCKConfig.ImageUpload = false ; +//FCKConfig.FlashUpload = false ; //See plugin +FCKConfig.MP3Upload = false ; \ No newline at end of file diff --git a/main/inc/lib/formvalidator/Element/html_editor.php b/main/inc/lib/formvalidator/Element/html_editor.php index 8e78fd2cd3..546724e781 100644 --- a/main/inc/lib/formvalidator/Element/html_editor.php +++ b/main/inc/lib/formvalidator/Element/html_editor.php @@ -1,5 +1,5 @@ fck_editor->Config['DefaultLanguage'] = $isocode_language; - $this -> fck_editor->Config['CustomConfigurationsPath'] = api_get_path(REL_PATH)."main/inc/lib/fckeditor/myconfig.js"; + $this -> fck_editor->Config['DefaultLanguage'] = $isocode_language; + if(api_get_setting('advanced_filemanager')=='true') + { + $this -> fck_editor->Config['CustomConfigurationsPath'] = api_get_path(REL_PATH)."main/inc/lib/fckeditor/myconfig_afm.js"; + } + else + { + $this -> fck_editor->Config['CustomConfigurationsPath'] = api_get_path(REL_PATH)."main/inc/lib/fckeditor/myconfig.js"; + } + $this -> fck_editor->ToolbarSet = $fck_attribute['ToolbarSet'] ; // css should be dokeos ones $this -> fck_editor->Config['EditorAreaCSS'] = $this -> fck_editor->Config['ToolbarComboPreviewCSS'] = api_get_path(REL_PATH).'main/css/'.api_get_setting('stylesheets').'/default.css'; - //FCKeditor Configuration for documents + //FCKeditor Configuration for documents (only for FCKeditor simple mode) if(isset($_SESSION['_course']) && $_SESSION['_course']['path']!='') { $upload_path = api_get_path(REL_COURSE_PATH).$_SESSION['_course']['path'].'/document/'; } else { @@ -114,28 +122,74 @@ class HTML_QuickForm_html_editor extends HTML_QuickForm_textarea //for images - $this -> fck_editor->Config['ImageBrowserURL'] = $this -> fck_editor->BasePath . "editor/filemanager/browser/default/browser.html?Type=Images&Connector=connectors/php/connector.php&ServerPath=$upload_path"; - $this -> fck_editor->Config['ImageUploadURL'] = $this -> fck_editor->BasePath . "editor/filemanager/upload/php/upload.php?Type=Images&ServerPath=$upload_path" ; + if(api_get_setting('advanced_filemanager')=='true') + { + $this -> fck_editor->Config['ImageBrowserURL'] = $this -> fck_editor->BasePath.'/editor/plugins/ajaxfilemanager/ajaxfilemanager.php'; + } + else + { + $this -> fck_editor->Config['ImageBrowserURL'] = $this -> fck_editor->BasePath . "editor/filemanager/browser/default/browser.html?Type=Images&Connector=connectors/php/connector.php&ServerPath=$upload_path"; + $this -> fck_editor->Config['ImageUploadURL'] = $this -> fck_editor->BasePath . "editor/filemanager/upload/php/upload.php?Type=Images&ServerPath=$upload_path" ; + } + //for flash - $this -> fck_editor->Config['FlashBrowserURL'] = $this -> fck_editor->BasePath . "editor/filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/php/connector.php&ServerPath=$upload_path"; - $this -> fck_editor->Config['FlashUploadURL'] = $this -> fck_editor->BasePath . "editor/filemanager/upload/php/upload.php?Type=Flash&ServerPath=$upload_path" ; + if(api_get_setting('advanced_filemanager')=='true') + { + $this -> fck_editor->Config['FlashBrowserURL'] = $this -> fck_editor->BasePath.'/editor/plugins/ajaxfilemanager/ajaxfilemanager.php'; + } + else + { + $this -> fck_editor->Config['FlashBrowserURL'] = $this -> fck_editor->BasePath . "editor/filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/php/connector.php&ServerPath=$upload_path"; + $this -> fck_editor->Config['FlashUploadURL'] = $this -> fck_editor->BasePath . "editor/filemanager/upload/php/upload.php?Type=Flash&ServerPath=$upload_path" ; + } + //for MP3 - $this -> fck_editor->Config['MP3BrowserURL'] = $this -> fck_editor->BasePath . "editor/filemanager/browser/default/browser.html?Type=MP3&Connector=connectors/php/connector.php&ServerPath=$upload_path"; - $this -> fck_editor->Config['MP3UploadURL'] = $this -> fck_editor->BasePath . "editor/filemanager/upload/php/upload.php?Type=MP3&ServerPath=$upload_path" ; + if(api_get_setting('advanced_filemanager')=='true') + { + $this -> fck_editor->Config['MP3BrowserURL'] = $this -> fck_editor->BasePath.'/editor/plugins/ajaxfilemanager/ajaxfilemanager.php'; + } + else + { + $this -> fck_editor->Config['MP3BrowserURL'] = $this -> fck_editor->BasePath . "editor/filemanager/browser/default/browser.html?Type=MP3&Connector=connectors/php/connector.php&ServerPath=$upload_path"; + $this -> fck_editor->Config['MP3UploadURL'] = $this -> fck_editor->BasePath . "editor/filemanager/upload/php/upload.php?Type=MP3&ServerPath=$upload_path" ; + } + //for Videos - $this -> fck_editor->Config['VideoBrowserURL'] = $this -> fck_editor->BasePath . "editor/filemanager/browser/default/browser.html?Type=Video&Connector=connectors/php/connector.php&ServerPath=$upload_path"; - $this -> fck_editor->Config['VideoUploadURL'] = $this -> fck_editor->BasePath . "editor/filemanager/upload/php/upload.php?Type=Video&ServerPath=$upload_path" ; + if(api_get_setting('advanced_filemanager')=='true') + { + $this -> fck_editor->Config['VideoBrowserURL'] = $this -> fck_editor->BasePath.'/editor/plugins/ajaxfilemanager/ajaxfilemanager.php'; + } + else + { + $this -> fck_editor->Config['VideoBrowserURL'] = $this -> fck_editor->BasePath . "editor/filemanager/browser/default/browser.html?Type=Video&Connector=connectors/php/connector.php&ServerPath=$upload_path"; + $this -> fck_editor->Config['VideoUploadURL'] = $this -> fck_editor->BasePath . "editor/filemanager/upload/php/upload.php?Type=Video&ServerPath=$upload_path" ; + } //link - $this -> fck_editor->Config['LinkBrowserURL'] = $this -> fck_editor->BasePath . "editor/filemanager/browser/default/browser.html?Type=Images&Connector=connectors/php/connector.php&ServerPath=$upload_path"; - + if(api_get_setting('advanced_filemanager')=='true') + { + $this -> fck_editor->Config['LinkBrowserURL'] = $this -> fck_editor->BasePath.'/editor/plugins/ajaxfilemanager/ajaxfilemanager.php'; + } + else + { + $this -> fck_editor->Config['LinkBrowserURL'] = $this -> fck_editor->BasePath . "editor/filemanager/browser/default/browser.html?Type=Images&Connector=connectors/php/connector.php&ServerPath=$upload_path"; + } + // for flv Player (Videos) - $this -> fck_editor->Config['MediaBrowserURL'] = $this -> fck_editor->BasePath . "editor/filemanager/browser/default/browser.html?Type=Video/flv&Connector=connectors/php/connector.php&ServerPath=$upload_path"; - $this -> fck_editor->Config['MediaUploadURL'] = $this -> fck_editor->BasePath . "editor/filemanager/upload/php/upload.php?Type=Video/flv&ServerPath=$upload_path" ; + if(api_get_setting('advanced_filemanager')=='true') + { + $this -> fck_editor->Config['MediaBrowserURL'] = $this -> fck_editor->BasePath.'/editor/plugins/ajaxfilemanager/ajaxfilemanager.php'; + } + else + { + $this -> fck_editor->Config['MediaBrowserURL'] = $this -> fck_editor->BasePath . "editor/filemanager/browser/default/browser.html?Type=Video/flv&Connector=connectors/php/connector.php&ServerPath=$upload_path"; + $this -> fck_editor->Config['MediaUploadURL'] = $this -> fck_editor->BasePath . "editor/filemanager/upload/php/upload.php?Type=Video/flv&ServerPath=$upload_path" ; + } } + /** * Check if the browser supports FCKeditor * diff --git a/main/install/dokeos_main.sql b/main/install/dokeos_main.sql index 6637b9bb1d..bb4befade5 100644 --- a/main/install/dokeos_main.sql +++ b/main/install/dokeos_main.sql @@ -629,7 +629,8 @@ VALUES ('allow_users_to_create_courses',NULL,'radio','Platform','true','AllowUsersToCreateCoursesTitle','AllowUsersToCreateCoursesComment',NULL,NULL), ('course_create_active_tools','survey','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Survey'), ('course_create_active_tools','glossary','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Glossary'), -('course_create_active_tools','notebook','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Notebook'); +('course_create_active_tools','notebook','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Notebook'), +('advanced_filemanager',NULL,'radio','Platform','false','AdvancedfilemanagerTitle','Advanced_filemanagerComment',NULL,NULL); UNLOCK TABLES; /*!40000 ALTER TABLE settings_current ENABLE KEYS */; @@ -780,7 +781,9 @@ VALUES ('show_session_coach', 'false', 'No'), ('allow_users_to_create_courses','true','Yes'), ('allow_users_to_create_courses','false','No'), -('breadcrumbs_course_homepage', 'session_name_and_course_title', 'SessionNameAndCourseTitle'); +('breadcrumbs_course_homepage', 'session_name_and_course_title', 'SessionNameAndCourseTitle'), +('advanced_filemanager','true','Yes'), +('advanced_filemanager','false','No'); UNLOCK TABLES; /*!40000 ALTER TABLE settings_options ENABLE KEYS */;