Skip to content
Snippets Groups Projects
Commit 0cc602db authored by Chris Leppanen's avatar Chris Leppanen
Browse files

Issue #2307379 by twistor: Fixed Add FeedsConfigurable::hasConfigForm().

parent f22a0f7f
No related branches found
No related tags found
No related merge requests found
...@@ -348,7 +348,7 @@ function feeds_ui_edit_page($importer, $active = 'help', $plugin_key = '') { ...@@ -348,7 +348,7 @@ function feeds_ui_edit_page($importer, $active = 'help', $plugin_key = '') {
// Fetcher. // Fetcher.
$fetcher = $plugins[$config['fetcher']['plugin_key']]; $fetcher = $plugins[$config['fetcher']['plugin_key']];
$actions = array(); $actions = array();
if (feeds_get_form($importer->fetcher, 'configForm')) { if ($importer->fetcher->hasConfigForm()) {
$actions = array(l(t('Settings'), $path . '/settings/' . $config['fetcher']['plugin_key'])); $actions = array(l(t('Settings'), $path . '/settings/' . $config['fetcher']['plugin_key']));
} }
$info['title'] = t('Fetcher'); $info['title'] = t('Fetcher');
...@@ -365,7 +365,7 @@ function feeds_ui_edit_page($importer, $active = 'help', $plugin_key = '') { ...@@ -365,7 +365,7 @@ function feeds_ui_edit_page($importer, $active = 'help', $plugin_key = '') {
// Parser. // Parser.
$parser = $plugins[$config['parser']['plugin_key']]; $parser = $plugins[$config['parser']['plugin_key']];
$actions = array(); $actions = array();
if (feeds_get_form($importer->parser, 'configForm')) { if ($importer->parser->hasConfigForm()) {
$actions = array(l(t('Settings'), $path . '/settings/' . $config['parser']['plugin_key'])); $actions = array(l(t('Settings'), $path . '/settings/' . $config['parser']['plugin_key']));
} }
$info['title'] = t('Parser'); $info['title'] = t('Parser');
...@@ -382,7 +382,7 @@ function feeds_ui_edit_page($importer, $active = 'help', $plugin_key = '') { ...@@ -382,7 +382,7 @@ function feeds_ui_edit_page($importer, $active = 'help', $plugin_key = '') {
// Processor. // Processor.
$processor = $plugins[$config['processor']['plugin_key']]; $processor = $plugins[$config['processor']['plugin_key']];
$actions = array(); $actions = array();
if (feeds_get_form($importer->processor, 'configForm')) { if ($importer->processor->hasConfigForm()) {
$actions[] = l(t('Settings'), $path . '/settings/' . $config['processor']['plugin_key']); $actions[] = l(t('Settings'), $path . '/settings/' . $config['processor']['plugin_key']);
} }
$actions[] = l(t('Mapping'), $path . '/mapping'); $actions[] = l(t('Mapping'), $path . '/mapping');
......
...@@ -169,6 +169,17 @@ abstract class FeedsConfigurable { ...@@ -169,6 +169,17 @@ abstract class FeedsConfigurable {
return array(); return array();
} }
/**
* Returns whether or not the configurable has a config form.
*
* @return bool
* True if the configurable has a config form, and false if not.
*/
public function hasConfigForm() {
$form_state = array();
return (bool) $this->configForm($form_state);
}
/** /**
* Return configuration form for this object. The keys of the configuration * Return configuration form for this object. The keys of the configuration
* form must match the keys of the array returned by configDefaults(). * form must match the keys of the array returned by configDefaults().
......
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