* @copyright 2001-2007 VIKO team and contributors * @license http://www.gnu.org/licenses/gpl.html GPL 2.0 */ /** * This is a child class of Material */ require_once 'Material.php'; /** * Link class * */ class Link extends Material { /** * Extends the general constructor by setting material type to 'LINK' */ function Link( $id ) { $this->_type = "LINK"; $this->_mime_type = ""; $this->_size = 0; parent::Material( $id ); } /** * Returns HTML link, that points to the location the link references * * @return string HTML a element */ function getLink() { return HTML::element( "a", $this->getHTMLName(), array( "href" => $this->getHTMLURI(), "class" => "uri" ) ); } /** * Returns the path of the file or URI of the link * * @return string URI */ function getURI() { return $this->getAttribute("_uri"); } /** * Sets the path of the file or URI of the link * * @param string $uri URI */ function setURI( $uri ) { $this->_uri = $uri; } /** * Returns URI that is HTML-formatted * * @return string URI that is ready for inserting into HTML */ function getHTMLURI() { return htmlspecialchars( $this->getURI(), ENT_QUOTES ); } /** * Returns translated string describing the type of material * * @return string */ function getTypeName() { return _("Link"); } } ?>