Following up from my original post - I think I finally found the files to hack. The hack I implemented keeps all the XOOPS editor buttons visible if you are logged in as "admin". Otherwise it strips out all the buttons and just displays the textarea box.
The file
{XOOPSBASE}/class/xoopsform/formdhtmltextarea.php
affects the News item submission form in the News module, and the Post Comment and Reply forms in the xcGallery module.
The file
{XOOPSBASE}/include/xoopscodes.php
affects the Upload Picture form in the xcGallery module and the Post form in the Forum module.
It seems very strange to me that the modules (core and add-on) are not consistent with how they implement the XOOPS default editor. I would think I should have only had to hack one file, and that would be used by all modules.
Here's the hack for function "xoopsCodeTarea" in xoopscodes.php
----------------------------------------------------
function xoopsCodeTarea($textarea_id, $cols=60, $rows=15, $suffix=null)
{
$hiddentext = isset($suffix) ? 'xoopsHiddenText'.trim($suffix) : 'xoopsHiddenText';
//Hack for url, email ...., the anchor is for having a link on [_More...]
//HACK: UNLESS USER IS ADMIN, COMMENT OUT THE SPECIAL XOOPSCODE DHTML BUTTONS BECAUSE MAKES PAGE TOO
// CLUTTERED AND TOO COMPLICATED FOR USERS WHEN ADDING COMMENTS, FORUMS, PICTURES, ETC. (3/13/06 JMS).
//GET THE USER ID OF THE LOGGED IN USER - ADDED THIS SECTION 3/13/06 JMS.
global $xoopsUser;
if ($xoopsUser) {
//User is logged in, display welcome message
$uname = $xoopsUser->getVar('uname');
//$upw = $xoopsUser->getVar('pass');
$uid = $xoopsUser->getVar('uid');
}
// ADMIN USER ID IS 1. ADDED THIS USER CHECK IF/ELSE CODE 3/13/06 JMS.
if ($uid == 1) {
...the rest of the function code goes here...
// IF USER IS NOT ADMIN, JUST SHOW TEXT AREA.
} else {
echo "
n";
//Hack smilies move for bold, italic ...
$areacontent = isset( $GLOBALS[$textarea_id] ) ? $GLOBALS[$textarea_id] : '';
echo "
n";
//Fin du hack
}
}
Use the same structure for the "render" function in formdhtmltextarea.php - the else code is listed below:
----------------------------------------------------
// IF USER IS NOT ADMIN, JUST SHOW TEXT AREA.
} else {
$ret = "
n";
$ret .= $this->_renderSmileys();
return $ret;
}