Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F100416594
PhutilConsoleBlock.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
Thu, Jan 30, 16:10
Size
878 B
Mime Type
text/x-php
Expires
Sat, Feb 1, 16:10 (2 d)
Engine
blob
Format
Raw Data
Handle
23949228
Attached To
rPHU libphutil
PhutilConsoleBlock.php
View Options
<?php
final
class
PhutilConsoleBlock
extends
PhutilConsoleView
{
private
$items
=
array
();
public
function
addParagraph
(
$item
)
{
$this
->
items
[]
=
array
(
'type'
=>
'paragraph'
,
'item'
=>
$item
,
);
return
$this
;
}
public
function
addList
(
PhutilConsoleList
$list
)
{
$this
->
items
[]
=
array
(
'type'
=>
'list'
,
'item'
=>
$list
,
);
return
$this
;
}
protected
function
drawView
()
{
$output
=
array
();
foreach
(
$this
->
items
as
$spec
)
{
$type
=
$spec
[
'type'
];
$item
=
$spec
[
'item'
];
switch
(
$type
)
{
case
'paragraph'
:
$item
=
array
(
tsprintf
(
'%s'
,
$item
)->
applyWrap
(),
"
\n
"
,
);
break
;
case
'list'
:
$item
=
$item
;
break
;
}
$output
[]
=
$item
;
}
return
$this
->
drawLines
(
$output
);
}
}
Event Timeline
Log In to Comment