Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2894109
PHUIDiffInlineCommentRowScaffold.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
PHUIDiffInlineCommentRowScaffold.php
View Options
<?php
/**
* Wraps an inline comment in a table row.
*
* Inline comments need different wrapping cells when shown in unified vs
* side-by-side diffs, as the two tables have different layouts. This wraps
* an inline comment element in an appropriate table row.
*/
abstract
class
PHUIDiffInlineCommentRowScaffold
extends
AphrontView
{
private
$views
=
array
(
)
;
private
$isUndoTemplate
;
final
public
function
setIsUndoTemplate
(
$is_undo_template
)
{
$this
->
isUndoTemplate
=
$is_undo_template
;
return
$this
;
}
final
public
function
getIsUndoTemplate
(
)
{
return
$this
->
isUndoTemplate
;
}
public
function
getInlineViews
(
)
{
return
$this
->
views
;
}
public
function
addInlineView
(
PHUIDiffInlineCommentView
$view
)
{
$this
->
views
[
]
=
$view
;
return
$this
;
}
protected
function
getRowAttributes
(
)
{
$is_undo_template
=
$this
->
getIsUndoTemplate
(
)
;
$is_hidden
=
false
;
if
(
$is_undo_template
)
{
// NOTE: When this scaffold is turned into an "undo" template, it is
// important it not have any metadata: the metadata reference will be
// copied to each instance of the row. This is a complicated mess; for
// now, just sneak by without generating metadata when rendering undo
// templates.
$metadata
=
null
;
}
else
{
foreach
(
$this
->
getInlineViews
(
)
as
$view
)
{
if
(
$view
->
isHidden
(
)
)
{
$is_hidden
=
true
;
}
}
$metadata
=
array
(
'hidden'
=>
$is_hidden
,
)
;
}
$classes
=
array
(
)
;
$classes
[
]
=
'inline'
;
if
(
$is_hidden
)
{
$classes
[
]
=
'inline-hidden'
;
}
$result
=
array
(
'class'
=>
implode
(
' '
,
$classes
)
,
'sigil'
=>
'inline-row'
,
'meta'
=>
$metadata
,
)
;
return
$result
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 19:24 (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1108892
Default Alt Text
PHUIDiffInlineCommentRowScaffold.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment