| 1 |
<?php |
<?php |
| 2 |
// $Id: thickbox.module,v 1.9.2.11 2008/08/13 06:46:28 frjo Exp $ |
// $Id: thickbox.module,v 1.9.2.12 2008/09/17 13:06:41 frjo Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 45 |
$form['thickbox_imagefield']['thickbox_imagefield_gallery'] = array( |
$form['thickbox_imagefield']['thickbox_imagefield_gallery'] = array( |
| 46 |
'#type' => 'radios', |
'#type' => 'radios', |
| 47 |
'#title' => t('Image field gallery'), |
'#title' => t('Image field gallery'), |
| 48 |
'#default_value' => variable_get('thickbox_imagefield_gallery', 0), |
'#default_value' => variable_get('thickbox_imagefield_gallery', 1), |
| 49 |
'#options' => array(0 => t('Per page gallery'), 1 => t('Per post gallery'), 2 => t('Per field gallery')), |
'#options' => array(0 => t('Per page gallery'), 1 => t('Per post gallery'), 2 => t('Per field gallery'), 3 => t('No gallery')), |
| 50 |
'#description' => t('Should the gallery be images within a single field, a single post or all images on the page.'), |
'#description' => t('Should the gallery be images within a single field, a single post (default) or all images on the page. The last option disabels gallerys.'), |
| 51 |
); |
); |
| 52 |
} |
} |
| 53 |
|
|
| 54 |
$form['thickbox_options'] = array( |
$form['thickbox_login_settings'] = array( |
| 55 |
'#type' => 'fieldset', |
'#type' => 'fieldset', |
| 56 |
'#title' => t('General options') |
'#title' => t('Login settings') |
| 57 |
); |
); |
| 58 |
$form['thickbox_options']['thickbox_login'] = array( |
$form['thickbox_login_settings']['thickbox_login'] = array( |
| 59 |
'#type' => 'checkbox', |
'#type' => 'checkbox', |
| 60 |
'#title' => t('Enable for login links'), |
'#title' => t('Enable for login links'), |
| 61 |
'#default_value' => variable_get('thickbox_login', 0), |
'#default_value' => variable_get('thickbox_login', 0), |
| 62 |
'#description' => t('Automatically activate Thickbox for links to user/login.'), |
'#description' => t('Automatically activate Thickbox for links to user/login.'), |
| 63 |
); |
); |
| 64 |
$form['thickbox_options']['thickbox_pages'] = array( |
|
| 65 |
|
$form['thickbox_advanced_settings'] = array( |
| 66 |
|
'#type' => 'fieldset', |
| 67 |
|
'#title' => t('Advanced settings'), |
| 68 |
|
'#collapsible' => TRUE, |
| 69 |
|
'#collapsed' => TRUE |
| 70 |
|
); |
| 71 |
|
$form['thickbox_advanced_settings']['thickbox_pages'] = array( |
| 72 |
'#type' => 'textarea', |
'#type' => 'textarea', |
| 73 |
'#title' => t('Deactivate Thickbox on specific pages'), |
'#title' => t('Deactivate Thickbox on specific pages'), |
| 74 |
'#default_value' => variable_get('thickbox_pages', "admin*\nimg_assist*\nnode/add/*\nnode/*/edit"), |
'#default_value' => variable_get('thickbox_pages', "admin*\nimg_assist*\nnode/add/*\nnode/*/edit"), |
| 155 |
} |
} |
| 156 |
|
|
| 157 |
if (variable_get('thickbox_auto', 0) && module_exists('image')) { |
if (variable_get('thickbox_auto', 0) && module_exists('image')) { |
| 158 |
drupal_add_js("var thickbox_derivative = ". drupal_to_js(variable_get('thickbox_derivative', 'preview')) .";", 'inline'); |
drupal_add_js(array('thickbox' => array('derivative' => variable_get('thickbox_derivative', 'preview'))), 'setting'); |
| 159 |
drupal_add_js($path .'/thickbox_auto.js'); |
drupal_add_js($path .'/thickbox_auto.js'); |
| 160 |
} |
} |
| 161 |
|
|
| 204 |
if (strpos($formatter, 'thickbox][') !== FALSE) { |
if (strpos($formatter, 'thickbox][') !== FALSE) { |
| 205 |
list($null, $namespace) = explode('][', $formatter, 2); |
list($null, $namespace) = explode('][', $formatter, 2); |
| 206 |
$nid = $item['nid'] ? $item['nid'] : ($node->nid ? $node->nid : ''); |
$nid = $item['nid'] ? $item['nid'] : ($node->nid ? $node->nid : ''); |
| 207 |
switch (variable_get('thickbox_imagefield_gallery', 0)) { |
switch (variable_get('thickbox_imagefield_gallery', 1)) { |
| 208 |
case 0: |
case 0: |
| 209 |
$gallery_id = 'all'; |
$gallery_id = 'all'; |
| 210 |
break; |
break; |
| 214 |
case 2: |
case 2: |
| 215 |
$gallery_id = $nid .'-'. $field; |
$gallery_id = $nid .'-'. $field; |
| 216 |
break; |
break; |
| 217 |
|
case 3: |
| 218 |
|
$gallery_id = $nid .'-'. $item['fid']; |
| 219 |
|
break; |
| 220 |
} |
} |
| 221 |
if ($preset = imagecache_preset_by_name($namespace)) { |
if ($preset = imagecache_preset_by_name($namespace)) { |
| 222 |
return theme('imagefield_image_imagecache_thickbox', $namespace, $field, $item['filepath'], $item['alt'], $item['title'], $gallery_id); |
return theme('imagefield_image_imagecache_thickbox', $namespace, $field, $item['filepath'], $item['alt'], $item['title'], $gallery_id); |