Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F17826623
DiffusionTagListView.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
DiffusionTagListView.php
View Options
<?php
final
class
DiffusionTagListView
extends
DiffusionView
{
private
$tags
;
private
$commits
=
array
();
private
$handles
=
array
();
public
function
setTags
(
$tags
)
{
$this
->
tags
=
$tags
;
return
$this
;
}
public
function
setCommits
(
array
$commits
)
{
$this
->
commits
=
mpull
(
$commits
,
null
,
'getCommitIdentifier'
);
return
$this
;
}
public
function
setHandles
(
array
$handles
)
{
$this
->
handles
=
$handles
;
return
$this
;
}
public
function
getRequiredHandlePHIDs
()
{
return
array_filter
(
mpull
(
$this
->
commits
,
'getAuthorPHID'
));
}
public
function
render
()
{
$drequest
=
$this
->
getDiffusionRequest
();
$repository
=
$drequest
->
getRepository
();
$rows
=
array
();
foreach
(
$this
->
tags
as
$tag
)
{
$commit
=
idx
(
$this
->
commits
,
$tag
->
getCommitIdentifier
());
$tag_link
=
phutil_tag
(
'a'
,
array
(
'href'
=>
$drequest
->
generateURI
(
array
(
'action'
=>
'browse'
,
'commit'
=>
$tag
->
getName
(),
)),
),
$tag
->
getName
());
$commit_link
=
phutil_tag
(
'a'
,
array
(
'href'
=>
$drequest
->
generateURI
(
array
(
'action'
=>
'commit'
,
'commit'
=>
$tag
->
getCommitIdentifier
(),
)),
),
$repository
->
formatCommitName
(
$tag
->
getCommitIdentifier
()));
$author
=
null
;
if
(
$commit
&&
$commit
->
getAuthorPHID
())
{
$author
=
$this
->
handles
[
$commit
->
getAuthorPHID
()]->
renderLink
();
}
else
if
(
$commit
&&
$commit
->
getCommitData
())
{
$author
=
self
::
renderName
(
$commit
->
getCommitData
()->
getAuthorName
());
}
else
{
$author
=
self
::
renderName
(
$tag
->
getAuthor
());
}
$description
=
null
;
if
(
$tag
->
getType
()
==
'git/tag'
)
{
// In Git, a tag may be a "real" tag, or just a reference to a commit.
// If it's a real tag, use the message on the tag, since this may be
// unique data which isn't otherwise available.
$description
=
$tag
->
getDescription
();
}
else
{
if
(
$commit
)
{
$description
=
$commit
->
getSummary
();
}
else
{
$description
=
$tag
->
getDescription
();
}
}
$rows
[]
=
array
(
$tag_link
,
$commit_link
,
$description
,
$author
,
phabricator_datetime
(
$tag
->
getEpoch
(),
$this
->
user
),
);
}
$table
=
new
AphrontTableView
(
$rows
);
$table
->
setHeaders
(
array
(
pht
(
'Tag'
),
pht
(
'Commit'
),
pht
(
'Description'
),
pht
(
'Author'
),
pht
(
'Created'
),
));
$table
->
setColumnClasses
(
array
(
'pri'
,
''
,
'wide'
,
));
return
$table
->
render
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Jul 28, 7:28 AM (1 w, 18 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
8281918
Default Alt Text
DiffusionTagListView.php (2 KB)
Attached To
Mode
rP Phabricator
Attached
Detach File
Event Timeline
Log In to Comment