Skip to content

Latest commit

 

History

History
135 lines (81 loc) · 3.12 KB

apps_front_end_reference.rst

File metadata and controls

135 lines (81 loc) · 3.12 KB

Front End API Reference

Classes

PermissionManager

Provides access to user defined permissions for a component.

hasPermission(code)

Returns true if current user has access to specified permission code.

param code

(string) permission code

rtype

boolean

Modules

Environment (Shr.Env)

The environment module provides access to a set of internal platform functions.

Shr.Env.log(variable)

Displays information about a variable in a readable way.

param variable

(mixed) variable to format

rtype

string

Shr.Env.getBaseUrl()

Returns system base URL (e.g. https://app.subscribe-hr.com).

rtype

string

Shr.Env.getAppUrl()

Returns application URL (e.g. https://app.subscribe-hr.com/cb/app).

rtype

string

Shr.Env.getModuleUrl()

Returns current module URL (e.g. https://app.subscribe-hr.com/cb/app/hr).

rtype

string

Shr.Env.getComponentApiUrl(id, function, options)

Creates request URL for component API function.

param id

(string) component id

param function

(string) function name

param options

(object) URL parameters

rtype

string

Shr.Env.getComponentPermissions(id)

Returns component permission manager.

param id

(string) component id

rtype

PermissionManager <permission-manager>

Request (Shr.Request)

Request module provides access to information about the client request. This information can be accessed via the following methods.

Shr.Request.getParameter(name)

Extracts client parameter from POST or GET request.

param name

(string) parameter name

rtype

mixed

UI / Template (Shr.UI)

UI module provides functions to help generate user interface.

Shr.UI.createField(options)

Generates form field in the template.

param options

(arguments) series of arguments depending on the type of field being generated

rtype

string

Util (Shr.Util.Base64)

Module to encode and decode base64 strings.

Shr.Util.Base64.encode(content)

Encodes string in base64 format.

param content

(string) string to encode

rtype

string

Shr.Util.Base64.decode(content)

Decodes a base64 string.

param content

(string) string to decode

rtype

string

Util (Shr.Util.File)

Module to work with files Subscribe-HR virtual storage.

Shr.Util.File.create(name, content, isTemp)

Creates file in virtual storage.

param name

(string) file name

param content

(string) file content

param isTemp

(boolean) is file temporary (temporary files are removed after 24 hours if they are not attached to records)

rtype

string - file id

Shr.Util.File.update(id, name, content)

Update file.

param name

(string) file id

param name

(string) file name

param content

(string) file content

rtype

string - file id