ViewsAdminController
class ViewsAdminController extends BaseAdminController
The ViewsAdminController class is the controller that handles all actions of the views management interface.
These actions are:
- Creation of a view
- Adding a node (file or folder) in the view tree
- Editing text file content
- Renaming a node
- Deleting a node
- Export of a view
- Deletion of a view
Properties
ControllersHelper | $helper | from BaseAdminController | |
string | $databasesDir | from BaseAdminController | |
string | $simulatorsDir | from BaseAdminController | |
string | $publicDir | from BaseAdminController | |
string | $viewsDir | from BaseAdminController | |
private string | $root | ||
private int | $nodeNum | ||
private array|null | $nodeFile | ||
private int | $node | ||
private int | $script |
Methods
Returns a JSON response formed with the data of a form and an error message.
Entry point for the route paths begining by /admin/views
Dispatches the index action to the appropriate processing based on the value of the crud parameter.
Shows the views management interface.
Creates a views and installs its templates and assets
Drops a view and all its files
Edits a text file content
Renames a node
Deletes a node from the view tree
Adds a node into the view tree
Exports a view node
Search the directory path of the current node of the view
Recursively traverses a directory to find the directory path of the current node
Recursively constructs a tree into an array from the directories of the view tree.
Returns the language mode of a file for the javascript component CodeMirror.
Details
in BaseAdminController at line 93
protected Response
errorResponse(array $form, string $error)
Returns a JSON response formed with the data of a form and an error message.
in BaseAdminController at line 113
protected
zip(array $contents)
Zip file creation function.
Makes zip files. Derivated from PhpMyAdmin package The $contents parameter is an array of associative array where keys are : - name: name of the zip - modtime: modification time - data: data to compress
in BaseAdminController at line 188
protected int
unix2DosTime(int $unixtime)
Converts unix time to MS DOS time
at line 120
Response|RedirectResponse
indexAction(Request $request, string|null $view = null, int $node, string|null $crud = null)
Entry point for the route paths begining by /admin/views
These route paths are :
- /admin/views
- /admin/views/{view}
- /admin/views/{view}/{node}
- /admin/views/{view}/{node}/{crud}
at line 141
protected Response|RedirectResponse
runIndex(Request $request, string|null $view, string|null $crud)
Dispatches the index action to the appropriate processing based on the value of the crud parameter.
If the crud parameter contains no value, shows the views management interface.
at line 172
protected Response
showViews(Request $request, string|null $view, string|null $crud)
Shows the views management interface.
at line 254
protected RedirectResponse
doCreateView(array $form, array $files)
Creates a views and installs its templates and assets
Route path : /admin/views/new/0/docreate-view
The templates are copied into the views directory and the assets into the public directory
at line 319
protected RedirectResponse
dropView(string $view)
Drops a view and all its files
Route path : /admin/views/{view}/0/drop-view
at line 340
protected RedirectResponse
doEditNode(array $form, string $view)
Edits a text file content
Route path : /admin/views/{view}/{node}/doedit-node
at line 360
protected RedirectResponse
renameNode(array $form, string $view)
Renames a node
Route path : /admin/views/{view}/{node}/rename-node
at line 389
protected RedirectResponse
removeViewNode(string $view)
Deletes a node from the view tree
Route path : /admin/views/{view}/{node}/remove-node
at line 416
protected RedirectResponse
addViewNode(array $form, array $files, string $view)
Adds a node into the view tree
Route path : /admin/views/{view}/{node}/add-node
If the node is a folder, a directory is created. If the node is a file, the uploaded file is copied into the view tree.
at line 462
protected Response
exportViewNode(string $view)
Exports a view node
Route path : /admin/views/{view}/{node}/export
Creates a compressed file containing all the files of the node for downloading by the user.
at line 496
private string
searchNodePath(string $view)
Search the directory path of the current node of the view
at line 522
private string
findNodePath(string $dir)
Recursively traverses a directory to find the directory path of the current node
at line 553
private array
makeTree(string $dir, string $type, int $parent)
Recursively constructs a tree into an array from the directories of the view tree.
at line 602
private string
getMode(string $file)
Returns the language mode of a file for the javascript component CodeMirror.