[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

/sites/all/modules/swftools/simpleviewer/ -> simpleviewer.admin.inc (source)

   1  <?php
   2  // $Id: simpleviewer.admin.inc,v 1.2 2008/09/07 19:42:14 stuartgreenfield Exp $
   3  
   4  function simpleviewer_admin_form($flat = FALSE) {
   5  
   6    $form['simpleviewer_miscellaneous'] = array(
   7      '#type' => 'fieldset',
   8      '#title' => t('General Settings'),
   9      '#collapsible' => TRUE,
  10      '#collapsed' => TRUE,
  11    );
  12    $form['simpleviewer_miscellaneous']['simpleviewer_display_title'] = array(
  13      '#type' => 'checkbox',
  14      '#default_value' => variable_get('simpleviewer_display_title', 1),
  15      '#title' => t('Display title'),
  16      '#description' => t('Whether to display the node title in the flash animation.'),
  17    );
  18    $form['simpleviewer_miscellaneous']['simpleviewer_display_album'] = array(
  19      '#type' => 'checkbox',
  20      '#default_value' => variable_get('simpleviewer_display_album', 1),
  21      '#title' => t('Display album name'),
  22      '#description' => t('Whether to display the album name in the flash animation.'),
  23    );
  24    $form['simpleviewer_miscellaneous']['simpleviewer_display_link'] = array(
  25      '#type' => 'checkbox',
  26      '#default_value' => variable_get('simpleviewer_display_link', 0),
  27      '#title' => t('Display download link'),
  28      '#description' => t('Apart from the node title, also display a clickable link to allow downloading the originally uploaded image.'),
  29    );
  30    $form['simpleviewer_dimensions'] = array(
  31      '#type' => 'fieldset',
  32      '#title' => t('Dimensions'),
  33      '#collapsible' => TRUE,
  34      '#collapsed' => TRUE,
  35      '#description' => t('All dimensions should be given in pixels.'),
  36    );
  37    $form['simpleviewer_dimensions']['simpleviewer_swf_width'] = array(
  38      '#type' => 'textfield',
  39      '#default_value' => variable_get('simpleviewer_swf_width', 700),
  40      '#size' => 5,
  41      '#maxlength' => 5,
  42      '#title' => t('Width of SimpleViewer'),
  43      '#required' => TRUE,
  44    );
  45    $form['simpleviewer_dimensions']['simpleviewer_swf_height'] = array(
  46      '#type' => 'textfield',
  47      '#default_value' => variable_get('simpleviewer_swf_height', 600),
  48      '#size' => 5,
  49      '#maxlength' => 5,
  50      '#title' => t('Height of SimpleViewer'),
  51      '#required' => TRUE,
  52    );
  53    $form['simpleviewer_dimensions']['simpleviewer_xml_maxImageWidth'] = array(
  54      '#type' => 'textfield',
  55      '#default_value' => variable_get('simpleviewer_xml_maxImageWidth', 480),
  56      '#size' => 5,
  57      '#maxlength' => 5,
  58      '#title' => t('Width of your largest image in pixels'),
  59      '#required' => TRUE,
  60      '#description' => t('Used to determine the best layout for your gallery.'),
  61    );
  62    $form['simpleviewer_dimensions']['simpleviewer_xml_maxImageHeight'] = array(
  63      '#type' => 'textfield',
  64      '#default_value' => variable_get('simpleviewer_xml_maxImageHeight', 480),
  65      '#size' => 5,
  66      '#maxlength' => 5,
  67      '#title' => t('Height of your largest image in pixels'),
  68      '#required' => TRUE,
  69      '#description' => t('Used to determine the best layout for your gallery.'),
  70    );
  71    $form['simpleviewer_dimensions']['simpleviewer_xml_frameWidth'] = array(
  72      '#type' => 'textfield',
  73      '#default_value' => variable_get('simpleviewer_xml_frameWidth', 20),
  74      '#size' => 5,
  75      '#maxlength' => 5,
  76      '#title' => t('Width of image frame in pixels'),
  77      '#required' => TRUE,
  78    );
  79    $form['simpleviewer_dimensions']['simpleviewer_xml_stagePadding'] = array(
  80      '#type' => 'textfield',
  81      '#default_value' => variable_get('simpleviewer_xml_stagePadding', 40),
  82      '#size' => 5,
  83      '#maxlength' => 5,
  84      '#title' => t('Stage padding'),
  85      '#description' => t('Distance between image and thumbnails and around gallery edge in pixels.'),
  86      '#required' => TRUE,
  87    );
  88    $form['simpleviewer_colors'] = array(
  89      '#type' => 'fieldset',
  90      '#title' => t('Colors'),
  91      '#collapsible' => TRUE,
  92      '#collapsed' => TRUE,
  93      '#description' => t('All colors should be given as hexadecimal rgb-values like \'#FFFFFF\'.'),
  94    );
  95    $form['simpleviewer_colors']['simpleviewer_swf_bgcolor'] = array(
  96      '#type' => 'textfield',
  97      '#default_value' => variable_get('simpleviewer_swf_bgcolor', '#181818'),
  98      '#size' => 8,
  99      '#maxlength' => 7,
 100      '#title' => t('Background color'),
 101      '#description' => t('Background color of flash animation.'),
 102      '#required' => TRUE,
 103    );
 104    $form['simpleviewer_colors']['simpleviewer_swf_wmode'] = array(
 105      '#type' => 'checkbox',
 106      '#default_value' => variable_get('simpleviewer_swf_wmode', 0),
 107      '#title' => t('Tranparency'),
 108      '#description' => t('Checking this box will make your background transparent. This setting overrides the background color setting.'),
 109    );
 110    $form['simpleviewer_colors']['simpleviewer_xml_loader_color'] = array(
 111      '#type' => 'textfield',
 112      '#default_value' => variable_get('simpleviewer_xml_loader_color', '#ff0000'),
 113      '#size' => 8,
 114      '#maxlength' => 7,
 115      '#title' => t('Flash loader color'),
 116      '#description' => t('Color of part of flash animation that says "loading xml data", while loading your gallery.'),
 117      '#required' => TRUE,
 118    );
 119    $form['simpleviewer_colors']['simpleviewer_xml_textColor'] = array(
 120      '#type' => 'textfield',
 121      '#default_value' => variable_get('simpleviewer_xml_textColor', '#ffffff'),
 122      '#size' => 8,
 123      '#maxlength' => 7,
 124      '#title' => t('Text color'),
 125      '#description' => t('Color of title and caption text.'),
 126      '#required' => TRUE,
 127    );
 128    $form['simpleviewer_colors']['simpleviewer_xml_frameColor'] = array(
 129      '#type' => 'textfield',
 130      '#default_value' => variable_get('simpleviewer_xml_frameColor', '#ffffff'),
 131      '#size' => 8,
 132      '#maxlength' => 7,
 133      '#title' => t('Frame color'),
 134      '#description' => t('Color of image frame, navigation buttons (on top and hover buttons) and thumbnail frame.'),
 135      '#required' => TRUE,
 136    );
 137    $form['simpleviewer_navigation'] = array(
 138      '#type' => 'fieldset',
 139      '#title' => t('Navigation'),
 140      '#collapsible' => TRUE,
 141      '#collapsed' => TRUE,
 142    );
 143    $options_1 = drupal_map_assoc(array(0, 1, 2, 3, 4, 5));
 144    $options_2 = drupal_map_assoc(array('top', 'bottom', 'left', 'right'));
 145    $form['simpleviewer_navigation']['simpleviewer_xml_navPosition'] = array(
 146      '#type' => 'select',
 147      '#options' => $options_2,
 148      '#default_value' => variable_get('simpleviewer_xml_navPosition', 'top'),
 149      '#title' => t('Navigation position'),
 150      '#description' => t('Position of thumbnails relative to image.'),
 151    );
 152    $form['simpleviewer_navigation']['simpleviewer_xml_thumbnailColumns'] = array(
 153      '#type' => 'select',
 154      '#options' => $options_1,
 155      '#default_value' => variable_get('simpleviewer_xml_thumbnailColumns', 4),
 156      '#title' => t('Thumbnail columns'),
 157      '#description' => t('Number of thumbnail columns. To disable thumbnails completely set this value to 0'),
 158    );
 159    $form['simpleviewer_navigation']['simpleviewer_xml_thumbnailRows'] = array(
 160      '#type' => 'select',
 161      '#options' => $options_1,
 162      '#default_value' => variable_get('simpleviewer_xml_thumbnailRows', 1),
 163      '#title' => t('Thumbnail rows'),
 164      '#description' => t('Number of thumbnail rows. To disable thumbnails completely set this value to 0.'),
 165    );
 166  /*
 167    $form['miscellaneous']['simpleviewer_rebuild_thumbs'] = array(
 168      '#type' => 'checkbox',
 169      '#default_value' => 0,
 170      '#title' => t('Build thumbnail library'),
 171      '#description' => t('Normally, you should do this only once, after installing the module. This builds a library of thumbnails based on pre-existing images which reside inside pre-exising galleries. You do not have to repeat this later on: images that are created after installing this module are handled automatically. '),
 172    );
 173  */
 174  
 175    if ($flat === TRUE) {
 176      return array_merge($form['simpleviewer_dimensions'], $form['simpleviewer_colors'], $form['simpleviewer_navigation'], $form['simpleviewer_miscellaneous']);
 177    }
 178    else {
 179  
 180      // Clear all caches
 181      drupal_flush_all_caches();
 182  
 183      return system_settings_form($form);
 184    }
 185  }


Generated: Thu Mar 24 11:18:33 2011 Cross-referenced by PHPXref 0.7