You are here

function juicerio_block_configure in Juicer - Social Media Feed Aggregator 7

Implements hook_block_configure().

File

./juicerio.module, line 137
Module file for the Juicer Integration module.

Code

function juicerio_block_configure($delta = 1) {
  $form = array();
  $form['juicero'] = array(
    '#type' => 'fieldset',
    '#title' => t('Juicer feed settings'),
    '#collapsible' => TRUE,
  );

  // Number of posts
  $form['juicero'][$delta . '_post_number'] = array(
    '#type' => 'select',
    '#title' => t('Number of posts'),
    '#default_value' => variable_get($delta . '_post_number', NULL),
    '#options' => drupal_map_assoc(array(
      1,
      2,
      3,
      5,
      10,
      15,
      20,
      25,
      50,
      75,
      100,
      250,
      500,
      1000,
    )),
    '#description' => t('Set the total number of posts shown. Defaults to 100.'),
  );

  // Infinite scrolling pages
  $form['juicero'][$delta . '_infinite_pages'] = array(
    '#type' => 'select',
    '#title' => t('Number of scrolling pages'),
    '#default_value' => variable_get($delta . '_infinite_pages', 0),
    '#options' => drupal_map_assoc(array(
      0,
      1,
      2,
      3,
      4,
      5,
      6,
      7,
      8,
      9,
      10,
      15,
      20,
      25,
      50,
      100,
    )),
    '#description' => t('Set to 0 your feed will scroll infinitely: more and more posts will keep being added to the feed until all your posts are visible.<br />
      If set to 1, only the first page of results will be visible. If set to 2, the feed will scroll just once.'),
  );

  // Space between posts
  $form['juicero'][$delta . '_gutter_amt'] = array(
    '#type' => 'textfield',
    '#title' => t('Column gutter size'),
    '#field_suffix' => t('pixels'),
    '#size' => 5,
    '#default_value' => variable_get($delta . '_gutter_amt', NULL),
    '#description' => t('The column gutter is the horrizontal space between columns of posts. Defaults to 20 pixels.'),
  );

  // Change number of columns
  $form['juicero'][$delta . '_column_number'] = array(
    '#type' => 'select',
    '#title' => t('Number of columns'),
    '#default_value' => variable_get($delta . '_column_number', NULL),
    '#options' => drupal_map_assoc(array(
      1,
      2,
      3,
      4,
      5,
      6,
      7,
      8,
      9,
      10,
      11,
      12,
    )),
    '#description' => t("Columns are not allowed to be less than 200px (as it doesn't look good). If the number of columns set here is not respected, increase the size of the containing element."),
  );

  // Filter the posts based on social account
  $form['juicero'][$delta . '_filter'] = array(
    '#type' => 'textfield',
    '#title' => t('Filter the posts based on social account'),
    '#default_value' => variable_get($delta . '_filter', NULL),
    '#description' => t('To filter your posts, enter either the capitalized name of the source, or the account name of source source.<br />
       Example: If you have an Instagram source of #tbt, enter either <em>tbt</em> or <em>Instagram</em> to only show posts from that source.<br />
       Note: If you have multiple Instagram srouces entering <em>Instagram<em> will show posts from all of them.'),
  );
  return $form;
}