You are here

function workbench_moderation_states in Workbench Moderation 7.3

Same name and namespace in other branches
  1. 7 workbench_moderation.module \workbench_moderation_states()

Get a list of all moderation states.

Return value

An array of state objects, keyed by state name and ordered by weight. Each state object has name, description, and weight properties.

8 calls to workbench_moderation_states()
WorkbenchModerationDraftTabTestCase::testDraftTab in tests/workbench_moderation.test
workbench_moderation_admin_states_form in ./workbench_moderation.admin.inc
Administration form for states.
workbench_moderation_form_node_form_alter in ./workbench_moderation.module
Implements hook_form_BASE_FORM_ID_alter().
workbench_moderation_i18n_string_list in ./workbench_moderation.module
Implements hook_i18n_string_list().
workbench_moderation_recommended_permissions in ./workbench_moderation.admin.inc
Recommended permissions for typical moderation roles.

... See full list

7 string references to 'workbench_moderation_states'
workbench_moderation_states_features_rebuild in ./workbench_moderation.features.inc
Implements COMPONENT_features_rebuild().
workbench_moderation_states_next in ./workbench_moderation.module
Provides a list of possible next states for this node.
workbench_moderation_transitions in ./workbench_moderation.module
Get a list of all moderation state transitions.
workbench_moderation_update_7001 in ./workbench_moderation.install
Update the 'weight' field on {workbench_moderation_states}.
workbench_moderation_update_7006 in ./workbench_moderation.install
Add machine names to moderation states.

... See full list

File

./workbench_moderation.module, line 1388
Content moderation for Workbench.

Code

function workbench_moderation_states() {
  $states =& drupal_static(__FUNCTION__);
  if (!isset($states)) {
    $states = db_select('workbench_moderation_states', 'states')
      ->fields('states', array(
      'name',
      'label',
      'description',
      'weight',
    ))
      ->orderBy('states.weight', 'ASC')
      ->execute()
      ->fetchAllAssoc('name');
  }
  return $states;
}