$window->updatedby = $xoopsUser->getVar("uid"); switch ($action) { case "ajaxfetch": if ($window->fetchWindow($_REQUEST['window_id'])) { $window->returnWindowXML(); } else { echo "<xml><errortext>Cannot retrieve window_id:" . $_REQUEST['window_id'] . "</errortext></xml>"; } break; case "ajaxgetmodulewindows": $window->mid = $_REQUEST['mid']; echo $window->showParentWindowsTree($window->mid); break; case "ajaxdelete": $window->window_id = $_REQUEST['window_id']; if (!$window->deleteWindow($window->window_id)) { echo "Warning! Cannot delete this window due to unknown reason."; } break; case "ajaxsave": //print_r($_POST); $window->window_id = $_POST['window_id']; $window->window_name = $_POST['window_name']; if ($_POST['isactive'] == 'on') { $window->isactive = 1; } else { $window->isactive = 0; } $window->filename = $_POST['filename']; $window->table_name = $_POST['table_name']; $window->windowsetting = $_POST['windowsetting'];
if ($s->check(false, $token, "CREATE_WDW")) { $o->updatedby = $xoopsUser->getVar('uid'); //get current uid if ($o->updateWindow()) { //if data save successfully redirect_header("window.php?action=edit&window_id={$o->window_id}", $pausetime, "Your data is saved."); } else { redirect_header("window.php?action=edit&window_id={$o->window_id}", $pausetime, "Warning! Can't save the data, please make sure all value is insert properly."); } } else { redirect_header("window.php?action=edit&window_id={$o->window_id}", $pausetime, "Warning! Can't save the data, please make sure all value is insert properly."); } break; case "delete": if ($s->check(false, $token, "CREATE_WDW")) { if ($o->deleteWindow($o->window_id)) { redirect_header("window.php", $pausetime, "Data removed successfully."); } else { redirect_header("window.php?action=edit&window_id={$o->window_id}", $pausetime, "Warning! Can't delete data from database."); } } else { redirect_header("window.php?action=edit&window_id={$o->window_id}", $pausetime, "Warning! Can't delete data from database."); } break; default: $token = $s->createToken($tokenlife, "CREATE_WDW"); //$o->orgctrl=$selectionOrg->selectionOrg($o->createdby,0); $o->getInputForm("new", 0, $token); $o->showWindowTable("WHERE window_id>0", "ORDER BY functiontype,seqno,window_name"); break; }