og_is_node_group_content.inc in Organic groups 7
File
plugins/access/og_is_node_group_content.inc
View source
<?php
$plugin = array(
'title' => t("OG: Node is an OG group content"),
'description' => t('Control access by whether or not a node is of type "Group content".'),
'callback' => 'og_is_node_group_content_check',
'summary' => 'og_is_node_group_content_summary',
'required context' => new ctools_context_required(t('Node'), 'node'),
);
function og_is_node_group_content_check($conf, $context) {
if (empty($context) || empty($context->data) || empty($context->data->type)) {
return FALSE;
}
return og_is_group_content_type('node', $context->data->type);
}
function og_is_node_group_content_summary($conf, $context) {
return t('@identifier is an OG group content', array(
'@identifier' => $context->identifier,
));
}