Form

List of reserved form names.

Table of Contents
  1. Blob
  2. Data
  3. File
  4. Folder
  5. Page
  6. State

Each file editor view typically contains a main form. This form is used to modify the contents of the file when the form is submitted:

Form

Several built-in form names are available to make it easier for developers to modify data for submission by changing only the structure of the form controls. Each of these default form control names will immediately affect the submitted form data. Data submitted using form control names other than the following will still be submitted, but will be abandoned at the end of the script and will not affect the current target file or folder. Note that each of the default form names apply only to a specific type of control panel layout.

Name Description
hash Contains URL hash data.
kick Contains a URL redirect that will be opened when the submission is complete. If this value is present, the values of hash, query, stack, tab, task, and type will not be taken into account after submission.
path Contains URL path data. If this data exists, the $_['path'] value will not be used in the form action, but execution will still be carried out on the current URL. This data is usually used only to direct the submission data to another path without having to change the current location of the form. Useful for cases like uploading files by forcing a certain folder structure, for example if files need to be stored in folders named with the current year and month, for organizing files.
query Contains URL query data as array to be included in the URL after form submission if kick property is not set.
stack This is a shortcut for declaring query[stack] data.
tab This is a shortcut for declaring query[tab] data.
task The current form task type. Usually the value will follow the current $_['task'] value.
token Required. Hidden. Contains current user’s token.
type Required. Hidden. Mostly follows the current panel layout type. Used to determine the form task.

Examples:

<!-- File will be saved in `.\lot\folder-name` folder as `file-name.txt` with “asdf” text written in it -->
<form action="/panel/set/folder-name" method="post">
  <!-- This input specifies the file content (optional, default to an empty string) -->
  <input name="file[content]" type="hidden" value="asdf">
  <!-- This input specifies the file name (required) -->
  <input name="file[name]" type="hidden" value="file-name.txt">
  <!-- This input specifies the file permission (optional) -->
  <input name="file[seal]" type="hidden" value="0600">
  <!-- This input specifies the form’s task name. Task name defines how the form data is processed -->
  <input name="type" type="hidden" value="file">
</form>
<form action="/panel/get/folder-name/file-name.txt" method="post">
  <!-- File will be updated as `.\lot\folder-name\file-name.txt` -->
</form>
<form action="/panel/get/folder-name/file-name.txt" method="post">
  <!-- File will be renamed to `.\lot\folder-name\file-name-1.txt` -->
  <input name="file[name]" type="hidden" value="file-name-1.txt">
</form>
<form action="/panel/get/folder-name/file-name.txt" method="post">
  <!-- This will delete `.\lot\folder-name\file-name.txt` -->
  <input name="task" type="hidden" value="let">
</form>
<form action="/panel/get/folder-name/file-name.txt" method="post">
  <!-- This will move `.\lot\folder-name\file-name.txt` file to the `.\lot\trash\2023-10-2908-46-48` folder -->
  <input name="task" type="hidden" value="let">
  <input name="trash" type="hidden" value="2023-10-2908-46-48">
</form>
<form method="post">
  <!-- This will redirect the user to `https://example.com` after the form data is processed -->
  <input name="kick" type="hidden" value="https://example.com">
</form>
<form method="post">
  <!-- A token is required and its value uses the value of `$_['token']` variable -->
  <input name="token" type="hidden" value="<?= $_['token']; ?>">
</form>

Blob

Name Description
blobs[] Applied to <input multiple type="file">, used to upload multiple files at once.
options -

Example:

<form action="/panel/set/folder-name" enctype="multipart/form-data" method="post">
  <input name="blobs[]" type="file">
  <input name="options[zip][extract]" type="hidden">
  <input name="options[zip][keep]" type="hidden">
  <input name="task" type="hidden" value="set">
  <input name="token" type="hidden" value="…">
  <input name="type" type="hidden" value="blob">
</form>

Data

Name Description
data Applied to any form element that can hold scalar data. Contains nested data includes content, name, and seal.

Example:

<form action="/panel/set/folder-name" enctype="multipart/form-data" method="post">
  <input name="data[name]" type="text">
  <textarea name="data[content]"></textarea>
  <input name="data[seal]" type="hidden" value="0600">
  <input name="task" type="hidden" value="set">
  <input name="token" type="hidden" value="…">
  <input name="type" type="hidden" value="data">
</form>

File

Name Description
file Applied to any form element that can hold scalar data. Contains nested data includes content, name, and seal.

Example:

<form action="/panel/set/folder-name" method="post">
  <input name="file[name]" type="text">
  <textarea name="file[content]"></textarea>
  <input name="file[seal]" type="hidden" value="0640">
  <input name="task" type="hidden" value="set">
  <input name="token" type="hidden" value="…">
  <input name="type" type="hidden" value="file">
</form>

Folder

Name Description
folder Applied to any form element that can hold scalar data. Contains nested data includes name, and seal.
options -

Example:

<form action="/panel/set/folder-name" method="post">
  <input name="folder[name]" type="text">
  <input name="folder[seal]" type="hidden" value="0750">
  <input name="options[kick]" type="hidden" value="true">
  <input name="task" type="hidden" value="set">
  <input name="token" type="hidden" value="…">
  <input name="type" type="hidden" value="folder">
</form>

Page

Name Description
data Applied to any form element that can hold scalar data. Contains nested data as key-value pairs, where keys will become the page data’s file name and values will become the page data’s file content. If value is not a string, it will be converted into JSON so that it can be stored as a file content.
file Applied to any form element that can hold scalar data. Contains nested data includes content, name, and seal.
page Applied to any form element that can hold scalar data. Contains nested data as key-value pairs, where keys will become the page property’s name and values will become the page property’s values. The whole data later will be converted into a YAML string and then passed to the file[content] value, to be processed as a regular file.

Example:

<form action="/panel/set/folder-name" method="post">
  <input name="data[sort][0]" type="hidden" value="-1">
  <input name="data[sort][1]" type="hidden" value="time">
  <input name="page[name]" type="text">
  <input name="page[title]" type="text">
  <input name="page[x]" type="hidden">
  <textarea name="page[content]"></textarea>
  <input name="task" type="hidden" value="set">
  <input name="token" type="hidden" value="…">
  <input name="type" type="hidden" value="page">
</form>

State

Name Description
state Applied to any form element that can hold scalar data. Contains nested data as key-value pairs, where keys will become the state’s keys and values will become the state’s values.

Example:

<form action="/panel/get/folder-name/state-name.php" method="post">
  <input name="state[key-1]" type="text">
  <input name="state[key-2]" type="text">
  <input name="state[key-3]" type="text">
  <input name="task" type="hidden" value="get">
  <input name="token" type="hidden" value="…">
  <input name="type" type="hidden" value="state">
</form>

Form

List of reserved form names.

Function

List of functions provided by this extension.

Hook

List of hooks provided by this extension.

Object

List of objects provided by this extension.

Variable

List of variables provided by this extension.