You are here

function skinr_context_group_get_gids in Skinr 7.2

Same name and namespace in other branches
  1. 8.2 skinr_context/skinr_context.module \skinr_context_group_get_gids()

Get skin settings group IDs.

Parameters

$filter_by: An associative array whose keys are:

  • module: (optional) The module.
  • element: (optional) The element ID.

Return value

An array of skin settings group IDs.

2 calls to skinr_context_group_get_gids()
skinr_context_ui_group_list in skinr_context/skinr_context_ui.edit.inc
Menu callback; lists skin settings groups for an element.
_skinr_context_add_default_group in skinr_context/skinr_context.module
Helper function to add a new default group to a skin configuration.

File

skinr_context/skinr_context.module, line 492
Provides Skinr integration with Context.

Code

function skinr_context_group_get_gids($filter_by = array()) {
  $query = db_select('skinr_groups', 'g')
    ->fields('g', array(
    'gid',
  ));
  if (isset($filter_by['module'])) {
    $query
      ->condition('module', $filter_by['module']);
  }
  if (isset($filter_by['element'])) {
    $query
      ->condition('element', $filter_by['element']);
  }

  // Take weight into account.
  $query
    ->orderBy('weight');
  $query
    ->orderBy('gid');
  return $query
    ->execute()
    ->fetchCol();
}