Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97230537
PhortuneCartController.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
Fri, Jan 3, 15:36
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Jan 5, 15:36 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23360003
Attached To
rPH Phabricator
PhortuneCartController.php
View Options
<?php
abstract
class
PhortuneCartController
extends
PhortuneController
{
protected
function
buildCartContentTable
(
PhortuneCart
$cart
)
{
$rows
=
array
();
foreach
(
$cart
->
getPurchases
()
as
$purchase
)
{
$rows
[]
=
array
(
$purchase
->
getFullDisplayName
(),
$purchase
->
getBasePriceAsCurrency
()->
formatForDisplay
(),
$purchase
->
getQuantity
(),
$purchase
->
getTotalPriceAsCurrency
()->
formatForDisplay
(),
);
}
$rows
[]
=
array
(
phutil_tag
(
'strong'
,
array
(),
pht
(
'Total'
)),
''
,
''
,
phutil_tag
(
'strong'
,
array
(),
$cart
->
getTotalPriceAsCurrency
()->
formatForDisplay
()),
);
$table
=
new
AphrontTableView
(
$rows
);
$table
->
setHeaders
(
array
(
pht
(
'Item'
),
pht
(
'Price'
),
pht
(
'Qty.'
),
pht
(
'Total'
),
));
$table
->
setColumnClasses
(
array
(
'wide'
,
'right'
,
'right'
,
'right'
,
));
return
$table
;
}
protected
function
renderCartDescription
(
PhortuneCart
$cart
)
{
$description
=
$cart
->
getDescription
();
if
(!
strlen
(
$description
))
{
return
null
;
}
$output
=
new
PHUIRemarkupView
(
$this
->
getUser
(),
$description
);
$box
=
id
(
new
PHUIBoxView
())
->
addMargin
(
PHUI
::
MARGIN_LARGE
)
->
appendChild
(
$output
);
return
id
(
new
PHUIObjectBoxView
())
->
setHeaderText
(
pht
(
'Description'
))
->
appendChild
(
$box
);
}
}
Event Timeline
Log In to Comment