You are here

function skinr_skin_get_sids in Skinr 7.2

Same name and namespace in other branches
  1. 8.2 skinr.module \skinr_skin_get_sids()

Get skin configuration IDs.

Parameters

$filter_by: An associative array whose keys are:

  • theme: (optional) The theme.
  • module: (optional) The module.
  • element: (optional) The element ID.
  • skin: (optional) The skin name.
  • status: (optional) Boolean indicating whether or not this skin configuration is enabled.

Return value

An array of skin configuration IDs.

5 calls to skinr_skin_get_sids()
skinr_preprocess in ./skinr.module
Implements hook_preprocess().
skinr_ui_admin_library_form_submit in ./skinr_ui.admin.inc
Form submission handler for skinr_ui_admin_library_form().
skinr_ui_export_form in ./skinr_ui.admin.inc
Form builder for the Skinr settings export form.
skinr_ui_form_get_defaults in ./skinr_ui.edit.inc
Helper function to get the default values for the skinr edit form.
skinr_ui_form_submit in ./skinr_ui.edit.inc
Form submission handler for skinr_ui_form_alter().

File

./skinr.module, line 1193
Handles core Skinr functionality.

Code

function skinr_skin_get_sids($filter_by = array()) {
  $query = db_select('skinr_skins', 's')
    ->fields('s', array(
    'sid',
  ));
  if (isset($filter_by['theme'])) {
    $query
      ->condition('theme', $filter_by['theme']);
  }
  if (isset($filter_by['module'])) {
    $query
      ->condition('module', $filter_by['module']);
  }
  if (isset($filter_by['element'])) {
    $query
      ->condition('element', $filter_by['element']);
  }
  if (isset($filter_by['skin'])) {
    $query
      ->condition('skin', $filter_by['skin']);
  }
  if (isset($filter_by['status'])) {
    $query
      ->condition('status', $filter_by['status']);
  }
  return $query
    ->execute()
    ->fetchCol();
}