Project

General

Profile

« Previous | Next » 

Revision d9c55e6c

Added by Andreas Kohlbecker almost 11 years ago

maximum extend of profile image configurabel

View differences:

7.x/modules/cdm_dataportal/settings.php
80 80
  )));
81 81

  
82 82
define('DISTRIBUTION_TEXTDATA_DISPLAY_ON_TOP', 'distribution_textdata_on_top');
83
define('CDM_DEFAULT_IMAGE_MAXEXTEND', 'cdm_default_image_maxextend');
84
define('CDM_DEFAULT_IMAGE_MAXEXTEND_DEFAULT', 184);
83 85

  
84 86

  
85 87
/**
......
972 974
  $collapsed = FALSE;
973 975
  $form = array();
974 976

  
977
  $form['cdm_dataportal_show_back_to_search_results'] = array(
978
      '#type' => 'checkbox',
979
      '#title' => t('Show <em>Back to search results</em> link at the taxon site.'),
980
      '#default_value' => variable_get('cdm_dataportal_show_back_to_search_results', 1),
981
      '#description' => t('<p>If checked the link to search results is rendered at
982
       the top of the taxon site. Clicking on the link the last search performed
983
       is rendered again.</p>'),
984
  );
985

  
975 986
  // --------- TABBED TAXON ------- //
976 987
  $form['taxon_tabs'] = array(
977 988
    '#type' => 'fieldset',
......
1013 1024
      taxon and not the above selected tab.'),
1014 1025
  );
1015 1026

  
1016
  $form['cdm_dataportal_show_back_to_search_results'] = array(
1017
    '#type' => 'checkbox',
1018
    '#title' => t('Show <em>Back to search results</em> link at the taxon site.'),
1019
    '#default_value' => variable_get('cdm_dataportal_show_back_to_search_results', 1),
1020
    '#description' => t('<p>If checked the link to search results is rendered at
1021
       the top of the taxon site. Clicking on the link the last search performed
1022
       is rendered again.</p>'),
1023
  );
1024

  
1025 1027
  /* ======  TAXON_PROFILE ====== */
1026 1028
  $form['taxon_profile'] = array(
1027 1029
    '#type' => 'fieldset',
......
1048 1050
    '#description' => t('Show the profil picture.'),
1049 1051
  );
1050 1052

  
1053
  $form['taxon_profile']['picture'][CDM_DEFAULT_IMAGE_MAXEXTEND] = array(
1054
      '#type' => 'textfield',
1055
      '#tree' => TRUE,
1056
      '#title' => t('Profil picture maximum extend'),
1057
      '#default_value' =>  variable_get(CDM_DEFAULT_IMAGE_MAXEXTEND, CDM_DEFAULT_IMAGE_MAXEXTEND_DEFAULT),
1058
      '#field_suffix' => 'px',
1059
      '#maxlength' => 4,
1060
      '#size' => 4,
1061
      '#description' => t('The maximum extend in either dimension, width or height, of the profil picture in pixels.')
1062
  );
1063

  
1051 1064
  $options = cdm_rankVocabulary_as_option();
1052 1065
  array_unshift($options, '-- DISABLED --');
1053 1066
  $form['taxon_profile']['picture']['image_hide_rank'] = array(
7.x/modules/cdm_dataportal/theme/cdm_dataportal.page.theme
299 299
    $defaultRepresentationPart->uri = base_path() .  drupal_get_path('module', 'cdm_dataportal') . '/images/no_picture.png';
300 300

  
301 301
    // Preferred image size 184px × 144.
302
    $imageMaxExtend = 184;
302
    $imageMaxExtend = variable_get(CDM_DEFAULT_IMAGE_MAXEXTEND, CDM_DEFAULT_IMAGE_MAXEXTEND_DEFAULT);
303 303
    $out .= '<div id="taxonProfileImage">' . theme('cdm_preferredImage', array(
304 304
      'media' => $media,
305 305
      'defaultRepresentationPart' => $defaultRepresentationPart,
7.x/themes/zen_dataportal/theme-settings.php
30 30
    return;
31 31
  }
32 32

  
33
  if(!module_exists('cdm_dataportal')) {
34
    drupal_set_message('<strong>FATAL MISCONFIGURATION:</strong>The zen_dataportal theme requires the cdm_dataportal module to be installed and enabled.', 'error');
35
    return;
36
  }
37

  
33 38
  $path_to_theme = drupal_get_path('theme', 'zen_dataportal');
34 39

  
35 40
  // check browser compatibility requirements
......
275 280
  );
276 281
}
277 282

  
278
/**
279
 *
280
 * Enter description here ...
281
 * @param $color_settings_key
282
 *
283
 */
284
function zen_dataportal_form_widget_color(&$form, $color_settings_key, $description) {
285
  $label = str_replace('_', ' ', $color_settings_key);
286
  $form['zen_dataportal_colors'][$color_settings_key] = array(
287
          '#type'          => 'textfield',
288
          '#title'         => ucfirst(t($label)),
289
          '#default_value' => theme_get_setting($color_settings_key),
290
          '#description'   => $description, //t('Set the color of the site name which is shown in the header. Must be a css color value like: #000000'),
291
          '#attributes' => array(
292
            'class' => array('color-picker'),
293
            'size' => '7',
294
          ),
295
  );
296
}
297

  
298 283
/**
299 284
 *
300 285
 * Enter description here ...

Also available in: Unified diff