[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

/sites/all/modules/skinr/docs/ -> docs.php (source)

   1  <?php
   2  // $Id: docs.php,v 1.1.4.2 2010/09/28 04:16:40 jgirlygirl Exp $
   3  /**
   4   * @file
   5   * This file contains no working PHP code; it exists to provide additional documentation
   6   * for doxygen as well as to document hooks in the standard Drupal manner.
   7   */
   8  
   9  /**
  10   * @mainpage Skinr API Manual
  11   *
  12   * Topics:
  13   * - @ref skinr_hooks
  14   */
  15  
  16  /**
  17   * @defgroup skinr_hooks Skinrs hooks
  18   * @{
  19   * Hooks that can be implemented by other modules in order to implement the
  20   * Skinr API.
  21   */
  22  
  23  /**
  24   * Configure Skinr for this module.
  25   *
  26   * This hook should be placed in MODULENAME.skinr.inc and it will be auto-loaded.
  27   * This must either be in the same directory as the .module file or in a subdirectory
  28   * named 'includes'.
  29   *
  30   * The configuration info is keyed by the MODULENAME. In the case of $data['block']
  31   * 'block' is the name of the module.
  32   *
  33   * There are two section to the configuration array:
  34   * - When you specify a "form", Skinr will insert its skins selector into the form
  35   *   with the specified form_id. Example: $data[MODULENAME]['form'][FORM_ID] = ...
  36   *   You can specify multiple forms that Skinr should add its skins selector to. A
  37   *   good example where this would be needed is blocks where you have a different
  38   *   form_id for adding a new block than when editing an existing block.
  39   * - When you specify "preprocess", Skinr will create a $vars['skinr'] variable
  40   *   containing the appropriate skin classes for the specified preprocess hook.
  41   *   Example: $data[MODULENAME]['preprocess'][PREPROCESS_HOOK] = ...
  42   *
  43   * Form options:
  44   * - "index_handler" is required. It specifies a function that returns an index where
  45   *   Skinr can find the values in its data structure.
  46   * - "access_handler" specifies a function that returns TRUE if you wish to grant access
  47   *   to skinr, or FALSE if not.
  48   * - "data_handler" specifies a function that returns the data used to populate the form.
  49   *   This is useful in cases where a module caches data (like panels and views) and has
  50   *   an option to cancel changes.
  51   * - "submit_handler" specifies a function that process the form data and saves it.
  52   * - "preprocess_hook" is required. Each skin states which preprocess hooks it will
  53   *   work for. This parameter will limit the available skins by the specified
  54   *   preprocess hook.
  55   * - "title" overrides the default title on the Skinr fieldset.
  56   * - "description" overrides the default description that provides additional
  57   *   information to the user about this Skinr selector.
  58   * - "weight" overrides the order where Skinrs selector appears on the form.
  59   * - "collapsed" sets whether the fieldset appears collapsed or not. Defaults to TRUE.
  60   * - "selector_weight" overrides the weight of the selector field inside the fieldset.
  61   *   This is useful, for instance, if you have multiple modules add selectors to the
  62   *   same form.
  63   * - "selector_title" overrides the title of the selector field inside the fieldset.
  64   *
  65   * Preprocess options:
  66   * - "indexhandler" is required. It specifies a function that returns an index where
  67   *   Skinr can find the values in its data structure.
  68   */
  69  function hook_skinr_config() {
  70    $data['example']['form']['block_admin_configure'] = array(
  71      'index_handler' => 'example_skinr_index_handler',
  72      'preprocess_hook' => 'block',
  73      'title' => t('Skinr settings'),
  74      'description' => t('Here you can manage which Skinr styles, if any, you want to apply.'),
  75      'weight' => 1,
  76      'collapsed' => TRUE,
  77      'selector_weight' => 0,
  78      'selector_title' => t('Choose Skinr Style(s)'),
  79    );
  80    $data['example']['form']['block_add_block_form'] = array(
  81      'index_handler' => 'example_skinr_index_handler',
  82      'title' => t('Skinr settings'),
  83      'description' => t('Here you can manage which Skinr styles, if any, you want to apply to this block.'),
  84      'weight' => -10,
  85      'collapsed' => FALSE,
  86    );
  87  
  88    $data['example']['preprocess']['block'] = array(
  89      'index_handler' => 'block_skinr_preprocess_handler_block',
  90    );
  91  
  92    return $data;
  93  }
  94  
  95  /**
  96   * Register Skinr API information. This is required for your module to have
  97   * its include files loaded.
  98   *
  99   * The full documentation for this hook is in the advanced help.
 100   */
 101  function hook_skinr_api() {
 102    return array(
 103      'api' => 1,
 104      'path' => drupal_get_path('module', 'modulename'),
 105      'skins' => FALSE,
 106    );
 107  }
 108  
 109  /**
 110   * @}
 111   */


Generated: Thu Mar 24 11:18:33 2011 Cross-referenced by PHPXref 0.7