hi everybody,
Quote:
wishcraft wrote:
Hi all how are you, this is a core issue not an issue with the application, the formselecteditor.php does not have a argument for the extra but also has a fault.. the remmed out lines are in error
To Fix this in the core here is how you do it, see it is using an none standardised form of Java which ensures you can have no use in the western world or anywhere else..
From line 51 of XOOPS_ROOT_PATH/class/xoopsform/formselecteditor.php you will have to alter it like so..function render()
{
xoops_load('XoopsEditorHandler');
$editor_handler = XoopsEditorHandler::getInstance();
$editor_handler->allowed_editors = $this->allowed_editors;
$option_select = new XoopsFormSelect("", $this->name, $this->value);
##[ Incorrect Javascript ]#################################################
// $extra = 'onchange="if(this.options[this.selectedIndex].value.length > 0 ){
// window.document.forms.'.$this->form->getName().'.submit();
// }"';
###########################################################################
// Here is the universal version of this it will work on any system as the location.href is the best method for backward compatibility..
$extra = 'onchange='location.href="'.XOOPS_URL.$_SERVER['PHP_SELF']."?";
foreach ($_GET as $key => $value)
if ($key!=$this->name)
$extra .= $key."=".$value."&";
$extra .= $this->name."="+this.options[this.selectedIndex].value'";
/// End of admendment.
$option_select->setExtra($extra);
$option_select->addOptionArray($editor_handler->getList($this->nohtml));
$this->addElement($option_select);
return parent::render();
}
there are some errors with the quotes in the code... I try this version, and it runs
function render()
{
xoops_load('XoopsEditorHandler');
$editor_handler = XoopsEditorHandler::getInstance();
$editor_handler->allowed_editors = $this->allowed_editors;
$option_select = new XoopsFormSelect("", $this->name, $this->value);
##[ Incorrect Javascript ]#################################################
// $extra = 'onchange="if(this.options[this.selectedIndex].value.length > 0 ){
// window.document.forms.'.$this->form->getName().'.submit();
// }"';
###########################################################################
// Here is the universal version of this it will work on any system as the location.href is the best method for backward compatibility..
$extra = 'onchange='location.href="'.$_SERVER['PHP_SELF'].'?';
foreach ($_GET as $key => $value)
if ($key!=$this->name)
$extra .= $key.'='.$value.'&';
$extra .= $this->name.'="+this.options[this.selectedIndex].value+"';
$extra .= '"'';
/// End of admendment.
$option_select->setExtra($extra);
$option_select->addOptionArray($editor_handler->getList($this->nohtml));
$this->addElement($option_select);
return parent::render();
}
but I don't like this solution because, in this way, I loose all just inserted values...
someone find a better solutions?
lucio.rota@gmail.com;
mobile: +39 338 9966321