function hook_opigno_tools in Opigno 7.0
Implements hook_opigno_tools()
Defines the tools that can be used inside a group. The resulting array must be keyed by tool-id. Each entry can contain the following keys:
- tool_name: (required) A human readable tool name
- tool_url: (required) A url to a tool overview page (usually a view)
- create_label: (optional) A label for the "create tool" link. User access check should be done by the module. Opigno does not verify the user access.
- create_url: (optional) A url to the create page
Return value
array
1 function implements hook_opigno_tools()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- opigno_opigno_tools in ./
opigno.module - Implements hook_opigno_tools()
1 invocation of hook_opigno_tools()
- opigno_get_og_tools in ./
opigno.module - Returns the list tools for the OG node.
File
- ./
opigno.api.php, line 72 - Defines the Opigno LMS specific API and hooks
Code
function hook_opigno_tools($node) {
$tools = array();
$tools['wikis'] = array(
'tool_name' => t("Wikis"),
'tool_url' => url("node/{$node->nid}/wikis"),
);
if (user_access('create wiki content')) {
$tools['wikis']['create_label'] = t("Add a !type", array(
'!type' => 'wiki',
));
$tools['wikis']['create_url'] = url('node/add/wiki', array(
'query' => array(
'gids_node[]' => $node->nid,
),
));
}
return $tools;
}