- <?php
- * @file
- * Hook implementations for the Tabledrag Example module.
- */
-
- * @defgroup tabledrag_example Example: Tabledrag
- * @ingroup examples
- * @{
- * This example demonstrates the usage of draggable table rows.
- */
-
- * Implements hook_menu().
- *
- * We'll let backdrop_get_form() generate the form page for us, for both of
- * these menu items.
- *
- * @see backdrop_get_form()
- */
- function tabledrag_example_menu() {
-
- $items['examples/tabledrag_example_simple'] = array(
- 'title' => 'TableDrag example (simple)',
- 'description' => 'Show a page with a sortable tabledrag form',
- 'page callback' => 'backdrop_get_form',
- 'page arguments' => array('tabledrag_example_simple_form'),
- 'access callback' => TRUE,
- 'file' => 'tabledrag_example_simple_form.inc',
- );
-
- $items['examples/tabledrag_example_parent'] = array(
- 'title' => 'TableDrag example (parent/child)',
- 'description' => 'Show a page with a sortable parent/child tabledrag form',
- 'page callback' => 'backdrop_get_form',
- 'page arguments' => array('tabledrag_example_parent_form'),
- 'access callback' => TRUE,
- 'file' => 'tabledrag_example_parent_form.inc',
- );
- return $items;
- }
-
- * Implements hook_theme().
- *
- * We need run our forms through custom theme functions in order to build the
- * table structure which is required by tabledrag.js. Before we can use our
- * custom theme functions, we need to implement hook_theme in order to register
- * them with Backdrop.
- *
- * We are defining our theme hooks with the same name as the form generation
- * function so that Backdrop automatically calls our theming function when the
- * form is displayed.
- */
- function tabledrag_example_theme() {
- return array(
-
- 'tabledrag_example_simple_form' => array(
- 'render element' => 'form',
- 'file' => 'tabledrag_example_simple_form.inc',
- ),
-
- 'tabledrag_example_parent_form' => array(
- 'render element' => 'form',
- 'file' => 'tabledrag_example_parent_form.inc',
- ),
- );
- }
- * @} End of "defgroup tabledrag_example".
- */