Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F835983
PhabricatorCountdownEditEngine.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
PhabricatorCountdownEditEngine.php
View Options
<?php
final
class
PhabricatorCountdownEditEngine
extends
PhabricatorEditEngine
{
const
ENGINECONST
=
'countdown.countdown'
;
public
function
isEngineConfigurable
()
{
return
false
;
}
public
function
getEngineName
()
{
return
pht
(
'Countdowns'
);
}
public
function
getSummaryHeader
()
{
return
pht
(
'Edit Countdowns'
);
}
public
function
getSummaryText
()
{
return
pht
(
'Creates and edits countdowns.'
);
}
public
function
getEngineApplicationClass
()
{
return
PhabricatorCountdownApplication
::
class
;
}
protected
function
newEditableObject
()
{
return
PhabricatorCountdown
::
initializeNewCountdown
(
$this
->
getViewer
());
}
protected
function
newObjectQuery
()
{
return
id
(
new
PhabricatorCountdownQuery
());
}
protected
function
getObjectCreateTitleText
(
$object
)
{
return
pht
(
'Create Countdown'
);
}
protected
function
getObjectCreateButtonText
(
$object
)
{
return
pht
(
'Create Countdown'
);
}
protected
function
getObjectEditTitleText
(
$object
)
{
return
pht
(
'Edit Countdown: %s'
,
$object
->
getTitle
());
}
protected
function
getObjectEditShortText
(
$object
)
{
return
pht
(
'Edit Countdown'
);
}
protected
function
getObjectCreateShortText
()
{
return
pht
(
'Create Countdown'
);
}
protected
function
getObjectName
()
{
return
pht
(
'Countdown'
);
}
protected
function
getCommentViewHeaderText
(
$object
)
{
return
pht
(
'Last Words'
);
}
protected
function
getCommentViewButtonText
(
$object
)
{
return
pht
(
'Contemplate Infinity'
);
}
protected
function
getObjectViewURI
(
$object
)
{
return
$object
->
getURI
();
}
protected
function
getCreateNewObjectPolicy
()
{
return
$this
->
getApplication
()->
getPolicy
(
PhabricatorCountdownCreateCapability
::
CAPABILITY
);
}
protected
function
buildCustomEditFields
(
$object
)
{
$epoch_value
=
$object
->
getEpoch
();
if
(
$epoch_value
===
null
)
{
$epoch_value
=
PhabricatorTime
::
getNow
();
}
return
array
(
id
(
new
PhabricatorTextEditField
())
->
setKey
(
'name'
)
->
setLabel
(
pht
(
'Name'
))
->
setIsRequired
(
true
)
->
setTransactionType
(
PhabricatorCountdownTitleTransaction
::
TRANSACTIONTYPE
)
->
setDescription
(
pht
(
'The countdown name.'
))
->
setConduitDescription
(
pht
(
'Rename the countdown.'
))
->
setConduitTypeDescription
(
pht
(
'New countdown name.'
))
->
setValue
(
$object
->
getTitle
()),
id
(
new
PhabricatorEpochEditField
())
->
setKey
(
'epoch'
)
->
setLabel
(
pht
(
'End Date'
))
->
setTransactionType
(
PhabricatorCountdownEpochTransaction
::
TRANSACTIONTYPE
)
->
setDescription
(
pht
(
'Date when the countdown ends.'
))
->
setConduitDescription
(
pht
(
'Change the end date of the countdown.'
))
->
setConduitTypeDescription
(
pht
(
'New countdown end date.'
))
->
setValue
(
$epoch_value
),
id
(
new
PhabricatorRemarkupEditField
())
->
setKey
(
'description'
)
->
setLabel
(
pht
(
'Description'
))
->
setTransactionType
(
PhabricatorCountdownDescriptionTransaction
::
TRANSACTIONTYPE
)
->
setDescription
(
pht
(
'Description of the countdown.'
))
->
setConduitDescription
(
pht
(
'Change the countdown description.'
))
->
setConduitTypeDescription
(
pht
(
'New description.'
))
->
setValue
(
$object
->
getDescription
()),
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, May 30, 2:50 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
177425
Default Alt Text
PhabricatorCountdownEditEngine.php (3 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment