Here you are a way to modulize image manager.
I think this is the first step to realize a new and improved image manager for xoops...
NOTE: This is a skeleton of an alfa version of a module... don't worry if it isn't complete.

Try this hack in XOOPS 233,it runs also in XOOPS 240b... but step 2 is a little different...
1. add a config in "xoops_data/config/xoopsconfig.php"
<?php return array( /**#@+ * Extended HTML editor for {@link XoopsFormDhtmlTextArea} * * <p>If an extended HTML editor is set, the renderer will be replaced by the specified editor, usually a visual or WYSIWYG editor.</p> * * <ul>Developer and user guide: * <li><ul>For run-time settings per call * <li>To use an editor pre-configured by {@link XoopsEditor}, e.g. 'fckeditor': <code>$options['editor'] = 'fckeditor';</code></li> * <li>To use a custom editor, e.g. 'MyEditor' class located in "/modules/myeditor/myeditor.php": <code>$options['editor'] = array('MyEditor', XOOPS_ROOT_PATH . "/modules/myeditor/myeditor.php");</code></li> * </ul></li> * <li><ul>For pre-configured settings, which will force to use a editor if no specific editor is set for call * <li><ul>Set up custom configs: in XOOPS_VAR_PATH . '/configs/xoopsconfig.php' set a editor as default, e.g. * <li>a pre-configured editor 'fckeditor': <code>return array('editor' => 'fckeditor');</code></li> * <li>a custom editor 'MyEditor' class located in "/modules/myeditor/myeditor.php": <code>return array('editor' => array('MyEditor', XOOPS_ROOT_PATH . "/modules/myeditor/myeditor.php");</code></li> * </ul></li> * <li>To disable the default editor, in XOOPS_VAR_PATH . '/configs/xoopsconfig.php': <code>return array();</code></li> * <li>To disable the default editor for a specific call: <code>$options['editor'] = 'dhtmltextarea';</code></li> * </ul></li> * </ul> */ //"editor" => "fckeditor", //"editor" => "dhtmlext", /**#@-*/ /**#@+ * Debug level for XOOPS * * Note: temporary solution only. Will be re-designed in XOOPS 3.0 * * <ul>Displaying debug information to different level(s) of users: * <li> 0 - To all users</li> * <li> 1 - To members</li> * <li> 2 - To admins only</li> * </ul> */ "debugLevel" => 1, /**#@-*/ /**#@+ * Imagemanager // hack * * <p>Relative path to default/custom imagemanager</p> */ //"Imagemanager" => "/imagemanager.php", // XOOPS default image manager "Imagemanager" => "/modules/imagemanager/imagemanager.php", /**#@-*/ ); ?>
2. modify funcion "codeIcon" in "/class/xoopsform/formdhtmltextarea.php"
le="color: #000000"><?php function codeIcon() { // get imagemanager form xoopsconfig.php $configs =@ include $GLOBALS['xoops']->path( "var/configs/xoopsconfig.php" ); // hack $Imagemanager = @$configs['Imagemanager']; // hack $textarea_id = $this->getName(); $code = "<a name='moresmiley'></a>" . "<img src='" . XOOPS_URL . "/images/url.gif' alt='" . _XOOPS_FORM_ALT_URL . "' title='" . _XOOPS_FORM_ALT_URL . "' onclick='xoopsCodeUrl("{$textarea_id}", "" . htmlspecialchars(_ENTERURL, ENT_QUOTES) . "", "" . htmlspecialchars(_ENTERWEBTITLE, ENT_QUOTES) . "");' onmouseover='style.cursor="hand"'/> " . "<img src='" . XOOPS_URL . "/images/email.gif' alt='" . _XOOPS_FORM_ALT_EMAIL . "' title='" . _XOOPS_FORM_ALT_EMAIL . "' onclick='xoopsCodeEmail("{$textarea_id}", "" . htmlspecialchars(_ENTEREMAIL, ENT_QUOTES) . "");' onmouseover='style.cursor="hand"'/> " . "<img src='" . XOOPS_URL . "/images/imgsrc.gif' alt='" . _XOOPS_FORM_ALT_IMG . "' title='" . _XOOPS_FORM_ALT_IMG . "' onclick='xoopsCodeImg("{$textarea_id}", "" . htmlspecialchars(_ENTERIMGURL, ENT_QUOTES) . "", "" . htmlspecialchars(_ENTERIMGPOS, ENT_QUOTES) . "", "" . htmlspecialchars(_IMGPOSRORL, ENT_QUOTES) . "", "" . htmlspecialchars(_ERRORIMGPOS, ENT_QUOTES) . "", "" . htmlspecialchars(_XOOPS_FORM_ALT_ENTERWIDTH, ENT_QUOTES) . "");' onmouseover='style.cursor="hand"'/> " . //"<img src='" . XOOPS_URL . "/images/image.gif' alt='" . _XOOPS_FORM_ALT_IMAGE . "' title='" . _XOOPS_FORM_ALT_IMAGE . "' onclick='openWithSelfMain("" . XOOPS_URL . "/imagemanager.php/?target={$textarea_id}","imgmanager",400,430);' onmouseover='style.cursor="hand"'/> " . // original "<img src='" . XOOPS_URL . "/images/image.gif' alt='" . _XOOPS_FORM_ALT_IMAGE . "' title='" . _XOOPS_FORM_ALT_IMAGE . "' onclick='openWithSelfMain("" . XOOPS_URL . $Imagemanager . "/?target={$textarea_id}","imgmanager",400,430);' onmouseover='style.cursor="hand"'/> " . // hack "<img src='" . XOOPS_URL . "/images/smiley.gif' alt='" . _XOOPS_FORM_ALT_SMILEY . "' title='" . _XOOPS_FORM_ALT_SMILEY . "' onclick='openWithSelfMain("" . XOOPS_URL . "/misc.php?action=showpopups&type=smilies&target={$textarea_id}","smilies",300,475);' onmouseover='style.cursor="hand"'/> "; $myts =& MyTextSanitizer::getInstance(); $extensions = array_filter($myts->config['extensions']); foreach (array_keys($extensions) as $key) { $extension = $myts->loadExtension($key); @list($encode, $js) = $extension->encode($textarea_id); if (empty($encode)) continue; $code .= $encode; if (!empty($js)) { $this->js .= $js; } } $code .= "<img src='" . XOOPS_URL . "/images/code.gif' alt='" . _XOOPS_FORM_ALT_CODE . "' title='" . _XOOPS_FORM_ALT_CODE . "' onclick='xoopsCodeCode("{$textarea_id}", "" . htmlspecialchars(_ENTERCODE, ENT_QUOTES) . "");' onmouseover='style.cursor="hand"'/> " . "<img src='" . XOOPS_URL . "/images/quote.gif' alt='" . _XOOPS_FORM_ALT_QUOTE . "' title='" . _XOOPS_FORM_ALT_QUOTE . "' onclick='xoopsCodeQuote("{$textarea_id}", "" . htmlspecialchars(_ENTERQUOTE, ENT_QUOTES) . "");' onmouseover='style.cursor="hand"'/>"; return $code; }
3. download here
http://luciorota.altervista.org/xoops/modules/wfdownloads/singlefile.php?cid=3&lid=14 and install the MODULE imagemanager (tnx to XGarb)
4. try it!
A QUESTION TO ANY XOOPS GURUWhat about this hack... might it be the right way?
Tell me if i'm loosing my time...
TNX