[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

/sites/all/modules/module_builder/hooks/ -> module_builder.php (source)

   1  <?php
   2  
   3  /**
   4   * @file
   5   * These are the hooks that are invoked by the Module builder.
   6   */
   7  
   8  /**
   9   * @addtogroup hooks
  10   * @{
  11   */
  12  
  13  /**
  14   * Provide information about hook definition files to Module builder.
  15   * This hook should go in a MODULE.module_builder.inc file in your module folder.
  16   * Is it only loaded by Module builder when the user goes to download new hook data.
  17   *
  18   * @return
  19   *   An array of data, keyed by module name.
  20   *   The subsequent array should specify:
  21   *    - url: a general url to fetch files from.
  22   *      Use tokens to insert filenames and branch: %file, %branch 
  23   *    - branch: the current branch of the module, eg DRUPAL-6--1, HEAD.
  24   *      TODO: find a neat way to grab this with a CVS id token?
  25   *    - group: the UI group these hooks should go in. This should probably be the
  26   *      name of your module, but you can use '#filenames' to specify that each
  27   *      of your files should form a group.
  28   *      Eg 'core.php' goes in the group 'core'.
  29   *    - hook_files: an array of files to fetch. The filename is the key
  30   *      and the value is the file where the hook code should eventually be stored.
  31   *      Use the token %module for the module machine name.
  32   *      Usually this will be '%module.module' but for instance,
  33   *      'install.php' has hooks that should go in '%module.install'.
  34   */
  35  function hook_module_builder_info() {
  36    $data = array(
  37      // Hooks on behalf of Drupal core.
  38      'system' => array(
  39        'url' => 'http://cvs.drupal.org/viewvc.py/drupal/contributions/docs/developer/hooks/%file?view=co&pathrev=%branch',
  40        'branch' => 'DRUPAL-6--1',
  41        'group' => '#filenames',
  42        'hook_files' => array(
  43          // List of files we should slurp from the url for hook defs.
  44          // and the destination file for processed code.
  45          'core.php' =>    '%module.module',
  46          'node.php' =>    '%module.module',      
  47          'install.php' => '%module.install',      
  48        ),
  49      ),
  50      // We need to do our own stuff now we have a hook!
  51      'module_builder' => array(
  52        'url' => 'http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/module_builder/hooks/%file?view=co&pathrev=%branch',
  53        'branch' => 'DRUPAL-6--2',
  54        'group' => 'module builder',      
  55        'hook_files' => array(
  56          'module_builder.php' => '%module.module_builder.inc',
  57        ),
  58      ),
  59    );
  60    
  61    return $data;
  62  }


Generated: Mon Jul 9 18:01:44 2012 Cross-referenced by PHPXref 0.7