ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
class.ilRSSButtonGUI.php
Go to the documentation of this file.
1<?php
2
23{
24 public const ICON_RSS = "rss";
25 public const ICON_RSS_AUDIO = "rss audio";
26 public const ICON_RSS_VIDEO = "rss video";
27 public const ICON_ICAL = "ical";
28 public const ICON_ITUNES = "itunes";
29 public const ICON_ITUNES_AUDIO = "itunes audio";
30 public const ICON_ITUNES_VIDEO = "itunes video";
31
39 public static function get(
40 string $a_type,
41 string $a_href = ""
42 ): string {
43 $tpl = new ilTemplate("tpl.rss_icon.html", true, true, "components/ILIAS/News");
44
45 if ($a_href !== "") {
46 $tpl->setCurrentBlock("a_start");
47 $tpl->setVariable("HREF", $a_href);
49 $tpl->touchBlock("a_end");
50 }
51
52 $text = "";
53
54 switch ($a_type) {
55 case self::ICON_RSS:
56 $text = "RSS";
57 break;
58
60 $text = "RSS Audio";
61 break;
62
64 $text = "RSS Video";
65 break;
66
67 case self::ICON_ICAL:
68 $text = "iCal";
69 break;
70
72 $text = "iTunes";
73 break;
74
76 $text = "iTunes Audio";
77 break;
78
80 $text = "iTunes Video";
81 break;
82 }
83
84 $tpl->setVariable("TEXT", $text);
85
86 return $tpl->get();
87 }
88}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
special template class to simplify handling of ITX/PEAR
setVariable(string $variable, $value='')
Sets the given variable to the given value.
touchBlock(string $block)
overwrites ITX::touchBlock.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
readonly ilGlobalTemplateInterface $tpl
$text
Definition: xapiexit.php:21