31 const DEFAULT_PADDING = 0;
33 public $classMapping = array(
'' =>
'',
34 Highlight::UNDEFINED=>
'hi-undefined',
36 Highlight::MATCH =>
'hi-match',
37 Highlight::CHANGED =>
'hi-changed',
38 Highlight::ADDED =>
'hi-added',
39 Highlight::DELETED =>
'hi-deleted',
40 Highlight::SIGNATURE =>
'hi-signature',
41 Highlight::KEYWORD =>
'hi-keyword',
42 Highlight::BULK =>
'hi-bulk',
43 Highlight::COPYRIGHT =>
'hi-cp',
44 Highlight::EMAIL =>
'hi-email',
45 Highlight::URL =>
'hi-url',
46 Highlight::AUTHOR =>
'hi-author',
47 Highlight::BULK =>
'hi-bulk',
48 Highlight::IP =>
'hi-ip',
49 Highlight::ECC =>
'hi-mediumorchid' 60 $type = $highlight ? $highlight->getType() : Highlight::UNDEFINED;
62 $wrappendElement =
"";
65 $htmlElement = $highlight->getHtmlElement();
67 $wrappendElement = $htmlElement->getOpeningText();
82 $wrappendElement =
"";
85 $htmlElement = $highlight->getHtmlElement();
87 $wrappendElement = $htmlElement->getClosingText();
91 return $wrappendElement .
'</span>';
103 if ($depth < self::DEFAULT_PADDING) {
104 $padd = (2 * (self::DEFAULT_PADDING - $depth - 2)) .
'px';
119 return str_replace(
'background',
"padding-top:$padding;padding-bottom:$padding;background", $style);
129 if ($type ==
'K ' || $type ==
'K') {
130 return "<span class=\"hi-keyword\">";
132 if (! array_key_exists($type, $this->classMapping)) {
133 $type = Highlight::UNDEFINED;
135 $class = $this->classMapping[$type];
136 return "<span class=\"$class\" title=\"$title\">";
147 $colorDefinition = $containsDiff
149 '' => _(
'license text:'),
150 Highlight::MATCH => _(
' - identical'),
151 Highlight::CHANGED => _(
' - modified'),
152 Highlight::ADDED => _(
' - added'),
153 Highlight::DELETED => _(
' - removed'),
154 Highlight::SIGNATURE => _(
'license relevant text'),
155 Highlight::KEYWORD => _(
'keyword'),
156 Highlight::BULK => _(
'bulk'))
158 Highlight::UNDEFINED => _(
"license relevant text"));
159 foreach ($colorDefinition as $colorKey => $txt) {
160 $data[] = array(
'class'=>$this->classMapping[$colorKey],
'text' => $txt);
createStartSpan($type, $title)
createSpanEnd(SplitPosition $entry)
createStyleWithPadding($type, $title, $depth=0)
createSpanStart(SplitPosition &$entry)
getLegendData($containsDiff)
getStyleWithPadding($padding, $style)