function cis_section_all_sections

cis7 cis_section.module cis_section_all_sections($active_only = FALSE)
cle7 cis_section.module cis_section_all_sections($active_only = FALSE)
elmsmedia7 cis_section.module cis_section_all_sections($active_only = FALSE)
icor7 cis_section.module cis_section_all_sections($active_only = FALSE)
meedjum_blog7 cis_section.module cis_section_all_sections($active_only = FALSE)
mooc7 cis_section.module cis_section_all_sections($active_only = FALSE)

Return all found sections as these are valid for switching

This is essentially a list of the current user's groups

Parameters

$active_only: (optional) Whether or not to return only the active sections this user is a part of.

Return value

$sections array of section key paired as key => name

2 calls to cis_section_all_sections()
cis_section_cron in sites/all/modules/elmsln_contrib/cis_connector/features/cis_section/cis_section.module
Implements hook_cron().
cis_service_connection_block_section_context_changer_form in sites/all/modules/elmsln_contrib/cis_connector/modules/cis_service_connection/cis_service_connection.module
Callback to render a list of optional section contexts to cycle through

File

sites/all/modules/elmsln_contrib/cis_connector/features/cis_section/cis_section.module, line 144
Code for the CIS Section feature.

Code

function cis_section_all_sections($active_only = FALSE) {
  $sections = array();
  // select field section data
  $query = new EntityFieldQuery();
  // pull all nodes
  $query->entityCondition('entity_type', 'node')
  // that are sections
  ->entityCondition('bundle', 'section')
  // that are published
  ->propertyCondition('status', 1);
  // allow for filtering by active state
  if ($active_only) {
    $query->fieldCondition('field_cis_active', 'value', 1, '=');
  }
  // store results
  $result = $query->execute();
  // ensure we have results
  if (isset($result['node'])) {
    $nids = array_keys($result['node']);
    $results = entity_load('node', $nids);
    // convert to a readable array of options
    foreach ($results as $val) {
      $section = $val->field_section_id['und'][0]['safe_value'];
      $sections[$section] = $val->title;
    }
    // useful for custom college / university integrations
    drupal_alter('cis_section_list', $sections);
  }
  return $sections;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.