| [ Index ] |
PHP Cross Reference of Drupal 6 (yi-drupal) |
[Summary view] [Print] [Text view]
1 <?php 2 3 /** 4 * @file 5 * Module builder code generating code specific to Drupal 7. 6 */ 7 8 /** 9 * Generate module info file code. 10 * 11 * @param $module_data 12 * Same as for generate_module(). 13 * An associative array of data for the module. The keys can *mostly* be taken 14 * straight from form values. They are as follows: 15 * - 'module_root_name' 16 * - 'module_readable_name' 17 * - 'module_short_description' 18 * - 'module_help_text' 19 * - 'hooks': An associative array whose keys are full hook names 20 * (eg 'hook_menu'), where requested hooks have a value of TRUE. 21 * Unwanted hooks may also be included as keys provided their value is FALSE. 22 * - 'module_dependencies': a string of dependencies, eg 'forum views'. 23 * - 'module_package': the module package. 24 */ 25 function module_builder_generate_info($module_data) { 26 //print_r($module_data); 27 28 // The weird syntax stops this from getting mangled by CVS 29 $info = '; $' . 'Id$' . "\n"; 30 $info .= 'name = ' . $module_data['module_readable_name'] . "\n"; 31 $info .= 'description = '. $module_data['module_short_description'] ."\n"; 32 33 if (!empty($module_data['module_dependencies'])) { 34 foreach (explode(' ', $module_data['module_dependencies']) as $dep) { 35 $info .= 'dependencies[] = '. $dep ."\n"; 36 } 37 } 38 39 if (!empty($module_data['module_package'])) { 40 $info .= 'package = '. $module_data['module_package'] ."\n"; 41 } 42 $info .= "core = 7.x\n"; 43 44 if (isset($module_data['module_files'])) { 45 foreach ($module_data['module_files'] as $file) { 46 $info .= 'files[] = '. $file ."\n"; 47 } 48 } 49 50 return $info; 51 } 52
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Mon Jul 9 18:01:44 2012 | Cross-referenced by PHPXref 0.7 |