You are here

function opigno_get_node_tools in Opigno 7

Get tools for the node. Optionally filter by access permissions.

Parameters

stdClass $node:

stdClass $account = NULL:

Return value

array

2 calls to opigno_get_node_tools()
opigno_block_view in ./opigno.module
Implements hook_block_view().
opigno_tools_page in ./opigno.module
Page callback for the tools page.

File

./opigno.module, line 541
Contains all hook_implementations and module specific API.

Code

function opigno_get_node_tools($node, $account = NULL) {
  $tools = array();
  if (isset($node->opigno_course_tools[LANGUAGE_NONE])) {
    foreach ($node->opigno_course_tools[LANGUAGE_NONE] as $item) {
      $tool = opigno_get_tool($item['tool'], $node, $account);
      if (!empty($tool)) {
        $tools[$item['tool']] = $tool;
      }
    }
  }
  return $tools;
}