object gets missing

object gets missing

by Peter Ritter -
Number of replies: 0
Hello there,

I really need some help with the function notice_yesno defined in weblib.php.
I am implementing a new activity-module. And when adding this module using the function mymodule_add_instance($mymodule, $showmessage=true) I need a message to be shown with a yes- and a no-option. When the users chosses the yes-option, I actually want the function to go on working.
But if I don't stop the script using exit, it would go on working not waiting for the users entry.
I added the following code into my add_instance function:

if($showmessage){
$yeslink = $CFG->wwwroot.'/mod/mymodule/lib.php';
$yesoptions = array('showmessage'=>'no', 'sesskey'=>sesskey(), 'mumiemodule'=>$mymodule);
$nolink = $CFG->wwwroot.'/course/modedit.php?add=mymodule&type=&course=8&section=0&return=0';
print_header();
print_heading(get_string('warning', 'mymodule'));
notice_yesno(get_string('warning', 'mymodule'), $yeslink, $nolink, $yesoptions);
print_footer($COURSE);
exit;
}

So as you can see I try to send the whole information to the same script again. But unfortunately it is not possible to send the mymodule-object back using a post-method.
It would be perfect, if i could add a function-call to my yes-option instead of a link. Is this possible???
Or do you have any other ideas how I could solve this problem?
I am really stuck! I thought this would no big problem. But I lost the whole last week working on this.
Please anybody help!

Peter
Average of ratings: -