You are here

pmpapi_update.module in Public Media Platform API Integration 7

File

pmpapi_update/pmpapi_update.module
View source
<?php

/**
 * Implements hook_boot().
 */
function pmpapi_update_boot() {

  // pmpapi_notifications can never be cached
  if (arg(0) == 'pmpapi_notifications') {
    $GLOBALS['conf']['cache'] = FALSE;
  }
}

/**
 * Implements hook_permission().
 */
function pmpapi_update_permission() {
  return array(
    'administer PMP update' => array(
      'title' => t('Administer updates from the PMP API'),
      'description' => t('Perform administration tasks for updates from the PMP API.'),
    ),
  );
}

/**
 * Implements hook_menu().
 */
function pmpapi_update_menu() {
  $items['admin/config/services/pmp/updates'] = array(
    'title' => 'Updates',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'pmpapi_update_config_form',
    ),
    'access callback' => TRUE,
    'file' => 'pmpapi_update.admin.inc',
    'type' => MENU_LOCAL_TASK,
  );
  $items['pmpapi_notifications'] = array(
    'page callback' => 'pmpapi_update_process_notification',
    'access arguments' => array(
      'access content',
    ),
    'file' => 'pmpapi_update.pages.inc',
    'type' => MENU_CALLBACK,
  );
  return $items;
}

/**
 * Retrieves the URI endpoint for a given topic.
 *
 * @param $topic string
 *   A PMP update topic (update or delete).
 *
 * @return string
 *   The topic URI,
 */
function pmpapi_update_get_topic_uri($topic) {
  return variable_get('pmpapi_base_url') . '/notifications/topics/' . $topic;
}

Functions

Namesort descending Description
pmpapi_update_boot Implements hook_boot().
pmpapi_update_get_topic_uri Retrieves the URI endpoint for a given topic.
pmpapi_update_menu Implements hook_menu().
pmpapi_update_permission Implements hook_permission().