9 namespace Fossology\Lib\View;
20 const DEFAULT_PADDING = 0;
22 public $classMapping = array(
'' =>
'',
23 Highlight::UNDEFINED=>
'hi-undefined',
25 Highlight::MATCH =>
'hi-match',
26 Highlight::CHANGED =>
'hi-changed',
27 Highlight::ADDED =>
'hi-added',
28 Highlight::DELETED =>
'hi-deleted',
29 Highlight::SIGNATURE =>
'hi-signature',
30 Highlight::KEYWORD =>
'hi-keyword',
31 Highlight::BULK =>
'hi-bulk',
32 Highlight::COPYRIGHT =>
'hi-cp',
33 Highlight::EMAIL =>
'hi-email',
34 Highlight::URL =>
'hi-url',
35 Highlight::AUTHOR =>
'hi-author',
36 Highlight::BULK =>
'hi-bulk',
37 Highlight::IPRA =>
'hi-ipra',
38 Highlight::ECC =>
'hi-mediumorchid',
39 Highlight::KEYWORDOTHERS =>
'hi-teal'
50 $type = $highlight ? $highlight->getType() : Highlight::UNDEFINED;
52 $wrappendElement =
"";
55 $htmlElement = $highlight->getHtmlElement();
57 $wrappendElement = $htmlElement->getOpeningText();
72 $wrappendElement =
"";
75 $htmlElement = $highlight->getHtmlElement();
77 $wrappendElement = $htmlElement->getClosingText();
81 return $wrappendElement .
'</span>';
93 if ($depth < self::DEFAULT_PADDING) {
94 $padd = (2 * (self::DEFAULT_PADDING - $depth - 2)) .
'px';
109 return str_replace(
'background',
"padding-top:$padding;padding-bottom:$padding;background", $style);
119 if ($type ==
'K ' || $type ==
'K') {
120 return "<span class=\"hi-keyword\">";
122 if (! array_key_exists($type, $this->classMapping)) {
123 $type = Highlight::UNDEFINED;
125 $class = $this->classMapping[$type];
126 return "<span class=\"$class\" title=\"$title\">";
137 $colorDefinition = $containsDiff
139 '' => _(
'license text:'),
140 Highlight::MATCH => _(
' - identical'),
141 Highlight::CHANGED => _(
' - modified'),
142 Highlight::ADDED => _(
' - added'),
143 Highlight::DELETED => _(
' - removed'),
144 Highlight::SIGNATURE => _(
'license relevant text'),
145 Highlight::KEYWORD => _(
'keyword'),
146 Highlight::BULK => _(
'bulk'))
148 Highlight::UNDEFINED => _(
"license relevant text"));
149 foreach ($colorDefinition as $colorKey => $txt) {
150 $data[] = array(
'class'=>$this->classMapping[$colorKey],
'text' => $txt);
createSpanStart(SplitPosition &$entry)
getLegendData($containsDiff)
createStyleWithPadding($type, $title, $depth=0)
createStartSpan($type, $title)
createSpanEnd(SplitPosition $entry)
getStyleWithPadding($padding, $style)