uPHP Blockly Development

Blockly is a visual programming editor developed by Google. We have integrated blockly with all the uPHP functions to make programming easier. Blockly scripts can be automatically hooked to various parts of the system from the interface.

Visual uPHP scripts need to be generated or run in order for the uPHP code to be created. Visual uPHP scripts have the extension .cgx whereas generated scripts will have a .cgi extension.

To access the editor, go to File Manager and click the New Script button in the folder you wish to create the script.

The visual editor is visible in the Designer tab. You can use the left navigation to drag code blocks onto the editor area and link them up accordingly.

To change the file name or save as a different name, edit the File box at the top of the page and hit Save. To generate the .cgi file, click Generate. If you wish to generate and preview the page, click Run.

If the script is to be inserted into the WattmonOS system, select the appropriate Hook in the drop down. This could be any of the following:

Hook Description
Run once at boot This script will be run one time upon system reboot
Run once per second The script will be run once a second
Run once per minute The script will be run once a minute
In Ajax Generation The script will be run while generating the ajax data for the home page. The format for this is very specific. Read up on Ajax Generation here.
In Home Page The script will be included as a widget in the home page. Customize the options by clicking the Options button. You can output any standard HTML or Javascript here.