| 1 |
<?php |
<?php |
| 2 |
// $Id: image_pub.module,v 1.11.2.8 2008/11/14 23:03:10 egfrith Exp $ |
// $Id: image_pub.module,v 1.11.2.9 2008/11/16 00:05:37 egfrith Exp $ |
| 3 |
|
|
| 4 |
/* |
/* |
| 5 |
* Image publishing support module |
* Image publishing support module |
| 239 |
$values['uid'] = $user->uid; |
$values['uid'] = $user->uid; |
| 240 |
$values['name'] = $user->name; |
$values['name'] = $user->name; |
| 241 |
$values['body_filter']['body'] = $description; |
$values['body_filter']['body'] = $description; |
| 242 |
$redirect_url = drupal_execute('node_form', $values, $node, NULL); |
$values['taxonomy'][_image_pub_get_vid()] = array($album->tid); |
| 243 |
|
$redirect_url = drupal_execute('image_node_form', $values, $node); |
| 244 |
|
|
| 245 |
// Check that the uploaded image was accepted. |
// Check that the uploaded image was accepted. |
| 246 |
$errors = form_get_errors(); |
$errors = form_get_errors(); |
| 249 |
'reason' => implode($errors, '. ')); |
'reason' => implode($errors, '. ')); |
| 250 |
} |
} |
| 251 |
|
|
|
// If it was accepted, tag it with the the album |
|
|
$arguments = explode('/', $redirect_url); |
|
|
$nid = $arguments[1]; |
|
|
taxonomy_node_save($nid, array($album->tid)); |
|
|
|
|
| 252 |
watchdog('image_pub', t('%image was added.', array('%image' => $_FILES[$srcfield]['name']))); |
watchdog('image_pub', t('%image was added.', array('%image' => $_FILES[$srcfield]['name']))); |
| 253 |
return array('success' => TRUE, 'redirect_url' => $redirect_url); |
return array('success' => TRUE, 'redirect_url' => $redirect_url); |
| 254 |
} |
} |