function ctools_content_admin_info in Chaos Tool Suite (ctools) 7
Same name and namespace in other branches
- 6 includes/content.inc \ctools_content_admin_info()
Get the administrative title from a given content type.
Parameters
$type: The content type. May be the name or an already loaded content type object.
$subtype: The subtype being rendered.
$conf: The configuration for the content type.
$context: An array of context objects available for use. These may be placeholders.
File
- includes/
content.inc, line 474 - Contains the tools to handle pluggable content that can be used by other applications such as Panels or Dashboard.
Code
function ctools_content_admin_info($type, $subtype, $conf, $context = NULL) {
if (is_array($type)) {
$plugin = $type;
}
else {
$plugin = ctools_get_content_type($type);
}
if ($function = ctools_plugin_get_function($plugin, 'admin info')) {
$output = $function($subtype, $conf, $context);
}
if (empty($output) || !is_object($output)) {
$output = new stdClass();
// Replace the _ with " " for a better output.
$subtype = check_plain(str_replace("_", " ", $subtype));
$output->title = $subtype;
$output->content = t('No info available.');
}
return $output;
}