#48 personalize your return with xoops_confirm

XOOPS_2.2
closed
5
2012-09-25
2004-07-30
Bruno
No

In the xoops_confirm function of the
/include/function.php file, I needed to return to
another screen than the last one (history.go(-1)).

Starting from the xoops 2.07 file function.php, i added
a $return parametre in xoops_confirm function whith
indicate the return url.

Here is the function xoops_confirm code .

function xoops_confirm($hiddens, $action, $msg,
$submit='',$return="")
{
$submit = ($submit != '') ? trim($submit) : _SUBMIT;
echo '


'.$msg.'


<form method="post" action="'.$action.'">
';
foreach ($hiddens as $name => $value) {
if (is_array($value)) {
foreach ($value as $caption => $newvalue) {
echo '<input type="radio" name="'.$name.'" value="'.htmlspecialchars($newvalue).'"/> '.$caption;
}
echo '
';
} else {
echo '<input type="hidden" name="'.$name.'" value="'.htmlspecialchars($value).'"/>';
}
}
if ($return) {
$return = 'javascript:document.location =
\''.$return.'\';';
} else {
$return ="javascript:history.go(-1);";
}
echo '
<input type="submit" name="confirm_submit" value="'.$submit.'"/> <input type="button" name="confirm_back" value="'._CANCEL.'" onclick="'.$return.'"/>
</form>

';
}

Discussion

  • Bruno

    Bruno - 2004-07-30

    function.php acked from xoops 2.07

     
  • Jan Pedersen

    Jan Pedersen - 2005-04-08

    Logged In: YES
    user_id=841117

    Fixed in CVS and waiting for review before merging to the trunk.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks