Toolbox is a utility module for creating tabbed, block-driven custom user interfaces for working with nodes and other objects. It is conceptually similar to Quick Tabs, however all of its configuration is code based.

Requirements

API

All configuration for Toolbox is done through the API. You can define Toolsets (which appear as Blocks) and Tools, which appear as tabs in your Toolsets.

hook_toolbox_toolset
This should return an array of toolsets with the following keys:

  • '#title' - The name of the toolbox to display
  • '#name' - Administrative name to appear in the block interface
  • '#tools' - an array of tools to use
  • '#function' - (optional) a function to pass the unrendered tabs into. this function should render the tabs and any other content for inserting into the block

<?php
function toolbox_example_toolbox_toolset() {
 
$toolset['toolbox_example_toolbox'] = array(
   
'#title' => t('Example toolbox'),
   
'#name' => t('example toolbox'),
   
'#tools' => array(
     
'example_tool_foo',
     
'example_tool_bar'
   
),
   
'#function' => 'toolbox_example_content',
  );

  return
$toolset;
}
?>

hook_toolbox_tools
This should return an array of individual tools to be rendered in tabs in toolsets. It expects the following keys:

  • '#title' - The name of the toolbox to display
  • '#name' - Administrative name to appear in the block interface
  • '#function' - the function to render the tab with. This is required for tools and should return a content string
  • '#weight' - the toolset weight
  • '#perm' - an optional permission for accessing the tab (if not specified, default permissions available in the permission list will be used)

<?php
function toolbox_example_toolbox_tools() {
 
$tools = array();

 
// You are here
 
$tools['example_tool_foo'] = array(
   
'#name' => t('Example tool foo'),
   
'#title' => t('Foo'),
   
'#function' => 'toolbox_example_foo',
   
'#weight' => 1,
   
'#perm' => array('view toolbox foo example')
  );

 
// Navigation
 
$tools['example_tool_bar'] = array(
   
'#name' => t('Bar tool for example'),
   
'#title' => t('Bar'),
   
'#function' => 'toolbox_example_bar',
   
'#weight' => 2,
  );

  return
$tools;
}
?>

Downloads

Version Downloads Date Links
6.x-1.0-beta1 tar.gz (9.18 KB) | zip (10.64 KB) 2011-Dec-23 Notes

Project Information


Maintainers for Toolbox

  • xtfer - 2 commits
    last: 22 weeks ago, first: 22 weeks ago

Issues for Toolbox

To avoid duplicates, please search before submitting a new issue.
All issues
Bug reports
nobody click here