README.txt 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. Admin 2.x
  2. =========
  3. The admin module provides UI improvements to the standard Drupal admin interface. The 2.x branch focuses on the following goals:
  4. 1. Sustainability - avoid excessive overrides of code, markup, and
  5. interface strings to ensure the module keeps the workload overhead
  6. on the maintainers and community to a minimum.
  7. 2. Pluggable/extensible architecture - ensure that admin serves as a
  8. starting point for other modules in contrib to implement admin
  9. interfaces.
  10. 3. Expose Drupal's strengths and downplay its weaknesses where possible.
  11. An honest approach to the underlying framework and architecture
  12. of Drupal will be less confusing to the user down the road.
  13. Admin is not an original work - many of its decisions have had direct
  14. influences from other work in the community:
  15. - [Administration menu](http://drupal.org/project/admin_menu)
  16. Daniel Kudwien (sun)
  17. - [Navigate](http://drupal.org/project/navigate)
  18. Chris Shattuck (chrisshattuck)
  19. - [d7ux](http://www.d7ux.org)
  20. Mark Boulton & Leisa Reichelt
  21. Installation
  22. ============
  23. 1. Install & enable the module.
  24. 2. Admin makes a permission available that allows only properly
  25. permissioned users to make use of the admin toolbar. Users with the
  26. 'use admin toolbar' permission will be able to use the toolbar.
  27. 3. You can configure the layout, position, and enabled tools for the
  28. admin toolbar on `admin/config/user-interface/admin`, or by navigating
  29. to `Administration > Configuration > User interface > Administration tools`
  30. Implementing your own Admin "plugins"
  31. =====================================
  32. Admin's "plugins" are simply Drupal blocks. In order to expose one of your
  33. module's blocks as one suitable for use in the admin toolbar you can set the `admin` key in your `hook_block()` to `TRUE`. Note that users can add any blocks to the admin toolbar if they wish at `admin/settings/admin`, though not all will work well in the context of the admin toolbar.
  34. /**
  35. * Implementation of hook_block().
  36. */
  37. function my_module_block($op = 'list', $delta = 0, $edit = array()) {
  38. switch ($op) {
  39. case 'list':
  40. $blocks = array();
  41. $blocks['example'] = array(
  42. 'info' => t('Example block'),
  43. 'admin' => TRUE
  44. );
  45. return $blocks;
  46. }
  47. }
  48. Theming your block and other tips
  49. =================================
  50. Your block should provide general rules for either of the admin toolbar
  51. layouts (horizontal or vertical). You can specify CSS rules using the
  52. following selectors:
  53. #admin-toolbar.horizontal {}
  54. #admin-toolbar.vertical {}
  55. Admin provides fairly decent defaults for the following Drupal core
  56. theme functions:
  57. - `theme('item_list')`
  58. - menu output (e.g. `menu_tree_output()`).
  59. - most form elements (with the exception of fieldsets)
  60. - admin panes (see below)
  61. Admin provides an additional FormAPI element type `admin_panes`. Admin
  62. panes allow you to fit multiple elements of content into a togglable
  63. interface. The panes will automatically adjust to the layout to the toolbar
  64. and display as either vertical tabs (horizontal layout) or accordian boxes
  65. (vertical layout).
  66. Here is an example of using admin panes in a form API array:
  67. $form['panes'] = array(
  68. '#tree' => FALSE,
  69. '#type' => 'admin_panes',
  70. 'foo' => array(
  71. '#title' => t('Pane 1'),
  72. ...
  73. ),
  74. 'bar' => array(
  75. '#title' => t('Pane 2'),
  76. ...
  77. ),
  78. );
  79. Note that each child element must have a #title attribute to be labeled
  80. properly.
  81. Contributors
  82. ============
  83. - yhahn (Young Hahn)
  84. - ajashton (AJ Ashton)