Thanks for the private message about answering your question, that is the best way to get me to look at something seeming i am not by everyday and sometimes miss headlines.
Okey for starters you have declared your variable incorrect this part in the __construct() should be as so:
function __construct()
{
...
$this->initVar("desc", XOBJ_DTYPE_OTHER);
...
}
The project_admin.php is correct except
$myts->makeTboxData4Edit is a depreciated function and not used anymore.
Now you have to output it there is two places you will need to format it for starters you will have to format it with the $myts (textsantizer) in the toArray() of the object in myclass.php not the handler so you will need to do the following in myclass.php.
class YourmoduleMyclass()
function __construct()
{
...
$this->initVar("desc", XOBJ_DTYPE_OTHER);
...
}
function toArray() {
$GLOBALS['myts'] = MyTextSanitizer::getInstance();
$ret = parent::toArray();
$ret['desc'] = $GLOBALS['myts']->displayTarea($this->getVar('desc'), true, true, true, true, true);
return $ret;
}
...
}
This will allow you after you include header.php on the XOOPS Root to pass the variables to an associative array for the smarty template like so:
...
include_once($GLOBALS['xoops']->path('/header.php'));
...
$GLOBALS['xoopsTpl']->assign('myclass', $myclass->toArray());
...
include_once($GLOBALS['xoops']->path('/footer.php'));
...
This will make the smarty object <{$myclass.desc}> populated with the description now with the smilies and so on. The alternative is to directly populate and item where in the example of the code below will make the smarty object <{$desc}> with the same data as <{$myclass.desc}> example.
$GLOBALS['myts'] = MyTextSanitizer::getInstance();
include_once($GLOBALS['xoops']->path('/header.php'));
...
$GLOBALS['xoopsTpl']->assign('desc', $GLOBALS['myts']->displayTarea($myclass->getVar('desc'), true, true, true, true, true));
...
include_once($GLOBALS['xoops']->path('/footer.php'));
...
I hope that has answered your question, you can off course optionate the
true clauses with NoHTML, NoBR, NoSmiles and other options see the text santizer for these.
When it comes to your question, you will find the frustration is by using TXTAREA or TXTBOX for any HTML code from an editor, you will have to use other.. the following code is what you should use for your questions.
1. what function of class myts should I Use in my edit/add function
$obj = $this_handler->get($id);
$obj->setVars($_POST);
$this_handler->insert($obj)
2. what function of class myts should I Use when I building a admin form
$editor_configs["value"] = $objArray['desc'];