additional return value

haggins - March 22, 2009 - 07:43
Project:Mobile Codes
Version:6.x-1.x-dev
Component:Miscellaneous
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

it would be a nice to have if mobile_codes_generate() could also return the blank path of the mobile code. maybe something like this:

<?php
if($arguments['echo']) {
  return
theme('image', $file, $arguments['name'], $arguments['name'], NULL, FALSE);
}else {
  return
$file;
}
?>

#1

haggins - March 22, 2009 - 09:11

I wonder if there's a method to get the http status code of the nokia.com request. I think file_save_data() will create a file even when $image->data contains no image data. If so then this http code should be returned, too.

Thinking about all of it the return value should be an array:

<?php
return array(
 
'image' => theme('image', $file, $arguments['name'], $arguments['name'], NULL, FALSE),
 
'file' => $file,
 
'status' => $image->code,
);
?>

#2

Deciphered - March 22, 2009 - 22:09

Agree on both suggestions.

I will try to make some time in the next few days to look further into these.
Patches are always welcome.

#3

Deciphered - March 23, 2009 - 01:48
Status:active» patch (to be ported)

Here's a patch that adds the ability to output simply the filename. Will be committed to DRUPAL-6--1 once I have backported it for DRUPAL-5.

You have two options for outputting the file, an API call to mobile_codes_generate() (not overly recommended as it could change and break things) or via the newly supplied CCK/Views formatter.

As for the other issue, to simplify things for me, I will re-post that into a separate issue. (#410564: HTTP Status code)

AttachmentSize
mobile_codes-DRUPAL-6--1-409958-additional_output_type.patch 5.1 KB

#4

Deciphered - March 23, 2009 - 02:15
Status:patch (to be ported)» fixed

Committed to DRUPAL-6--1 and DRUPAL-5.

#5

haggins - March 24, 2009 - 09:08

works pretty well. thanks for the quick patch!

#6

System Message - April 7, 2009 - 09:10
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.