You are here

function jquery_social_stream_common_form in jQuery social stream 8.2

Same name and namespace in other branches
  1. 8 jquery_social_stream.module \jquery_social_stream_common_form()
  2. 7.2 jquery_social_stream.module \jquery_social_stream_common_form()
  3. 7 jquery_social_stream.module \jquery_social_stream_common_form()

Common stream settings.

1 call to jquery_social_stream_common_form()
jquery_social_stream_settings_form in ./jquery_social_stream.module
General stream settings.

File

./jquery_social_stream.module, line 295
Code for the Campaign social media module.

Code

function jquery_social_stream_common_form($conf) {
  $form = array();
  _jquery_social_stream_settings_text($form, $conf, 'remove', 'Removed posts', 'This option allows you to remove specific posts from the stream. To remove posts enter the URL of the post. To remove multiple posts enter each URL separated by a comma (e.g <em>https://twitter.com/designchemical/status/364012915533164544</em>)');
  _jquery_social_stream_settings_text($form, $conf, 'twitterId', 'Twitter ID', 'Enter your twitter username to be used when sharing posts via twitter - this will be added to the tweets as "via @username".');
  _jquery_social_stream_settings_select($form, $conf, 'max', 'Feed size mode', 'Set whether to create the feed based on maximum days or number of results per network.', array(
    'days' => t('Age'),
    'limit' => t('Limit'),
  ), 'days');
  _jquery_social_stream_settings_text($form, $conf, 'days', 'Age', 'Maximum age of stream items in days.', 30);
  $form['days']['#states'] = array(
    'visible' => array(
      ':input[name$="[max]"]' => array(
        'value' => 'days',
      ),
    ),
  );
  _jquery_social_stream_settings_text($form, $conf, 'limit', 'Limit', 'Maximum number of results to check/return for each social network.', 50);
  $form['limit']['#states'] = array(
    'visible' => array(
      ':input[name$="[max]"]' => array(
        'value' => 'limit',
      ),
    ),
  );
  _jquery_social_stream_settings_select($form, $conf, 'external', 'External links', 'Select whether to open all links in new browser window.', array(
    1 => t('Yes'),
    0 => t('No'),
  ), 0);
  _jquery_social_stream_settings_text($form, $conf, 'speed', 'Speed', 'Speed (in milliseconds) of animation.', '600');
  _jquery_social_stream_settings_text($form, $conf, 'height', 'Height', 'Height in pixels of stream container.', '520');
  _jquery_social_stream_settings_select($form, $conf, 'wall', 'Wall', 'Select whether to output the social stream as an isotope powered social network wall.', array(
    1 => t('Yes'),
    0 => t('No'),
  ), 0);
  _jquery_social_stream_settings_select($form, $conf, 'order', 'Order', 'Set to <em>Random</em> to order wall feed items randomly as opposed to by <em>Date</em>.', array(
    'date' => 'Date',
    'random' => t('Random'),
  ), 'date');
  _jquery_social_stream_settings_select($form, $conf, 'filter', 'Filter', 'Select whether to include a filter navigation allowing the user to filter specific social networks.', array(
    1 => t('Yes'),
    0 => t('No'),
  ), 1);
  _jquery_social_stream_settings_select($form, $conf, 'controls', 'Controls', 'Select whether to include links for controlling feed rotator.', array(
    1 => t('Yes'),
    0 => t('No'),
  ), 1);
  $form['rotate'] = array(
    '#type' => 'details',
    '#title' => t('Rotate'),
    '#tree' => TRUE,
    '#description' => t('Feed rotator options.'),
    '#open' => TRUE,
    '#states' => array(
      'visible' => array(
        ':input[name$="[wall]"]' => array(
          'value' => 0,
        ),
      ),
    ),
  );
  if (!isset($conf['rotate'])) {
    $conf['rotate'] = array();
  }
  _jquery_social_stream_settings_select($form['rotate'], $conf['rotate'], 'direction', 'Direction', 'Direction for content rotation', array(
    'up' => t('Up'),
    'down' => t('Down'),
  ), 'up');
  _jquery_social_stream_settings_text($form['rotate'], $conf['rotate'], 'delay', 'Delay', 'Delay in milliseconds between rotations - if set to 0 the automatic rotation effect is disabled.', '8000');
  _jquery_social_stream_settings_select($form, $conf, 'cache', 'Cache', 'Select whether to cache AJAX response, set to false to force response not to be cached by the browser.', array(
    1 => t('Yes'),
    0 => t('No'),
  ), 0);
  $styles = jquery_social_stream_styles();
  foreach ($styles as &$style) {
    $style = $style['title'];
  }
  $styles['_custom'] = t('Custom');
  $form['theme'] = array(
    '#type' => 'select',
    '#title' => t('Stream style'),
    '#description' => t('Select one of pre-defined themes, or <em>Custom</em> to define custom styling.'),
    '#options' => $styles,
    '#default_value' => isset($conf['theme']) ? $conf['theme'] : reset($styles),
    '#states' => array(
      'visible' => array(
        ':input[name$="[wall]"]' => array(
          'value' => 0,
        ),
      ),
    ),
  );
  _jquery_social_stream_settings_text($form, $conf, 'container', 'Container class', 'CSS class of main element', 'dcsns');
  _jquery_social_stream_settings_text($form, $conf, 'cstream', 'Stream list class', 'CSS class of stream ul tag.', 'stream');
  _jquery_social_stream_settings_text($form, $conf, 'content', 'Content class', 'CSS class of main content wrapper.', 'dcsns-content');
  _jquery_social_stream_settings_text($form, $conf, 'iconPath', 'Icon path', '', $GLOBALS['base_path'] . libraries_get_path('jquery-social-stream') . '/images/dcsns-dark/');
  _jquery_social_stream_settings_text($form, $conf, 'imagePath', 'Image path', '', $GLOBALS['base_path'] . libraries_get_path('jquery-social-stream') . '/images/dcsns-dark/');
  $form['iconPath']['#states'] = $form['imagePath']['#states'] = $form['container']['#states'] = $form['cstream']['#states'] = $form['content']['#states'] = array(
    'visible' => array(
      ':input[name$="[theme]"]' => array(
        'value' => '_custom',
      ),
    ),
  );
  _jquery_social_stream_settings_select($form, $conf, 'debug', 'Debug', 'Select whether to include returned error messages in feed items', array(
    1 => t('Yes'),
    0 => t('No'),
  ), 0);
  return $form;
}