You are here

function _vkxp_get_node_images in VK CrossPoster 6

Same name and namespace in other branches
  1. 6.3 vkxp.module \_vkxp_get_node_images()
  2. 6.2 vkxp.module \_vkxp_get_node_images()
  3. 7.2 vkxp.module \_vkxp_get_node_images()
  4. 7 vkxp.module \_vkxp_get_node_images()

Get images realpath from selected imagefield

Parameters

$node: node object:

Return value

array: array with images for uploading

1 call to _vkxp_get_node_images()
vkxp_nodeapi in ./vkxp.module
Implementation of hook_nodeapi

File

./vkxp.module, line 184

Code

function _vkxp_get_node_images($node) {
  $images = array();
  $image_amount = variable_get($node->type . '_image_amount', 0);
  if ($image_amount) {
    $field = variable_get($node->type . '_image_field', '');
    if ($field && isset($node->{$field})) {
      $i = 0;
      foreach ($node->{$field} as $image) {
        if ($image['filepath']) {
          if ($i++ == $image_amount) {
            break;
          }
          $images[] = '@' . realpath($image['filepath']);
        }
      }
    }
  }
  return $images;
}