' . $summary . '
' . $element['#children'];
// Render file upload field using theme_form_element().
$output = theme('form_element', $element);
// Close "feeds-file" and "feeds-file-upload" divs.
diff --git a/feeds_import/feeds_import.test b/feeds_import/feeds_import.test
index e5a1f7a..ee62de0 100644
--- a/feeds_import/feeds_import.test
+++ b/feeds_import/feeds_import.test
@@ -100,10 +100,9 @@ class FeedsExamplesNodeTestCase extends FeedsWebTestCase {
$this->assertText('Updated 7 nodes');
// Import a tab separated file.
- $this->drupalGet('import/node/delete-items');
$this->drupalPost('import/node/delete-items', array(), 'Delete');
$edit = array(
- 'files[node]' => $this->absolutePath() . '/tests/feeds/nodes.tsv',
+ 'files[feeds]' => $this->absolutePath() . '/tests/feeds/nodes.tsv',
'feeds[FeedsCSVParser][delimiter]' => "TAB",
);
$this->drupalPost('import/node', $edit, 'Import');
diff --git a/feeds_ui/feeds_ui.test b/feeds_ui/feeds_ui.test
index 58ac0cd..296d2ed 100644
--- a/feeds_ui/feeds_ui.test
+++ b/feeds_ui/feeds_ui.test
@@ -108,10 +108,8 @@ class FeedsUIUserInterfaceTestCase extends FeedsWebTestCase {
// Create a feed node.
$edit = array(
'title' => 'Development Seed',
- 'feeds[test_feed][FeedsHTTPFetcher][source]' =>
- $GLOBALS['base_url'] . '/' . drupal_get_path('module', 'feeds') .
- '/tests/feeds/developmentseed.rss2',
- );
+ 'feeds[test_feed][FeedsHTTPFetcher][source]' => $GLOBALS['base_url'] . '/' . drupal_get_path('module', 'feeds') . '/tests/feeds/developmentseed.rss2',
+ );
$this->drupalPost('node/add/page', $edit, 'Save');
$this->assertText('Basic page Development Seed has been created.');
diff --git a/includes/FeedsSource.inc b/includes/FeedsSource.inc
index 6dded29..172ee8f 100644
--- a/includes/FeedsSource.inc
+++ b/includes/FeedsSource.inc
@@ -33,7 +33,7 @@ interface FeedsSourceInterface {
*
* @see FeedsPlugin class.
*
- * @return bool
+ * @return
* TRUE if a plugin handles source specific configuration, FALSE otherwise.
*/
public function hasSourceConfig();
@@ -124,9 +124,9 @@ class FeedsState {
* - $progress is larger than $total
* - $progress approximates $total so that $finished rounds to 1.0
*
- * @param int $total
+ * @param $total
* A natural number that is the total to be worked off.
- * @param int $progress
+ * @param $progress
* A natural number that is the progress made on $total.
*/
public function progress($total, $progress) {
@@ -217,8 +217,7 @@ class FeedsSource extends FeedsConfigurable {
}
/**
- * Returns the FeedsImporter object that this source is expected
- * to be used with.
+ * Returns the FeedsImporter object that this source is expected to be used with.
*/
public function importer() {
return $this->importer;
@@ -227,7 +226,7 @@ class FeedsSource extends FeedsConfigurable {
/**
* Preview = fetch and parse a feed.
*
- * @return object
+ * @return
* FeedsParserResult object.
*
* @throws
@@ -369,7 +368,7 @@ class FeedsSource extends FeedsConfigurable {
* This method only executes the current batch chunk, then returns. If you are
* looking to import an entire source, use FeedsSource::startImport() instead.
*
- * @return float
+ * @return
* FEEDS_BATCH_COMPLETE if the import process finished. A decimal between
* 0.0 and 0.9 periodic if import is still in progress.
*
@@ -497,7 +496,7 @@ class FeedsSource extends FeedsConfigurable {
* looking to delete all items of a source, use FeedsSource::startClear()
* instead.
*
- * @return float
+ * @return
* FEEDS_BATCH_COMPLETE if the clearing process finished. A decimal between
* 0.0 and 0.9 periodic if clearing is still in progress.
*
@@ -595,10 +594,10 @@ class FeedsSource extends FeedsConfigurable {
*
* @todo Rename getConfigFor() accordingly to config().
*
- * @param string $stage
+ * @param $stage
* One of FEEDS_FETCH, FEEDS_PARSE, FEEDS_PROCESS or FEEDS_PROCESS_CLEAR.
*
- * @return object
+ * @return
* The FeedsState object for the given stage.
*/
public function state($stage) {
@@ -664,12 +663,7 @@ class FeedsSource extends FeedsConfigurable {
* @todo Patch CTools to move constants from export.inc to ctools.module.
*/
public function load() {
- if ($record = db_query("SELECT imported, config, state, fetcher_result FROM {feeds_source} WHERE id = :id AND feed_nid = :nid",
- array(
- ':id' => $this->id,
- ':nid' => $this->feed_nid,
- )
- )->fetchObject()) {
+ if ($record = db_query("SELECT imported, config, state, fetcher_result FROM {feeds_source} WHERE id = :id AND feed_nid = :nid", array(':id' => $this->id, ':nid' => $this->feed_nid))->fetchObject()) {
// While FeedsSource cannot be exported, we still use CTool's export.inc
// export definitions.
ctools_include('export');
@@ -714,7 +708,7 @@ class FeedsSource extends FeedsConfigurable {
/**
* Only return source if configuration is persistent and valid.
*
- * @see FeedsConfigurable::existing()
+ * @see FeedsConfigurable::existing().
*/
public function existing() {
// If there is no feed nid given, there must be no content type specified.
@@ -751,7 +745,7 @@ class FeedsSource extends FeedsConfigurable {
* @param $config
* The configuration for $client.
*
- * @return array
+ * @return
* An array stored for $client.
*/
public function setConfigFor(FeedsSourceInterface $client, $config) {
@@ -818,10 +812,10 @@ class FeedsSource extends FeedsConfigurable {
* submits a source for import or clearing, we will leave her without any
* visual indicators of an ongoing job.
*
- * @see FeedsSource::startImport()
- * @see FeedsSource::startClear()
+ * @see FeedsSource::startImport().
+ * @see FeedsSource::startClear().
*
- * @param string $method
+ * @param $method
* Method to execute on importer; one of 'import' or 'clear'.
*
* @throws Exception $e
@@ -841,13 +835,13 @@ class FeedsSource extends FeedsConfigurable {
/**
* Batch API helper. Starts a Batch API job.
*
- * @see FeedsSource::startImport()
- * @see FeedsSource::startClear()
+ * @see FeedsSource::startImport().
+ * @see FeedsSource::startClear().
* @see feeds_batch()
*
- * @param string $title
+ * @param $title
* Title to show to user when executing batch.
- * @param string $method
+ * @param $method
* Method to execute on importer; one of 'import' or 'clear'.
*/
protected function startBatchAPIJob($title, $method) {
diff --git a/plugins/FeedsFileFetcher.inc b/plugins/FeedsFileFetcher.inc
index 6ed8ac3..cf84480 100644
--- a/plugins/FeedsFileFetcher.inc
+++ b/plugins/FeedsFileFetcher.inc
@@ -30,11 +30,7 @@ class FeedsFileFetcherResult extends FeedsFetcherResult {
*/
public function getFilePath() {
if (!is_readable($this->file_path)) {
- throw new Exception(t('File @filepath is not accessible.',
- array(
- '@filepath' => $this->file_path,
- )
- ));
+ throw new Exception(t('File @filepath is not accessible.', array('@filepath' => $this->file_path)));
}
return $this->sanitizeFile($this->file_path);
}
@@ -69,15 +65,14 @@ class FeedsFileFetcher extends FeedsFetcher {
return new FeedsFileFetcherResult($file);
}
- throw new Exception(t('Resource is not a file or it is an empty directory: %source',
- array('%source' => $source_config['source'])));
+ throw new Exception(t('Resource is not a file or it is an empty directory: %source', array('%source' => $source_config['source'])));
}
/**
* Returns an array of files in a directory.
*
* @param string $dir
- * A stream wrapper URI that is a directory.
+ * A stream wreapper URI that is a directory.
*
* @return array
* An array of stream wrapper URIs pointing to files. The array is empty if
@@ -114,12 +109,9 @@ class FeedsFileFetcher extends FeedsFetcher {
'#type' => 'file',
'#name' => 'files[' . $this->id . ']',
'#title' => empty($this->config['direct']) ? t('File') : NULL,
- '#description' => empty($source_config['source']) ?
- t('Select a file from your local system.') :
- t('Select a different file from your local system.'),
+ '#description' => empty($source_config['source']) ? t('Select a file from your local system.') : t('Select a different file from your local system.'),
'#theme_wrappers' => array('feeds_upload'),
- '#file_info' => empty($source_config['fid']) ?
- NULL : file_load($source_config['fid']),
+ '#file_info' => empty($source_config['fid']) ? NULL : file_load($source_config['fid']),
'#size' => 10,
);
}
@@ -127,10 +119,8 @@ class FeedsFileFetcher extends FeedsFetcher {
$form['source'] = array(
'#type' => 'textfield',
'#title' => t('File'),
- '#description' => t('Specify a path to a file or a directory. Prefix the path with a scheme. Available schemes: @schemes.',
- array('@schemes' => implode(', ', $this->config['allowed_schemes']))),
- '#default_value' => empty($source_config['source']) ?
- '' : $source_config['source'],
+ '#description' => t('Specify a path to a file or a directory. Prefix the path with a scheme. Available schemes: @schemes.', array('@schemes' => implode(', ', $this->config['allowed_schemes']))),
+ '#default_value' => empty($source_config['source']) ? '' : $source_config['source'],
);
}
return $form;
@@ -150,27 +140,15 @@ class FeedsFileFetcher extends FeedsFetcher {
if (user_access('administer feeds')) {
$plugin_key = feeds_importer($this->id)->config[$this->pluginType()]['plugin_key'];
$link = url('admin/structure/feeds/' . $this->id . '/settings/' . $plugin_key);
- form_set_error('feeds][FeedsFileFetcher][source',
- t('Upload failed. Please check the upload
settings.',
- array('@link' => $link))
- );
+ form_set_error('feeds][FeedsFileFetcher][source', t('Upload failed. Please check the upload
settings.', array('@link' => $link)));
}
else {
- form_set_error('feeds][FeedsFileFetcher][source',
- t('Upload failed. Please contact your site administrator.')
- );
+ form_set_error('feeds][FeedsFileFetcher][source', t('Upload failed. Please contact your site administrator.'));
}
- watchdog('feeds', 'The upload directory %directory required by a feed could not be created or is not accessible. A newly uploaded file could not be saved in this directory as a consequence, and the upload was canceled.',
- array('%directory' => $feed_dir)
- );
+ watchdog('feeds', 'The upload directory %directory required by a feed could not be created or is not accessible. A newly uploaded file could not be saved in this directory as a consequence, and the upload was canceled.', array('%directory' => $feed_dir));
}
// Validate and save uploaded file.
- elseif ($file = file_save_upload($this->id,
- array(
- 'file_validate_extensions' => array(
- 0 => $this->config['allowed_extensions'],
- ),
- ), $feed_dir)) {
+ elseif ($file = file_save_upload($this->id, array('file_validate_extensions' => array(0 => $this->config['allowed_extensions'])), $feed_dir)) {
$values['source'] = $file->uri;
$values['file'] = $file;
}
@@ -185,12 +163,7 @@ class FeedsFileFetcher extends FeedsFetcher {
// Check if chosen url scheme is allowed.
$scheme = file_uri_scheme($values['source']);
if (!$scheme || !in_array($scheme, $this->config['allowed_schemes'])) {
- form_set_error('feeds][FeedsFileFetcher][source',
- t("The file needs to reside within the site's files directory, its path needs to start with scheme://. Available schemes: @schemes.",
- array(
- '@schemes' => implode(', ', $this->config['allowed_schemes']),
- ))
- );
+ form_set_error('feeds][FeedsFileFetcher][source', t("The file needs to reside within the site's files directory, its path needs to start with scheme://. Available schemes: @schemes.", array('@schemes' => implode(', ', $this->config['allowed_schemes']))));
}
// Check whether the given path is readable.
elseif (!is_readable($values['source'])) {
@@ -284,9 +257,7 @@ class FeedsFileFetcher extends FeedsFetcher {
$form['directory'] = array(
'#type' => 'textfield',
'#title' => t('Upload directory'),
- '#description' => t('Directory where uploaded files get stored. Prefix the path with a scheme. Available schemes: @schemes.',
- array('@schemes' => implode(', ', $this->getSchemes()))
- ),
+ '#description' => t('Directory where uploaded files get stored. Prefix the path with a scheme. Available schemes: @schemes.', array('@schemes' => implode(', ', $this->getSchemes()))),
'#default_value' => $this->config['directory'],
'#states' => array(
'visible' => array(
@@ -337,8 +308,7 @@ class FeedsFileFetcher extends FeedsFetcher {
// Validate the URI scheme of the upload directory.
$scheme = file_uri_scheme($values['directory']);
if (!$scheme || !in_array($scheme, $this->getSchemes())) {
- form_set_error('directory',
- t('Please enter a valid scheme into the directory location.'));
+ form_set_error('directory', t('Please enter a valid scheme into the directory location.'));
// Return here so that attempts to create the directory below don't
// throw warnings.
@@ -347,8 +317,7 @@ class FeedsFileFetcher extends FeedsFetcher {
// Ensure that the upload directory exists.
if (!file_prepare_directory($values['directory'], FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS)) {
- form_set_error('directory',
- t('The chosen directory does not exist and attempts to create it failed.'));
+ form_set_error('directory', t('The chosen directory does not exist and attempts to create it failed.'));
}
}
}
diff --git a/plugins/FeedsNodeProcessor.inc b/plugins/FeedsNodeProcessor.inc
index d3912fe..129dfdf 100644
--- a/plugins/FeedsNodeProcessor.inc
+++ b/plugins/FeedsNodeProcessor.inc
@@ -96,9 +96,7 @@ class FeedsNodeProcessor extends FeedsProcessor {
// could be invalid.
if (!$author) {
$message = 'User %uid is not a valid user.';
- throw new FeedsAccessException(t($message,
- array('%uid' => $entity->uid))
- );
+ throw new FeedsAccessException(t($message, array('%uid' => $entity->uid)));
}
if (empty($entity->nid) || !empty($entity->is_new)) {
@@ -131,7 +129,7 @@ class FeedsNodeProcessor extends FeedsProcessor {
parent::entityValidate($entity);
if (!isset($entity->uid) || !is_numeric($entity->uid)) {
- $entity->uid = $this->config['author'];
+ $entity->uid = $this->config['author'];
}
}
@@ -188,7 +186,7 @@ class FeedsNodeProcessor extends FeedsProcessor {
'#title' => t('Author'),
'#description' => t('Select the author of the nodes to be created - leave empty to assign "anonymous".'),
'#autocomplete_path' => 'user/autocomplete',
- '#default_value' => empty($author->name) ? 'anonymous' : check_plain($author->name),
+ '#default_value' => empty($author->name) ? 'anonymous' : check_plain($author->name),
);
$form['authorize'] = array(
'#type' => 'checkbox',
@@ -196,10 +194,7 @@ class FeedsNodeProcessor extends FeedsProcessor {
'#description' => t('Check that the author has permission to create the node.'),
'#default_value' => $this->config['authorize'],
);
- $period = drupal_map_assoc(array(
- FEEDS_EXPIRE_NEVER, 3600, 10800, 21600, 43200, 86400, 259200, 604800,
- 2592000, 2592000 * 3, 2592000 * 6, 31536000,
- ), 'feeds_format_expire');
+ $period = drupal_map_assoc(array(FEEDS_EXPIRE_NEVER, 3600, 10800, 21600, 43200, 86400, 259200, 604800, 2592000, 2592000 * 3, 2592000 * 6, 31536000), 'feeds_format_expire');
$form['expire'] = array(
'#type' => 'select',
'#title' => t('Expire nodes'),
@@ -382,14 +377,11 @@ class FeedsNodeProcessor extends FeedsProcessor {
foreach ($this->uniqueTargets($source, $result) as $target => $value) {
switch ($target) {
case 'nid':
- $nid = db_query("SELECT nid FROM {node} WHERE nid = :nid",
- array(':nid' => $value))->fetchField();
+ $nid = db_query("SELECT nid FROM {node} WHERE nid = :nid", array(':nid' => $value))->fetchField();
break;
case 'title':
- $nid = db_query("SELECT nid FROM {node} WHERE title = :title AND type = :type",
- array(':title' => $value, ':type' => $this->bundle()))
- ->fetchField();
+ $nid = db_query("SELECT nid FROM {node} WHERE title = :title AND type = :type", array(':title' => $value, ':type' => $this->bundle()))->fetchField();
break;
}
if (isset($this->config['content_type']) &&
diff --git a/tests/feeds_processor_node.test b/tests/feeds_processor_node.test
index 171a960..196d41d 100644
--- a/tests/feeds_processor_node.test
+++ b/tests/feeds_processor_node.test
@@ -24,8 +24,7 @@ class FeedsRSStoNodesTest extends FeedsWebTestCase {
public function setUp() {
parent::setUp();
- // Set the front page to show 20 nodes so we can easily see what
- // is aggregated.
+ // Set the front page to show 20 nodes so we can easily see what is aggregated.
variable_set('default_nodes_main', 20);
// Set the teaser length display to unlimited otherwise tests looking for