Modules File manager - happy-geeks/wiser GitHub Wiki
File manager
This module allows files to be managed in Wiser. This module consists of 3 parts: Images, Templates and Files.
Through 'Images', global images can be managed which can then be used in an application built with Wiser. This is intended for generic images such as logos etc. Things like images of products or other content are best added to a specific item (such as a product entity) itself, not through this module.
'Templates' are HTML snippets that can be inserted on a linked's page via HTML editors in Wiser. These can be uploaded into this module as HTML files.
The 'Files' section is for all other files, such as PDFs. These files can then be offered for download.
Setting up the filemanager module
Upon installation of Wiser, this module should be added immediately and set up properly. If this is not the case, or if you want to add this module to an existing Wiser install that does not yet have the module, it can be added this way:
- Open the Wiser admin module, and add a new module of type
FileManager
and give it an appropriate name and icon (document-duplicate
is used by default). - Then set the permissions so that users can actually see the module. This can also be done through the admin module.
- Open the table
wiser_item
in the database and add 3 new items there with entity typefiledirectory
. These are the root directories for the 3 items of this module. - Open the table
easy_objects
in the database and add 3 lines to it with keysW2FilesRootId
,W2ImagesRootId
andW2TemplatesRootId
. The column typer is always -1 and at value you should then enter the IDs of the items created in the previous step. - The module is now ready to use.
Usage of the filemanager module
The module is available as a stand-alone module to manage files, it is simply listed among the modules, provided you have the appropriate permissions to see it. Also, the module can be invoked via HTML editors in various modules of Wiser (such as the web page module), in which there are then buttons that open this module.
In the module there is a tree structure of create and files on the left side. Folders can be created here and files can be added under each folder. New folders/files can be added using the buttons below the tree. Folders/files are then added under the selected folder. On the right side, properties of can be entered. These are not stored in the database, they are used when you insert the file in an HTML editor.
Info for Wiser developers
To use a file manager anywhere in Wiser, in an HTML editor for example, it is best to create a popup (Kendo Window) containing the module as an iframe. This can then be used to communicate with javascript. For examples, see Windows.js in the Wiser 3 code: wiser/Windows.js, in the initialize
function at this.fileManagerWindow
.