You are here

function zoomapi_menu in Zoom API 7.2

Same name and namespace in other branches
  1. 7 zoomapi.module \zoomapi_menu()

Implements hook_menu().

File

./zoomapi.module, line 69
Main file for the Zoom API module.

Code

function zoomapi_menu() {

  // Webhook.
  // @todo allow for custom webhook urls.
  $items['zoomapi/webhook'] = [
    'title' => 'Zoom API Webhook',
    'description' => 'See https://zoom.github.io/api/#webhooks',
    'page callback' => 'zoomapi_webhooks_callback',
    'access callback' => 'zoomapi_webhooks_access',
    'file' => 'zoomapi.webhooks.inc',
    'type' => MENU_CALLBACK,
  ];

  // Admin settings.
  $items['admin/config/services/zoomapi'] = [
    'title' => 'Zoom API',
    'description' => 'Configuration for Zoom API',
    'page callback' => 'drupal_get_form',
    'page arguments' => [
      'zoomapi_settings_form',
    ],
    'access arguments' => [
      'administer zoomapi',
    ],
    'file' => 'zoomapi.admin.inc',
    'type' => MENU_NORMAL_ITEM,
  ];
  $items['admin/config/services/zoomapi/settings'] = [
    'title' => 'Settings',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  ];

  // Admin Webhooks.
  $items['admin/config/services/zoomapi/webhooks'] = [
    'title' => 'Webhooks',
    'description' => 'Manage existing and create new webhooks.',
    'page callback' => 'drupal_get_form',
    'page arguments' => [
      'zoomapi_report_custom_list_form',
      'webhooks',
    ],
    'access arguments' => [
      'administer zoomapi',
    ],
    'file' => 'zoomapi.admin.inc',
    'type' => MENU_LOCAL_TASK,
  ];

  // Report Listing.
  $items['admin/reports/zoomapi'] = [
    'title' => 'Zoom API',
    'description' => 'A few basic custom reports and API reports.',
    'position' => 'left',
    'page callback' => 'system_admin_menu_block_page',
    'access arguments' => [
      'access zoomapi reports',
    ],
    'file' => 'system.admin.inc',
    'file path' => drupal_get_path('module', 'system'),
    'type' => MENU_NORMAL_ITEM,
  ];

  // Report: Custom Lists.
  // @todo unable to do this with meetings at the moment and webhooks is
  // displayed in configuration.
  foreach ([
    'users',
  ] as $api) {
    $label = ucfirst($api);
    $items["admin/reports/zoomapi/{$api}"] = [
      'title' => $label,
      'description' => "Basic listing of Zoom {$label}.",
      'page callback' => 'drupal_get_form',
      'page arguments' => [
        'zoomapi_report_custom_list_form',
        $api,
      ],
      'access arguments' => [
        'access zoomapi reports',
      ],
      'file' => 'zoomapi.admin.inc',
      'type' => MENU_NORMAL_ITEM,
    ];
  }
  return $items;
}