You are here

function fz152_menu in FZ152 7

Implements hook_menu().

File

./fz152.module, line 22
Main file for hooks and custom functions.

Code

function fz152_menu() {
  $items['admin/config/system/fz152'] = array(
    'title' => 'FZ152 settings',
    'description' => t('Adjust settings for FZ152'),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'variable_group_form',
      'fz152_settings',
    ),
    'access arguments' => array(
      'administer fz152',
    ),
  );
  $items['admin/config/system/fz152/settings'] = array(
    'title' => 'Settings',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items['admin/config/system/fz152/privacy-policy-page'] = array(
    'title' => 'Page settings',
    'type' => MENU_LOCAL_TASK,
    'weight' => -9,
    'access arguments' => array(
      'administer fz152',
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'variable_group_form',
      'fz152_privacy_policy_page',
    ),
  );
  $modules_info = fz152_info();
  foreach ($modules_info as $path => $values) {
    if (!empty($values['page callback'])) {
      $items['admin/config/system/fz152/' . $path] = array(
        'title' => $values['title'],
        'type' => MENU_LOCAL_TASK,
        'weight' => !empty($values['weight']) ? $values['weight'] : 0,
        'access arguments' => array(
          'administer fz152',
        ),
        'page callback' => $values['page callback'],
        'page arguments' => !empty($values['page arguments']) ? $values['page arguments'] : array(),
      );
    }
  }
  if (variable_get_value('fz152_enable') && variable_get_value('fz152_privacy_policy_page_enable')) {
    $path = variable_get_value('fz152_privacy_policy_page_path');
    $title = variable_get_value('fz152_privacy_policy_page_title');
    $items[$path] = array(
      'title' => $title,
      'title callback' => FALSE,
      'page callback' => 'fz152_privacy_policy_page',
      'access callback' => TRUE,
    );
  }
  return $items;
}