if ($my_app->get_param('fs') == 'db_mysql') { $f['id'] = $my_app->get_param('opened_file_id'); $_SESSION['phpos_files_handler'][$my_app->get_param('win_id')]['file_info'] = $phposFS->get_file_info($f); } else { $_SESSION['phpos_files_handler'][$my_app->get_param('win_id')]['file_info'] = $phposFS->get_file_info($my_app->get_param('opened_file_id')); } /*.............................................. */ $_SESSION['phpos_files_handler'][$my_app->get_param('win_id')]['file_data'] = $api_file_content; $my_app->set_param('opened_file_id', null); echo "<script>phpos.windowRefresh('" . $my_app->get_param('win_id') . "',''); " . winclose(WIN_ID) . "</script>"; } /*.............................................. */ if ($my_app->get_param('api_action') == 'save') { if (globalconfig('demo_mode') != 1 || is_root()) { if ($my_app->get_param('api_dialog') !== null && $my_app->get_param('api_dialog_type') == 'save_as_file') { $file_info = $explorerAPI->get_file_info(); $data = $explorerAPI->get_cached_data_to_save(); if ($data == null) { $data = ' '; } if ($phposFS->update_file_content($file_info, $data)) { $saved_file_info['fs'] = $my_app->get_param('fs'); $explorerAPI->set_saved_file_info($file_info); $phposFS->set_api_file_id($file_info['id']); $api_file_content = $phposFS->get_file_content(); if (!is_array($_SESSION['phpos_files_handler'])) { $_SESSION['phpos_files_handler'] = array(); } $_SESSION['phpos_files_handler'][$my_app->get_param('win_id')] = array(); $_SESSION['phpos_files_handler'][$my_app->get_param('win_id')]['file_data'] = $api_file_content; $_SESSION['phpos_files_handler'][$my_app->get_param('win_id')]['file_info'] = $file_info;
//echo '<script>'.$explorerAPI->savefile_dialog().'</script>'; } if ($_POST['action'] == 'save') { $my_app->set_param('notepad', $_POST['txt']); cache_param('notepad'); $explorerAPI->set_action('save'); $explorerAPI->cache_data_to_save($_POST['txt']); $_POST['action'] = null; //echo '<script>'.$explorerAPI->savefile_dialog().'</script>'; } } else { if ($explorerAPI->data_loaded() && $_POST['action'] === null) { if ($explorerAPI->get_file_data() !== null) { $my_app->set_param('notepad', $explorerAPI->get_file_data()); } $my_app->set_param('file_info', $explorerAPI->get_file_info()); cache_param('file_info'); $explorerAPI->clear_data(); } else { if ($my_app->get_param('id_file') != null) { if ($explorerAPI->have_db_content($my_app->get_param('id_file'))) { $content = $explorerAPI->get_db_content($my_app->get_param('id_file')); $info = $explorerAPI->get_db_info($my_app->get_param('id_file')); $info['fs'] = 'db_mysql'; $my_app->set_param('file_info', $info); cache_param('file_info'); $my_app->set_param('notepad', $content); cache_param('notepad'); } } }