You are here

royalslider.module in RoyalSlider Integration 8

Same filename and directory in other branches
  1. 7 royalslider.module

Exposes global functionality for using RoyalSlider on your website.

File

royalslider.module
View source
<?php

/**
 * @file
 * Exposes global functionality for using RoyalSlider on your website.
 */

/**
 * Implements hook_theme().
 */
function royalslider_theme() {
  return array(
    'royalslider_formatter' => array(
      'variables' => array(
        'items' => NULL,
        'attributes' => NULL,
      ),
      'file' => 'royalslider.field.inc',
    ),
  );
}

/**
 * Gets an array of optionsets suitable for using as select list options.
 *
 * @param $include_empty
 *   If TRUE a '- None -' option will be inserted in the options array.
 * @return
 *   Array of optionsets both key and value are set to optionset name.
 */
function royalslider_optionset_options($include_empty = TRUE) {
  $optionsets = entity_load_multiple('royalslider_optionset');
  $options = array();
  if ($include_empty && !empty($optionsets)) {
    $options[''] = t('- None -');
  }
  foreach ($optionsets as $name => $optionset) {
    $options[$name] = $optionset
      ->label();
  }
  if (empty($options)) {
    $options[''] = t('No defined optionsets');
  }
  return $options;
}

Functions

Namesort descending Description
royalslider_optionset_options Gets an array of optionsets suitable for using as select list options.
royalslider_theme Implements hook_theme().