public function update($title, $plugin = 'app', $app_id = null, $app_action = 'index', $icon = null, $post_app_params = null, $location = null, $id) { if (is_array($post_app_params)) { $c = count($post_app_params); if ($c != 0) { $app_params = array(); foreach ($post_app_params as $key => $value) { $app_params[] = $key . ':' . $value; } $db_app_params = implode(',', $app_params); } } global $my_user; if ($icon == 'null') { $icon = ''; } $items = array('file_title' => filter::utf($title), 'id_user' => $my_user->get_id_user(), 'plugin_id' => filter::alfas($plugin), 'app_id' => filter::alfas($app_id), 'app_action' => filter::alfas($app_action), 'modified_at' => time(), 'app_params' => $db_app_params, 'icon' => filter::fname($icon)); global $sql; $sql->cond('id_file', $id); if ($sql->update($this->db_shortcuts, $items)) { return true; } }
$_GET['id'] = filter::num($_POST['id']); } /* ************************** */ $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);
define('PHPOS_IN_LOADER', true); require_once PHPOS_DIR . 'config/core.php'; require_once PHPOS_DIR . 'config/database.php'; // Load all classes and functions require_once PHPOS_DIR . 'controllers/databaseController.php'; require_once PHPOS_DIR . 'classes/class.users.php'; require_once PHPOS_DIR . 'classes/class.phpos_config.php'; $config = new phpos_config(); //$config->get_logged_user(); $config->set_id_user(); require_once PHPOS_DIR . 'classes/class.helpers.php'; define("PHPOS_SYSTEM_LANG", cfg::get('lang')); define("PHPOS_USER_LANG", cfg::uget('lang')); require_once PHPOS_DIR . 'classes/class.api_wintask.php'; require_once PHPOS_DIR . 'classes/class.api_processes.php'; require_once PHPOS_DIR . 'classes/class.languages.php'; require_once PHPOS_DIR . 'controllers/languageController.php'; require_once PHPOS_DIR . 'controllers/helpersController.php'; require_once PHPOS_DIR . 'classes/class.phpos_tasks.php'; if (!empty($_GET['action'])) { switch (filter::alfas($_GET['action'])) { case 'update': if (globalconfig('demo_mode') != 1 || is_root()) { $config->update_user('wallpaper', filter::fname($_GET['wallpaper'])); $config->update_user('wallpaper_type', filter::fname($_GET['wallpaper_type'])); } break; default: break; } }
break; case 'create': if (!empty($_GET['title'])) { $win_task = new api_wintask(); $id = null; if ($_GET['desktop']) { $win_task->setID(1); $win_task->setParam('is_desktop', 1); $id = 1; } 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'])) {
$_SESSION['login_lang'] = $reqested_lang; } } $lang->lang_load($login_language); } else { $usr = new phpos_users(); $config = new phpos_config(); if ($usr->user_is_logged()) { $config->set_id_user($usr->get_logged_user()); } $usr->get_logged_user(); $access_level = $usr->get_access_level(); if (!empty($_GET['lang'])) { //$PHPOS_GLOBALCONFIG['lang'] = strtolower($_GET['lang']); //$PHPOS_USERCONFIG['lang'] = strtolower($_GET['lang']); $requested_lang = trim(filter::alfas(strtolower($_GET['lang']))); if ($langs->lang_exists($requested_lang)) { if ($config->get_global('demo_mode') != 1 || $access_level == 3) { $config->update_user('lang', $requested_lang); } else { $demo_lang = trim($requested_lang); $_SESSION['demo_lang'] = $demo_lang; } } } $txt = array(); if ($config->get_global('demo_mode') != 1 || $access_level == 3) { $langs->lang_load($config->get_user('lang')); } else { $langs->lang_load($_SESSION['demo_lang']); }