You are here

function hook_environment_workflow in Environment 6

Same name and namespace in other branches
  1. 7 environment.api.php \hook_environment_workflow()

Define qualities about a given environment workflow.

Environment workflows might also be thought of as environment namespaces. A given site might have a number of different environment contexts. The default workflow is NULL, and represents a straightforward site deployment workflow.

In the example for hook_environmnet, a pair of states are created for a 'public' workflow which is intended to be used to indicate whether the site is actually live, as opposed to in a state for internal testing.

Other workflows that may be useful could include the current state of functional development vs. front-end design, or administrative review stages of the site as a software project.

Return value

Array Array of workflows indexed on machine name. Supported elements include:

  • label: The human-readable name for the workflow.
  • description: Extended description of the workflow.
1 function implements hook_environment_workflow()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

environment_environment_workflow in ./environment.module
Implementation of hook_environment_workflow().
1 invocation of hook_environment_workflow()
environment_workflow_load in ./environment.module
Get the current assortment of Workflows.

File

./environment.api.php, line 134
Hooks provided by Environment.

Code

function hook_environment_workflow() {
  $workflows = array();
  $workflows['public'] = array(
    'label' => t('Publicly accessible'),
  );
  $workflows['design'] = array(
    'label' => t('Design status'),
    'description' => t('Set the current status of design/front-end work for the site.'),
  );
  $workflows['review'] = array(
    'label' => t('Administrative review'),
  );
  return $workflows;
}