/** * Return HTML string for displaying only by HTML. * The second parametor doesn't exist. */ public function getShow($key, $obj = NULL) { //function &displayTarea( $text , $html = 0 , $smiley = 1 , $xcode = 1 , $image = 1 , $br = 1 , $nbsp = 0 , $number_entity = 0 , $special_entity = 0 ) $value = null; $vars = $this->mVars[$key]; switch ($vars['data_type']) { case XOBJ_DTYPE_BOOL: case XOBJ_DTYPE_INT: case XOBJ_DTYPE_FLOAT: $value = $vars['value']; break; case XOBJ_DTYPE_STRING: $root =& XCube_Root::getSingleton(); $root->setTextFilter(Xcforum_TextSanitizer::getInstance()); // added $textFilter =& $root->getTextFilter(); $value = $textFilter->toShow($vars['value']); break; case XOBJ_DTYPE_TEXT: if (is_object($obj) && $obj instanceof Xcforum_PostsObject) { $html = $obj->getShow('html'); $smiley = $obj->getShow('smiley'); $xcode = $obj->getShow('xcode'); $image = 1; $br = $obj->getShow('br'); $nbsp = $obj->getShow('nbsp'); $number_entity = $obj->getShow('number_entity'); $special_entity = $obj->getShow('special_entity'); } else { $html = $number_entity = $special_entity = 0; $smiley = $xcode = $image = $br = $nbsp = 1; } $root =& XCube_Root::getSingleton(); $root->setTextFilter(Xcforum_TextSanitizer::getInstance()); // added $textFilter =& $root->getTextFilter(); //$value = $textFilter->toShowTarea($vars['value'], 0, 1, 1, 1, 1); $value = $textFilter->toShowTarea($vars['value'], $html, $smiley, $xcode, $image, $br, $nbsp, $number_entity, $special_entity); //$value = $textFilter->displayTarea($vars['value'], $html, $smiley, $xcode, $image, $br, $nbsp, $number_entity, $special_entity ); break; } return $value; }
public function __construct() { //$this->xoops_root_path = XOOPS_ROOT_PATH; $this->mRoot = $root = XCube_Root::getSingleton(); $this->db =& $root->mController->mDB; // module ID & name $this->mModule =& $root->mContext->mXoopsModule; //$this->mid = $this->mModule->get('mid'); //$this->mname = $this->mModule->get('name'); //$this->mydirname = $this->mModule->get('dirname'); // module config $this->mod_config =& $root->mContext->mModuleConfig; //adump($this->mod_config); // user $this->mUser =& $this->mRoot->mContext->mUser; $this->mXoopsUser =& $this->mRoot->mContext->mXoopsUser; // mytextsanitizer require_once XCFORUM_TRUST_PATH . '/class/Textsanitizer.php'; $this->myts =& Xcforum_TextSanitizer::getInstance(); }
/** * getMytextSanitizer * * @return Xcforum_TextSanitizer **/ public static function getMytextSanitizer() { // mytextsanitizer require_once XCFORUM_TRUST_PATH . '/class/Textsanitizer.php'; $myts =& Xcforum_TextSanitizer::getInstance(); return $myts; }