/**
  * Update the UI to reflect published state
  * @return void
  */
 public function transformToButton()
 {
     parent::transformToButton();
     if ($this->gridFieldRequest->recordIsPublished()) {
         $this->setTitle(_t('SiteTree.BUTTONPUBLISHED', 'Published'));
     }
     if ($this->gridFieldRequest->record->stagesDiffer('Stage', 'Live') && $this->gridFieldRequest->recordIsDeletedFromStage()) {
         $this->addExtraClass('ss-ui-alternate');
     }
     return $this;
 }
 /**
  * Builds the button
  */
 public function __construct()
 {
     return parent::__construct('doSend', _t('Push.DO_SEND', 'Send'));
 }
 /**
  * Adds a class to identify this as a destructive action
  * @return void
  */
 public function baseTransform()
 {
     parent::baseTransform();
     return $this->addExtraClass('ss-ui-action-destructive');
 }
 /**
  * Adds a class to help identify the button in a group
  * @return FormAction
  */
 public function transformToInput()
 {
     return parent::transformToInput()->addExtraClass("saveAndGoPrev");
 }
 /**
  * Adds the appropriate icon and style
  * @return FormAction
  */
 public function transformToButton()
 {
     return parent::transformToButton()->addExtraClass('ss-ui-action-constructive')->setAttribute('data-icon', 'accept');
 }
 /**
  * Add the necessary classes and icons
  * @return FormAction
  */
 public function baseTransform()
 {
     parent::baseTransform();
     return $this->addExtraClass("ss-ui-action-constructive")->setAttribute('data-icon', 'add');
 }
 /**
  * Adds the JS, sets up necessary HTML attributes
  * @return FormAction
  */
 public function baseTransform()
 {
     parent::baseTransform();
     Requirements::javascript(BETTER_BUTTONS_DIR . '/javascript/gridfield_betterbuttons_delete.js');
     return $this->setUseButtonTag(true)->addExtraClass('gridfield-better-buttons-delete')->setAttribute("data-toggletext", _t('GridFieldBetterButtons.AREYOUSURE', 'Yes. Delete this item.'))->setAttribute("data-confirmtext", _t('GridFieldDetailForm.CANCELDELETE', 'No. Don\'t delete.'));
 }
 public function Field($properties = array())
 {
     $field = parent::Field($properties);
     return $this->classDropdown() . $field;
 }
 /**
  * Updates the button to have the correct style and icon
  * @return FormAction
  */
 public function baseTransform()
 {
     parent::baseTransform();
     return $this->setAttribute('data-icon', 'accept')->setAttribute('data-icon-alternate', 'addpage')->setAttribute('data-text-alternate', _t('CMSMain.SAVEDRAFT', 'Save draft'));
 }
 /**
  * Update the button to show a description
  * @return [type] [description]
  */
 public function baseTransform()
 {
     parent::baseTransform();
     return $this->setDescription(_t('SiteTree.BUTTONCANCELDRAFTDESC', 'Delete your draft and revert to the currently published page'));
 }