JCE editor strips all html in custom component - Joomla! Forum - community, help and support
i writing first joomla component.
i have working perfectly. 1 last roadblock save <a href tag image in display banner. cannot save html tags because html tags stripped automatically.
i have seen post @ http://forum.joomla.org/viewtopic.php?f=304&t=425264 , cannot quite understand need do. suggests use
i using hello world tutorial , it's code guide accomplish functionality. know need use part of code in above example.
this code in store function
how should implement suggested code? if need provide further information, let me know.
thank you!
i have working perfectly. 1 last roadblock save <a href tag image in display banner. cannot save html tags because html tags stripped automatically.
i have seen post @ http://forum.joomla.org/viewtopic.php?f=304&t=425264 , cannot quite understand need do. suggests use
code: select all
//...
$table->description_sample = jrequest::getvar( 'description_sample', '', 'post', 'string', jrequest_allowhtml );
$table->store();
//...
i using hello world tutorial , it's code guide accomplish functionality. know need use part of code in above example.
code: select all
$table->description_sample = jrequest::getvar( 'description_sample', '', 'post', 'string', jrequest_allowhtml );
this code in store function
code: select all
function store()
{
$row =& $this->gettable();
$data = jrequest::get( 'post' );
// bind form fields cjbanner table
if (!$row->bind($data)) {
$this->seterror($this->_db->geterrormsg());
return false;
}
// make sure cjbanner record valid
if (!$row->check()) {
$this->seterror($this->_db->geterrormsg());
return false;
}
// store banner table database
if (!$row->store()) {
$this->seterror( $row->geterrormsg() );
return false;
}
return true;
}
how should implement suggested code? if need provide further information, let me know.
thank you!
ok, i've solved in 'dirty' way. know need use getvar function, couldn't work.
if can explain me please post reply. not want leave code.
the jrequest::get cleans html, overwrite it. added following code
so store function looks this
if can explain me please post reply. not want leave code.
the jrequest::get cleans html, overwrite it. added following code
code: select all
//overwriting cleaned html banner code removed jrequest::get
$banner = $_post['banner'];
$data[banner] = $banner;
so store function looks this
code: select all
function store()
{
$row =& $this->gettable();
$data = jrequest::get( 'post' );
//overwriting cleaned html banner code removed jrequest::get
$banner = $_post['banner'];
$data[banner] = $banner;
// bind form fields cjbanner table
if (!$row->bind($data)) {
$this->seterror($this->_db->geterrormsg());
return false;
}
// make sure cjbanner record valid
if (!$row->check()) {
$this->seterror($this->_db->geterrormsg());
return false;
}
// store web link table database
if (!$row->store()) {
$this->seterror( $row->geterrormsg() );
return false;
}
return true;
}
Comments
Post a Comment