function _panels_mini_panels_mini_content_type_content_type in Panels 6.3
Same name and namespace in other branches
- 7.3 panels_mini/plugins/content_types/panels_mini.inc \_panels_mini_panels_mini_content_type_content_type()
Return an info array describing a single mini panel.
2 calls to _panels_mini_panels_mini_content_type_content_type()
- panels_mini_panels_mini_content_type_content_type in panels_mini/
plugins/ content_types/ panels_mini.inc - Return each available mini panel available as a subtype.
- panels_mini_panels_mini_content_type_content_types in panels_mini/
plugins/ content_types/ panels_mini.inc - Return each available mini panel available as a subtype.
File
- panels_mini/
plugins/ content_types/ panels_mini.inc, line 49 - Contains the content type plugin for a mini panel. While this does not need to be broken out into a .inc file, it's convenient that we do so that we don't load code unneccessarily. Plus it demonstrates plugins in modules other than Panels…
Code
function _panels_mini_panels_mini_content_type_content_type($mini) {
if (!empty($mini->disabled)) {
return;
}
$title = filter_xss_admin($mini->admin_title);
$type = array(
'title' => $title,
// For now mini panels will just use the contrib block icon.
'icon' => 'icon_mini_panel.png',
'description' => $title,
'category' => !empty($mini->category) ? $mini->category : t('Mini panel'),
);
if (!empty($mini->requiredcontexts)) {
$type['required context'] = array();
foreach ($mini->requiredcontexts as $context) {
$info = ctools_get_context($context['name']);
// TODO: allow an optional setting
$type['required context'][] = new ctools_context_required($context['identifier'], $info['context name']);
}
}
return $type;
}