/[drupal]/contributions/modules/module_builder/includes/generate.inc
ViewVC logotype

Diff of /contributions/modules/module_builder/includes/generate.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.19, Sat Oct 24 14:28:06 2009 UTC revision 1.1.2.20, Sat Oct 24 22:55:55 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: generate.inc,v 1.1.2.18 2009/10/24 13:27:18 joachim Exp $  // $Id: generate.inc,v 1.1.2.19 2009/10/24 14:28:06 joachim Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 13  Line 13 
13   * Generate module code.   * Generate module code.
14   *   *
15   * @param $module_data   * @param $module_data
16   *   An associative array of data for the module. The keys can *mostly* be taken   *   An associative array of data for the module, passed by reference so data
17   *   straight from form values. They are as follows:   *   on generated files can be added.
18     *   The keys can *mostly* be taken straight from form values. They are as follows:
19   *     - 'module_root_name'   *     - 'module_root_name'
20   *     - 'module_readable_name'   *     - 'module_readable_name'
21   *     - 'module_short_description'   *     - 'module_short_description'
# Line 24  Line 25 
25   *       Unwanted hooks may also be included as keys provided their value is FALSE.   *       Unwanted hooks may also be included as keys provided their value is FALSE.
26   *     - 'module_dependencies': a string of dependencies, eg 'forum views'.   *     - 'module_dependencies': a string of dependencies, eg 'forum views'.
27   *     - 'module_package': the module package.   *     - 'module_package': the module package.
28     *     - 'module_files': added by this function. A flat array of filenames that have been generated.
29   * @param $bare   * @param $bare
30   *   If true, omit header and footers and output only hook code.   *   If true, omit header and footers and output only hook code.
31   * @return   * @return
32   *   An array of code, indexed by filename. Eg,   *   An array of code, indexed by filename. Eg,
33   *     'modulename.module' => CODE   *     'modulename.module' => CODE
34   */   */
35  function module_builder_generate_module($module_data, $bare = FALSE) {  function module_builder_generate_module(&$module_data, $bare = FALSE) {
36    // Get a set of hook declarations and function body templates for the hooks we want.    // Get a set of hook declarations and function body templates for the hooks we want.
37    // $hook_data is of the form:    // $hook_data is of the form:
38    //   'hook_foo' => array( 'declaration' => DATA, 'template' => DATA )    //   'hook_foo' => array( 'declaration' => DATA, 'template' => DATA )
# Line 38  function module_builder_generate_module( Line 40  function module_builder_generate_module(
40    if (is_null($hook_file_data)) {    if (is_null($hook_file_data)) {
41      return NULL;      return NULL;
42    }    }
43    
44    //print_r($module_data);    //print_r($module_data);
45    //dsm($hook_file_data);    //dsm($hook_file_data);
46    
# Line 102  function module_builder_generate_module( Line 104  function module_builder_generate_module(
104      //print $code;      //print $code;
105    
106      $return[$filename] = $code;      $return[$filename] = $code;
107        // Add the generated filename to the module data for the info generation to find.
108        $module_data['module_files'][] = $filename;
109    } // foreach file    } // foreach file
110    
111      //print_r($module_data);
112    
113    return $return;    return $return;
114  }  }
115    

Legend:
Removed from v.1.1.2.19  
changed lines
  Added in v.1.1.2.20

  ViewVC Help
Powered by ViewVC 1.1.2