Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F971564
DifferentialChangesetOneUpRenderer.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
DifferentialChangesetOneUpRenderer.php
View Options
<?php
final
class
DifferentialChangesetOneUpRenderer
extends
DifferentialChangesetHTMLRenderer
{
public
function
isOneUpRenderer
()
{
return
true
;
}
public
function
renderTextChange
(
$range_start
,
$range_len
,
$rows
)
{
$primitives
=
$this
->
buildPrimitives
(
$range_start
,
$range_len
);
$out
=
array
();
foreach
(
$primitives
as
$p
)
{
$type
=
$p
[
'type'
];
switch
(
$type
)
{
case
'old'
:
case
'new'
:
$out
[]
=
hsprintf
(
'<tr>'
);
if
(
$type
==
'old'
)
{
if
(
$p
[
'htype'
])
{
$class
=
'left old'
;
}
else
{
$class
=
'left'
;
}
$out
[]
=
phutil_tag
(
'th'
,
array
(),
$p
[
'line'
]);
$out
[]
=
phutil_tag
(
'th'
,
array
());
$out
[]
=
phutil_tag
(
'td'
,
array
(
'class'
=>
$class
),
$p
[
'render'
]);
}
else
if
(
$type
==
'new'
)
{
if
(
$p
[
'htype'
])
{
$class
=
'right new'
;
$out
[]
=
phutil_tag
(
'th'
,
array
());
}
else
{
$class
=
'right'
;
$out
[]
=
phutil_tag
(
'th'
,
array
(),
$p
[
'oline'
]);
}
$out
[]
=
phutil_tag
(
'th'
,
array
(),
$p
[
'line'
]);
$out
[]
=
phutil_tag
(
'td'
,
array
(
'class'
=>
$class
),
$p
[
'render'
]);
}
$out
[]
=
hsprintf
(
'</tr>'
);
break
;
case
'inline'
:
$out
[]
=
hsprintf
(
'<tr><th /><th />'
);
$out
[]
=
hsprintf
(
'<td>'
);
$inline
=
$this
->
buildInlineComment
(
$p
[
'comment'
],
$p
[
'right'
]);
$inline
->
setBuildScaffolding
(
false
);
$out
[]
=
$inline
->
render
();
$out
[]
=
hsprintf
(
'</td></tr>'
);
break
;
default
:
$out
[]
=
hsprintf
(
'<tr><th /><th /><td>%s</td></tr>'
,
$type
);
break
;
}
}
if
(
$out
)
{
return
$this
->
wrapChangeInTable
(
phutil_implode_html
(
''
,
$out
));
}
return
null
;
}
public
function
renderFileChange
(
$old_file
=
null
,
$new_file
=
null
,
$id
=
0
,
$vs
=
0
)
{
throw
new
Exception
(
"Not implemented!"
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, Jun 18, 5:51 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
213008
Default Alt Text
DifferentialChangesetOneUpRenderer.php (2 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment