I’m way ahead of ya, xWisdom! Think I have it licked! Here’s what I did:
Like you said, I disabled the image type on line 29 by commenting out the lines.
Could probably just delete the whole thing once it’s integrated into the code in another release:
// setup image type
/* Disabled since all we care about is the value now.
if($tvtype=='image') {
$value = parseInput($value);
$value = "<img src='$value' />";
}
*/
Next, I went down to about line 125 and inserted the following before case "richtext":
case "image":
$value = parseInput($value,"||","array");
for($i = 0;$i<count($value); $i++){
list($name,$image) = is_array($value[$i]) ? $value[$i]: explode("==",$value[$i]);
if(!$image) $image = $name;
if($o) $o.='<br />';
$o.= "<img src='$name'"." alt='".mysql_escape_string($params["alttext"])."'".($params["name"] ? " name='".$params["name"]."'":"").($params["hspace"] ? " hspace='".$params["hspace"]."'":"").($params["vspace"] ? " vspace='".$params["vspace"]."'":"").($params["borsize"] ? " border='".$params["borsize"]."'":"").(($params["align"] != "none") && ($params["align"] != "undefined") && ($params["align"] != "") ? " align='".$params["align"]."'":"").($params["class"] ? " class='".$params["class"]."'":"").($params["style"] ? " style='".$params["style"]."'":"").($params["id"] ? " id='".$params["id"]."'":"").($params["attrib"] ? $params["attrib"]:"")."/>";
}
break;
Now we move on to mutate_tmplvars.dynamic.action.php. Around line 100, just below the displayParams[’hyperlink’] line, I inserted the following:
displayParams['image'] = '&alttext=Alternate Text;string &hspace=H Space;int &vspace=V Space;int &borsize=Border Size;int &align=Align;list;none,baseline,top,middle,bottom,texttop,absmiddle,absbottom,left,right &name=Name;string &class=Class;string &id=ID;string &style=Style;string &attrib=Attributes;string';
And around line 305, just below the option value="checkbox" line, I inserted this:
<option value="image" <?php echo ($content['type']=='image')? "selected='selected'":""; ?>>Image</option>
That should take care of it all! Options available for an Image Display Type are as follows:
Alternate Text
H Space
V Space
Border Size
Align
Name
Class
ID
Style
Attributes
All but Attributes are standard IMG tag inputs. Attributes, of course, is a good way to add some sort of JavaScript or the like to the IMG tag in the TV. Alternate Text will allow for other TV variables...err...none of the other fields will though, I don’t think. But that doesn’t really matter since you’ll likely won’t use the other ones for TV variables anyways.
Hope this helps! Works good for my purposes!
L8R!
Jeff