function folder_process_session_request() { if (!empty($_REQUEST["find"])) { unset($_REQUEST["item"]); unset($_REQUEST["folders"]); $result = folder_process_session_find((array) $_REQUEST["find"]); $_REQUEST = array_merge($_REQUEST, $result); if (empty($result) and empty($_REQUEST["iframe"])) { $params = implode(", ", (array) $_REQUEST["find"]); $params = str_replace(array("|", utf8_encode("¦"), "¦", "~"), array(", ", "", "", " like "), $params); sys_warning("{t}Item not found.{/t} {t}Parameters{/t}: " . $params, true); } } if (isset($_REQUEST["fschema"])) { $row = db_select_first("simple_sys_tree", "id", array("ftype=@ftype@", $_SESSION["permission_sql_read"]), "lft asc", array("ftype" => str_replace("simple_", "", $_REQUEST["fschema"]))); if (!isset($row["id"])) { sys_warning("{t}Item not found.{/t} (" . $_REQUEST["fschema"] . ")"); } else { $_REQUEST["folder"] = $row["id"]; } } if (!empty($_REQUEST["folder2"]) and !empty($_REQUEST["view2"]) and empty($_REQUEST["folder"])) { if (!isset($_REQUEST["folder"])) { $_REQUEST["folder"] = $_REQUEST["folder2"]; } if (!isset($_REQUEST["view"])) { $_REQUEST["view"] = $_REQUEST["view2"]; } } if (!isset($_SESSION["treevisible"])) { $_SESSION["treevisible"] = true; } if (!isset($_SESSION["hidedata"])) { $_SESSION["hidedata"] = false; } if (isset($_REQUEST["tree"])) { if ($_REQUEST["tree"] == "minimize") { $_SESSION["treevisible"] = false; } if ($_REQUEST["tree"] == "maximize") { $_SESSION["treevisible"] = true; } } if (isset($_REQUEST["hidedata"])) { $_SESSION["hidedata"] = !$_SESSION["hidedata"]; } if (!empty($_REQUEST["folder"])) { $folders = folders_from_path($_REQUEST["folder"]); $_SESSION["folder"] = $folders[0]; if (count($folders) > 1) { $_REQUEST["folders"] = $folders; } } if (isset($_REQUEST["tree"]) and $_REQUEST["tree"] == "closeall") { $_SESSION["folder_states"] = array(); } if (!empty($_REQUEST["view"]) and !empty($_SESSION["folder"])) { $_SESSION["view"]["_" . $_SESSION["folder"]] = $_REQUEST["view"]; } if (!empty($_REQUEST["item"]) and count($_REQUEST["item"]) == 1 and isset($_REQUEST["item"][0]) and $_REQUEST["item"][0] == 0) { unset($_REQUEST["item"]); } }
/** * Returns the folder IDs from a folder path * * Examples: * Path lookup: /Workspace/*\/ => array(101, 301, ...) * Path + module lookup: /Workspace/Personal folders/*\/!tasks => array(6201, 6601, ...) * Anchor + path lookup: ^home_username1/*\/ => /Workspace/Personal folders/username1/*\/ => array(11101, 11301, ...) * * @param string $path Folder string (/Workspace/.../) * @return array(int) Folder IDs or array(0) if not found */ static function folders_from_path($path) { return folders_from_path($path); }