function _ed_classified_check_settings in Classified Ads 6.2
Same name and namespace in other branches
- 5.2 ed_classified_utils.inc \_ed_classified_check_settings()
- 5 ed_classified_utils.inc \_ed_classified_check_settings()
- 7.2 ed_classified_utils.inc \_ed_classified_check_settings()
do the sanity-check dance.
1 call to _ed_classified_check_settings()
- ed_classified_admin_settings in ./
ed_classified_settings.inc - Implementation of hook_settings().
File
- ./
ed_classified_utils.inc, line 272 - Simple text-based classified ads module.
Code
function _ed_classified_check_settings(&$form) {
$vid = _ed_classified_get_vid();
$taxonomy = taxonomy_get_tree($vid);
$warning = '';
if (empty($taxonomy)) {
if (!empty($vid)) {
$url = "admin/content/taxonomy/{$vid}/add/term";
$url = l('taxonomy administration', $url);
$warning = t('<div class="error">It appears that you have not configured any vocabulary terms to be used with the Classified Ads module. This module will not function correctly until you define vocabulary terms for vocabulary id !vid. Please visit !url to add terms such as "For Sale" or "Wanted" (or other categories as appropriate for your needs).</div>', array(
'!url' => $url,
'!vid' => $vid,
));
}
else {
$url = 'http://exodusdev.com/drupal/modules/ed_classified.module';
$url = l('the project homepage', $url);
$warning = t('<div class="error">The classified ads vocabulary settings are not configured correctly. This is mostly likely due to a failed installation or an administrator deleting the automatically configured taxonomy or other problems. Please visit the online handbook page(s) at !url.</div>', array(
'!url' => $url,
));
}
$form['warning'] = array(
'#type' => 'markup',
'#value' => $warning,
);
return FALSE;
}
return TRUE;
}