Revision c5ed6357
Added by Andreas Kohlbecker over 10 years ago
7.x/modules/cdm_dataportal/cdm_dataportal.module | ||
---|---|---|
1332 | 1332 |
* Returns the state of the the showThumbnails flag set in the |
1333 | 1333 |
* users session ($_SESSION['pageoption']['searchtaxa']['showThumbnails']). |
1334 | 1334 |
* |
1335 |
* @return Ambigous <boolean, number>
|
|
1335 |
* @return boolean
|
|
1336 | 1336 |
* returns 1 if the flag is set |
1337 | 1337 |
*/ |
1338 | 1338 |
function do_showThumbnails() { |
1339 | 1339 |
static $showThumbnails = null; |
1340 | 1340 |
|
1341 | 1341 |
if($showThumbnails == null) { |
1342 |
$showThumbnails = FALSE; |
|
1343 |
if (isset($_SESSION['pageoption']['searchtaxa']['showThumbnails'])) { |
|
1344 |
$showThumbnails = $_SESSION['pageoption']['searchtaxa']['showThumbnails']; |
|
1345 |
} |
|
1342 |
$showThumbnails = 0; |
|
1343 |
if (!isset($_SESSION['pageoption']['searchtaxa']['showThumbnails'])) { |
|
1344 |
$showThumbnails = 0; |
|
1345 |
$search_gallery_settings = variable_get(CDM_DATAPORTAL_SEARCH_GALLERY_NAME, null); |
|
1346 |
$showThumbnails = is_array($search_gallery_settings) |
|
1347 |
&& isset($search_gallery_settings['cdm_dataportal_show_taxon_thumbnails']) |
|
1348 |
&& ( |
|
1349 |
$search_gallery_settings['cdm_dataportal_show_taxon_thumbnails'] + |
|
1350 |
$search_gallery_settings['cdm_dataportal_show_synonym_thumbnails'] + |
|
1351 |
$search_gallery_settings['cdm_dataportal_show_thumbnail_captions'] > 0 |
|
1352 |
) |
|
1353 |
? 1 : 0; |
|
1354 |
|
|
1355 |
drupal_array_set_nested_value($_SESSION, array('pageoption', 'searchtaxa', 'showThumbnails'), $showThumbnails); |
|
1356 |
} |
|
1357 |
$showThumbnails = $_SESSION['pageoption']['searchtaxa']['showThumbnails']; |
|
1346 | 1358 |
if (!is_numeric($showThumbnails)) { |
1347 | 1359 |
$showThumbnails = 1; |
1348 | 1360 |
} |
Also available in: Unified diff
fixing #3703 ( Show Thumbnails shown even if thumbnails options are not checked in the setting)