--- imce/_imce.module.original 2008-09-24 17:04:57.000000000 +0200 +++ imce/imce.module 2008-09-25 10:53:58.000000000 +0200 @@ -189,4 +189,36 @@ function imce_user_page_access($account, */ function imce_reg_dir($dirname) { return $dirname == '.' || (is_string($dirname) && $dirname != '' && !preg_match('@(^\s)|(^/)|(^\./)|(\s$)|(/$)|(/\.$)|(\.\.)|(//)|(\\\\)|(/\./)@', $dirname)); -} \ Kein Zeilenumbruch am Dateiende. +} + +/** + * Implementation of hook_wysiwyg_plugin(). + */ +function imce_wysiwyg_plugin($editor) { + static $access, $integrated; + + switch ($editor) { + case 'tinymce': + if (!isset($access)) { + $access = imce_access(); + } + if ($access) { + $result = array( + 'imce' => array( + 'extensions' => array('imce' => t('IMCE')), + 'url' => 'http://drupal.org/project/imce', + 'options' => array( + 'file_browser_callback' => 'imceImageBrowser', + 'inline_styles' => TRUE, + ), + 'load' => TRUE, + ), + ); + if (!isset($integrated)) { + $integrated = TRUE; + drupal_add_js("function imceImageBrowser(fid, url, type, win) {win.open(Drupal.settings.basePath +'?q=imce&app=TinyMCE|url@'+ fid, '', 'width=760,height=560,resizable=1');}", 'inline'); + } + return $result; + } + } +}