Last active
August 29, 2015 14:08
-
-
Save jackfoust/84a4963a2a4eb96a4131 to your computer and use it in GitHub Desktop.
#drupal Sample plugin for Feeds Importer module.Drupal 7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file | |
* Creates a plugin that in this example was used in the Feeds Importer module. Plugin can execute PHP against values passed to it. | |
*/ | |
$plugin = array( | |
'form' => 'MODULE_NAME_PLUGIN_NAME_form', | |
// Optional validation callback. | |
'validate' => 'MODULE_NAME_PLUGIN_NAME__validate', | |
'callback' => 'MODULE_NAME_PLUGIN_NAME__callback', | |
'name' => 'NAME', | |
'multi' => 'loop', | |
'category' => 'Other', | |
); | |
function MODULE_NAME_PLUGIN_NAME_form($importer, $element_key, $settings) { | |
$form = array(); | |
$form['help']['#value'] = t('HElP'); | |
return $form; | |
} | |
function MODULE_NAME_PLUGIN_NAME_validate(&$settings) { | |
// Validate $settings. | |
} | |
function MODULE_NAME_PLUGIN_NAME_callback($source, $item_key, $element_key, &$field, $settings) { | |
// Do something to $field | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment