Fix current_queue() list when there are no entries.
[adorno.git] / inc / LinkClass.php
blob964baa59bcb161509044a878a39568529c54a5a7
1 <?php
2 class ALink {
3 var $target;
4 var $content;
5 var $help;
6 var $template;
8 function ALink( $target, $content, $help="", $template="" ) {
9 $this->target = $target;
10 $this->content = $content;
11 $this->help = $help;
12 $this->template = $template;
13 return $this;
16 function Render( $class="" ) {
17 $title = ( $this->help == "" ? "" : " title=\"$this->help\"");
18 $class = ( $class == "" ? "" : " class=\"$class\"");
19 if ( $this->template == "" )
20 $this->template = '<a href="%s"%s%s>%s</a>';
21 return sprintf( $this->template, $this->target, $class, $title, $this->content );
26 class LinkSet {
27 var $template;
28 var $class;
30 function LinkSet( $template, $class ) {
31 $this->template = $template;
32 $this->class = $class;
35 function Link( $target, $content, $help = "" ) {
36 $l = new ALink( $target, $content, $help, $this->template );
37 return $l->Render($this->class);