function 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

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;
}