예제 #1
0
 /**
  * Constructor method; sets the component data.
  *
  * @param $component_name
  *   The identifier for the component.
  * @param $component_data
  *   (optional) An array of data for the component. Any missing properties
  *   (or all if this is entirely omitted) are given default values.
  *   Valid properties are:
  *      - 'title': The title for the item.
  *      - TODO: further properties such as access!
  */
 function __construct($component_name, $component_data = array())
 {
     // Set some default properties.
     // This allows the user to leave off specifying details like title and
     // access, and get default strings in place that they can replace in
     // generated module code.
     $component_data += array('title' => 'myPage');
     parent::__construct($component_name, $component_data);
 }
예제 #2
0
 /**
  * Constructor method; sets the component data.
  *
  * @param $component_name
  *   The identifier for the component.
  * @param $component_data
  *   (optional) An array of data for the component. Any missing properties
  *   (or all if this is entirely omitted) are given default values.
  *   Valid properties are:
  *      - 'code_file': The code file to place this form in. This may contain
  *        placeholders.
  *      - 'form_code_bodies': (optional) An array of code bodies. Each should
  *        be in a format suitable to return from componentFunctions(). Any or
  *        all of the following keys may be present:
  *        - 'builder': The form builder.
  *        - 'validate': The validate handler.
  *        - 'submit': The submit handler.
  */
 function __construct($component_name, $component_data = array())
 {
     // Set some default properties.
     $component_data += array('code_file' => '%module.module', 'form_code_bodies' => array());
     parent::__construct($component_name, $component_data);
 }
예제 #3
0
 /**
  * Constructor method; sets the component data.
  *
  * @param $component_name
  *   The identifier for the component.
  * @param $component_data
  *   (optional) An array of data for the module. The properties are as
  *   follows:
  *    - 'base': The type of component: 'module'.
  *    - 'module_root_name': The machine name for the module.
  *    - 'module_readable_name': The human readable name for the module.
  *    - 'module_short_description': The module's description text.
  *    - 'module_help_text': Help text for the module. If this is given, then
  *       hook_help() is automatically added to the list of required hooks.
  *    - 'hooks': An associative array whose keys are full hook names
  *      (eg 'hook_menu'), where requested hooks have a value of TRUE.
  *      Unwanted hooks may also be included as keys provided their value is
  *      FALSE.
  *    - 'module_dependencies': A string of module dependencies, separated by
  *       spaces, e.g. 'forum views'.
  *    - 'module_package': The module package.
  *    - 'component_folder': (optional) The destination folder to write the
  *      module files to.
  *    - 'module_files': ??? OBSOLETE!? added by this function. A flat array
  *      of filenames that have been generated.
  *    - 'requested_build': An array whose keys are names of subcomponents to
  *       build. Component names are defined in requiredComponents(), and include:
  *       - 'all': everything we can do.
  *       - 'code': PHP code files.
  *       - 'info': the info file.
  *       - 'module': the .module file.
  *       - 'install': the .install file.
  *       - 'tests': test file.
  *       - 'api': api.php hook documentation file.
  *       - FILE ID: requests a particular code file, by the abbreviated name.
  *         This is the filename without the initial 'MODULE.' or the '.inc'
  *         extension.
  *    - 'requested_components': An array of components to build (in addition
  *      to any that are added automatically). This should in the same form
  *      as the return from requiredComponents(), thus keyed by component name,
  *      with values either a component type or an array of data.
  *  Properties added by generators during the process:
  *    - 'hook_file_data': Added by the Hooks generator. Keyed by the component
  *      names of the ModuleCodeFile type components that Hooks adds.
  */
 function __construct($component_name, $component_data = array())
 {
     // Fill in all defaults. This allows default values to be set here that
     // are not involved in the UI, such as the module class name.
     $this->getComponentDataDefaultValue($component_data);
     // This method is only here to document the component data.
     parent::__construct($component_name, $component_data);
 }