We're now going to take a look at WacsUI module's
most important function,
iconlink. It's job is simply
to display and icon with an appropriate link around it. Sounds simple
enough, doesn't it? Unfortunately it isn't - there's a lot of work that
needs to be done relating to permissions, access methods, checking caches
and resizing which actually makes it fairly complex. The good news is
iconlink function will do it all for you!
iconlink function takes quite a few arguments
which control how it works, but they are reasonably straightforward.
In most cases parameters are optional and sensible defaults will be
used instead if they are not given - obviously things like set number
and the location fields (
sarea, scategory and
sdirectory) are necessary.
Example 6.5. Using the
print $wacsui->iconlink( array( 'type'=>$setdetails, 'setno'=>$setdetails, 'sarea'=>$setdetails, 'scategory'=>$setdetails, 'sdirectory'=>$setdetails, 'model'=>$moddetails, 'resize'=> 0 ))."\n";
The perl dialect is again very much the same:
print iconlink( type=>$setdetails, setno=>$setdetails, sarea=>$setdetails, scategory=>$setdetails, sdirectory=>$setdetails, model=>moddetails. resize=> 0 ))."\n";