You are here

function sendinblue_menu in SendinBlue 7

Same name and namespace in other branches
  1. 7.2 sendinblue.module \sendinblue_menu()

Implements hook_menu().

File

./sendinblue.module, line 27
The entry point of Sendinblue module.

Code

function sendinblue_menu() {
  $items = array();
  $items['admin/config/system/sendinblue'] = array(
    'title' => 'SendinBlue',
    'description' => 'Manage SendinBlue Settings.',
    'page callback' => 'sendinblue_home_page',
    'page arguments' => array(
      'sendinblue_home_page',
    ),
    'access arguments' => array(
      'administer sendinblue',
    ),
    'file' => 'includes/sendinblue_home.admin.inc',
    'type' => MENU_NORMAL_ITEM,
  );
  $items['admin/config/system/sendinblue/lists'] = array(
    'title' => 'Lists',
    'description' => 'Display SendinBlue Lists and Contacts.',
    'page callback' => 'sendinblue_list_page',
    'access callback' => 'sendinblue_signup_entity_access',
    'access arguments' => array(
      'administer sendinblue',
    ),
    'file' => 'includes/sendinblue_list.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => 8,
  );
  $items['admin/config/system/sendinblue/campaigns'] = array(
    'title' => 'Campaigns',
    'description' => 'Display SendinBlue Campaigns.',
    'page callback' => 'sendinblue_campaign_page',
    'access callback' => 'sendinblue_signup_entity_access',
    'access arguments' => array(
      'administer sendinblue',
    ),
    'file' => 'includes/sendinblue_campaign.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => 9,
  );
  $items['admin/config/system/sendinblue/statistics'] = array(
    'title' => 'Statistics',
    'description' => 'Display SendinBlue Statistics.',
    'page callback' => 'sendinblue_statistic_page',
    'access callback' => 'sendinblue_signup_entity_access',
    'access arguments' => array(
      'administer sendinblue',
    ),
    'file' => 'includes/sendinblue_statstic.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => 9,
  );
  $items['admin/config/system/sendinblue/global'] = array(
    'title' => 'Home',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items['admin/config/system/sendinblue/signup/%sendinblue_signup/edit'] = array(
    'title' => 'Edit a signup form',
    'description' => 'Edit a Signup form.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'sendinblue_signup_form',
      5,
    ),
    'load arguments' => array(
      5,
    ),
    'access arguments' => array(
      'administer sendinblue',
    ),
    'file' => 'includes/sendinblue_signup.admin.inc',
    'type' => MENU_CALLBACK,
  );
  $items['admin/config/system/sendinblue/signup/%sendinblue_signup/delete'] = array(
    'title' => 'Delete Signup form',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'sendinblue_signup_signup_delete_form',
      5,
    ),
    'access arguments' => array(
      'administer sendinblue',
    ),
    'file' => 'includes/sendinblue_signup.admin.inc',
  );
  $signups = sendinblue_signup_load_multiple();
  foreach ($signups as $signup) {
    if (intval($signup->mode) == SENDINBLUE_SIGNUP_PAGE || intval($signup->mode) == SENDINBLUE_SIGNUP_BOTH) {
      $items[$signup->settings['path']] = array(
        'title' => $signup->title,
        'page callback' => 'drupal_get_form',
        'page arguments' => array(
          'sendinblue_signup_subscribe_page_' . $signup
            ->identifier() . '_form',
          $signup,
          'sendinblue_signup_page',
        ),
        'access callback' => 'user_access',
        'access arguments' => array(
          'access sendinblue signup pages',
        ),
        'type' => MENU_SUGGESTED_ITEM,
      );
    }
  }
  return $items;
}