Skip to content

About HRCloud2 Apps

Justin Grimes edited this page Oct 28, 2018 · 16 revisions

HRCloud2 Apps

Apps, just like on any platform, are the bread-and-butter of what you do on a specific device. With HRCloud2 Apps for your server, you can serve content to your users with simply crafted PHP, JScript, and HTML. HRCloud2 can install, uninstall, display, and manage your Apps, as well as scan them for viruses to keep your server safe.

HRCloud2 allows admins to add and remove Apps from simple archive packages through the AppLauncher page with just a few clicks. Currently only ".zip" archives are supported, although admins are invited to try any archive format if the contents meet the criteria for an HRCloud2 App (see below). It also allows controlled exposure of installed Apps to specific users (Admin or non-Admin Apps supported).

As with all other HRCloud2 features and functionality, App developers are not expected to interact with a database. HRCloud2 utilizes as much "noSQL" philosophy as possible. To that end, none of the default apps require database results to function. It is highly recommended (although not required) that App developers refrain from storing App related data in the WordPress database.

What makes an App... An app?

Apps can be any language, but there are some special requirements that HRCloud2 scans for when looking for installed Apps. These requirements are in place to protect you, your server, your users, and the trust between end-users and developers.

The App Format

Requirements

The following are requirements for Apps to be properly installed and recognized.

  1. An "App" must have a .php file with the SAME EXACT name as the directory for the App. (Ex: Notes/Notes.php or Calculator/Calculator.php)

  2. The "App.php" file must contain the following lines of code, adjusted for your App....

/*//

HRCLOUD2-PLUGIN-START

App Name: text

App Version: text

App License: text

App Author: text

App Description: text

App Integration: 0 or 1

App Permission: 0 (Admin), 1 (non-Admin)

HRCLOUD2-PLUGIN-END

//*/

  1. Your App MUST be open-source, with publicly available source code, a link to the official HRCloud2 Github repo, and a license that satisfies GPLv3. (if you want to distribute it or monetize it in any way).

  2. If you choose to distribute your file to others, it MUST be distributed in an archive file containing ONLY ONE FOLDER named WITH ONLY the name of the included App. (HRCloud2 will NOT install an App with a mis-matched Directory/Naming structure)

  3. Any App documentation or Readme files MUST be included INSIDE the app folder, NOT ALONGSIDE IT in the distribution archive. This ensures the Apps directory stays clean. (as extra files add time to HRCloud2's scans)

  4. An App can contain as many files as it wants, but it CAN NOT contain an "index.html" file. Any index.html files in your App will be discarded and replaced by HRCloud2 for security. Your "App/App.php" file is effectively an App's index file. Developers can build their own libraries and include or require them into their Apps.

  5. An App can have an Icon file that is any size .png file, however it will be re-sized to 60px X 60px when displayed in the AppLauncher. App Icons must be located in the root App directory and have the EXACT SAME name as the "App.php" file and the App directory. If no App Icon is included with an App, a default App Icon is used instead.

  6. If one or more of the above conditions are not met, HRCloud2 may not detect or properly install your App.

Using Cores Within Apps

  1. HRCloud2 Apps have access to all global variables within the cores that they load. Like $date, $Time, $UserID, $CloudUsrDir, ect. To load a core use;

require('/path/to/commonCore.php');

  1. The commonCore will specify multiple stylesheets and the desired user color. To control which stylesheets are generated within an app, declare any combination of the following variables BEFORE loading commonCore.php. $noStyles $minStyles $maxStyles $allStyles

  2. You may use POST or GET inputs to specify stylesheets.

// For example:

$_POST['minStyles'] = 'checked';

// Is the same as:

$minStyles = 1;

  1. If the $minStyles or $maxStyles variables are used; commonCore should be loaded inside the < head > tags of the App's HTML code. Otherwise HTML errors may occur and stylesheets may not load properly on the client browser.

  2. commonCore automatically loads sanitizationCore. So there's no need to load both of them.

  3. cloudCore, appCore, guiCore, compatibilityCore, and securityCore automatically load commonCore. So there's no need to load commonCore if you're loading one of these.

  4. The HRCloud2 AppLauncher window is 810px wide. The HRCloud2 AppLauncher launches apps in their own scrollable 650px wide custom browser windows. You should try to optimize any Apps you develop for these resolutions. The chance always exists that a user could choose to launch the app in a full-screen window themselves. Try to develop flexible, responsive, and simple HRCloud2 Apps.