| 1 |
<?php
|
| 2 |
// $Id$
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
* Admin page callback and other admin page related functions.
|
| 7 |
*/
|
| 8 |
|
| 9 |
/**
|
| 10 |
* Form builder; Configure the SimplePie settings.
|
| 11 |
*
|
| 12 |
* @ingroup forms
|
| 13 |
* @see system_settings_form()
|
| 14 |
*/
|
| 15 |
function simplepie_admin_settings() {
|
| 16 |
$cache_location = variable_get('file_default_scheme', 'public') . '://' . variable_get('simplepie_cache_location', 'cache/simplepie');
|
| 17 |
if (!file_prepare_directory($cache_location, FILE_CREATE_DIRECTORY)) {
|
| 18 |
form_set_error('simplepie_cache_location', t('The directory %directory does not exist or is not writable.', array('%directory' => $cache_location)));
|
| 19 |
watchdog('file system', 'The directory %directory does not exist or is not writable.', array('%directory' => $cache_location), WATCHDOG_ERROR);
|
| 20 |
}
|
| 21 |
$form['simplepie_cache_location'] = array(
|
| 22 |
'#type' => 'textfield',
|
| 23 |
'#title' => t('SimplePie Core cache location'),
|
| 24 |
'#default_value' => variable_get('simplepie_cache_location', 'cache/simplepie'),
|
| 25 |
'#description' => t('Subdirectory in the directory %dir where cache files will be stored.', array('%dir' => file_directory_path() . '/')),
|
| 26 |
);
|
| 27 |
|
| 28 |
return system_settings_form($form);
|
| 29 |
}
|