Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F442684
PhortuneCartController.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
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
=
PhabricatorMarkupEngine
::
renderOneObject
(
id
(
new
PhabricatorMarkupOneOff
())
->
setPreserveLinebreaks
(
true
)
->
setContent
(
$description
),
'default'
,
$this
->
getViewer
());
$box
=
id
(
new
PHUIBoxView
())
->
addMargin
(
PHUI
::
MARGIN_LARGE
)
->
appendChild
(
$output
);
return
id
(
new
PHUIObjectBoxView
())
->
setHeaderText
(
pht
(
'Description'
))
->
appendChild
(
$box
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, May 4, 9:21 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
64667
Default Alt Text
PhortuneCartController.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment