Global

Members

_theme_autocomplete_input_selector

Autocomplete global variables. Used to hold onto various global variables needed for an autocomplete.
Source:

Methods

_drupalgap_back()

An internal function used to change the page to the previous page.
Source:

_drupalgap_back_exit(button)

An internal function used to exit the app when the back button is clicked.
Parameters:
Name Type Description
button Number Which button was pressed.
Source:

_drupalgap_deviceready()

Implements PhoneGap's deviceready().
Source:

_drupalgap_deviceready_options() → {Object}

Builds the default system connect options.
Source:
Returns:
Type
Object

_drupalgap_entity_page_container(entity_type, entity_id, mode) → {Object}

Given an entity type, an entity id and a mode, this will return a render object for the entity's page container.
Parameters:
Name Type Description
entity_type String
entity_id Number
mode String
Source:
Returns:
Type
Object

_drupalgap_entity_page_container_id(entity_type, entity_id, mode) → {String}

Given an entity type, an entity id, and a mode, this will return the unique id to be used for the entity's page container.
Parameters:
Name Type Description
entity_type String
entity_id Number
mode String
Source:
Returns:
Type
String

_drupalgap_entity_page_container_inject(entity_type, entity_id, mode, build)

Given an entity type, id, mode and page build, this will render the page build and inject it into the container on the page.
Parameters:
Name Type Description
entity_type String
entity_id Number
mode String
build Object
Source:

_drupalgap_form_add_another_item(form_id, name, delta)

Internal function used to dynamically add another element item to a form for unlimited value fields.
Parameters:
Name Type Description
form_id String
name String
delta Number
Source:

_drupalgap_form_element_items_widget_arguments(form, form_state, element, language, delta) → {Array}

Parameters:
Name Type Description
form Object
form_state Object
element Object
language String
delta Number
Source:
Returns:
Type
Array

_drupalgap_form_render_element(form, element) → {String}

Renders an input element for a form.
Parameters:
Name Type Description
form Object
element Object
Source:
Returns:
Type
String

_drupalgap_form_render_element_item(form, element, variables, item) → {*}

Given a form, an element, the variables for a theme function, and the element item, this will return the html rendering of the element item.
Parameters:
Name Type Description
form Object
element Object
variables Object
item Object
Source:
Returns:
Type
*

_drupalgap_form_render_elements(form) → {String}

Renders all the input elements in a form.
Parameters:
Name Type Description
form Object
Source:
Returns:
Type
String

_drupalgap_form_state_values_assemble_get_element_value(id, element) → {String|Number}

Parameters:
Name Type Description
id String
element Object
Source:
Returns:
Type
String | Number

_drupalgap_form_submit(form_id) → {*}

Handles a drupalgap form's submit button click.
Parameters:
Name Type Description
form_id String
Source:
Returns:
Type
*

_drupalgap_form_submit_response_errors(form, form_state, xhr, status, message) → {String|Boolean}

When a service call results in an error, this function is used to extract the request's response form errors into a human readble string and returns it. If there are no form errors, it will return false.
Parameters:
Name Type Description
form Object
form_state Object
xhr Object
status String
message String
Source:
Returns:
Type
String | Boolean

_drupalgap_form_validate(form, form_state)

An internal function used by the DrupalGap forms api to validate all the elements on a form.
Parameters:
Name Type Description
form Object
form_state Object
Source:

_drupalgap_goto_prepare_path(path) → {String}

An internal function used to prepare the path for menu routing. An optional second parameter (boolean) may be passed in, and if it is set to true it will process any _GET query string parameters.
Parameters:
Name Type Description
path String
Source:
Returns:
Type
String

_drupalgap_page_title_pageshow(page_arguments)

An interal callback used to handle the setting of the page title during the pageshow event.
Parameters:
Name Type Description
page_arguments *
Source:

_drupalgap_page_title_pageshow_success(title)

An internal function used to set the page title when the page title callback function is successful.
Parameters:
Name Type Description
title String
Source:

_drupalgap_region_render_zone(zone, region, current_path) → {String}

Renders the given zone (_prefix, _suffix) if any for a region.
Parameters:
Name Type Description
zone String
region Object
current_path String
Source:
Returns:
Type
String

_entity_index_local_storage_delete(path)

An internal function used to delete an entity_index from local storage.
Parameters:
Name Type Description
path String
Source:

_entity_index_local_storage_load(entity_type, path, options) → {Object}

An internal function used by entity_index() to attempt loading a specific query's results from local storage.
Parameters:
Name Type Description
entity_type String
path String The URL path used by entity_index(), used as the cache key.
options Object
Source:
Returns:
Type
Object

_entity_index_local_storage_save(entity_type, path, result)

An internal function used to save an entity_index result entity ids to local storage.
Parameters:
Name Type Description
entity_type String
path String
result Object
Source:

_entity_local_storage_delete(entity_type, entity_id)

An internal function used to delete an entity from local storage.
Parameters:
Name Type Description
entity_type String
entity_id Number
Source:

_entity_local_storage_load(entity_type, entity_id, options) → {Object}

An internal function used by entity_load() to attempt loading an entity from local storage.
Parameters:
Name Type Description
entity_type String
entity_id Number
options Object
Source:
Returns:
Type
Object

_entity_local_storage_save(entity_type, entity_id, entity)

An internal function used to save an entity to local storage.
Parameters:
Name Type Description
entity_type String
entity_id Number
entity Object
Source:

_entity_set_expiration_time(entity_type, entity)

An internal function used to set the expiration time onto a given entity.
Parameters:
Name Type Description
entity_type String The entity type.
entity Object The entity object.
Source:

_entity_wrap(entity_type, entity) → {String}

Wraps an entity in a JSON object, keyed by its type.
Parameters:
Name Type Description
entity_type String
entity Object
Source:
Returns:
Type
String

_GET() → {String|NULL}

This will return the query string arguments for the page. You may optionally pass in a key to get its value, pass in a key then a value to set the key equal to the value, and you may optionally pass in a third argument to use a specific page id, otherwise DrupalGap will automatically use the appropriate page id.
Source:
Returns:
Type
String | NULL

_image_field_form_process(form, form_state, options)

An internal function used to upload images to the server, retreive their file id and then populate the corresponding form element's value with the file id.
Parameters:
Name Type Description
form Object
form_state Object
options Object
Source:

_image_field_widget_form_remove_image()

On an entity edit form, this removes an image file from the server, then from the form elements and user interface.
Source:

_image_phonegap_camera_getPicture_success(options)

The success callback function used when handling PhoneGap's camera getPicture() call.
Parameters:
Name Type Description
options Object
Source:

_services_entity_queue_init()

Readies the Drupal.services_queue object with Services Entity configuration.
Source:

_services_queue_add_to_queue(service, resource, entity_id)

Adds an entity id to the service resource queue.
Parameters:
Name Type Description
service String
resource String
entity_id Number
Source:

_services_queue_already_queued(service, resource, entity_id, callback_type) → {Boolean}

Returns true if the entity_id is already queued for the service resource, false otherwise.
Parameters:
Name Type Description
service String
resource String
entity_id Number
callback_type String
Source:
Returns:
Type
Boolean

_services_queue_callback_add(service, resource, entity_id, callback_type, callback)

Adds a callback function to the service resource queue.
Parameters:
Name Type Description
service String
resource String
entity_id Number
callback_type String
callback function
Source:

_services_queue_callback_count(service, resource, entity_id, callback_type) → {Number}

Returns the number of callback functions for the service resource queue.
Parameters:
Name Type Description
service String
resource String
entity_id Number
callback_type String
Source:
Returns:
Type
Number

_services_queue_remove_from_queue(service, resource, entity_id)

Removes an entity id from the service resource queue.
Parameters:
Name Type Description
service String
resource String
entity_id Number
Source:

_taxonomy_field_widget_form_autocomplete(id, vid, list, e, data)

Handles the remote data fetching for taxonomy term reference autocomplete tagging widget.
Parameters:
Name Type Description
id String The id of the hidden input that will hold the term id.
vid Number
list Object The unordered list that displays the terms.
e Object
data Object
Source:

_taxonomy_field_widget_form_click(id, list_id, item)

Handles clicks on taxonomy term reference autocomplete widgets.
Parameters:
Name Type Description
id String The id of the hidden input that will hold the term name.
list_id String The id of the list that holds the terms.
item Object The list item that was just clicked.
Source:

_theme_autocomplete(list, e, data, autocomplete_id)

An internal function used to handle remote data for an autocomplete.
Parameters:
Name Type Description
list Object The unordered list that displays the items.
e Object
data Object
autocomplete_id String
Source:

_theme_autocomplete_click(id, item, autocomplete_id)

An internal function used to handle clicks on items in autocomplete results.
Parameters:
Name Type Description
id String The id of the hidden input that holds the value.
item Object The list item anchor that was just clicked.
autocomplete_id String
Source:

_theme_autocomplete_prepare_items(variables) → {*}

An internal function used to prepare the items for an autocomplete list.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
*

_theme_autocomplete_set_default_value_label(options)

Used to set a default value in an autocomplete's text field.
Parameters:
Name Type Description
options Object
Source:
An internal function used to handle clicks on pager links.
Parameters:
Name Type Description
variables Object
Source:
An internal function used to generate the onclick handler JS for a pager link.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

_theme_taxonomy_term_reference_load_items(options)

An internal function used to load the taxonomy terms from a term reference field and populate them into select list identified by options.widget_id.
Parameters:
Name Type Description
options Object
Source:

_theme_taxonomy_term_reference_onchange(input, id)

An internal function used by a taxonomy term reference field widget to detect changes on it and populate the hidden field that holds the tid in the form.
Parameters:
Name Type Description
input Object
id String
Source:

_theme_view(variables)

An internal function used to theme a view.
Parameters:
Name Type Description
variables Object
Source:

arg() → {*}

Implementation of arg(index = null, path = null).
Source:
Returns:
Type
*

bl() → {String}

Returns a button link.
Source:
Returns:
Type
String

collection_list_page(module, type) → {Object}

The page callback for mvc/collection/list/%/%.
Parameters:
Name Type Description
module String
type String
Source:
Returns:
Type
Object

collection_load(module, type) → {*}

Given a module name and model type, this will return the collection JSON object.
Parameters:
Name Type Description
module String
type String
Source:
Returns:
Type
*

collection_save(module, type, collection)

Given a module name, model type and item collection, this will save the collection JSON object to local storage.
Parameters:
Name Type Description
module String
type String
collection Object
Source:

comment_access(comment) → {Boolean}

Given a comment, this determines if the current user has access to it. Returns true if so, false otherwise.
Parameters:
Name Type Description
comment Object
Source:
Returns:
Type
Boolean

comment_container_id(cid) → {String}

Given a comment id, this will return the id to use on the comment wrapper.
Parameters:
Name Type Description
cid Number
Source:
Returns:
Type
String

comment_create(comment, options)

Creates a comment.
Parameters:
Name Type Description
comment Object
options Object
Source:

comment_delete(cid, options)

Delete a comment.
Parameters:
Name Type Description
cid Number
options Object
Source:

comment_edit(form, form_state, comment, node) → {Object}

The comment edit form.
Parameters:
Name Type Description
form Object
form_state Object
comment Object
node Object
Source:
Returns:
Type
Object

comment_edit_submit(form, form_state)

The comment edit submit function.
Parameters:
Name Type Description
form Object
form_state Object
Source:

comment_index(query, options)

Perform a comment index.
Parameters:
Name Type Description
query Object
options Object
Source:

comment_list_id(nid) → {String}

Given a node id, this will return the id to use on the html list for the comments.
Parameters:
Name Type Description
nid Number
Deprecated:
  • Use comments_container_id() instead.
Source:
Returns:
Type
String

comment_load(cid, options)

Loads a comment.
Parameters:
Name Type Description
cid Number
options Object
Source:

comment_menu() → {Object}

Implements hook_menu().
Source:
Returns:
Type
Object

comment_page_title(callback, cid)

The title call back function for the comment view page.
Parameters:
Name Type Description
callback function
cid Number
Source:

comment_page_view(cid) → {Object}

Page callback for comment/%.
Parameters:
Name Type Description
cid Number
Source:
Returns:
Type
Object

comment_page_view_pageshow(cid)

jQM pageshow handler for comment/% pages.
Parameters:
Name Type Description
cid Number
Source:

comment_retrieve(ids, options)

Retrieves a comment.
Parameters:
Name Type Description
ids Number
options Object
Source:

comment_save(comment, options)

Saves a comment.
Parameters:
Name Type Description
comment Object
options Object
Source:

comment_services_postprocess(options, result)

Implements hook_services_postprocess().
Parameters:
Name Type Description
options Object
result Object
Source:

comment_update(comment, options)

Update a comment.
Parameters:
Name Type Description
comment Object
options Object
Source:

comments_container_id(nid) → {String}

Given a node id, this will return the id to use on the comments wrapper.
Parameters:
Name Type Description
nid Number
Source:
Returns:
Type
String

contact_index(options)

The contact index service resource.
Parameters:
Name Type Description
options Object
Source:

contact_menu() → {Object}

Implements hook_menu().
Source:
Returns:
Type
Object

contact_personal(options)

The contact personal service resource.
Parameters:
Name Type Description
options Object
Source:

contact_personal_form(form, form_state, recipient) → {Object}

The personal contact form.
Parameters:
Name Type Description
form Object
form_state Object
recipient Number
Source:
Returns:
Type
Object

contact_personal_form_pageshow(form, recipient)

The pageshow callback for the personal contact form.
Parameters:
Name Type Description
form Object
recipient Number
Source:

contact_personal_form_submit(form, form_state)

The personal contact form submit handler.
Parameters:
Name Type Description
form Ojbect
form_state Ojbect
Source:

contact_personal_form_to_container_id(recipient) → {String}

Returns the div container id to use on the "to" markup on the personal contact form.
Parameters:
Name Type Description
recipient Number
Source:
Returns:
Type
String

contact_site(options)

The contact site service resource.
Parameters:
Name Type Description
options Object
Source:

contact_site_form(form, form_state) → {Object}

The site contact form.
Parameters:
Name Type Description
form Object
form_state Object
Source:
Returns:
Type
Object

contact_site_form_pageshow()

The pageshow callback for the contact site form.
Source:

contact_site_form_submit(form, form_state)

The site wide contact form submit handler.
Parameters:
Name Type Description
form Ojbect
form_state Ojbect
Source:

date(format) → {String}

Equivalent to PHP's date function. You may optionally pass in a second int timestamp argument (number of milliseconds since epoch, not the number of seconds since the epoch) to format that particular time, otherwise it'll default to the current time.
Parameters:
Name Type Description
format String The format of the outputted date string.
Source:
See:
Returns:
Type
String

date_number_of_days_in_month(year, month) → {Number}

Given a year and month (0-11), this will return the number of days in that month.
Parameters:
Name Type Description
year Number
month Number
Source:
See:
Returns:
Type
Number

date_yyyy_mm_dd_hh_mm_ss() → {String}

Returns the current time as a string with the format: "yyyy-mm-dd hh:mm:ss".
Source:
Returns:
Type
String

date_yyyy_mm_dd_hh_mm_ss_parts() → {Array}

Returns an array with the parts for the current time. You may optionally pass in a JS date object to use that date instead.
Source:
Returns:
Type
Array

dpm(data)

Given a JSON object or string, this will print it to the console. It accepts an optional boolean as second argument, if it is false the output sent to the console will not use pretty printing in a Chrome/Ripple environment.
Parameters:
Name Type Description
data Object
Source:

drupal_init()

Initializes the Drupal JSON object.
Source:

drupal_user_defaults() → {Object}

Returns a default JSON object representing an anonymous Drupal user account.
Source:
Returns:
Type
Object

drupalgap_add_css()

Given a path to a css file relative to the app's www directory, this will attempt to load the css file so it will be available in scope.
Source:

drupalgap_add_js()

Given a path to a javascript file relative to the app's www directory, this will load the javascript file so it will be available in scope.
Source:

drupalgap_add_page_to_dom(options)

Given a page id, the theme's hook_TYPE_tpl_html() string, and the menu link object (all bundled in options) this takes the page template html and adds it to the DOM. It doesn't actually render the page, that is taken care of by the pagebeforechange handler.
Parameters:
Name Type Description
options Object
Source:

drupalgap_alert(message)

Alerts a message to the user using PhoneGap's alert. It is important to understand this is an async function, so code will continue to execute while the alert is displayed to the user. You may optionally pass in a second argument as a JSON object with the following properties: alertCallback - the function to call after the user presses OK title - the title to use on the alert box, defaults to 'Alert' buttonName - the text to place on the button, default to 'OK'
Parameters:
Name Type Description
message String
Source:

drupalgap_attributes(attributes) → {String}

Converts a JSON object to an XML/HTML tag attribute string and returns the string.
Parameters:
Name Type Description
attributes Object
Source:
Returns:
Type
String

drupalgap_back()

Change the page to the previous page.
Source:

drupalgap_back_2tf()

The DrupalGap "Back to the Future" function goes forward to the previous page by first removing that page from the DOM, then going "forward" to that page using drupalgap_goto() with a reloadPage option set to true.
Source:

drupalgap_back_path() → {String}

Returns the previous page path, or the front page if there is none.
Source:
Returns:
Type
String

drupalgap_block_load(delta) → {Object}

Given a block delta, this will return the corresponding block from drupalgap.blocks.
Parameters:
Name Type Description
delta String
Source:
Returns:
Type
Object

drupalgap_block_render(region, current_path, block_delta, block_settings, block_counts) → {String}

Renders the html string for a block.
Parameters:
Name Type Description
region Object
current_path String
block_delta String
block_settings Object
block_counts Object
Source:
Returns:
Type
String

drupalgap_bootstrap()

Loads up all necessary assets to make DrupalGap ready.
Source:

drupalgap_check_connection() → {String}

Checks the devices connection and sets drupalgap.online to true if the device has a connection, false otherwise.
Source:
Returns:
A string indicating the type of connection according to PhoneGap.
Type
String

drupalgap_check_visibility(type, data) → {Boolean}

Used by drupalgap_render_region to check the visibility settings on region links and blocks. Just like Drupal Blocks, this function checks the visibility rules specified by role or pages specified in data. Returns true by default, otherwise it will return true or false depending on the first visibility setting present in data.
Parameters:
Name Type Description
type String
data Object
Source:
Returns:
Type
Boolean

drupalgap_clear_messages()

Clears the messages from the current page. Optionally pass in a page id to clear messages from a particular page.
Source:

drupalgap_confirm(message) → {Boolean}

Displays a confirmation message to the user using PhoneGap's confirm. It is important to understand this is an async function, so code will continue to execute while the confirmation is displayed to the user. You may optionally pass in a second argument as a JSON object with the following properties: confirmCallback - the function to call after the user presses a button, the button's label is passed to this function. title - the title to use on the alert box, defaults to 'Confirm' buttonLabels - the text to place on the OK, and Cancel buttons, separated by comma.
Parameters:
Name Type Description
message String
Source:
Returns:
Type
Boolean

drupalgap_empty(value) → {Boolean}

Parameters:
Name Type Description
value *
Deprecated:
  • Use empty() instead. Returns true if given value is empty. A generic way to test for emptiness.
Source:
Returns:
Type
Boolean

drupalgap_entity_add_core_fields_to_form(entity_type, bundle, form, entity)

Given an entity type, bundle name, form and entity, this will add the entity's core fields to the form via the DrupalGap forms api.
Parameters:
Name Type Description
entity_type String
bundle String
form Object
entity Object
Source:

drupalgap_entity_assemble_data(entity_type, bundle, entity, options)

Deprecated! Given an entity type, the bundle, the entity (assembled from form state values) and any options, this assembles the ?data= string for the entity service resource call URLs.
Parameters:
Name Type Description
entity_type String
bundle String
entity Object
options Object
Source:

drupalgap_entity_build_from_form_state(form, form_state) → {Object}

Given a form and form_state, this will assemble an entity from the form_state values and return the entity as a JSON object.
Parameters:
Name Type Description
form Object
form_state Object
Source:
Returns:
Type
Object

drupalgap_entity_edit_form_delete_button(entity_type, entity_id) → {Object}

Returns the 'Delete' button object that is used on entity edit forms.
Parameters:
Name Type Description
entity_type String
entity_id Number
Source:
Returns:
Type
Object

drupalgap_entity_edit_form_delete_confirmation(entity_type, entity_id) → {*}

Given an entity type and id, this will display a confirmation dialogue and will subsequently delete the entity if the user confirms the dialogue box. The Services module retains Drupal user permissions so users without proper permissions will not be able to delete the entities from the server.
Parameters:
Name Type Description
entity_type String
entity_id Number
Source:
Returns:
Type
*

drupalgap_entity_form_submit(form, form_state, entity) → {*}

Given a form, form_state and entity, this will call the appropriate service resource to create or update the entity.
Parameters:
Name Type Description
form Object
form_state Object
entity Object
Source:
Returns:
Type
*

drupalgap_entity_get_core_fields(entity_type, bundle) → {Object}

Given an entity type, this returns its core fields as forms api elements.
Parameters:
Name Type Description
entity_type String
bundle String
Source:
Returns:
Type
Object

drupalgap_entity_get_info() → {Object|Boolean}

Given an entity_type, this returns the entity JSON info, if it exists, false otherwise. You may optionally call this function with no arguments to retrieve the JSON info for all entity types. See also
Source:
See:
Returns:
Type
Object | Boolean

drupalgap_entity_get_primary_key(entity_type) → {String}

Parameters:
Name Type Description
entity_type String
Deprecated:
  • Since 7.x-1.7-alpha you should use entity_primary_key() instead. Given an entity type, this returns the primary key identifier for it.
Source:
Returns:
Type
String

drupalgap_entity_render_content(entity_type, entity)

Given an entity, this will render the content of the entity and place it in the entity JSON object as the 'content' property.
Parameters:
Name Type Description
entity_type String
entity Object
Source:

drupalgap_entity_render_field(entity_type, entity, field_name, field, display) → {String}

Given an entity_type, the entity, a field name, and the field this will render the field using the appropriate hook_field_formatter_view().
Parameters:
Name Type Description
entity_type String
entity Object
field_name String
field Object
display *
Source:
Returns:
Type
String

drupalgap_entity_view_mode(entity_type, bundle) → {string}

Given an entity type and optional bundle, this will return the view mode machine name to use. It defaults to "drupalgap", but can be configured.
Parameters:
Name Type Description
entity_type String
bundle String
Source:
See:
Returns:
Type
string

drupalgap_error(message)

Given an error message, this will log the message to the console and goto the error page, if it isn't there already. If Drupal.settings.debug is set to true, this function will also alert the error. You may optionally send in a second message that will be displayed to the user via an alert dialog box.
Parameters:
Name Type Description
message String
Source:

drupalgap_field_info_field(field_name) → {Object}

Given a field name, this will return its field info or null if it doesn't exist.
Parameters:
Name Type Description
field_name String
Source:
Returns:
Type
Object

drupalgap_field_info_fields() → {Object}

Returns info on all fields or null if they don't exist.
Source:
Returns:
Type
Object

drupalgap_field_info_instance(entity_type, field_name, bundle_name) → {Object}

Given an entity type, field name, and bundle name this will return a JSON object with data for the specified field name.
Parameters:
Name Type Description
entity_type String
field_name String
bundle_name String
Source:
Returns:
Type
Object

drupalgap_field_info_instances(entity_type, bundle_name) → {Object}

Given an entity type and/or a bundle name, this returns the field info instances for the entity or the bundle.
Parameters:
Name Type Description
entity_type String
bundle_name String
Source:
Returns:
Type
Object

drupalgap_field_info_instances_add_to_form(entity_type, bundle, form, entity)

Given an entity type, bundle, form and entity, this will add the entity's fields to the given form.
Parameters:
Name Type Description
entity_type String
bundle String
form Object
entity Object
Source:

drupalgap_field_key(field_name) → {String}

Given a field name, this will return the key that should be used when setting its value on an entity. If the field name is not a field, it returns false.
Parameters:
Name Type Description
field_name String
Source:
Returns:
Type
String

drupalgap_file_exists(path) → {bool}

Checks if a given file exists, returns true or false.
Parameters:
Name Type Description
path string A path to a file
Source:
Returns:
True if file exists, else false.
Type
bool

drupalgap_file_get_contents(path, options) → {String}

Reads entire file into a string and returns the string. Returns false if it fails.
Parameters:
Name Type Description
path String
options Object
Source:
Returns:
Type
String

drupalgap_form_cancel_button() → {Object}

Returns a 'Cancel' button object that can be used on most forms.
Source:
Returns:
Type
Object

drupalgap_form_clear()

Given a jQuery selector to a form, this will clear all the elements on the UI.
Source:
See:

drupalgap_form_defaults(form_id) → {Object}

Given a form id, this will assemble and return the default form JSON object.
Parameters:
Name Type Description
form_id String
Source:
Returns:
Type
Object

drupalgap_form_element_access(element) → {Boolean}

Given a form element, this will return true if access to the element is permitted, false otherwise.
Parameters:
Name Type Description
element Object
Source:
Returns:
Type
Boolean

drupalgap_form_element_get_module_name(type) → {String}

Given a form element type, this will return the name of the module that implements the hook_field_widget_form() for the element. Keep in mind for now some of the module names don't exist, and are actually implemented inside the field module. If no module is found, it returns false.
Parameters:
Name Type Description
type String
Source:
Returns:
Type
String

drupalgap_form_element_item_create(name, form, language, delta) → {Object}

Given an element name, the form, a language code and a delta value, this will return default values that can be used to place an item element into a Forms API object.
Parameters:
Name Type Description
name String
form Object
language String
delta Number
Source:
Returns:
Type
Object

drupalgap_form_get_element_container_class(name) → {String}

Given an element name, this will return the class name to use on the element's container.
Parameters:
Name Type Description
name String
Source:
Returns:
Type
String

drupalgap_form_get_element_id(name, form_id) → {String}

Given a form element name and the form_id, this generates an html id attribute value to be used in the DOM. An optional third argument is a string language code to use. An optional fourth argument is an integer delta value to use on field elements.
Parameters:
Name Type Description
name String
form_id String
Source:
Returns:
Type
String

drupalgap_form_id_local_storage_key(form_id) → {String}

Given a form id, this will return the local storage key used by DrupalGap to save the assembled form to the device's local storage.
Parameters:
Name Type Description
form_id String
Source:
Returns:
Type
String

drupalgap_form_load(form_id) → {Object}

Given a form id, this will return the form JSON object assembled by the form's call back function. If the form fails to load, this returns false.
Parameters:
Name Type Description
form_id String
Source:
Returns:
Type
Object

drupalgap_form_local_storage_delete(form_id) → {Object}

Given a form id, this will delete the form from local storage. If the form isn't in local storage, this returns false.
Parameters:
Name Type Description
form_id String
Source:
Returns:
Type
Object

drupalgap_form_local_storage_load(form_id) → {Object}

Given a form id, this will load the form from local storage and return it. If the form isn't in local storage, this returns false.
Parameters:
Name Type Description
form_id String
Source:
Returns:
Type
Object

drupalgap_form_local_storage_save(form)

Given a form, this will save the form to local storage, overwriting any previously saved forms.
Parameters:
Name Type Description
form Object
Source:

drupalgap_form_onkeypress(form_id, event) → {Boolean}

Optionally use this function as an HTML DOM onkeypress handler, and it will attempt to listen for the enter key being pressed and submit the form at that time.
Parameters:
Name Type Description
form_id String
event Object
Source:
Returns:
Type
Boolean

drupalgap_form_render(form) → {String}

Given a drupalgap form, this renders the form html and returns it.
Parameters:
Name Type Description
form Object
Source:
Returns:
Type
String

drupalgap_form_set_error(name, message)

Given a form element name and an error message, this attaches the error message to the drupalgap.form_errors array, keyed by the form element name.
Parameters:
Name Type Description
name String
message String
Source:

drupalgap_form_state_values_assemble(form) → {Object}

Given a form, this function iterates over the form's elements and assembles each element and value and places them into the form state's values. This is similar to $form_state['values'] in Drupal.
Parameters:
Name Type Description
form Object
Source:
Returns:
Type
Object

drupalgap_format_interval(interval) → {String}

Parameters:
Name Type Description
interval Number The length of the interval in seconds.
Source:
See:
Returns:
Type
String

drupalgap_format_plural(count, singular, plural) → {String}

Parameters:
Name Type Description
count Number
singular String
plural String
Source:
See:
Returns:
Type
String

drupalgap_function_exists(name) → {Boolean}

Parameters:
Name Type Description
name String
Deprecated:
  • - Use function_exists() instead.
Source:
Returns:
Type
Boolean

drupalgap_get_bundle()

Deprecated:
  • @ see entity_get_bundle()
Source:

drupalgap_get_entity(handler, entity_type, entity_id) → {string}

A page_callback function used to build an empty placeholder for an entity and inline JavaScript to retrieve the entity for display.
Parameters:
Name Type Description
handler String
entity_type String
entity_id Number
Source:
Returns:
Type
string

drupalgap_get_entity_container_id(entity_type, entity_id, context) → {string}

Given an entity type, id and optional context, this will return a container id to be used when constructing a placeholder to load/display/edit an entity.
Parameters:
Name Type Description
entity_type String
entity_id Number
context String An optional context to use, e.g. "edit"
Source:
Returns:
Type
string

drupalgap_get_entity_form(handler, entity_type, entity_id) → {string}

A page_callback function used to build an empty placeholder for an entity and inline JavaScript to retrieve the entity for editing.
Parameters:
Name Type Description
handler String
entity_type String
entity_id Number
Source:
Returns:
Type
string

drupalgap_get_entity_form_pageshow(options)

A pageshow function used to retrieve an entity, pass it along to a form builder, and then inject the form into the waiting placeholder.
Parameters:
Name Type Description
options Object
Source:

drupalgap_get_entity_pageshow(options)

A pageshow function used to retrieve an entity, pass it along to its handler for rendering, and then inject the handler's render array into the waiting placeholder.
Parameters:
Name Type Description
options Object
Source:

drupalgap_get_form(form_id) → {String}

Given a form id, this will render the form and return the html for the form. Any additional arguments will be sent along to the form.
Parameters:
Name Type Description
form_id String
Source:
Returns:
Type
String

drupalgap_get_ip() → {String|Null}

Returns the IP Address of the current user as reported by PHP via the last System Connect call's $_SERVER['REMOTE_ADDR'] value.
Source:
Returns:
Type
String | Null
Given a menu link path, this determines and returns the router path as a string.
Parameters:
Name Type Description
path String
Source:
Returns:
Type
String

drupalgap_get_messages() → {Array}

Returns the current messages.
Source:
Returns:
Type
Array

drupalgap_get_page_id(path) → {String}

Given a path, this will return the id for the page's div element. For example, a string path of 'foo/bar' would result in an id of 'foo_bar'. If no path is provided, it will return the current page's id.
Parameters:
Name Type Description
path String
Source:
Returns:
Type
String

drupalgap_get_path(type, name) → {*}

Returns the path to a system item (module, theme, etc.), returns false if it can't find it.
Parameters:
Name Type Description
type String
name String
Source:
Returns:
Type
*

drupalgap_get_path_from_page_id(page_id) → {String|null}

Returns the path used for a given page id. Essentially a reverse path look up, given a page id.
Parameters:
Name Type Description
page_id String
Source:
Returns:
Type
String | null

drupalgap_get_placeholders_from_html(html) → {*}

Given an html string from a *.tpl.html file, this will extract all of the placeholders names and return them in an array. Returns false otherwise.
Parameters:
Name Type Description
html String
Source:
Returns:
Type
*

drupalgap_get_title() → {String}

Returns the current page's title.
Source:
Returns:
Type
String

drupalgap_get_wildcards_from_router_path(router_path) → {Boolean}

Given a router path, this will return an array containing the indexes of where the wildcards (%) are present in the router path. Returns false if there are no wildcards present.
Parameters:
Name Type Description
router_path String
Source:
Returns:
Type
Boolean

drupalgap_goto(path) → {*}

Given a path, this will change the current page in the app.
Parameters:
Name Type Description
path String
Source:
Returns:
Type
*

drupalgap_goto_generate_page_and_go(path, page_id, options, menu_link)

Generate a JQM page by running it through the theme then attach the page to the of the document, then change to the page. Remember, the rendering of the page does not take place here, that is covered by the pagebeforechange event in theme.inc.js which happens after we change the page here.
Parameters:
Name Type Description
path String
page_id String
options Object
menu_link Object The menu link object from drupalgap.menu_links.
Source:

drupalgap_goto_prepare_path(path) → {String}

Prepares a drupalgap page path.
Parameters:
Name Type Description
path String
Deprecated:
  • Use _drupalgap_goto_prepare_path() instead.
Source:
Returns:
Type
String

drupalgap_has_connection() → {boolean}

Checks for an Internet connection, returns true if connected, false otherwise.
Source:
Returns:
Type
boolean

drupalgap_image_path(uri) → {String}

Given a drupal image file uri, this will return the path to the image on the Drupal site.
Parameters:
Name Type Description
uri String
Source:
Returns:
Type
String

drupalgap_includes_load()

Deprecated:
  • - This is no longer needed since the includes are built via the makefile. Loads the js files in includes specified by drupalgap.includes.
Source:

drupalgap_init() → {Object}

Initializes the drupalgap json object.
Source:
Returns:
Type
Object

drupalgap_is_front_page() → {Boolean}

Returns true if the current page is the front page, false otherwise.
Source:
Returns:
Type
Boolean

drupalgap_item_list_populate(list_css_selector, items)

Given an html list element id and an array of items, this will clear the list, populate it with the items, and then refresh the list.
Parameters:
Name Type Description
list_css_selector String
items Array
Source:

drupalgap_jqm_active_page_url() → {String}

Returns the URL of the active jQuery Mobile page.
Source:
Returns:
Type
String

drupalgap_jqm_page_event_fire(event, callback, page_arguments)

Given a jQM page event, and the corresponding callback function name that handles the event, this function will call the callback function, if it has not already been called on the current page. This really is only used by menu_execute_active_handler() to prevent jQM from firing inline page event handlers more than once. You may optionally pass in a 4th argument, a string, to append to the suffix of the unique key of recorded fired page events.
Parameters:
Name Type Description
event String
callback String
page_arguments *
Source:

drupalgap_jqm_page_event_script_code(options) → {String}

Given a JSON object with a page id, a jQM page event name, a callback function to handle the jQM page event and any page arguments (as a JSON string), this function will return the inline JS code needed to handle the event. You may optionally pass in a unique second argument (string) to allow the same page event handler to be fired more than once on a page.
Parameters:
Name Type Description
options Object
Source:
Returns:
Type
String

drupalgap_jqm_page_events() → {Array}

Returns array of jQM Page event names.
Source:
See:
Returns:
Type
Array
Given a link JSON object, this will return its attribute class value, or null if it isn't set.
Parameters:
Name Type Description
link Object
Source:
Returns:
Type
String

drupalgap_load_blocks()

Rounds up all blocks defined by hook_block_info and places them in the drupalgap.blocks array.
Source:

drupalgap_load_locales()

Loads language files.
Source:

drupalgap_load_modules()

Loads any contrib or custom modules specifed in the settings.js file. Then invoke hook_install() on all modules, including core.
Source:

drupalgap_load_theme() → {Boolean}

Load the theme specified by drupalgap.settings.theme into drupalgap.theme Returns true on success, false if it fails.
Source:
Returns:
Type
Boolean

drupalgap_loader_enable(enable)

Toggle on or off the loader spinner, send true to turn it on, false to turn it off.
Parameters:
Name Type Description
enable Boolean
Source:

drupalgap_loader_enabled() → {Boolean}

Returns true if the loader spinner is enabled, false otherwise. Defaults to true if no config for it is present.
Source:
Returns:
Type
Boolean

drupalgap_loader_options() → {Object}

Returns the jQM loader options based on the current mode and settings.js.
Source:
Returns:
Type
Object

drupalgap_loading_message_hide()

Hide the jQueryMobile loading message.
Source:

drupalgap_loading_message_show()

Show the jQueryMobile loading message.
Source:
See:

drupalgap_max_width() → {Number}

Returns the suggested max width for elements within the content area.
Source:
Returns:
Type
Number

drupalgap_menu_access(routerPath, path) → {Boolean}

Checks to see if the current user has access to the given path. Returns true if the user has access, false otherwise. You may optionally pass in a user account object as the second argument to check access on a specific user. Also, you may optionally pass in an entity object as the third argument, if that entity needs to be passed along to an 'access_callback' handler.
Parameters:
Name Type Description
routerPath String The router path of the destination.
path String The destination path.
Source:
Returns:
Type
Boolean

drupalgap_menu_router_build_menu_item_relationships(path, menu_item)

Given a path, and its corresponding menu item, this will determine any parent, sibling, and/or child menu item paths and set the references on each so they are all aware of eachother's paths.
Parameters:
Name Type Description
path String
menu_item Object
Source:

drupalgap_menus_load()

Loads all of the menus specified in drupalgap.settings.menus into drupalgap.menus. This is called after menu_router_build(), so any system defined menus will already be present and should be overwritten with any customizations present in the settings. It then iterates over the menu links specified in drupalgap.menu_links and attaches any of them that have a menu_name to their corresponding menu in drupalgap.menus. Any menu link items that have a 'region' property specified will be added to drupalgap.theme.regions[region].
Source:
Given a menu link item from drupalgap_menus_load(), this will return a JSON object representing a link object compatible with theme_link(). It contains the link title, path and options.
Parameters:
Name Type Description
menu_link Object
Source:
Returns:
Type
Object

drupalgap_module_load(name) → {Object}

Parameters:
Name Type Description
name String
Deprecated:
  • Use module_load() instead.
Source:
Returns:
Type
Object

drupalgap_modules_get_bundle_directory(bundle) → {String}

Given a module bundle type, this will return the path to that module bundle's directory.
Parameters:
Name Type Description
bundle String
Source:
Returns:
Type
String

drupalgap_onload()

This is called once the element's onload is fired.
Source:

drupalgap_page_class_get(router_path) → {String}

Given a router path, this will return the CSS class name that can be used for the page container.
Parameters:
Name Type Description
router_path String The page router path.
Source:
Returns:
A css class name.
Type
String

drupalgap_page_in_dom(page_id) → {Boolean}

Returns true if the given page id's page div already exists in the DOM.
Parameters:
Name Type Description
page_id String
Source:
Returns:
Type
Boolean

drupalgap_panel_id(key) → {String}

Given a key (typically a block delta), this will generate a unique ID that can be used for the panel. It will be fused with the current page id.
Parameters:
Name Type Description
key String
Source:
Returns:
Type
String

drupalgap_path_get() → {String}

Get the current DrupalGap path.
Source:
Returns:
Type
String

drupalgap_path_has_entity_arg(args) → {Boolean}

Given an args array, this returns true if the path in the array will have an entity (id) present in it.
Parameters:
Name Type Description
args Array
Source:
Returns:
Type
Boolean

drupalgap_path_set(path)

Set the current DrupalGap path.
Parameters:
Name Type Description
path String
Source:

drupalgap_place_args_in_path(input_path) → {*}

Given a router path (and optional path, defaults to current drupalgap path if one isn't provided), this takes the path's arguments and replaces any wildcards (%) in the router path with the corresponding path argument(s). It then returns the assembled path. Returns false otherwise.
Parameters:
Name Type Description
input_path String
Source:
Returns:
Type
*

drupalgap_remove_page_from_dom(page_id)

Attempts to remove given page from the DOM, will not remove the current page. You may force the removal by passing in a second argument as a JSON object with a 'force' property set to true. You may pass in a third argument to specify the current page, otherwise it will default to what DrupalGap thinks is the current page. No matter what, the current page (specified or not) can't be removed from the DOM, because jQM always needs one page in the DOM.
Parameters:
Name Type Description
page_id String
Source:

drupalgap_remove_page_from_dom(page_id)

Given a page id, this will remove it from the DOM.
Parameters:
Name Type Description
page_id String
Source:

drupalgap_remove_pages_from_dom()

Removes all pages from the DOM except the current one.
Source:

drupalgap_render_page() → {String}

Renders the html string of the page content that is stored in drupalgap.output.
Source:
Returns:
Type
String

drupalgap_render_region(region) → {String}

Given a region, this renders it and all the blocks in it. The blocks are specified in the settings.js file, they are bundled under a region, which in turn is bundled under a theme name. Returns an empty string if it fails.
Parameters:
Name Type Description
region Object
Source:
Returns:
Type
String

drupalgap_restart()

Restart the app.
Source:

drupalgap_router_path_get() → {String}

Get the current DrupalGap router_path.
Source:
Returns:
Type
String

drupalgap_router_path_set(router_path)

Set the current DrupalGap router_path.
Parameters:
Name Type Description
router_path String
Source:

drupalgap_service_resource_extract_results(options)

Given a json drupalgap options array from a service resource results call, this extracts data based on the resource and populates necessary global vars.
Parameters:
Name Type Description
options Object
Source:

drupalgap_services_get_entity_resource(entity_type) → {Type|Object|null}

Given an entity type, this will return its corresponding service resource, or null if the resource doesn't exist.
Parameters:
Name Type Description
entity_type String
Source:
Returns:
Type
Type | Object | null

drupalgap_services_postprocess(options, result)

Implements hook_services_postprocess().
Parameters:
Name Type Description
options Object
result Object
Source:

drupalgap_services_preprocess(options)

Implements hook_services_preprocess().
Parameters:
Name Type Description
options Object
Source:

drupalgap_services_request_pre_postprocess_alter(options, result)

Implements hook_services_request_pre_postprocess_alter().
Parameters:
Name Type Description
options Object
result *
Source:

drupalgap_services_rss_extract_items(data) → {Type|Array|null}

Given the result of a drupalgap.services.rss.retrieve.call, this will iterate over the RSS items and assemble them into a nice array of JSON objects and return them. Returns null if it fails.
Parameters:
Name Type Description
data Object
Source:
Returns:
Type
Type | Array | null

drupalgap_set_message(message)

Sets a message to display to the user. Optionally pass in a second argument to specify the message type: status, warning, error
Parameters:
Name Type Description
message String
Source:

drupalgap_set_messages(messages)

Sets the current messages.
Parameters:
Name Type Description
messages Array
Source:

drupalgap_set_title(title)

Implementation of drupal_set_title().
Parameters:
Name Type Description
title String
Source:

drupalgap_settings_load()

Deprecated:
  • - Loads the settings specified in app/settings.js into the app.
Source:

drupalgap_table_populate(table_css_selector, rows)

Given an html table element id and an array of rows, this will clear the table, populate it with the rows, and then refresh the table.
Parameters:
Name Type Description
table_css_selector String
rows Array rows follow the.
Source:

drupalgap_taxonomy_vocabularies_extract(taxonomy_vocabularies) → {Object}

Extracts the taxonomy vocabularies JSON objects bundled by the Drupal module into the system connect's resource results.
Parameters:
Name Type Description
taxonomy_vocabularies Object
Source:
Returns:
Type
Object

drupalgap_theme_registry_build()

This calls all implementations of hook_theme and builds the DrupalGap theme registry.
Source:

drupalgap_toast(html)

Show a non intrusive alert message. You may optionally pass in an integer value as the second argument to specify how many milliseconds to wait before closing the message. Likewise, you can pass in a third argument to specify how long to wait before opening the message.
Parameters:
Name Type Description
html string The html to display.
Source:

drupalgap_toast_is_shown() → {Boolean}

Returns true if the toast is currently shown, false otherwise.
Source:
Returns:
Type
Boolean

drupalgap_user_has_role(role) → {Boolean}

Given a user role (string), this determines if the current user has the role. Returns true if the user has the role, false otherwise. You may pass in a user account object to check against a certain account, instead of the current user.
Parameters:
Name Type Description
role String
Source:
Returns:
Type
Boolean

drupalgap_views_get_result_formats(variables) → {Object}

A helper function used to retrieve the various open and closing tags for views results, depending on their format.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
Object

drupalgap_views_render_rows(variables, results, root, child, open_row, close_row) → {String}

A helper function used to render a views result's rows.
Parameters:
Name Type Description
variables Object
results Object
root String
child String
open_row String
close_row String
Source:
Returns:
Type
String

empty(value) → {Boolean}

Returns true if given value is empty. A generic way to test for emptiness.
Parameters:
Name Type Description
value *
Source:
Returns:
Type
Boolean

entity_caching_enabled() → {Boolean}

Returns true or false depending on whether caching is enabled or not. You may optionally pass in an entity type as the first argument, and optionally pass in a bundle name as a second argument to see if that particular cache is enabled.
Source:
Returns:
Type
Boolean

entity_clean_local_storage()

Looks for expired entities and remove them from local storage.
Source:

entity_create(entity_type, bundle, entity, options)

Creates an entity.
Parameters:
Name Type Description
entity_type String
bundle String
entity Object
options Object
Source:

entity_delete(entity_type, entity_id, options)

Deletes an entity.
Parameters:
Name Type Description
entity_type String
entity_id Number
options Object
Source:

entity_get_bundle(entity_type, entity) → {*}

Given an entity type and entity, this will return the bundle name as a string for the given entity, or null if the bundle is N/A.
Parameters:
Name Type Description
entity_type String The entity type.
entity Object The entity JSON object.
Source:
Returns:
Type
*

entity_has_expired(entity_type, entity)

Parameters:
Name Type Description
entity_type
entity
Source:

entity_id_parse(entity_id) → {Number}

Parses an entity id and returns it as an integer (not a string).
Parameters:
Name Type Description
entity_id *
Source:
Returns:
Type
Number

entity_index(entity_type, query, options)

Performs an entity index.
Parameters:
Name Type Description
entity_type String
query String
options Object
Source:

entity_index_build_query_string(query) → {String}

Builds a query string from a query object for an entity index resource.
Parameters:
Name Type Description
query Object
Source:
Returns:
Type
String

entity_index_local_storage_key(path) → {String}

A placeholder function used to provide a local storage key for entity index queries.
Parameters:
Name Type Description
path String
Source:
Returns:
Type
String

entity_install()

Implements hook_install().
Source:

entity_load(entity_type, ids, options)

Loads an entity.
Parameters:
Name Type Description
entity_type String
ids Number | Array
options Object
Source:

entity_local_storage_key(entity_type, id) → {String}

Given an entity type and the entity id, this will return the local storage key to be used when saving/loading the entity from local storage.
Parameters:
Name Type Description
entity_type String
id Number
Source:
Returns:
Type
String

entity_page_edit(form_id, entity_type, entity_id) → {Object}

The page callback for entity edit forms.
Parameters:
Name Type Description
form_id String
entity_type String
entity_id Number
Source:
Returns:
Type
Object

entity_page_edit_pageshow(form_id, entity_type, entity_id)

The pageshow callback for entity edit forms.
Parameters:
Name Type Description
form_id String
entity_type String
entity_id Number
Source:

entity_primary_key(entity_type) → {String}

Returns an entity type's primary key.
Parameters:
Name Type Description
entity_type String
Source:
Returns:
Type
String

entity_primary_key_title(entity_type) → {String}

Returns an entity type's primary title key.
Parameters:
Name Type Description
entity_type String
Source:
Returns:
Type
String

entity_retrieve(entity_type, ids, options)

Retrieves an entity.
Parameters:
Name Type Description
entity_type String
ids Number
options Object
Source:

entity_save(entity_type, bundle, entity, options)

Saves an entity.
Parameters:
Name Type Description
entity_type String
bundle String
entity Object
options Object
Source:

entity_services_request_pre_postprocess_alter(options, result)

Implements hook_services_request_pre_postprocess_alter().
Parameters:
Name Type Description
options Object
result *
Source:

entity_types() → {Array}

Returns an array of entity type names.
Source:
Returns:
Type
Array

entity_update(entity_type, bundle, entity, options)

Updates an entity.
Parameters:
Name Type Description
entity_type String
bundle String
entity Object
options Object
Source:

file_create(file, options)

Creates a file.
Parameters:
Name Type Description
file Object
options Object
Source:

file_delete(fid, options)

Delete a file.
Parameters:
Name Type Description
fid Number
options Object
Source:

file_drupalgap_goto_post_process()

Implements hook_drupalgap_goto_post_process().
Source:

file_entity_field_formatter_view()

Implements hook_field_formatter_view().
Source:

file_field_formatter_view()

Implements hook_field_formatter_view().
Source:

file_form_alter()

Implements hook_form_alter().
Source:

file_load(fid, options)

Loads a file, given a file id.
Parameters:
Name Type Description
fid Number
options Object
Source:

file_retrieve(ids, options)

Retrieves a file.
Parameters:
Name Type Description
ids Number
options Object
Source:

file_save(file, options)

Saves a file.
Parameters:
Name Type Description
file Object
options Object
Source:

function_exists(name) → {Boolean}

Given a JS function name, this returns true if the function exists in the scope, false otherwise.
Parameters:
Name Type Description
name String
Source:
Returns:
Type
Boolean

hook_404()

A hook used to handle a 404 in the app.
Source:

hook_add_page_to_dom_alter()

Implements hook_add_page_to_dom_alter().
Source:

hook_assemble_form_state_into_field(entity_type, bundle, form_state_value, field, instance, langcode, delta, field_key, form) → {*}

When a form submission for an entity is assembling the entity json object to send to the server, some form element fields need to be assembled in unique ways to match the entity's structure in Drupal. Modules that implement fields can use this hook to properly assemble the item value (by delta) and return it.
Parameters:
Name Type Description
entity_type Object
bundle String
form_state_value String
field Object
instance Object
langcode String
delta Number
field_key Object Set the 'value' string property on this object to use a custom property name on the field value. Defaults to 'value'. Set the 'use_key' boolean property on this object to false to not use a key when assembling the result into the field. Defaults to true. Set the 'use_wrapper' boolean property on this object to false to not use the default wrapper placed around the result object. Defaults to true. Set the 'use_delta' boolean property to false when a delta value is not needed. Defaults to true.
form Object
Source:
Returns:
Type
*

hook_block_info()

A hook used to declare custom block information.
Source:

hook_block_view()

A hook used to render custom blocks.
Source:

hook_csrf_token_preprocess()

Implements hook_csrf_token_preprocess().
Source:

hook_device_connection()

When someone calls drupalgap_has_connection(), this hook has an opportunity to set drupalgap.online to true or false. The value of drupalgap.online is returned to anyone who calls drupalgap_has_connection(), including DrupalGap core.
Source:

hook_device_offline()

Called during app startup if the device does not have a connection. Note, the Drupal.user object is ot initialized at this point, and will always be an anonymous user.
Source:

hook_deviceready()

When the app is first loading up, DrupalGap checks to see if the device has a connection, if it does then this hook is called. If DrupalGap doesn't have a connection, then hook_device_offline() is called. Implementations of hook_deviceready() need to return true if they'd like DrupalGap to continue, or return false if you'd like DrupalGap to NOT continue. If DrupalGap continues, it will perform a System Connect resource call then go to the App's front page. This is called during DrupalGap's "deviceready" implementation for PhoneGap. Note, the Drupal.user object is not initialized at this point, and will always be an anonymous user.
Source:

hook_drupalgap_back(from, to)

Take action when the user presses the "back" button. This includes the soft, hardware and browser back buttons. The browser back button is only available in web app mode, the hardware back button is typically only on compiled Android devices, whereas the soft back button actually appears within the UX of the app.
Parameters:
Name Type Description
from String
to String
Source:
See:

hook_drupalgap_goto_post_process(path)

Each time a page is navigated to within the app, drupalgap_goto() is called. Use this hook to do some post processing after drupalgap_goto() has finished.
Parameters:
Name Type Description
path String The current page path.
Source:

hook_drupalgap_goto_preprocess(path)

Each time a page is navigated to within the app, drupalgap_goto() is called. Use this hook to do some preprocessing before drupalgap_goto() gets started.
Parameters:
Name Type Description
path String The current page path.
Source:

hook_entity_post_build_content()

Implements hook_entity_post_build_content().
Source:

hook_entity_post_render_content()

Called after drupalgap_entity_render_content() assembles the entity.content string. Use this to make modifications to the HTML output of the entity's content before it is displayed.
Source:

hook_entity_post_render_field()

Implements hook_entity_post_render_field(). Called after drupalgap_entity_render_field() assembles the field content string. Use this to make modifications to the HTML output of the entity's field before it is displayed. The field content will be inside of reference.content, so to make modifications, change reference.content. For more info: http://stackoverflow.com/questions/518000/is-javascript-a-pass-by-reference-or-pass-by-value-language
Source:

hook_entity_pre_build_content()

Implements hook_entity_pre_build_content().
Source:

hook_entity_pre_render_content()

Implements hook_entity_pre_render_content(). Called before drupalgap_entity_render_content() assembles the entity.content string. Use this to make modifications to an entity before its' content is rendered.
Source:

hook_entity_view_alter()

Implements hook_entity_view_alter(). Called immediately before a page is rendered and injected into its waiting container. Use this hook to modifications to the build object by adding or editing render arrays (widgets) on the build object.
Source:

hook_field_formatter_view(entity_type, entity, field, instance, langcode, items, display)

Implements hook_field_formatter_view().
Parameters:
Name Type Description
entity_type String
entity Object
field Object
instance Object
langcode String
items Object
display Object
Source:

hook_field_info_instance_add_to_form(entity_type, bundle, form, entity, element)

Implements hook_field_info_instance_add_to_form(). Used by modules that provide custom fields to operate on a form or its elements before the form gets saved to local storage. This allows extra data be attached to the form that way things like hook_field_widget_form(), which takes place at render time, can have access to any extra data it may need.
Parameters:
Name Type Description
entity_type String
bundle String
form Object
entity Object
element Object
Source:

hook_field_widget_form(form, form_state, field, instance, langcode, items, delta, element)

Implements hook_field_widget_form().
Parameters:
Name Type Description
form Object
form_state Object
field Object
instance Object
langcode String
items Object
delta Number
element Object
Source:

hook_form_alter()

Implements hook_form_alter(). This hook is used to make alterations to existing forms.
Source:

hook_image_path_alter()

Implements hook_image_path_alter(). Called after drupalgap_image_path() assembles the image path. Use this hook to make modifications to the image path. Return the modified path, or false to allow the default path to be generated.
Source:

hook_install()

Implements hook_install(). This hook is used by modules that need to execute custom code when the module is loaded. Note, the Drupal.user object is not initialized at this point, and always appears to be an anonymous user.
Source:

hook_locale()

Implements hook_locale(). Used to declare language code .json files that should be loaded by DrupalGap.
Source:
See:

hook_menu()

Implements hook_menu() This hook is used to declare menu paths for custom pages.
Source:

hook_node_page_view_alter_TYPE(node, options)

Implements hook_node_page_view_alter_TYPE().
Parameters:
Name Type Description
node Object The fully loaded node object.
options Object The options object, containing the success callback.
Source:

hook_page_build(output)

Implements hook_page_build().
Parameters:
Name Type Description
output Object The page build output object.
Source:

hook_post_process_page(variables)

Implements hook_post_process_page(). Take action after the page is processed and shown to the user.
Parameters:
Name Type Description
variables Object The page variables.
Source:

hook_preprocess_page(variables)

Implements hook_preprocess_page(). Take action before the page is processed and shown to the user.
Parameters:
Name Type Description
variables Object The page variables.
Source:

hook_services_postprocess(options, result)

Postprocess a service call.
Parameters:
Name Type Description
options Object
result Object
Source:

hook_services_preprocess(options)

Preprocess a service call.
Parameters:
Name Type Description
options Object
Source:

hook_services_request_postprocess_alter(options, result)

Alter the result data of a service call, after its success function.
Parameters:
Name Type Description
options object
result Object
Source:

hook_services_request_pre_postprocess_alter(options, result)

Alter the result data of a service call, before its success function.
Parameters:
Name Type Description
options object
result Object
Source:

hook_services_success()

Called after a successful services API call to a Drupal site. Do not call any services from within your implementation, you may run into an infinite loop in your code. See http://drupalgap.org/project/force_authentication for example usage.
Deprecated:
  • - use hook_services_postprocess() instead.
Source:

hook_views_exposed_filter(form, form_state, element, filter, field)

Implements hook_views_exposed_filter().
Parameters:
Name Type Description
form Object
form_state Object
element Object
filter Object
field Object
Source:

http_status_code_title(status) → {String}

Given an integer http status code, this will return the title of it.
Parameters:
Name Type Description
status Number
Source:
Returns:
title
Type
String

image_assemble_form_state_into_field(entity_type, bundle, form_state_value, field, instance, langcode, delta, field_key) → {*}

Implements hook_assemble_form_state_into_field().
Parameters:
Name Type Description
entity_type Object
bundle String
form_state_value String
field Object
instance Object
langcode String
delta Number
field_key Object
Source:
Returns:
Type
*

image_field_formatter_view(entity_type, entity, field, instance, langcode, items, display) → {Object}

Implements hook_field_formatter_view(). /** Implements hook_field_formatter_view().
Parameters:
Name Type Description
entity_type String
entity Object
field Object
instance Object
langcode String
items Object
display *
Source:
Returns:
Type
Object

image_field_widget_form(form, form_state, field, instance, langcode, items, delta, element)

Implements hook_field_widget_form().
Parameters:
Name Type Description
form Object
form_state Object
field Object
instance Object
langcode String
items Object
delta Number
element Object
Source:

image_fields_present_on_entity_type(entity_type, bundle) → {Object}

Given an entity type and optional bundle name, this will return an array containing any image field names present, false otherwise.
Parameters:
Name Type Description
entity_type String
bundle String
Source:
Returns:
Type
Object

image_form_alter(form, form_state, form_id)

Implements hook_form_alter().
Parameters:
Name Type Description
form Object
form_state Object
form_id String
Source:

image_style_url(style_name, path) → {String}

Given an image style name and image uri, this will return the absolute URL that can be used as a src value for an img element.
Parameters:
Name Type Description
style_name String
path String
Source:
Returns:
Type
String

in_array(needle, haystack) → {Boolean}

Checks if the needle string, is in the haystack array. Returns true if it is found, false otherwise. Credit: http://stackoverflow.com/a/15276975/763010
Parameters:
Name Type Description
needle String | Number
haystack Array
Source:
Returns:
Type
Boolean

is_array(obj) → {boolean}

Given something, this will return true if it's an array, false otherwise.
Parameters:
Name Type Description
obj *
Source:
See:
Returns:
Type
boolean

is_int(n) → {Boolean}

Given an argument, this will return true if it is an int, false otherwise.
Parameters:
Name Type Description
n Number
Source:
Returns:
Type
Boolean

item_create_form(form, form_state, module, type) → {Object}

Given a module type, and model type, this generates and returns the form JSON object to create a model item.
Parameters:
Name Type Description
form Object
form_state Object
module String
type String
Source:
Returns:
Type
Object

item_create_form_submit(form, form_state)

Handles the submission of an mvc model item creation form.
Parameters:
Name Type Description
form Object
form_state Object
Source:

item_load(module, type, id) → {Object}

Given a module name, mvc model type, and item id, this will return the item, or false if the item fails to load.
Parameters:
Name Type Description
module String
type String
id String
Source:
Returns:
Type
Object

item_save(item) → {Boolean}

Given an mvc item, this saves it to local storage.
Parameters:
Name Type Description
item Object
Source:
Returns:
Type
Boolean

item_view_page(module, type, item) → {String}

The page callback for mvc/item/%/%/%.
Parameters:
Name Type Description
module String
type String
item Object
Source:
Returns:
Type
String

l() → {String}

Returns a link.
Source:
Returns:
Type
String

language_default() → {String}

Get the default language from Drupal.settings.
Source:
Returns:
Type
String

list_assemble_form_state_into_field(entity_type, bundle, form_state_value, field, instance, langcode, delta, field_key) → {*}

Implements hook_assemble_form_state_into_field().
Parameters:
Name Type Description
entity_type Object
bundle String
form_state_value String
field Object
instance Object
langcode String
delta Number
field_key Object
Source:
Returns:
Type
*

list_field_formatter_view(entity_type, entity, field, instance, langcode, items, display) → {Object}

Implements hook_field_formatter_view().
Parameters:
Name Type Description
entity_type String
entity Object
field Object
instance Object
langcode String
items Object
display *
Source:
Returns:
Type
Object

list_views_exposed_filter(form, form_state, element, filter, field)

Implements hook_views_exposed_filter().
Parameters:
Name Type Description
form Object
form_state Object
element Object
filter Object
field Object
Source:
Implements hook_block_view().
Parameters:
Name Type Description
delta String
region Object
Source:
Returns:
Type
String
The pageshow handler for menu blocks.
Parameters:
Name Type Description
options Object
Source:
Given a menu name, this will return its container id for that page. You may optionally pass in a page id as the second argument, otherwise it will use the current page id.
Parameters:
Name Type Description
menu_name String
Source:
Returns:
Type
String
Execute the page callback associated with the current path and return its content.
Source:
Returns:
Type
Object
Gets a router item.
Source:
Returns:
Type
Object
Implements hook_install().
Source:
Returns default menu item attributes.
Source:
Returns:
Type
Object
Returns default menu item options.
Source:
Returns:
Type
Object
Returns an array containing the names of system-defined (default) menus.
Source:
Returns:
Type
Object
Given a menu name, this will return it from drupalgap.menus, or return null if it doesn't exist.
Parameters:
Name Type Description
name String
Source:
Returns:
Type
*
Returns a JSON object that can be used as default options for a menu object.
Source:
Returns:
Type
Object
Given a menu region link, this will return its data JSON object, or null if no data exists.
Parameters:
Name Type Description
region_link Object
Source:
Returns:
{*)
Given a menu region link's class name, this will return what side of the ui it is on, returns left by default, unless it specifically contains the ui-btn-right class.
Parameters:
Name Type Description
class_name String
Source:
Returns:
{String)
Collects and alters the menu definitions.
Source:
Given a menu, this adds it to drupalgap.menus. See menu_list_system_menus for examples of a menu JSON object.
Parameters:
Name Type Description
menu Object
Source:

model_load(module, name) → {Object}

Given a module name and a corresponding model name, this will load the model from drupalgap.mvc.models.
Parameters:
Name Type Description
module String
name String
Source:
Returns:
Type
Object

module_exists(name) → {Boolean}

Given a module name, this returns true if the module is enabled, false otherwise.
Parameters:
Name Type Description
name String The name of the module
Source:
Returns:
Type
Boolean

module_implements(hook) → {Array}

Determines which modules are implementing a hook. Returns an array with the names of the modules which are implementing this hook. If no modules implement the hook, it returns false.
Parameters:
Name Type Description
hook String
Source:
Returns:
Type
Array

module_invoke(module, hook) → {*}

Given a module name and a hook name, this will invoke that module's hook.
Parameters:
Name Type Description
module String
hook String
Source:
Returns:
Type
*

module_invoke_all(hook) → {Array}

Given a hook name, this will invoke all modules that implement the hook.
Parameters:
Name Type Description
hook String
Source:
Returns:
Type
Array

module_load(name) → {Object|Boolean}

Given a module name, this will return the module inside Drupal.modules, or false if it fails to find it.
Parameters:
Name Type Description
name String
Source:
Returns:
Type
Object | Boolean

module_object_template(name) → {Object}

Initializes and returns a JSON object template that all modules should use when declaring themselves.
Parameters:
Name Type Description
name String
Source:
Returns:
Type
Object

module_types() → {Array}

Returns an array of module type names.
Source:
Returns:
Type
Array

mvc_get_collection_key(bucket, module, model_type) → {String}

Given a bucket (e.g. collection, settings), module name and mvc model type, this will return the local storage key used for the model type's item collection.
Parameters:
Name Type Description
bucket String
module String
model_type String
Source:
Returns:
Type
String

mvc_install()

Implements hook_install().
Source:

mvc_menu() → {Object}

Implements hook_menu().
Source:
Returns:
Type
Object

mvc_model_system_fields() → {Array}

Returns an array of system fields (properties) to be used on item JSON object.
Source:
Returns:
Type
Array

node_access(node) → {Boolean}

Given a node, this determines if the current user has access to it. Returns true if so, false otherwise. This function implementation is incomplete, use with caution.
Parameters:
Name Type Description
node Object
Source:
Returns:
Type
Boolean

node_add_page() → {Object}

Page call back for node/add.
Source:
Returns:
Type
Object

node_add_page_by_type(type) → {Object}

Page call back function for node/add/[type].
Parameters:
Name Type Description
type String
Source:
Returns:
Type
Object

node_add_page_by_type_title(callback, type) → {Object}

Title call back function for node/add/[type].
Parameters:
Name Type Description
callback function
type String
Source:
Returns:
Type
Object

node_create(node, options)

Creates a node.
Parameters:
Name Type Description
node Object
options Object
Source:

node_delete(nid, options)

Delete a node.
Parameters:
Name Type Description
nid Number
options Object
Source:

node_edit(form, form_state, node) → {Object}

The node edit form.
Parameters:
Name Type Description
form Object
form_state Object
node Object
Source:
Returns:
Type
Object

node_edit_submit(form, form_state)

The node edit form's submit function.
Parameters:
Name Type Description
form Object
form_state Object
Source:

node_index(query, options)

Perform a node index.
Parameters:
Name Type Description
query Object
options Object
Source:

node_load(nid, options)

Loads a node.
Parameters:
Name Type Description
nid Number
options Object
Source:

node_menu() → {Object}

Implements hook_menu().
Source:
Returns:
Type
Object

node_page() → {Object}

Page callback for node.
Source:
Returns:
Type
Object

node_page_pageshow()

The jQM pageshow callback for the node listing page.
Source:

node_page_title(callback, nid)

The title call back function for the node view page.
Parameters:
Name Type Description
callback function
nid Number
Source:

node_page_view(nid) → {Object}

Page callback for node/%.
Parameters:
Name Type Description
nid Number
Source:
Returns:
Type
Object

node_page_view_pageshow(nid)

jQM pageshow handler for node/% pages.
Parameters:
Name Type Description
nid Number
Source:

node_retrieve(ids, options)

Retrieves a node.
Parameters:
Name Type Description
ids Number
options Object
Source:

node_save(node, options)

Saves a node.
Parameters:
Name Type Description
node Object
options Object
Source:

node_theme() → {Object}

Implements hook_theme().
Source:
Returns:
Type
Object

node_update(node, options)

Update a node.
Parameters:
Name Type Description
node Object
options Object
Source:

number_field_formatter_view(entity_type, entity, field, instance, langcode, items, display) → {Object}

Implements hook_field_formatter_view().
Parameters:
Name Type Description
entity_type String
entity Object
field Object
instance Object
langcode String
items Object
display *
Source:
Returns:
Type
Object

number_field_widget_form(form, form_state, field, instance, langcode, items, delta, element)

Implements hook_field_widget_form().
Parameters:
Name Type Description
form Object
form_state Object
field Object
instance Object
langcode String
items Object
delta Number
element Object
Source:

offline_try_again() → {*}

When the 'try again' button is clicked, check for a connection and if it has one make a call to system connect then go to the front page, otherwise just inform user the device is still offline.
Source:
Returns:
Type
*

options_field_widget_form(form, form_state, field, instance, langcode, items, delta, element) → {*}

Implements hook_field_widget_form().
Parameters:
Name Type Description
form Object
form_state Object
field Object
instance Object
langcode String
items Object
delta Number
element Object
Source:
Returns:
Type
*

path_to_theme() → {String|Boolean}

Returns the path to the current DrupalGap theme, false otherwise.
Source:
Returns:
Type
String | Boolean

scrollToElement()

Source:
See:

search_block_form(form, form_state) → {Object}

The search block form.
Parameters:
Name Type Description
form Object
form_state Object
Source:
Returns:
Type
Object

search_block_form_submit(form, form_state)

The search block form submit handler.
Parameters:
Name Type Description
form Object
form_state Object
Source:

search_block_info() → {Object}

Implements hook_block_info().
Source:
Returns:
Type
Object

search_block_view(delta, region) → {String}

Implements hook_block_view().
Parameters:
Name Type Description
delta String
region String
Source:
Returns:
Type
String

search_form(form, form_state) → {Object}

The search form.
Parameters:
Name Type Description
form Object
form_state Object
Source:
Returns:
Type
Object

search_form_pageshow(form_id)

The pageshow callback for the search form page.
Parameters:
Name Type Description
form_id String
Source:

search_form_submit(form, form_state)

The search form submit handler.
Parameters:
Name Type Description
form Object
form_state Object
Source:

search_menu() → {Object}

Implements hook_menu().
Source:
Returns:
Type
Object

search_node(keys, options)

The search node service.
Parameters:
Name Type Description
keys String The keyword(s) to search for.
options Object
Source:

services_entity_types() → {Array}

Returns an array of entity type machine names configured with Services Entity in settings.js
Source:
Returns:
Type
Array

services_get_csrf_token(options)

Gets the CSRF token from Services.
Parameters:
Name Type Description
options Object
Source:

services_get_resource_function_for_entity(entity_type, crud) → {String}

Returns the name of the jDrupal function to be used when in need of an entity C.R.U.D. operation.
Parameters:
Name Type Description
entity_type String
crud String
Source:
Returns:
Type
String

services_ready() → {Boolean}

Checks if we're ready to make a Services call.
Source:
Returns:
Type
Boolean

services_resource_defaults(options, service, resource)

Given the options for a service call, the service name and the resource name, this will attach the names and their values as properties on the options.
Parameters:
Name Type Description
options Object
service String
resource String
Source:

shuffle(array) → {Array}

Shuffle an array.
Parameters:
Name Type Description
array Array
Source:
See:
Returns:
Type
Array

system_401_page(path) → {String}

Page callback for the 401 page.
Parameters:
Name Type Description
path String
Source:
Returns:
Type
String

system_404_page(path) → {String}

Page callback for the 404 page.
Parameters:
Name Type Description
path String
Source:
Returns:
Type
String

system_block_info() → {Object}

Implements hook_block_info().
Source:
Returns:
Type
Object

system_block_view(delta) → {String}

Implements hook_block_view().
Parameters:
Name Type Description
delta String
Source:
Returns:
Type
String

system_connect(options)

System connect call.
Parameters:
Name Type Description
options Object
Source:

system_dashboard_page() → {Object}

Page callback for the dashboard page.
Source:
Returns:
Type
Object

system_drupalgap_goto_post_process(path)

Implements hook_system_drupalgap_goto_post_process().
Parameters:
Name Type Description
path String
Source:

system_error_page() → {Object}

The page callback for the error page.
Source:
Returns:
Type
Object

system_install()

Implements hook_install().
Source:

system_logout_block_access_callback(options) → {Boolean}

The default access callback function for the logout block. Allows the block to only be shown when a user is viewing their own profile.
Parameters:
Name Type Description
options Object
Source:
Returns:
Type
Boolean

system_menu() → {Object}

Implements hook_menu().
Source:
Returns:
Type
Object

system_offline_page() → {Object}

Call back for the offline page.
Source:
Returns:
Type
Object

system_regions_list() → {Array}

Returns an array of region names defined by the system that themes must use. We do this so Core and Contrib Modules can use these regions for UI needs.
Source:
Returns:
Type
Array

system_reload_page() → {String}

The page callback for the reload page.
Source:
Returns:
Type
String

system_reload_pageshow()

The pageshow callback for the reload page.
Source:

system_settings_form(form, form_state) → {Object}

Add default buttons to a form and set its prefix.
Parameters:
Name Type Description
form Object
form_state Object
Source:
Returns:
Type
Object

system_settings_form_submit(form, form_state)

Execute the system_settings_form.
Parameters:
Name Type Description
form Object
form_state Object
Source:

system_title_block_id(path) → {String}

Returns the block id used on the system's title block.
Parameters:
Name Type Description
path String
Source:
Returns:
Type
String

t(str) → {String}

Returns translated text.
Parameters:
Name Type Description
str String The string to translate
Source:
Returns:
Type
String

taxonomy_assemble_form_state_into_field(entity_type, bundle, form_state_value, field, instance, langcode, delta, field_key) → {Object}

Implements hook_assemble_form_state_into_field().
Parameters:
Name Type Description
entity_type Object
bundle String
form_state_value String
field Object
instance Object
langcode String
delta Number
field_key Object
Source:
Returns:
Type
Object

taxonomy_field_formatter_view(entity_type, entity, field, instance, langcode, items, display) → {Object}

Implements hook_field_formatter_view().
Parameters:
Name Type Description
entity_type String
entity Object
field Object
instance Object
langcode String
items Object
display *
Source:
Returns:
Type
Object

taxonomy_field_widget_form(form, form_state, field, instance, langcode, items, delta, element)

Implements hook_field_widget_form().
Parameters:
Name Type Description
form Object
form_state Object
field Object
instance Object
langcode String
items Object
delta Number
element Object
Source:

taxonomy_form_term(form, form_state, term) → {Object}

The taxonomy term form.
Parameters:
Name Type Description
form Object
form_state Object
term Object
Source:
Returns:
Type
Object

taxonomy_form_term_submit(form, form_state)

The taxonomy term form submit handler.
Parameters:
Name Type Description
form Object
form_state Object
Source:

taxonomy_form_vocabulary(form, form_state, vocabulary) → {Object}

The taxonomy vocabulary form.
Parameters:
Name Type Description
form Object
form_state Object
vocabulary Object
Source:
Returns:
Type
Object

taxonomy_form_vocabulary_submit(form, form_state)

The taxonomy vocabulary form submit handler.
Parameters:
Name Type Description
form Object
form_state Object
Source:

taxonomy_get_tree()

Source:
See:

taxonomy_menu() → {Object}

Implements hook_menu().
Source:
Returns:
Type
Object

taxonomy_term_create(taxonomy_term, options)

Creates a taxonomy term.
Parameters:
Name Type Description
taxonomy_term Object
options Object
Source:

taxonomy_term_delete(tid, options)

Delete a taxonomy term.
Parameters:
Name Type Description
tid Number
options Object
Source:

taxonomy_term_index(query, options)

Perform a taxonomy_term index.
Parameters:
Name Type Description
query Object
options Object
Source:

taxonomy_term_load(tid, options)

Loads a taxonomy term.
Parameters:
Name Type Description
tid Number
options Object
Source:

taxonomy_term_page(tid) → {Object}

Page callback for taxonomy/term/%.
Parameters:
Name Type Description
tid Number
Source:
Returns:
Type
Object

taxonomy_term_pageshow(tid)

jQM pageshow callback for taxonomy/term/%
Parameters:
Name Type Description
tid Number
Source:

taxonomy_term_retrieve(ids, options)

Retrieves a taxonomy term.
Parameters:
Name Type Description
ids Number
options Object
Source:

taxonomy_term_save(taxonomy_term, options)

Saves a taxonomy term.
Parameters:
Name Type Description
taxonomy_term Object
options Object
Source:

taxonomy_term_selectNodes(tid, options)

The selectNodes resource from the Taxonomy Term service.
Parameters:
Name Type Description
tid Number The taxonomy term id.
options Object
Source:

taxonomy_term_update(taxonomy_term, options)

Update a taxonomy term.
Parameters:
Name Type Description
taxonomy_term Object
options Object
Source:

taxonomy_views_exposed_filter(form, form_state, element, filter, field)

Implements hook_views_exposed_filter().
Parameters:
Name Type Description
form Object
form_state Object
element Object
filter Object
field Object
Source:

taxonomy_vocabularies_page() → {Object|Object}

Page call back for taxonomy/vocabularies.
Source:
Returns:
  • Type
    Object
  • Type
    Object

taxonomy_vocabularies_pageshow()

jQM pageshow call back for taxonomy/vocabularies.
Source:

taxonomy_vocabulary_create(taxonomy_vocabulary, options)

Creates a taxonomy vocabulary.
Parameters:
Name Type Description
taxonomy_vocabulary Object
options Object
Source:

taxonomy_vocabulary_delete(vid, options)

Delete a taxonomy vocabulary.
Parameters:
Name Type Description
vid Number
options Object
Source:

taxonomy_vocabulary_get_vid_from_name(name) → {Number|Boolean}

Given a vocabulary machine name this will return the vocabulary id or false.
Parameters:
Name Type Description
name String
Source:
Returns:
Type
Number | Boolean

taxonomy_vocabulary_index(query, options)

Perform a taxonomy_vocabulary index.
Parameters:
Name Type Description
query Object
options Object
Source:

taxonomy_vocabulary_load(vid, options)

Loads a taxonomy vocabulary.
Parameters:
Name Type Description
vid Number
options Object
Source:

taxonomy_vocabulary_machine_name_load(name) → {Object|Boolean}

Given a vocabulary machine name this will return the JSON object for the vocabulary that is attached to the drupalgap.taxonomy_vocabularies object, or false if it doesn't exist.
Parameters:
Name Type Description
name String
Source:
Returns:
Type
Object | Boolean

taxonomy_vocabulary_page(vid) → {String|Object}

Page callback for taxonomy/vocabulary/%
Parameters:
Name Type Description
vid Number
Source:
Returns:
Type
String | Object

taxonomy_vocabulary_pageshow(vid)

jQM pageshow callback for taxonomy/vocabulary/%.
Parameters:
Name Type Description
vid Number
Source:

taxonomy_vocabulary_retrieve(ids, options)

Retrieves a comment.
Parameters:
Name Type Description
ids Number
options Object
Source:

taxonomy_vocabulary_save(taxonomy_vocabulary, options)

Saves a taxonomy vocabulary.
Parameters:
Name Type Description
taxonomy_vocabulary Object
options Object
Source:

taxonomy_vocabulary_update(taxonomy_vocabulary, options)

Update a taxonomy vocabulary.
Parameters:
Name Type Description
taxonomy_vocabulary Object
options Object
Source:

template_preprocess_page(variables)

Implementation of template_preprocess_page().
Parameters:
Name Type Description
variables Object
Source:

template_process_page(variables)

Implementation of template_process_page().
Parameters:
Name Type Description
variables Object
Source:

text_field_formatter_view(entity_type, entity, field, instance, langcode, items, display) → {Object}

Implements hook_field_formatter_view().
Parameters:
Name Type Description
entity_type String
entity Object
field Object
instance Object
langcode String
items Object
display *
Source:
Returns:
Type
Object

text_field_widget_form(form, form_state, field, instance, langcode, items, delta, element)

Implements hook_field_widget_form().
Parameters:
Name Type Description
form Object
form_state Object
field Object
instance Object
langcode String
items Object
delta Number
element Object
Source:

theme(hook, variables) → {String}

Implementation of theme().
Parameters:
Name Type Description
hook String
variables Object
Source:
Returns:
Type
String

theme_audio(variables) → {String}

Implementation of theme_audio().
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_autocomplete(variables) → {String}

Themes an autocomplete.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_button(variables) → {String}

Themes a button.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String
Themes a button link.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_checkbox(variables) → {String}

Themes a checkbox input.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_checkboxes(variables) → {String}

Themes checkboxes input.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_collapsible(variables) → {String}

Themes a collapsible widget.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_collapsibleset(variables) → {String}

Themes a collapsibleset widget.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_comment(variables) → {String}

Theme's a comment.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_comments(variables) → {String}

Theme's a comment container.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_controlgroup(variables) → {String}

Themes a controlgroup widget.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_email(variables) → {String}

Themes a email input.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_file(variables) → {string}

Themes a file input.
Parameters:
Name Type Description
variables
Source:
Returns:
Type
string

theme_form_element_label(variables) → {String}

Themes a form element label.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_form_required_marker(variables) → {String}

Themes a marker for a required form element label.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_header(variables) → {String}

Themes a header widget.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_hidden(variables) → {String}

Themes a hidden input.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_image(variables) → {String}

Implementation of theme_image().
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_image_style(variables) → {String}

Implementation of theme_image_style().
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_item(variables) → {String}

Theme's an item from an MVC collection.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_item_list(variables) → {String}

Implementation of theme_item_list().
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_jqm_item_list(variables) → {String}

Identical to theme_item_list, except this turns the list into a jQM listview.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_jqm_table(variables) → {String}

Theme a jQueryMobile table.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String
Implementation of theme_link().
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_logout(variables) → {String}

Themes the logout button.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_number(variables) → {String}

Themes a number input.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_pager(variables) → {String}

Themes a pager.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String
Themes a pager link.
Parameters:
Name Type Description
variables Object
link_vars Object
Source:
Returns:
Type
String

theme_pager_next(variables) → {String}

Themes a pager next link.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_pager_previous(variables) → {String}

Themes a pager previous link.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_password(variables) → {String}

Themes a password input.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_popup(variables) → {String}

Themes a popup widget.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_radios(variables) → {String}

Themes radio buttons.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_range(variables) → {String}

Themes a range input.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String
Themes a search input.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_search_result_node(variables) → {String}

Themes a search result node.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_select(variables) → {String}

Themes a select list input.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_submit(variables) → {String}

Implementation of theme_submit().
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_table(variables) → {String}

Implementation of theme_table().
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_taxonomy_term_reference(variables) → {String}

Theme's the html for a taxonomy term reference field.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_tel(variables) → {String}

Themes a telephone input.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_textarea(variables) → {String}

Themes a textarea input.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_textfield(variables) → {String}

Themes a text input.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_video(variables) → {String}

Implementation of theme_video().
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_view(variables) → {String}

Themes a view.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_views_spacer(variables) → {String}

Themes a spacer that can be placed between displayed components of the view.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

theme_views_view(variables) → {String}

Theme's a view.
Parameters:
Name Type Description
variables Object
Source:
Returns:
Type
String

time() → {Number}

Javascript equivalent of php's time() function.
Source:
Returns:
Type
Number

ucfirst(str) → {String}

Given a string, this will change the first character to upper case and return the new string.
Parameters:
Name Type Description
str String
Source:
Returns:
Type
String

user_access(string) → {Boolean}

Determine whether the user has a given privilege. Optionally pass in a user account JSON object for the second paramater to check that particular account.
Parameters:
Name Type Description
string String The permission, such as "administer nodes", being checked for.
Source:
Returns:
Type
Boolean

user_create(account, options)

Creates a user.
Parameters:
Name Type Description
account Object
options Object
Source:

user_delete(uid, options)

Delete a user.
Parameters:
Name Type Description
uid Number
options Object
Source:

user_edit_access(account) → {Boolean}

The access callback for the user/%/edit page.
Parameters:
Name Type Description
account Object
Source:
Returns:
Type
Boolean

user_index(query, options)

Perform a user index.
Parameters:
Name Type Description
query Object
options Object
Source:

user_listing() → {Object}

A page call back function to display a simple list of drupal users.
Source:
Returns:
Type
Object

user_listing_empty(view) → {String}

The empty callback for the simple user listing page.
Parameters:
Name Type Description
view
Source:
Returns:
Type
String

user_listing_row(view, row) → {String}

The row callback for the simple user listing page.
Parameters:
Name Type Description
view
row
Source:
Returns:
Type
String

user_load(uid, options)

Loads a user account.
Parameters:
Name Type Description
uid Number
options Object
Source:

user_login(name, pass, options)

Login user.
Parameters:
Name Type Description
name String
pass String
options Object
Source:

user_login_form(form, form_state) → {Object}

The user login form.
Parameters:
Name Type Description
form Object
form_state Object
Source:
Returns:
Type
Object

user_login_form_submit(form, form_state)

The user login form submit handler.
Parameters:
Name Type Description
form Object
form_state Object
Source:

user_logout(options)

Logout current user.
Parameters:
Name Type Description
options Object
Source:

user_logout_callback() → {String}

The user logout page callback.
Source:
Returns:
Type
String

user_logout_pageshow()

The user logout pageshow callback. This actually handles the call to the user logout service resource.
Source:

user_menu() → {Object}

Implements hook_menu().
Source:
Returns:
Type
Object

user_page() → {String}

Page callback for the user page.
Source:
Returns:
Type
String

user_pass_form(form, form_state) → {Object}

The request new password form.
Parameters:
Name Type Description
form Object
form_state Object
Source:
Returns:
Type
Object

user_pass_form_submit(form, form_state)

The request new password form submission handler.
Parameters:
Name Type Description
form Object
form_state Object
Source:

user_password() → {String}

Generates a random user password.
Source:
Returns:
Type
String

user_profile_form(form, form_state, account) → {Object}

The user profile form.
Parameters:
Name Type Description
form Object
form_state Object
account Object
Source:
Returns:
Type
Object

user_profile_form_submit(form, form_state)

The user profile form submit handler.
Parameters:
Name Type Description
form Object
form_state Object
Source:

user_profile_form_validate(form, form_state)

The user profile form validate handler.
Parameters:
Name Type Description
form Object
form_state Object
Source:

user_register(account, options)

Registers a user.
Parameters:
Name Type Description
account Object
options Object
Source:

user_register_access() → {Boolean}

Access callback for the user registration page.
Source:
Returns:
Type
Boolean

user_register_form(form, form_state) → {Object}

The user registration form.
Parameters:
Name Type Description
form Object
form_state Object
Source:
Returns:
Type
Object

user_register_form_submit(form, form_state)

The user registration form submit handler.
Parameters:
Name Type Description
form Object
form_state Object
Source:

user_register_form_validate(form, form_state)

Define the form's validation function (optional).
Parameters:
Name Type Description
form Object
form_state Object
Source:

user_request_new_password(name, options)

The "request_new_password" service resource.
Parameters:
Name Type Description
name String User name or e-mail address.
options Object
Source:

user_retrieve(ids, options)

Retrieves a user.
Parameters:
Name Type Description
ids Number
options Object
Source:

user_save(account, options)

Saves a user account.
Parameters:
Name Type Description
account Object
options Object
Source:

user_services_postprocess(options, result)

Implements hook_services_postprocess().
Parameters:
Name Type Description
options Object
result Object
Source:

user_theme() → {Object}

Implements hook_theme().
Source:
Returns:
Type
Object

user_update(account, options)

Updates a user.
Parameters:
Name Type Description
account Object
options Object
Source:

user_view(uid) → {Object}

Page callback for user/%.
Parameters:
Name Type Description
uid Number
Source:
Returns:
Type
Object

user_view_pageshow(uid)

jQM pageshow handler for node/% pages.
Parameters:
Name Type Description
uid Number
Source:

user_view_title(callback, uid)

Title callback for the user profile view page.
Parameters:
Name Type Description
callback function
uid Number
Source:

variable_del(name) → {*}

Given a variable name, this will remove the value from local storage.
Parameters:
Name Type Description
name String
Source:
Returns:
Type
*

variable_get(name, default_value) → {*}

Given a variable name and a default value, this will first attempt to load the variable from local storage, if it can't then the default value will be returned.
Parameters:
Name Type Description
name String
default_value *
Source:
Returns:
Type
*

variable_set(name, value) → {*}

Given a variable name and value, this will save the value to local storage, keyed by its name.
Parameters:
Name Type Description
name String
value *
Source:
Returns:
Type
*

views_datasource_get_view_result(path, options)

Given a path to a Views Datasource (Views JSON) view, this will get the results and pass them along to the provided success callback.
Parameters:
Name Type Description
path String
options Object
Source:

views_embed_view(path, options)

Returns the html string to options.success, used to embed a view.
Parameters:
Name Type Description
path String
options Object
Source:

views_embedded_view_delete(page_id) → {boolean}

Given a page id, this will delete the embedded view for the page from memory. Returns true if successful, false otherwise.
Parameters:
Name Type Description
page_id
Source:
Returns:
Type
boolean

views_embedded_view_get(page_id) → {Object}

Gets an embedded view for the given page id.
Parameters:
Name Type Description
page_id String
Source:
Returns:
Type
Object

views_embedded_view_set(page_id, property, value)

Given a page id, property name and value, this will set the value for the embedded view.
Parameters:
Name Type Description
page_id String
property String
value *
Source:

views_exposed_form(form, form_state, options) → {Object}

The exposed filter form builder.
Parameters:
Name Type Description
form Object
form_state Object
options Object
Source:
Returns:
Type
Object

views_exposed_form_reset()

Handles clicks on the views exposed filter form's reset button.
Source:

views_exposed_form_submit(form, form_state)

The exposed filter submission handler.
Parameters:
Name Type Description
form Object
form_state Object
Source: