Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 314192

Add list_predefined_options functionality to core

$
0
0

Problem/Motivation

From the module page.

Supports 'predefined options' for core List fields such as US states, etc. Provides a hook to allow other modules to define their own lists.
This is similar in functionality to the Webform-specific hook hook_webform_select_options_info, but is intended for an API for not just core but for other modules as well.

http://drupal.org/project/list_predefined_options
hook_webform_select_options_info

Proposed resolution

Add hook_list_option_info

<?php
/**
  * Implements hook_list_option_info().
  */
function list_predefined_options_list_option_info() {
  
$info['us_states'] = array(
    
'label'=> t('US states'),
   
'callback'=> 'list_option_us_states',
   );
  
$info['countries'] = array(
    
'label'=> t('Countries'),
    
'callback'=> 'list_option_countries',
   );
   }
?>

Remaining tasks

Create Ptach

User interface changes

None

API changes

None


Viewing all articles
Browse latest Browse all 314192

Trending Articles