You are here

function opigno_poll_app_opigno_tool in Opigno Poll App 7

Implements hook_opigno_tool().

File

./opigno_poll_app.module, line 34
Module hooks.

Code

function opigno_poll_app_opigno_tool($node = NULL) {
  return array(
    'poll' => array(
      'name' => t("Poll"),
      'path' => isset($node) ? "node/{$node->nid}/polls" : '',
      'description' => t("Create polls for your course users."),
      'actions' => array(
        'add_quiz' => array(
          'title' => t("Add a new poll"),
          'href' => 'node/add/poll',
          'access_arguments' => array(
            'node',
            isset($node) ? $node->nid : 0,
            'create poll content',
          ),
          'access_callback' => 'og_user_access',
          'query' => array(
            'og_group_ref' => isset($node) ? $node->nid : '',
          ),
        ),
      ),
    ),
  );
}