Create a custom admin page to you module

Public

This will create an page with all items for your module config page like admin/structure page.

Get raw version
php
  1. <?
  2. /**
  3.  * Implements hook_menu().
  4.  */
  5. function my_module_menu() {
  6.  
  7. $items['admin/my-module'] = array(
  8. 'title' => 'My module admin page',
  9. 'page callback' => 'system_admin_menu_block_page',
  10. 'access arguments' => array('access administration pages'),
  11. 'file path' => drupal_get_path('module', 'system'),
  12. 'file' => 'system.admin.inc',
  13. );
  14.  
  15. $items['admin/my-module/settings'] = array(
  16. 'title' => 'Basic Settings',
  17. 'description' => 'My module Settings',
  18. 'page callback' => 'drupal_get_form',
  19. 'page arguments' => array('my_module_settings_form'),
  20. 'access arguments' => array('access my module settings page'),
  21. );
  22.  
  23. return $items;
  24. }

Comments

sebas5384's picture

Thanks Rafa!!! Using this right now in my new module.