You are here

function slick_get_grid_elements in Slick Carousel 7.2

Same name and namespace in other branches
  1. 7.3 includes/slick.admin.inc \slick_get_grid_elements()

Returns reusable grid elements across Slick field formatter and Views.

File

includes/slick.admin.inc, line 811
Contains optional functions called only if needed by admin pages.

Code

function slick_get_grid_elements(array &$elements, $settings, &$form_state) {
  $grid_options = drupal_map_assoc(range(1, 12));
  $elements['grid'] = array(
    '#type' => 'select',
    '#title' => t('Grid large'),
    '#options' => $grid_options,
    '#description' => t('The amount of block grid columns for large monitors 64.063em - 90em. <br /><strong>Requires</strong>:<ol><li>Visible slides,</li><li>Skin Grid for starter,</li><li>A reasonable amount of contents,</li><li>Optionset with Rows and slidesPerRow = 1.</li></ol>This is module feature using the Foundation block grid, older than core Rows, and offers more flexibility. Leave empty to DIY, or to not build grids.'),
    '#prefix' => '<h3 class="form--slick__title">' . t('Group individual slide as block grid?<small>An older alternative to core <strong>Rows</strong> option. Only works if the total items &gt; <strong>Visible slides</strong>. <br />block grid != slidesToShow option, yet both can work in tandem.<br />block grid = Rows option, yet the first is module feature, the later core.</small>') . '</h3>',
  );
  $elements['grid_medium'] = array(
    '#type' => 'select',
    '#title' => t('Grid medium'),
    '#options' => $grid_options,
    '#description' => t('The amount of block grid columns for medium devices 40.063em - 64em.'),
  );
  $elements['grid_small'] = array(
    '#type' => 'select',
    '#title' => t('Grid small'),
    '#options' => $grid_options,
    '#description' => t('The amount of block grid columns for small devices 0 - 40em.'),
  );
  $elements['visible_slides'] = array(
    '#type' => 'select',
    '#title' => t('Visible slides'),
    '#options' => drupal_map_assoc(range(1, 32)),
    '#description' => t('How many items per slide displayed at a time. Required if Grid provided. Grid will not work if Views rows count &lt; <strong>Visible slides</strong>.'),
  );
  $elements['preserve_keys'] = array(
    '#title' => t('Preserve keys'),
    '#type' => 'checkbox',
    '#description' => t('If checked, keys will be preserved. Default is FALSE which will reindex the grid chunk numerically.'),
  );
  drupal_alter('slick_grid_elements_info', $elements, $settings, $form_state);
}