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

Convert node_get_types().

parent 0164b5c4
No related branches found
No related tags found
No related merge requests found
...@@ -25,7 +25,7 @@ function feeds_page() { ...@@ -25,7 +25,7 @@ function feeds_page() {
} }
elseif (user_access('create '. $importer->config['content_type'] .' content')) { elseif (user_access('create '. $importer->config['content_type'] .' content')) {
$link = 'node/add/'. str_replace('_', '-', $importer->config['content_type']); $link = 'node/add/'. str_replace('_', '-', $importer->config['content_type']);
$title = node_types_get('name', $importer->config['content_type']); $title = node_type_get_name($importer->config['content_type']);
} }
$rows[] = array( $rows[] = array(
l($title, $link), l($title, $link),
......
...@@ -236,11 +236,13 @@ class FeedsImporter extends FeedsConfigurable { ...@@ -236,11 +236,13 @@ class FeedsImporter extends FeedsConfigurable {
'#description' => t('A description of this configuration.'), '#description' => t('A description of this configuration.'),
'#default_value' => $this->config['description'], '#default_value' => $this->config['description'],
); );
$node_types = node_type_get_names();
array_walk($node_types, 'check_plain');
$form['content_type'] = array( $form['content_type'] = array(
'#type' => 'select', '#type' => 'select',
'#title' => t('Attach to content type'), '#title' => t('Attach to content type'),
'#description' => t('If an importer is attached to a content type, content is imported by creating a node. If the standalone form is selected, content is imported by using the standalone form under http://example.com/import.'), '#description' => t('If an importer is attached to a content type, content is imported by creating a node. If the standalone form is selected, content is imported by using the standalone form under http://example.com/import.'),
'#options' => array('' => t('Use standalone form')) + node_get_types('names'), '#options' => array('' => t('Use standalone form')) + $node_types,
'#default_value' => $this->config['content_type'], '#default_value' => $this->config['content_type'],
); );
$period = drupal_map_assoc(array(0, 900, 1800, 3600, 10800, 21600, 43200, 86400, 259200, 604800, 2419200), 'format_interval'); $period = drupal_map_assoc(array(0, 900, 1800, 3600, 10800, 21600, 43200, 86400, 259200, 604800, 2419200), 'format_interval');
......
...@@ -141,7 +141,7 @@ class FeedsNodeProcessor extends FeedsProcessor { ...@@ -141,7 +141,7 @@ class FeedsNodeProcessor extends FeedsProcessor {
* Override parent::configDefaults(). * Override parent::configDefaults().
*/ */
public function configDefaults() { public function configDefaults() {
$types = node_get_types('names'); $types = node_type_get_names();
$type = isset($types['story']) ? 'story' : key($types); $type = isset($types['story']) ? 'story' : key($types);
return array( return array(
'content_type' => $type, 'content_type' => $type,
...@@ -157,7 +157,8 @@ class FeedsNodeProcessor extends FeedsProcessor { ...@@ -157,7 +157,8 @@ class FeedsNodeProcessor extends FeedsProcessor {
* Override parent::configForm(). * Override parent::configForm().
*/ */
public function configForm(&$form_state) { public function configForm(&$form_state) {
$types = node_get_types('names'); $types = node_type_get_names();
array_walk($types, 'check_plain');
$form = array(); $form = array();
$form['content_type'] = array( $form['content_type'] = array(
'#type' => 'select', '#type' => 'select',
...@@ -257,7 +258,7 @@ class FeedsNodeProcessor extends FeedsProcessor { ...@@ -257,7 +258,7 @@ class FeedsNodeProcessor extends FeedsProcessor {
), ),
); );
// Include body field only if available. // Include body field only if available.
$type = node_get_types('type', $this->config['content_type']); $type = node_type_get_type($this->config['content_type']);
if ($type->has_body) { if ($type->has_body) {
// Using 'teaser' instead of 'body' forces entire content above the break. // Using 'teaser' instead of 'body' forces entire content above the break.
$targets['body'] = array( $targets['body'] = array(
......
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