}
/*
**************************
*/
$apiWindow = new api_wintask();
$apiWindow->setID(filter::num($_GET['id']));
// set ID of my window
$apiWindow->getWindow();
// get Window data
define("WIN_ID", $apiWindow->getID());
// Get APP ID
$app = $apiWindow->getAPPID();
$app_name = $apiWindow->get_app_name();
if (!empty($_GET['action'])) {
    $apiWindow->setAPPID($app_name . '@' . filter::alfas($_GET['action']));
    $apiWindow->updateWindow();
}
$app_action = $apiWindow->get_app_action();
define("APP_ID", $app_name);
define("APP_ACTION", $app_action);
define("WIN_TYPE", $apiWindow->getParam('wintype'));
/*
**************************
*/
if (file_exists(PHPOS_DIR . 'plugins/window.' . $apiWindow->getParam('wintype') . 'Plugin.php')) {
    define('PHPOS_PLUGIN', true);
    if (!empty($app_name)) {
        $my_app = new phpos_app();
        $my_app->set_app_id($app_name);
        $my_app->set_app_action($app_action);
        $my_app->set_window($apiWindow);
                        $win_task->setID($_SESSION['tasks'][$key]['id']);
                        $win_task->getWindow();
                        $win_task->generateJavaScript('notags');
                        $js_code .= $win_task->getJavaScript();
                    }
                    unset($win_task);
                }
            }
            break;
        case 'update':
            if (isset($_GET['id'])) {
                $win_task = new api_wintask();
                $win_task->setID(filter::num($_GET['id']));
                $win_task->getWindow();
                $win_task->setParams($_GET['parameters_parsed']);
                $win_task->updateWindow();
                unset($win_task);
            }
            break;
        default:
            break;
    }
}
// if !action
if ($_GET['action'] != 'update') {
    $t = new phpos_tasks();
    echo $t->render_tasks();
    $js_context_menu = $t->get_jquery();
    $styles = $t->get_styles();
}
?>