Differential D25061 Diff 294 src/applications/calendar/editor/PhabricatorCalendarImportEditEngine.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/calendar/editor/PhabricatorCalendarImportEditEngine.php
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | final class PhabricatorCalendarImportEditEngine | ||||
} | } | ||||
protected function buildCustomEditFields($object) { | protected function buildCustomEditFields($object) { | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
$engine = $object->getEngine(); | $engine = $object->getEngine(); | ||||
$can_trigger = $engine->supportsTriggers($object); | $can_trigger = $engine->supportsTriggers($object); | ||||
// calendar URI import | |||||
// note that it can contains a secret token | |||||
// if we are here you have enough privileges to edit and see the value | |||||
$uri_key = PhabricatorCalendarImportICSURITransaction::PARAMKEY_URI; | |||||
$uri = $object->getParameter($uri_key); | |||||
$fields = array( | $fields = array( | ||||
id(new PhabricatorTextEditField()) | id(new PhabricatorTextEditField()) | ||||
->setKey('name') | ->setKey('name') | ||||
->setLabel(pht('Name')) | ->setLabel(pht('Name')) | ||||
->setDescription(pht('Name of the import.')) | ->setDescription(pht('Name of the import.')) | ||||
->setTransactionType( | ->setTransactionType( | ||||
PhabricatorCalendarImportNameTransaction::TRANSACTIONTYPE) | PhabricatorCalendarImportNameTransaction::TRANSACTIONTYPE) | ||||
->setConduitDescription(pht('Rename the import.')) | ->setConduitDescription(pht('Rename the import.')) | ||||
->setConduitTypeDescription(pht('New import name.')) | ->setConduitTypeDescription(pht('New import name.')) | ||||
->setPlaceholder($object->getDisplayName()) | ->setPlaceholder($object->getDisplayName()) | ||||
->setValue($object->getName()), | ->setValue($object->getName()), | ||||
id(new PhabricatorTextEditField()) | |||||
->setKey('uri') | |||||
->setLabel(pht('URI')) | |||||
->setDescription(pht('URI to import.')) | |||||
->setTransactionType( | |||||
PhabricatorCalendarImportICSURITransaction::TRANSACTIONTYPE) | |||||
->setConduitDescription(pht('URI to import.')) | |||||
->setConduitTypeDescription(pht('New URI.')) | |||||
->setValue($uri), | |||||
id(new PhabricatorBoolEditField()) | id(new PhabricatorBoolEditField()) | ||||
->setKey('disabled') | ->setKey('disabled') | ||||
->setOptions(pht('Active'), pht('Disabled')) | ->setOptions(pht('Active'), pht('Disabled')) | ||||
->setLabel(pht('Disabled')) | ->setLabel(pht('Disabled')) | ||||
->setDescription(pht('Disable the import.')) | ->setDescription(pht('Disable the import.')) | ||||
->setTransactionType( | ->setTransactionType( | ||||
PhabricatorCalendarImportDisableTransaction::TRANSACTIONTYPE) | PhabricatorCalendarImportDisableTransaction::TRANSACTIONTYPE) | ||||
->setIsFormField(false) | ->setIsFormField(false) | ||||
▲ Show 20 Lines • Show All 51 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0