Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93791919
PHUIPolicySectionView.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Dec 1, 13:16
Size
2 KB
Mime Type
text/x-php
Expires
Tue, Dec 3, 13:16 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22705483
Attached To
rPH Phabricator
PHUIPolicySectionView.php
View Options
<?php
final
class
PHUIPolicySectionView
extends
AphrontTagView
{
private
$icon
;
private
$header
;
private
$documentationLink
;
public
function
setHeader
(
$header
)
{
$this
->
header
=
$header
;
return
$this
;
}
public
function
getHeader
()
{
return
$this
->
header
;
}
public
function
setIcon
(
$icon
)
{
$this
->
icon
=
$icon
;
return
$this
;
}
public
function
getIcon
()
{
return
$this
->
icon
;
}
public
function
setDocumentationLink
(
$name
,
$href
)
{
$link
=
phutil_tag
(
'a'
,
array
(
'href'
=>
$href
,
'target'
=>
'_blank'
,
),
$name
);
$this
->
documentationLink
=
phutil_tag
(
'div'
,
array
(
'class'
=>
'phui-policy-section-view-link'
,
),
array
(
id
(
new
PHUIIconView
())->
setIcon
(
'fa-book'
),
$link
,
));
return
$this
;
}
public
function
getDocumentationLink
()
{
return
$this
->
documentationLink
;
}
public
function
appendList
(
array
$items
)
{
foreach
(
$items
as
$key
=>
$item
)
{
$items
[
$key
]
=
phutil_tag
(
'li'
,
array
(
'class'
=>
'remarkup-list-item'
,
),
$item
);
}
$list
=
phutil_tag
(
'ul'
,
array
(
'class'
=>
'remarkup-list'
,
),
$items
);
return
$this
->
appendChild
(
$list
);
}
public
function
appendHint
(
$content
)
{
$hint
=
phutil_tag
(
'p'
,
array
(
'class'
=>
'phui-policy-section-view-hint'
,
),
array
(
id
(
new
PHUIIconView
())
->
setIcon
(
'fa-sticky-note bluegrey'
),
' '
,
pht
(
'Note:'
),
' '
,
$content
,
));
return
$this
->
appendChild
(
$hint
);
}
public
function
appendParagraph
(
$content
)
{
return
$this
->
appendChild
(
phutil_tag
(
'p'
,
array
(),
$content
));
}
protected
function
getTagAttributes
()
{
return
array
(
'class'
=>
'phui-policy-section-view'
,
);
}
protected
function
getTagContent
()
{
require_celerity_resource
(
'phui-header-view-css'
);
$icon_view
=
null
;
$icon
=
$this
->
getIcon
();
if
(
$icon
!==
null
)
{
$icon_view
=
id
(
new
PHUIIconView
())
->
setIcon
(
$icon
);
}
$header_view
=
phutil_tag
(
'span'
,
array
(
'class'
=>
'phui-policy-section-view-header-text'
,
),
$this
->
getHeader
());
$header
=
phutil_tag
(
'div'
,
array
(
'class'
=>
'phui-policy-section-view-header'
,
),
array
(
$icon_view
,
$header_view
,
$this
->
getDocumentationLink
(),
));
return
array
(
$header
,
phutil_tag
(
'div'
,
array
(
'class'
=>
'phui-policy-section-view-body'
,
),
$this
->
renderChildren
()),
);
}
}
Event Timeline
Log In to Comment