本文整理汇总了PHP中DataObject::getCMSActions方法的典型用法代码示例。如果您正苦于以下问题:PHP DataObject::getCMSActions方法的具体用法?PHP DataObject::getCMSActions怎么用?PHP DataObject::getCMSActions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataObject
的用法示例。
在下文中一共展示了DataObject::getCMSActions方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCMSActions
/**
* 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;
}
示例2: getCMSActions
public function getCMSActions()
{
$actions = parent::getCMSActions();
$actions->push(FormAction::create('doGenerateCampaign', _t('Chimpify.ButtonLabelGenerateCampaign', 'Create in MailChimp')));
$this->extend('updateCMSActions', $actions);
return $actions;
}
示例3: getCMSActions
/**
* @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;
}
示例4: getCMSActions
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;
}
示例5: getCMSActions
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;
}
示例6: getCMSActions
public function getCMSActions()
{
$actions = parent::getCMSActions();
$actions->push(new FormAction('save', 'Save'));
return $actions;
}
示例7: getCMSActions
/**
* 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;
}
示例8: getCMSActions
public function getCMSActions()
{
$actions = parent::getCMSActions();
$actions->push(new FormAction('compose', _t('ComposedPdf.COMPOSE', 'Compose')));
return $actions;
}