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

Clean up notices, remove some whitespace.

parent e2898061
No related branches found
No related tags found
No related merge requests found
......@@ -392,7 +392,7 @@ function feeds_importer_load_all($load_disabled = FALSE) {
ctools_include('export');
$configs = ctools_export_load_object('feeds_importer', 'all');
foreach ($configs as $config) {
if (!empty($config->id) && ($load_disabled || !$config->disabled)) {
if (!empty($config->id) && ($load_disabled || empty($config->disabled))) {
$feeds[$config->id] = feeds_importer($config->id);
}
}
......
......@@ -651,27 +651,29 @@ function _feeds_ui_format_options($options) {
function theme_feeds_ui_overview_form($form) {
drupal_add_js(drupal_get_path('module', 'feeds_ui') .'/feeds_ui.js');
drupal_add_css(drupal_get_path('module', 'feeds_ui') .'/feeds_ui.css');
// Iterate through all importers and build a table.
$rows = array();
foreach (array('enabled', 'disabled') as $type) {
foreach (element_children($form[$type]) as $id) {
$row = array();
foreach (element_children($form[$type][$id]) as $col) {
$row[$col] = array(
'data' => drupal_render($form[$type][$id][$col]),
if (isset($form[$type])) {
foreach (element_children($form[$type]) as $id) {
$row = array();
foreach (element_children($form[$type][$id]) as $col) {
$row[$col] = array(
'data' => drupal_render($form[$type][$id][$col]),
'class' => $type,
);
}
$rows[] = array(
'data' => $row,
'class' => $type,
);
}
$rows[] = array(
'data' => $row,
'class' => $type,
);
}
}
$output = '';
if (count($rows)) {
$output = theme('table', $form['#header'], $rows, array('class' => 'feeds-admin-importers'));
$output .= theme('table', $form['#header'], $rows, array('class' => 'feeds-admin-importers'));
}
$output .= drupal_render($form);
return $output;
}
......
......@@ -60,13 +60,12 @@ abstract class FeedsConfigurable {
protected function __construct($id) {
// Set this object's id.
$this->id = $id;
// Per default we assume that a Feeds object is not saved to
// database nor is it exported to code.
$this->export_type = FEEDS_EXPORT_NONE;
// Make sure configuration is populated.
$this->config = $this->configDefaults();
$this->disabled = FALSE;
}
/**
......
......@@ -113,7 +113,7 @@ class FeedsImporter extends FeedsConfigurable {
if ($config = ctools_export_load_object('feeds_importer', 'conditions', array('id' => $this->id))) {
$config = array_shift($config);
$this->export_type = $config->export_type;
$this->disabled = $config->disabled;
$this->disabled = isset($config->disabled) ? $config->disabled : FALSE;
$this->config = $config->config;
return TRUE;
}
......
......@@ -87,7 +87,7 @@ class FeedsCSVParser extends FeedsParser {
'#title' => t('Delimiter'),
'#description' => t('The character that delimits fields in the CSV file.'),
'#options' => drupal_map_assoc(array(',', ';')),
'#default_value' => $source_config['delimiter'],
'#default_value' => isset($source_config['delimiter']) ? $source_config['delimiter'] : ',',
);
return $form;
}
......
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