public function save_file_content($file_name, $content) { global $my_app; $explorerAPI = new phpos_explorerAPI(); $explorerAPI->set_window_id($my_app->get_param('win_id')); $app_data = $explorerAPI->get_cached_app_data(); $shortcut = new phpos_shortcuts(); $app_params['content'] = 1; if (false !== ($record_id = $shortcut->add($file_name, 'app', $app_data['app_id'], $app_data['app_action'], null, $app_params, 'db', $my_app->get_param('dir_id'), $content))) { $file['id'] = $record_id; return $this->get_file_info($file); } }
} cache_param('navigation_index'); cache_param('action_status'); cache_param('readonly'); cache_param('win_id'); cache_param('api_dialog'); cache_param('api_dialog_type'); cache_param('api_file_ext'); cache_param('explorer_save_as_filename'); cache_param('api_action'); if (!empty($_POST['explorer_save_as_filename'])) { $my_app->set_param('explorer_save_as_filename', filter::fname($_POST['explorer_save_as_filename'])); } /*.............................................. */ $explorerAPI = new phpos_explorerAPI(); $explorerAPI->set_window_id($my_app->get_param('win_id')); $my_app->set_param('api_action', $explorerAPI->get_action()); cache_param('api_action'); /*.............................................. */ if ($my_app->get_param('api_open_id') != null) { $my_app->set_param('opened_file_id', base64_decode($my_app->get_param('api_open_id'))); cache_param('opened_file_id'); } // api load file if ($my_app->get_param('api_dialog') !== null && $my_app->get_param('opened_file_id') !== null) { $phposFS->set_api_file_id($my_app->get_param('opened_file_id')); $api_file_content = $phposFS->get_file_content(); /*.............................................. */ if (!is_array($_SESSION['phpos_files_handler'])) { $_SESSION['phpos_files_handler'] = array(); }