/** * @throws DataSecuriyAccessDeniedException */ public static function browser() { global $content; $data_browser = new DataBrowser(); if ($_GET['vfolder_id']) { $virtual_folder = new VirtualFolder($_GET['vfolder_id']); $virtual_folder_id = $_GET['vfolder_id']; $folder_id = null; $data_path = new DataPath(null, $_GET['vfolder_id']); } elseif ($_GET['folder_id']) { $folder = Folder::get_instance($_GET['folder_id']); if ($folder->is_read_access() == false) { throw new DataSecurityAccessDeniedException(); } else { $virtual_folder_id = null; $folder_id = $_GET['folder_id']; $data_path = new DataPath($_GET['folder_id'], null); } } else { $data_path = new DataPath(null, null); if ($data_path->get_last_entry_type() == true) { $virtual_folder_id = $data_path->get_last_entry_id(); $folder_id = null; } else { $virtual_folder_id = null; $folder_id = $data_path->get_last_entry_id(); } } if ($folder_id == null and $virtual_folder_id == null) { $folder_id = $data_browser->get_folder_id(); $argument_array = array(); $argument_array[0][0] = "folder_id"; $argument_array[0][1] = $folder_id; $argument_array[1][0] = "virtual_folder_id"; $argument_array[1][1] = null; } $argument_array = array(); $argument_array[0][0] = "folder_id"; $argument_array[0][1] = $folder_id; $argument_array[1][0] = "virtual_folder_id"; $argument_array[1][1] = $virtual_folder_id; $list = new List_IO("DataBrowser", "ajax.php?nav=data", "list_data_browser", "count_data_browser", $argument_array, "DataBrowserAjax"); $list->add_column("", "delete_checkbox", false, "22px"); $list->add_column("", "symbol", false, "22px"); $list->add_column(Language::get_message("DataGeneralListColumnName", "general"), "name", true, "30%"); $list->add_column(Language::get_message("DataGeneralListColumnType", "general"), "type", true, null); $list->add_column(Language::get_message("DataGeneralListColumnVersion", "general"), "version", false, null); $list->add_column(Language::get_message("DataGeneralListColumnDateTime", "general"), "datetime", true, "10em"); $list->add_column(Language::get_message("DataGeneralListColumnSize", "general"), "size", true, null); $list->add_column(Language::get_message("DataGeneralListColumnOwner", "general"), "owner", true, null); $list->add_column(Language::get_message("DataGeneralListColumnPermission", "general"), "permission", false, null); $folder = Folder::get_instance($folder_id); $template = new HTMLTemplate("data/data_browser.html"); $template->set_var("title", "Data Browser"); $template->set_var("list", $list->get_list()); $template->output(); }
/** * @param string $json_argument_array * @return string * @throws FolderIDMissingException */ public static function count_data_browser($json_argument_array) { $argument_array = json_decode($json_argument_array); $folder_id = $argument_array[0][1]; $virtual_folder_id = $argument_array[1][1]; if (!$folder_id and !$virtual_folder_id) { $data_path = new DataPath(null, null); $folder_id = $data_path->get_folder_id(); $virtual_folder_id = $data_path->get_virtual_folder_id(); } if (is_numeric($folder_id) or is_numeric($virtual_folder_id)) { return DataBrowser::count_data_browser_array($folder_id, $virtual_folder_id); } else { throw new FolderIDMissingException(); } }
/** * @return string */ public static function delete_stack() { $data_path = new DataPath(null, null); return $data_path->delete_stack(true); }
public static function search() { global $user, $session; if ($_GET['nextpage']) { if ($_GET['sortvalue'] and $_GET['sortmethod']) { if ($_GET['nextpage'] == "2" and $_POST['string']) { $name = $_POST['string']; $folder_id = $session->read_value("SEARCH_FFV_FOLDER_ID"); } else { $name = $session->read_value("SEARCH_FFV_NAME"); $folder_id = $session->read_value("SEARCH_FFV_FOLDER_ID"); } } else { if ($_GET['page']) { $name = $session->read_value("SEARCH_FFV_NAME"); $folder_id = $session->read_value("SEARCH_FFV_FOLDER_ID"); } else { if ($_GET['nextpage'] == "1") { $name = $_POST['string']; if (isset($_POST['folder_id']) and is_numeric($_POST['folder_id'])) { $folder_id = $_POST['folder_id']; } else { $data_path = new DataPath(); $data_path_folder_id = $data_path->get_folder_id(); if (is_numeric($data_path_folder_id)) { $folder_id = $data_path_folder_id; } else { $folder_id = UserFolder::get_folder_by_user_id($user->get_user_id()); } } $session->delete_value("SEARCH_FFV_NAME"); $session->delete_value("SEARCH_FFV_FOLDER_ID"); } else { $name = $_POST['string']; $folder_id = $session->read_value("SEARCH_FFV_FOLDER_ID"); } } } $no_error = true; } else { $no_error = false; } if ($no_error == false) { $template = new HTMLTemplate("data/search/ffv_search.html"); $paramquery = $_GET; unset($paramquery['page']); $paramquery['nextpage'] = "1"; $params = http_build_query($paramquery, '', '&'); $template->set_var("params", $params); $template->set_var("error", ""); $template->output(); } else { if (!$folder_id) { $folder_id = $_POST['folder_id']; } $session->write_value("SEARCH_FFV_NAME", $name, true); $session->write_value("SEARCH_FFV_FOLDER_ID", $folder_id, true); $argument_array = array(); $argument_array[0][0] = "folder_id"; $argument_array[0][1] = $folder_id; $argument_array[1][0] = "name"; $argument_array[1][1] = $name; $list = new List_IO("DataSearch", "ajax.php?nav=data", "search_data_list_data", "search_data_count_data", $argument_array, "DataSearch"); $list->add_column("", "symbol", false, "16px"); $list->add_column(Language::get_message("DataGeneralListColumnName", "general"), "name", true, null); $list->add_column(Language::get_message("DataGeneralListColumnType", "general"), "type", false, null); $list->add_column(Language::get_message("DataGeneralListColumnVersion", "general"), "version", false, null); $list->add_column(Language::get_message("DataGeneralListColumnDateTime", "general"), "datetime", true, null); $list->add_column(Language::get_message("DataGeneralListColumnSize", "general"), "size", true, null); $list->add_column(Language::get_message("DataGeneralListColumnOwner", "general"), "owner", true, null); $list->add_column(Language::get_message("DataGeneralListColumnPermission", "general"), "permission", false, null); $folder = Folder::get_instance($folder_id); $template = new HTMLTemplate("data/search/ffv_search_result.html"); $paramquery = $_GET; $paramquery['nextpage'] = "2"; $params = http_build_query($paramquery, '', '&'); $template->set_var("params", $params); $template->set_var("name", $name); $template->set_var("folder", $folder->get_name()); $template->set_var("list", $list->get_list()); $template->output(); } }