'left+10', 'ypos' => 'bottom-10', 'textstyle' => array( 'fontfile' => drupal_get_path('module', 'imageapi_text') . '/fonts/liberation-fonts-1.04/LiberationSans-Regular.ttf', 'style' => "font-size:12px;\nfill:#333333;\ntop:10px;\nright:10px;", ), 'text' => 'Hello World!', 'evaluate_text' => FALSE, ); // Our 'textstyle' parameter is a nested array - reflecting the wiget fieldset structure // only because imagecache sets the form // #tree to true, and unsetting it doesn't work. $action = array_merge($defaults, (array)$action); $form = array( 'textstyle' => imageapi_text_style_widget($action['textstyle']), 'text' => array( '#type' => 'textarea', '#rows' => 7, '#title' => t('Text'), '#default_value' => $action['text'], '#description' => t('The text string. If you are using a WYSIWYG editor, you should disable it for this field!'), '#wysiwyg' => FALSE, ), 'evaluate_text' => array( '#type' => 'checkbox', '#title' => t('Evaluate text as PHP code'), '#default_value' => $action['evaluate_text'], '#description' => t('If selected, the text will be treated as PHP code.
Enter PHP code that will return your dynamic text. Do not use %php tags.
EG return format_date(time());
return $file_data->description ? $file_data->description : $node->title;
Note that executing incorrect PHP-code can break your Drupal site.
If it\'s an image.module image then a $node object with its values
may be available.
return $node->title;
return format_date($node->created);
If it\'s an image that has been attached to a node using CCK-filefield-imagefield
(or just filefield)
then as well as the parent $node object,
a $file_data object that may contain a file description from that file field.
return $file_data->description;
So far that seems to be the only available \'data\' provided by filefield,
but you can investigate the node structure using devel.module or print_r()
to see what else this array actually contains.
If it\'s a file that\'s just been attached using upload.module,
a $file_data object may also have a description.
return $file_data->description;
If the image path is detected as belonging to more than one node, just the data for the first one found is returned.
An "$image" object is also available, but that usually contains only technical data, including
return $image->source;
return basename($image->source);
return $image->info["filesize"];