/** * Adds a button the Site Config page of the CMS to rebuild the Lucene search index. */ public function getCMSActions() { $actions = parent::getCMSActions(); if ($fileLocation = $this->getFullLocationWithExtension() || 1 == 1) { clearstatcache(); if (file_exists($this->FullLocation)) { //do nothing } else { $lastChanged = _t('Databasebackup.NO_BACKUP_IS_AVAILABLE', 'This Backup is Available ... '); } if (Permission::check("ADMIN")) { if (!$this->exists()) { $actions->push(new FormAction('doMakeDatabaseBackup', _t('Databasebackup.MAKE_DATABASE_BACKUP', 'Make Database Backup') . "; " . $lastChanged)); } else { if (file_exists($this->FullLocation)) { if (!Director::IsLive() || $this->Config()->get("allow_restores_in_live_environment")) { $actions->push(new FormAction('doRestoreDatabaseBackup', _t('Databasebackup.RESTORE_DB_BACKUP_NOW', 'Restore This Database (override current one)'))); } } } } } $this->extend('updateCMSActions', $actions); return $actions; }
public function getCMSActions() { $actions = parent::getCMSActions(); $actions->push(FormAction::create('doGenerateCampaign', _t('Chimpify.ButtonLabelGenerateCampaign', 'Create in MailChimp'))); $this->extend('updateCMSActions', $actions); return $actions; }
/** * @return FieldList */ public function getCMSActions() { $actions = parent::getCMSActions(); if (!$this->ID || $this->AccessToken) { $this->extend('updateCMSActions', $actions); return $actions; } $client = self::getNewInstagramClient(); $loginURL = $client->getLoginUrl(); $this->setSessionOAuthState($this->getOAuthStateValueFromLoginURL($loginURL)); $actions->push(LiteralField::create('OAuthLink', '<a class="ss-ui-button" href="' . $loginURL . '">' . _t('Instagram.ButtonLabelAuthoriseAccount', 'Authorise account') . '</a>')); $this->extend('updateCMSActions', $actions); return $actions; }
public function getCMSActions() { $actions = parent::getCMSActions(); $addCreditCard = new FormAction('addCreditCard', 'Add Credit Card'); $addCreditCard->addExtraClass('ss-ui-action-constructive'); $updateCreditCard = new FormAction('updateCreditCard', 'Update Credit Card'); $updateCreditCard->addExtraClass('ss-ui-action-constructive'); if ($this->ID) { $actions->push($updateCreditCard); } if (!$this->ID) { $actions->push($addCreditCard); } return $actions; }
public function getCMSActions() { $actions = parent::getCMSActions(); $createSubscription = new FormAction('createSubscription', 'Create Subscription'); $createSubscription->addExtraClass('ss-ui-action-constructive'); $cancelSubscription = new FormAction('cancelSubscription', 'Cancel Subscription'); $cancelSubscription->addExtraClass('ss-ui-action-destructive'); $changeSubscription = new FormAction('changeSubscription', 'Change Subscription'); $changeSubscription->addExtraClass('ss-ui-action-constructive'); if ($this->ID && $this->Status && ($this->ProductID == 1 || $this->ProductID == 2 || $this->ProductID == 3)) { $actions->push($cancelSubscription); $actions->push($changeSubscription); } if (!$this->ID) { $actions->push($createSubscription); } return $actions; }
public function getCMSActions() { $actions = parent::getCMSActions(); $actions->push(new FormAction('save', 'Save')); return $actions; }
/** * Set custom CMS actions which call * OrderAdmin_RecordController actions of the same name * * @see DataObject::getCMSActions() * @return FieldList */ public function getCMSActions() { $actions = parent::getCMSActions(); return $actions; }
public function getCMSActions() { $actions = parent::getCMSActions(); $actions->push(new FormAction('compose', _t('ComposedPdf.COMPOSE', 'Compose'))); return $actions; }