You are here

function forena_menu in Forena Reports 7.4

Same name and namespace in other branches
  1. 6.2 forena.module \forena_menu()
  2. 6 forena.module \forena_menu()
  3. 7.5 forena.module \forena_menu()
  4. 7 forena.module \forena_menu()
  5. 7.2 forena.module \forena_menu()
  6. 7.3 forena.module \forena_menu()

Implementation of hook_menu.

Return value

array

File

./forena.module, line 10

Code

function forena_menu() {
  $items = array();

  // First build menu items.
  Frx::Menu()
    ->addMenuItems($items);
  $items['admin/structure/forena'] = array(
    'type' => MENU_NORMAL_ITEM,
    'title' => 'Forena Reports',
    'description' => 'Build reports based on data in your sites databases.',
    'page callback' => 'forena_admin_reports',
    'access arguments' => array(
      'design any report',
    ),
    'file' => 'forena.admin.inc',
  );
  $items['admin/structure/forena/reports'] = array(
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'title' => 'Reports',
    'description' => 'Build reports based on data in your sites databases.',
    'page callback' => 'forena_admin_reports',
    'access arguments' => array(
      'design any report',
    ),
    'file' => 'forena.admin.inc',
  );
  $items['admin/config/content/forena'] = array(
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'forena_settings',
    ),
    'title' => 'Forena Reports',
    'description' => 'Tell Forena where to store report files and how users should access them.',
    'access arguments' => array(
      'administer forena reports',
    ),
    'type' => MENU_NORMAL_ITEM,
    'file' => 'forena.admin.inc',
  );
  $items['admin/config/content/forena/general'] = array(
    'title' => 'General',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'file' => 'forena.admin.inc',
    'weight' => -10,
  );
  $items['admin/config/content/forena/data/configure'] = array(
    'title' => 'Configure data source',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'forena_data_settings_edit',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'forena.admin.inc',
    'access arguments' => array(
      'administer forena reports',
    ),
  );
  $items['admin/config/content/forena/data/add'] = array(
    'title' => 'Add data source',
    'type' => MENU_CALLBACK,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'forena_data_settings_edit',
    ),
    'file' => 'forena.admin.inc',
    'access arguments' => array(
      'administer forena reports',
    ),
  );
  $items['admin/config/content/forena/data'] = array(
    'title' => 'Data',
    'page callback' => 'forena_data_settings',
    'type' => MENU_LOCAL_TASK,
    'file' => 'forena.admin.inc',
    'access arguments' => array(
      'administer forena reports',
    ),
  );
  $items['admin/config/content/forena/formats'] = array(
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'forena_doc_formats_settings',
    ),
    'title' => 'Document Types',
    'access arguments' => array(
      'administer forena reports',
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => 'forena.admin.inc',
  );
  $items['admin/structure/forena/data'] = array(
    'type' => MENU_LOCAL_TASK,
    'title' => 'Data',
    'access arguments' => array(
      'design any report',
    ),
    'page callback' => 'forena_display_blocks',
    'file' => 'forena.data.inc',
  );
  $items['forena/data'] = array(
    'page callback' => 'forena_data_preview',
    'access arguments' => array(
      'design any report',
    ),
    'file' => 'forena.data.inc',
    'type' => MENU_CALLBACK,
  );
  $items['reports/%'] = array(
    'page callback' => 'forena_report',
    'page arguments' => array(
      1,
    ),
    'title' => 'Reports',
    'access arguments' => array(
      'access content',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'forena.common.inc',
  );
  $items['reports/%/%'] = array(
    'page callback' => 'forena_report_page_callback',
    'page arguments' => array(
      1,
      2,
    ),
    'title' => 'Reports',
    'access arguments' => array(
      'access content',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'forena.common.inc',
  );
  $items['report_doc/%'] = array(
    'page callback' => 'forena_report',
    'page arguments' => array(
      1,
    ),
    'access arguments' => array(
      'access content',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'forena.common.inc',
  );
  $items['reports/%/edit'] = array(
    'title' => 'Edit',
    'page callback' => 'forena_report_preview',
    'page arguments' => array(
      1,
    ),
    'access arguments' => array(
      'design any report',
    ),
    'description' => 'Edit the layout of your report',
    'type' => MENU_CALLBACK,
    'file' => 'forena.report.inc',
  );
  if (module_exists('locale')) {
    $items['reports/%/translations'] = array(
      'page callback' => 'forena_report_translations',
      'page arguments' => array(
        1,
      ),
      'title' => 'Translate',
      'file' => 'forena.report.inc',
      'access arguments' => array(
        'design any report',
      ),
      'type' => MENU_CALLBACK,
    );
  }
  $items['reports/%/edit/parameters'] = array(
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'forena_report_parameters_form',
      1,
    ),
    'title' => 'Parameters',
    'file' => 'forena.report.inc',
    'access arguments' => array(
      'design any report',
    ),
    'type' => MENU_LOCAL_TASK,
  );
  $items['reports/%/edit/edit-parameter'] = array(
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'forena_report_parameter_config_form',
      1,
    ),
    'title' => 'Edit Parameter',
    'file' => 'forena.report.inc',
    'access arguments' => array(
      'design any report',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['reports/%/edit/add-parameter'] = array(
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'forena_report_add_parameter_form',
      1,
    ),
    'file' => 'forena.report.inc',
    'title' => 'Parameters',
    'access arguments' => array(
      'design any report',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['reports/%/edit/general'] = array(
    'title' => 'General',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'forena_report_general_form',
      1,
    ),
    'access arguments' => array(
      'design any report',
    ),
    'description' => 'General Report Properties',
    'type' => MENU_LOCAL_TASK,
    'weight' => -1,
    'file' => 'forena.report.inc',
  );
  $items['reports/%/edit/layout'] = array(
    'title' => 'Layout',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'forena_report_layout_form',
      1,
    ),
    'access arguments' => array(
      'design any report',
    ),
    'description' => 'Edit the layout of your report',
    'type' => MENU_LOCAL_TASK,
    'file' => 'forena.report.inc',
  );
  $items['reports/%/edit/edit-data/%/%'] = array(
    'title' => 'Edit Block',
    'file' => 'forena.report.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'forena_report_data_block_form',
      1,
      3,
      4,
      5,
      'edit-data',
    ),
    'access arguments' => array(
      'design any report',
    ),
    'description' => 'Add a data block to your report',
    'type' => MENU_CALLBACK,
  );
  $items['reports/%/edit/edit-field/%'] = array(
    'title' => 'Edit Block',
    'file' => 'forena.report.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'forena_report_field_form',
      1,
      4,
    ),
    'access arguments' => array(
      'design any report',
    ),
    'description' => 'Add a data block to your report',
    'type' => MENU_CALLBACK,
  );
  $items['reports/%/edit/select-data/%'] = array(
    'title' => 'Select Data Block',
    'file' => 'forena.report.inc',
    'page callback' => 'forena_select_block_list',
    'page arguments' => array(
      1,
      4,
    ),
    'access arguments' => array(
      'design any report',
    ),
    'description' => 'Select the data blcok to add',
    'type' => MENU_CALLBACK,
  );
  $items['reports/%/edit/select-data/%/%'] = array(
    'title' => 'Select Data Block',
    'file' => 'forena.report.inc',
    'page callback' => 'forena_select_block_list',
    'page arguments' => array(
      1,
      4,
      5,
    ),
    'access arguments' => array(
      'design any report',
    ),
    'description' => 'Select the data blcok to add',
    'type' => MENU_CALLBACK,
  );
  $items['reports/%/edit/preview-data/%/%'] = array(
    'title' => 'Preview Data Block',
    'file' => 'forena.report.inc',
    'page callback' => 'forena_report_block_preview',
    'page arguments' => array(
      1,
      4,
      5,
    ),
    'access arguments' => array(
      'design any report',
    ),
    'description' => 'Select the data block to add',
    'type' => MENU_CALLBACK,
  );
  $items['reports/%/edit/preview-data/%/%/%'] = array(
    'title' => 'Preview Data Block',
    'file' => 'forena.report.inc',
    'page callback' => 'forena_report_block_preview',
    'page arguments' => array(
      1,
      4,
      5,
      6,
    ),
    'access arguments' => array(
      'design any report',
    ),
    'description' => 'Select the data block to add',
    'type' => MENU_CALLBACK,
  );
  $items['reports/%/edit/add-data/%'] = array(
    'title' => 'Data',
    'file' => 'forena.report.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'forena_report_data_block_form',
      1,
      3,
      4,
    ),
    'access arguments' => array(
      'design any report',
    ),
    'description' => 'Edit a data block on the report. ',
    'type' => MENU_CALLBACK,
  );
  $items['reports/%/edit/add-data/%/%'] = array(
    'title' => 'Add Data',
    'file' => 'forena.report.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'forena_report_data_block_form',
      1,
      3,
      4,
      5,
    ),
    'access arguments' => array(
      'design any report',
    ),
    'description' => 'Edit a data block on the report. ',
    'type' => MENU_CALLBACK,
  );
  $items['reports/%/edit/prepend-data/%/%'] = array(
    'title' => 'Add Data',
    'file' => 'forena.report.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'forena_report_data_block_form',
      1,
      3,
      4,
      5,
    ),
    'access arguments' => array(
      'design any report',
    ),
    'description' => 'Edit a data block on the report. ',
    'type' => MENU_CALLBACK,
  );
  $items['reports/%/edit/delete-data/%'] = array(
    'title' => 'Delete Data',
    'file' => 'forena.report.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'forena_report_delete_confirm',
      1,
      4,
    ),
    'access arguments' => array(
      'design any report',
    ),
    'description' => 'Delete this form',
    'type' => MENU_CALLBACK,
  );
  $items['reports/%/edit/format'] = array(
    'title' => 'Document Types',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'forena_report_format_form',
      1,
    ),
    'access arguments' => array(
      'design any report',
    ),
    'file' => 'forena.report.inc',
    'description' => 'Document Options',
    'type' => MENU_LOCAL_TASK,
  );
  $items['reports/%/delete'] = array(
    'title' => 'Remove Custom Report',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'forena_report_delete_form',
      1,
    ),
    'access arguments' => array(
      'delete report',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'forena.report.inc',
  );
  $items['reports/add'] = array(
    'title' => 'Create Report',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'forena_add_report_form',
    ),
    'access arguments' => array(
      'create any report',
    ),
    'description' => 'Create a new report',
    'file' => 'forena.report.inc',
    'type' => MENU_SUGGESTED_ITEM,
  );
  $items['reports/%/add'] = array(
    'title' => 'Create Report',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'forena_add_report_form',
      1,
    ),
    'access arguments' => array(
      'create any report',
    ),
    'description' => 'Create a new report from a template',
    'file' => 'forena.admin.inc',
    'type' => MENU_CALLBACK,
  );
  $items['reports/%/translate'] = array(
    'title' => 'Translate Report',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'forena_create_trans_form',
      1,
    ),
    'access arguments' => array(
      'create any report',
    ),
    'description' => 'Create a new report translation',
    'file' => 'forena.admin.inc',
    'type' => MENU_CALLBACK,
  );
  $items['forena'] = array(
    'page callback' => 'forena_user_reports',
    'page arguments' => array(),
    'title' => 'My Reports',
    'access arguments' => array(
      'list reports',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['reports'] = array(
    'page callback' => 'forena_user_reports',
    'page arguments' => array(),
    'title' => 'My Reports',
    'access arguments' => array(
      'list reports',
    ),
    'type' => MENU_NORMAL_ITEM,
  );
  $items['forena/xml/%'] = array(
    'page callback' => 'forena_block_xml',
    'page arguments' => array(
      2,
    ),
    'access arguments' => array(
      'access forena block xml',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['forena/json/%'] = array(
    'page callback' => 'forena_json',
    'page arguments' => array(
      2,
    ),
    'access arguments' => array(
      'access forena block xml',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['forena/fields/format/autocomplete'] = array(
    'page callback' => 'forena_fields_format_autocomplete',
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
  );
  $items['forena/data_block/autocomplete'] = array(
    'page callback' => 'forena_data_block_autocomplete',
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
  );
  $items['forena/reports/autocomplete'] = array(
    'page callback' => 'forena_reports_autocomplete',
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
  );
  $items['forena/categories/autocomplete'] = array(
    'page callback' => 'forena_categories_autocomplete',
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
  );
  return $items;
}