/[drupal]/contributions/modules/image_pub/image_pub.module
ViewVC logotype

Diff of /contributions/modules/image_pub/image_pub.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.11.2.9, Sun Nov 16 00:05:37 2008 UTC revision 1.11.2.10, Fri Jan 2 00:58:49 2009 UTC
# Line 1  Line 1 
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
# Line 239  function _image_pub_image_add($album, $c Line 239  function _image_pub_image_add($album, $c
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();
# Line 248  function _image_pub_image_add($album, $c Line 249  function _image_pub_image_add($album, $c
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  }  }

Legend:
Removed from v.1.11.2.9  
changed lines
  Added in v.1.11.2.10

  ViewVC Help
Powered by ViewVC 1.1.2