/[drupal]/contributions/modules/lightbox2/lightbox2.admin.inc
ViewVC logotype

Diff of /contributions/modules/lightbox2/lightbox2.admin.inc

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

revision 1.1.2.14, Wed Dec 17 10:31:24 2008 UTC revision 1.1.2.15, Thu Jan 1 16:45:21 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: lightbox2.admin.inc,v 1.1.2.13 2008/09/05 14:32:38 snpower Exp $  // $Id: lightbox2.admin.inc,v 1.1.2.14 2008/12/17 10:31:24 snpower Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 452  function lightbox2_general_settings_form Line 452  function lightbox2_general_settings_form
452   * numeric.   * numeric.
453   */   */
454  function lightbox2_general_settings_form_validate($form, &$form_state) {  function lightbox2_general_settings_form_validate($form, &$form_state) {
455    $border_size = $form_state['values']['lightbox2_border_size'];    if ($form_state['values']['op'] == 'Save configuration') {
456    $box_hex_colour = $form_state['values']['lightbox2_box_color'];      $border_size = $form_state['values']['lightbox2_border_size'];
457    $font_hex_colour = $form_state['values']['lightbox2_font_color'];      $box_hex_colour = $form_state['values']['lightbox2_box_color'];
458    $top_position = $form_state['values']['lightbox2_top_position'];      $font_hex_colour = $form_state['values']['lightbox2_font_color'];
459    $overlay_hex_colour = $form_state['values']['lightbox2_overlay_color'];      $top_position = $form_state['values']['lightbox2_top_position'];
460    $resize_speed = $form_state['values']['lightbox2_resize_speed'];      $overlay_hex_colour = $form_state['values']['lightbox2_overlay_color'];
461    $fadein_speed = $form_state['values']['lightbox2_fadein_speed'];      $resize_speed = $form_state['values']['lightbox2_resize_speed'];
462    $slide_down_speed = $form_state['values']['lightbox2_slidedown_speed'];      $fadein_speed = $form_state['values']['lightbox2_fadein_speed'];
463        $slide_down_speed = $form_state['values']['lightbox2_slidedown_speed'];
464    if (!_lightbox2_validate_hex_color($overlay_hex_colour)) {  
465      form_set_error('lightbox2_overlay_color', t('You must enter a properly formed hex value.'));      if (!_lightbox2_validate_hex_color($overlay_hex_colour)) {
466    }        form_set_error('lightbox2_overlay_color', t('You must enter a properly formed hex value.'));
467        }
468    if (!$form_state['values']['lightbox2_lite']) {  
469      if (!is_numeric($border_size) || $border_size < 0) {      if (!$form_state['values']['lightbox2_lite']) {
470        form_set_error('lightbox2_border_size', t('You must enter a size greater than 0 pixels.'));        if (!is_numeric($border_size) || $border_size < 0) {
471      }          form_set_error('lightbox2_border_size', t('You must enter a size greater than 0 pixels.'));
472          }
473    
474      if (!_lightbox2_validate_hex_color($box_hex_colour)) {        if (!_lightbox2_validate_hex_color($box_hex_colour)) {
475        form_set_error('lightbox2_border_color', t('You must enter a properly formed hex value.'));          form_set_error('lightbox2_border_color', t('You must enter a properly formed hex value.'));
476      }        }
477    
478      if (!_lightbox2_validate_hex_color($font_hex_colour)) {        if (!_lightbox2_validate_hex_color($font_hex_colour)) {
479        form_set_error('lightbox2_font_color', t('You must enter a properly formed hex value.'));          form_set_error('lightbox2_font_color', t('You must enter a properly formed hex value.'));
480      }        }
481    
482      if (!empty($top_position) && (!is_numeric($top_position) || $top_position < 0)) {        if (!empty($top_position) && (!is_numeric($top_position) || $top_position < 0)) {
483        form_set_error('lightbox2_top_position', t('You must enter a size greater than 0 pixels.  Leave blank for default positioning.'));          form_set_error('lightbox2_top_position', t('You must enter a size greater than 0 pixels.  Leave blank for default positioning.'));
484      }        }
485    
486      if (!is_numeric($resize_speed) || $resize_speed <= 0 || $resize_speed >= 10) {        if (!is_numeric($resize_speed) || $resize_speed <= 0 || $resize_speed >= 10) {
487        form_set_error('lightbox2_resize_speed', t('You must enter a duration between 0 and 10 seconds.'));          form_set_error('lightbox2_resize_speed', t('You must enter a duration between 0 and 10 seconds.'));
488      }        }
489    
490      if (!is_numeric($fadein_speed) || $fadein_speed <= 0 || $fadein_speed >= 10) {        if (!is_numeric($fadein_speed) || $fadein_speed <= 0 || $fadein_speed >= 10) {
491        form_set_error('lightbox2_fadein_speed', t('You must enter a duration between 0 and 10 seconds.'));          form_set_error('lightbox2_fadein_speed', t('You must enter a duration between 0 and 10 seconds.'));
492      }        }
493    
494      if (!is_numeric($slide_down_speed) || $slide_down_speed <= 0 || $slide_down_speed >= 10) {        if (!is_numeric($slide_down_speed) || $slide_down_speed <= 0 || $slide_down_speed >= 10) {
495        form_set_error('lightbox2_slidedown_speed', t('You must enter a duration between 0 and 10 seconds.'));          form_set_error('lightbox2_slidedown_speed', t('You must enter a duration between 0 and 10 seconds.'));
496          }
497      }      }
498    }    }
499  }  }

Legend:
Removed from v.1.1.2.14  
changed lines
  Added in v.1.1.2.15

  ViewVC Help
Powered by ViewVC 1.1.2