Skip to content
Snippets Groups Projects
Commit af015f3d authored by Alex Barth's avatar Alex Barth
Browse files

Attach feed configurations to content types.

parent 0ccaed76
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,25 @@ function feeds_perm() {
return array('use feeds', 'administer feeds');
}
/**
* Implementation of hook_form_alter().
*/
function feeds_form_alter(&$form, $form_state, $form_id) {
if ($form['#id'] == 'node-form') {
$feeds = feeds_load_all();
foreach ($feeds as $feed) {
$config = $feed->getConfig();
if ($config['content_type'] == $form['type']['#value']) {
$form['feeds'] = array(
'#type' => 'fieldset',
'#title' => t('Feed'),
);
$form['feeds'] += $feed->fetcher->sourceForm($form_state);
}
}
}
}
/**
* Implementation of hook_ctools_plugin_api().
*
......
......@@ -82,6 +82,8 @@ function feeds_ui_build_create_form(&$form_state) {
/**
* Validation handler for feeds_build_create_form().
*
* @todo: don't allow attaching more than one configuration to one content type.
*/
function feeds_ui_build_create_form_validate($form, &$form_state) {
ctools_include('export');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment