/[drupal]/contributions/modules/image_cycle/image_cycle.module
ViewVC logotype

Diff of /contributions/modules/image_cycle/image_cycle.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.1, Fri May 1 02:47:13 2009 UTC revision 1.1.2.2, Fri May 1 03:02:52 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: image_cycle.module,v 1.1 2008/12/29 22:30:24 boombatower Exp $  // $Id: image_cycle.module,v 1.1.2.1 2009/05/01 02:47:13 boombatower Exp $
3  /**  /**
4   * @file   * @file
5   * Create an image slideshow from images in a gallery using the jQuery Cycle plugin.   * Create an image slideshow from images in a gallery using the jQuery Cycle plugin.
# Line 49  function image_cycle_form_alter($form_id Line 49  function image_cycle_form_alter($form_id
49      $form['image_cycle']['effect'] = array(      $form['image_cycle']['effect'] = array(
50        '#type' => 'select',        '#type' => 'select',
51        '#title' => t('Effect'),        '#title' => t('Effect'),
52          '#description' => t('Please note that the available effects will depend on which version of the jQuery Cycle Plugin ' .
53                              'is installed.'),
54        '#options' => array(        '#options' => array(
55          'blindX',          'blindX',
56          'blindY',          'blindY',
# Line 84  function image_cycle_form_alter($form_id Line 86  function image_cycle_form_alter($form_id
86      $form['image_cycle']['parameters'] = array(      $form['image_cycle']['parameters'] = array(
87        '#type' => 'textarea',        '#type' => 'textarea',
88        '#title' => t('Parameters'),        '#title' => t('Parameters'),
89        '#description' => t('Custom parameters to pass with the effect. Place each parameter on a line in the format KEY:VALUE.' .        '#description' => t('Custom parameters to pass with the effect. Place each parameter on a line in the format KEY:VALUE. ' .
90                            'Leave blank for default effect settings.'),                            'Leave blank for default effect settings. ' .
91                              'See the <a href="@reference">jQuery Cycle Plugin - Option Reference</a> for a list options and an ' .
92                              'explaination of what they do.',
93                              array('@reference' => 'http://malsup.com/jquery/cycle/options.html')),
94        '#default_value' => '',        '#default_value' => '',
95      );      );
96    
97        // Implode paramters.
98      $parameters = variable_get('image_cycle_parameters_' . $form['vid']['#value'], array());      $parameters = variable_get('image_cycle_parameters_' . $form['vid']['#value'], array());
99      foreach ($parameters as $key => $value) {      foreach ($parameters as $key => $value) {
100        $form['image_cycle']['parameters']['#default_value'] .= "$key: $value\n";        $form['image_cycle']['parameters']['#default_value'] .= "$key: $value\n";
# Line 97  function image_cycle_form_alter($form_id Line 103  function image_cycle_form_alter($form_id
103      $form['image_cycle']['css'] = array(      $form['image_cycle']['css'] = array(
104        '#type' => 'textarea',        '#type' => 'textarea',
105        '#title' => t('CSS'),        '#title' => t('CSS'),
106        '#description' => t('Custom CSS for the slideshow. The images will be encapsulated by <em>image_cycle_pictures</em>.'),        '#description' => t('Custom CSS for the slideshow. The images will be encapsulated by <em>div.image_cycle_pictures</em>.'),
107        '#default_value' => variable_get('image_cycle_css_' . $form['vid']['#value'], '')        '#default_value' => variable_get('image_cycle_css_' . $form['vid']['#value'], '')
108      );      );
109    }    }
# Line 109  function image_cycle_form_alter($form_id Line 115  function image_cycle_form_alter($form_id
115  function image_cycle_gallery_submit($form_id, &$form_values) {  function image_cycle_gallery_submit($form_id, &$form_values) {
116    variable_set('image_cycle_effect_' . $form_values['vid'], $form_values['image_cycle']['effect']);    variable_set('image_cycle_effect_' . $form_values['vid'], $form_values['image_cycle']['effect']);
117    
118      // Explode parameters by line and key => value pair.
119    $parameters_input = explode("\n", $form_values['image_cycle']['parameters']);    $parameters_input = explode("\n", $form_values['image_cycle']['parameters']);
120    $parameters = array();    $parameters = array();
121    foreach ($parameters_input as $parameter) {    foreach ($parameters_input as $parameter) {

Legend:
Removed from v.1.1.2.1  
changed lines
  Added in v.1.1.2.2

  ViewVC Help
Powered by ViewVC 1.1.2