Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F458584
PHUIFormIconSetControl.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PHUIFormIconSetControl.php
View Options
<?php
final
class
PHUIFormIconSetControl
extends
AphrontFormControl
{
private
$iconSet
;
public
function
setIconSet
(
PhabricatorIconSet
$icon_set
)
{
$this
->
iconSet
=
$icon_set
;
return
$this
;
}
public
function
getIconSet
()
{
return
$this
->
iconSet
;
}
protected
function
getCustomControlClass
()
{
return
'phui-form-iconset-control'
;
}
protected
function
renderInput
()
{
Javelin
::
initBehavior
(
'choose-control'
);
$set
=
$this
->
getIconSet
();
$input_id
=
celerity_generate_unique_node_id
();
$display_id
=
celerity_generate_unique_node_id
();
$button
=
javelin_tag
(
'a'
,
array
(
'href'
=>
'#'
,
'class'
=>
'button grey'
,
'sigil'
=>
'phui-form-iconset-button'
,
),
$set
->
getChooseButtonText
());
$icon
=
$set
->
getIcon
(
$this
->
getValue
());
if
(
$icon
)
{
$display
=
$set
->
renderIconForControl
(
$icon
);
}
else
{
$display
=
null
;
}
$display_cell
=
phutil_tag
(
'td'
,
array
(
'class'
=>
'phui-form-iconset-display-cell'
,
'id'
=>
$display_id
,
),
$display
);
$button_cell
=
phutil_tag
(
'td'
,
array
(
'class'
=>
'phui-form-iconset-button-cell'
,
),
$button
);
$row
=
phutil_tag
(
'tr'
,
array
(),
array
(
$display_cell
,
$button_cell
));
$layout
=
javelin_tag
(
'table'
,
array
(
'class'
=>
'phui-form-iconset-table'
,
'sigil'
=>
'phui-form-iconset'
,
'meta'
=>
array
(
'uri'
=>
$set
->
getSelectURI
(),
'inputID'
=>
$input_id
,
'displayID'
=>
$display_id
,
),
),
$row
);
$hidden_input
=
phutil_tag
(
'input'
,
array
(
'type'
=>
'hidden'
,
'name'
=>
$this
->
getName
(),
'value'
=>
$this
->
getValue
(),
'id'
=>
$input_id
,
));
return
array
(
$hidden_input
,
$layout
,
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 5, 12:22 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
71490
Default Alt Text
PHUIFormIconSetControl.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment