function _hs_content_taxonomy_parse_context_from_url in Hierarchical Select 6.3
Same name and namespace in other branches
- 5.3 modules/hs_content_taxonomy.module \_hs_content_taxonomy_parse_context_from_url()
Parse the context (the content type and the field name) from the URL.
Return value
- FALSE if no context could be found
- array($content_type_name, $field_name) otherwise
1 call to _hs_content_taxonomy_parse_context_from_url()
- hs_content_taxonomy_widget_settings in modules/
hs_content_taxonomy.module - Implementation of hook_widget_settings().
File
- modules/
hs_content_taxonomy.module, line 524 - Implementation of the Hierarchical Select API for the Content Taxonomy module.
Code
function _hs_content_taxonomy_parse_context_from_url() {
if (arg(0) == 'admin' && arg(1) == 'content' && arg(2) == 'node-type') {
$content_type = content_types(arg(3));
$field_name = arg(5);
if (arg(4) == 'fields' && !empty($field_name) && isset($content_type['fields'][$field_name])) {
if ($content_type['fields'][$field_name]['type'] == 'content_taxonomy' && $content_type['fields'][$field_name]['widget']['type'] == 'content_taxonomy_hs') {
return array(
$content_type['type'],
$field_name,
);
}
}
}
return FALSE;
}