예제 #1
0
 public function closeWindow()
 {
     // Remove from Process
     //$proc = new api_winproces;
     //$proc->removeWindowFromProcess($this->id, $this->process_id);
     $proc = new api_winprocess();
     $proc->removeWindow($this->getID(), $this->getPID());
     unset($_SESSION['tasks'][$this->id]);
 }
         }
         if ($_GET['modal']) {
             $win_task->setParam('modal', true);
         }
         $win_task->setParam('title', filter::utf($_GET['title']));
         // set title
         $win_task->setParam('wintype', filter::alfas($_GET['wintype']));
         // set wintype
         $win_task->setParams($_GET['params']);
         // parse params
         $win_task->openWindow($id);
         // create window
         $win_task->setAppParams($_GET['app_params']);
         echo $win_task->getJavaScript();
         // get JS code
         $apiProcess = new api_winprocess();
         $apiProcess->assignWindow($win_task);
         $pid = $apiProcess->newProcess();
     }
     break;
 case 'destroy':
     if (!empty($_GET['id'])) {
         $win_task = new api_wintask();
         $win_task->setID(filter::num($_GET['id']));
         $win_task->getWindow();
         //echo '<script>alert("'.$win_task->getParam('process_id').'");</script>';
         $win_task->closeWindow();
     }
     break;
 case 'sessiondestroy':
     session_destroy();
예제 #3
0
 public function removeWindow($windowID, $pid)
 {
     settype($pid, 'integer');
     settype($windowID, 'integer');
     // Create process object
     $check_process = new api_winprocess();
     $check_process->loadPID($pid);
     // load process data
     $app_id = $check_process->getAPP_ID();
     // get app_id from process
     // check for app_id in processes
     if (is_array($_SESSION['pid'][$app_id]['WIN_ID'])) {
         // if app_id exists in session
         foreach ($_SESSION['pid'][$app_id]['WIN_ID'] as $key => $value) {
             settype($key, 'integer');
             // key = array index
             settype($value, 'integer');
             // value = windowID
             // if this is my ID
             if ($value == $windowID) {
                 unset($_SESSION['pid'][$app_id]['WIN_ID'][$key]);
                 // remove from array
                 // check for other windows, if empty then remove process
                 $this->emptyProcess($pid);
                 return true;
             }
         }
     }
 }