echo "Can't create window!"; } } else { // if the token is not valid or the token is expired, it back to previous form with previous inputed data $token = $s->createToken(120, "CREATE_STD"); $o->getInputForm("new", -1, $token); $o->showWindowTable(); } break; //when user request to edit particular organization //when user request to edit particular organization case "edit": if ($o->fetchWindow($o->window_id)) { //create a new token for editing a form $token = $s->createToken(120, "CREATE_STD"); $o->modulesctrl = $ctrl->getSelectModules($o->mid, "Y"); $o->getInputForm("edit", $o->window, $token); $o->showWindowTable("WHERE window_id>0", "ORDER BY functiontype,seqno,window_name"); } else { //if can't find particular organization from database, return error message redirect_header("window.php", 3, "Some error on viewing your window data, probably database corrupted"); } break; //when user press save for change existing organization data //when user press save for change existing organization data case "update": if ($s->check(false, $token, "CREATE_STD")) { $o->updatedby = $xoopsUser->getVar('uid'); //get current uid if ($o->updateWindow()) { //if data save successfully