ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
HtmlOutputHelper.php
Go to the documentation of this file.
1<?php
2
3namespace Sabre\DAV\Browser;
4
5use Sabre\Uri;
6use Sabre\Xml\Service as XmlService;
7
17
23 protected $baseUri;
24
30 protected $namespaceMap;
31
46
47 $this->baseUri = $baseUri;
48 $this->namespaceMap = $namespaceMap;
49
50 }
51
63 function fullUrl($path) {
64
65 return Uri\resolve($this->baseUri, $path);
66
67 }
68
75 function h($input) {
76
77 return htmlspecialchars($input, ENT_COMPAT, 'UTF-8');
78
79 }
80
91 function link($url, $label = null) {
92
93 $url = $this->h($this->fullUrl($url));
94 return '<a href="' . $url . '">' . ($label ? $this->h($label) : $url) . '</a>';
95
96 }
97
105 function xmlName($element) {
106
107 list($ns, $localName) = XmlService::parseClarkNotation($element);
108 if (isset($this->namespaceMap[$ns])) {
109 $propName = $this->namespaceMap[$ns] . ':' . $localName;
110 } else {
111 $propName = $element;
112 }
113 return "<span title=\"" . $this->h($element) . "\">" . $this->h($propName) . "</span>";
114
115 }
116
117}
$path
Definition: aliased.php:25
An exception for terminatinating execution or to throw for unit testing.
This class provides a few utility functions for easily generating HTML for the browser plugin.
fullUrl($path)
Generates a 'full' url based on a relative one.
h($input)
Escape string for HTML output.
__construct($baseUri, array $namespaceMap)
Creates the object.
link($url, $label=null)
Generates a full -tag.
xmlName($element)
This method takes an xml element in clark-notation, and turns it into a shortened version with a pref...
XML parsing and writing service.
Definition: Service.php:16
resolve($basePath, $newPath)
This file contains all the uri handling functions.
Definition: functions.php:23
$url