| 1 |
<?php |
<?php |
| 2 |
// $Id: flickr.admin.inc,v 1.1 2008/03/24 19:57:18 drewish Exp $ |
// $Id: flickr.admin.inc,v 1.1.2.1 2009/01/30 10:39:01 paulbooker Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* Implementation of hook_settings |
* Implementation of hook_settings |
| 34 |
'#default_value' => variable_get('flickr_cache_duration', 3600), |
'#default_value' => variable_get('flickr_cache_duration', 3600), |
| 35 |
'#description' => t("The refresh interval indicating how often you want to check cached Flickr API calls are up to date."), |
'#description' => t("The refresh interval indicating how often you want to check cached Flickr API calls are up to date."), |
| 36 |
); |
); |
| 37 |
|
$form['flickr_photos_per_page'] = array( |
| 38 |
|
'#type' => 'select', |
| 39 |
|
'#title' => t('Number of photos per photoset'), |
| 40 |
|
'#default_value' => variable_get('flickr_photos_per_page', '30'), |
| 41 |
|
'#options' => array( |
| 42 |
|
'10' => t('10'), |
| 43 |
|
'30' => t('30'), |
| 44 |
|
'50' => t('50'), |
| 45 |
|
'100' => t('100'), |
| 46 |
|
'150' => t('150'), |
| 47 |
|
'200' => t('200'), |
| 48 |
|
'300' => t('300'), |
| 49 |
|
'400' => t('400'), |
| 50 |
|
'500' => t('500'), |
| 51 |
|
), |
| 52 |
|
'#description' => t("The number indicates how many photos of a photoset display in your nodes. After saving the configuration, <a href='?q=admin/settings/performance'>clear the cache</a>."), |
| 53 |
|
); |
| 54 |
// we need an api key before we can verify usernames |
// we need an api key before we can verify usernames |
| 55 |
if (!$form['flickr_api_key']['#default_value']) { |
if (!$form['flickr_api_key']['#default_value']) { |
| 56 |
$form['flickr_default_userid']['#disabled'] = TRUE; |
$form['flickr_default_userid']['#disabled'] = TRUE; |
| 88 |
// clean up the data ... |
// clean up the data ... |
| 89 |
$form_state['values']['flickr_api_key'] = trim($form_state['values']['flickr_api_key']); |
$form_state['values']['flickr_api_key'] = trim($form_state['values']['flickr_api_key']); |
| 90 |
$form_state['values']['flickr_api_secret'] = trim($form_state['values']['flickr_api_secret']); |
$form_state['values']['flickr_api_secret'] = trim($form_state['values']['flickr_api_secret']); |
| 91 |
|
$form_state['values']['flickr_photos_per_page'] = trim($form_state['values']['flickr_photos_per_page']); |
| 92 |
$form_state['values']['flickr_default_userid'] = trim($form_state['values']['flickr_default_userid']); |
$form_state['values']['flickr_default_userid'] = trim($form_state['values']['flickr_default_userid']); |
| 93 |
|
|
| 94 |
// ... replace the usernames with a user id ... |
// ... replace the usernames with a user id ... |