Mercurial > hg > drupalISMI
comparison relation_processor/FeedsRelationProcessor.inc @ 5:1c73c660c2f2
new relation_processor
author | Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de> |
---|---|
date | Wed, 17 Jun 2015 18:55:14 +0200 |
parents | 124ef8f3b22d |
children |
comparison
equal
deleted
inserted
replaced
0:124ef8f3b22d | 5:1c73c660c2f2 |
---|---|
135 } | 135 } |
136 /** | 136 /** |
137 * Save a node. | 137 * Save a node. |
138 */ | 138 */ |
139 public function entitySave($entity) { | 139 public function entitySave($entity) { |
140 | |
140 relation_save($entity); | 141 relation_save($entity); |
141 } | 142 } |
142 | 143 |
143 /** | 144 /** |
144 * Delete a series of nodes. | 145 * Delete a series of nodes. |
195 */ | 196 */ |
196 public function configForm(&$form_state) { | 197 public function configForm(&$form_state) { |
197 $form = parent::configForm($form_state); | 198 $form = parent::configForm($form_state); |
198 | 199 |
199 $author = user_load($this->config['author']); | 200 $author = user_load($this->config['author']); |
201 | |
202 | |
203 $options =$this->bundleOptions(); | |
204 $form['bundle'] = array( | |
205 '#type' => 'select', | |
206 '#options' => $options, | |
207 '#title' => !empty($info['bundle name']) ? $info['bundle name'] : t('Bundle'), | |
208 '#required' => false, | |
209 '#description' => t('if set to generic, relation_name has to be one of the mappings'), | |
210 '#default_value' => "generic", | |
211 ); | |
212 | |
213 | |
214 | |
215 | |
216 | |
200 $form['author'] = array( | 217 $form['author'] = array( |
201 '#type' => 'textfield', | 218 '#type' => 'textfield', |
202 '#title' => t('Author'), | 219 '#title' => t('Author'), |
203 '#description' => t('Select the author of the nodes to be created - leave empty to assign "anonymous".'), | 220 '#description' => t('Select the author of the nodes to be created - leave empty to assign "anonymous".'), |
204 '#autocomplete_path' => 'user/autocomplete', | 221 '#autocomplete_path' => 'user/autocomplete', |
357 // load nodes mapper | 374 // load nodes mapper |
358 require_once("nodes.inc"); | 375 require_once("nodes.inc"); |
359 //$entity_type = $this->entityType(); | 376 //$entity_type = $this->entityType(); |
360 $entity_type = "relation"; | 377 $entity_type = "relation"; |
361 $bundle = $this->bundle(); | 378 $bundle = $this->bundle(); |
362 drupal_alter('feeds_processor_targets', $targets, $entity_type, $bundle); | 379 |
363 | 380 #drupal_alter('feeds_processor_targets', $targets, $entity_type, $bundle); |
381 relation_feeds_processor_targets_alter($targets, $entity_type, $bundle); | |
364 return $targets; | 382 return $targets; |
365 } | 383 } |
366 | 384 |
367 /** | 385 /** |
368 * Get nid of an existing feed item node if available. | 386 * Get nid of an existing feed item node if available. |