<?php
/**
* Get a specific item
*
* @package tovhelper
* @copyright (C) 2007 Velocitech Inc
* @author fcd
*/
/**
* Get a specific item
*
* Standard function of a module to retrieve a specific item
*
* @src the image name source
* @width the image width (or height if portrait)
* @height the image height (or width if portrait)
* @crop whether or not to crop the image instead of resizing to the largest portion
* @wm the watermarks logo
* @wmpos the postition of the watermark ('TR','TL','BR','BL')
* @wmtrans the transparency of the watmark
* @logo the logo (across the bottom of the screen)
* @t1 the first text on the image
* @t1x the xpos of the text
* @t1y the ypos of the text
* @t1font the font of the text
* @t1size the size of the font
* @t1color the color of the font
* @t2 the second text of the image
* @t2x the xpos of the text
* @t2y the ypos of the text
* @t2font the font of the text
* @t2size the size of the font
* @t2color the color of the font
* @qlty the quality of the image
* @return url string
* @throws BAD_PARAM, DATABASE_ERROR, NO_PERMISSION
*/
function tovhelper_userapi_handle_tovimage_tag($args)
{
extract($args);
print_r($args);
if (!isset($src)) {
$msg = xarML("Required attribute src for tag <xar:tovimage /> missing.");
xarErrorSet(XAR_USER_EXCEPTION, xarML('Missing Attributes'), new DefaultUserException($msg));
return '';
}
foreach ($args as $key => $value) {
if (!strcmp($key,'src')) {
$items[]= "'$key'=> \"$value\"";
}
}
$params=implode(',', $items);
$imgTag='$url=xarModAPIFunc(\'tovhelper\',\'user\',\'processimage\',array('.$params.'));' .
'echo("<img src=\"$url\" alt=\"\" />");';
return $imgTag;
}