本文整理汇总了PHP中Drupal\Core\Form\ConfirmFormBase类的典型用法代码示例。如果您正苦于以下问题:PHP ConfirmFormBase类的具体用法?PHP ConfirmFormBase怎么用?PHP ConfirmFormBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ConfirmFormBase类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: buildForm
/**
* Overrides \Drupal\Core\Form\ConfirmFormBase::buildForm().
*/
public function buildForm(array $form, array &$form_state, $pid = NULL)
{
$this->pathAlias = $this->aliasStorage->load(array('pid' => $pid));
$form = parent::buildForm($form, $form_state);
// @todo Convert to getCancelRoute() after http://drupal.org/node/1987802.
$form['actions']['cancel']['#href'] = 'admin/config/search/path';
return $form;
}
开发者ID:alnutile,项目名称:drunatra,代码行数:11,代码来源:DeleteForm.php
示例2: buildForm
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state, NodeInterface $node = NULL, $fid = NULL, $pfid = NULL)
{
$this->node = $node;
$this->featureId = $fid;
$this->feature = uc_product_feature_load($pfid);
return parent::buildForm($form, $form_state);
}
开发者ID:justincletus,项目名称:webdrupalpro,代码行数:10,代码来源:ProductFeatureDeleteForm.php
示例3: buildForm
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state, PageInterface $page = NULL, $display_variant_id = NULL, $block_id = NULL)
{
$this->page = $page;
$this->displayVariant = $this->page->getVariant($display_variant_id);
$this->block = $this->displayVariant->getBlock($block_id);
return parent::buildForm($form, $form_state);
}
开发者ID:pulibrary,项目名称:recap,代码行数:10,代码来源:DisplayVariantDeleteBlockForm.php
示例4: buildForm
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state, PageInterface $page = NULL, $display_variant_id = NULL, $condition_id = NULL)
{
$this->page = $page;
$this->displayVariant = $this->page->getVariant($display_variant_id);
$this->selectionCondition = $this->displayVariant->getSelectionCondition($condition_id);
return parent::buildForm($form, $form_state);
}
开发者ID:pulibrary,项目名称:recap,代码行数:10,代码来源:SelectionConditionDeleteForm.php
示例5: buildForm
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state)
{
$results = $_POST;
$form['method'] = array('#type' => 'hidden', '#value' => $results['method']);
if (!isset($results['reset'])) {
$results['reset'] = 0;
}
$form['all'] = array('#type' => 'hidden', '#value' => $results['all']);
if (isset($results['all'])) {
// Only carry reset value through if delete all nodes is set
$form['reset'] = array('#type' => 'hidden', '#value' => $results['reset']);
$form['all_warning'] = array('#markup' => '<p>' . $this->t('All content in all content types will be deleted. Be sure to have a backup of any important data!') . '</p>');
if (!empty($results['reset'])) {
if ($results['all']) {
$form['all_reset'] = array('#markup' => '<p>' . $this->t('Node, revision and comment counts will be reset.') . '</p>');
}
}
} elseif (isset($results['types'])) {
if (is_array($results['types'])) {
foreach ($results['types'] as $key_type => $type) {
/**
* @TODO, if we use the form array the value doesn't exist in the submit
*/
$_SESSION['nodes_type'][$key_type] = $type;
$info = node_type_get_types('type', $type);
$info = $info[$type];
$form[$type . '_warning'] = array('#markup' => '<p>' . $this->t('All content in the %type content type will be deleted. Be sure to have a backup of any important data!', array('%type' => $info->get('name'))) . '</p>');
}
}
if ($results['reset']) {
$form['all_reset'] = array('#markup' => '<p>' . $this->t('Sorry, we can\'t reset the counters because you are not deleting all nodes.') . '</p>');
}
}
return parent::buildForm($form, $form_state);
}
开发者ID:blakefrederick,项目名称:sas-backend,代码行数:38,代码来源:DeleteContentConfirmForm.php
示例6: buildForm
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state, NodeInterface $node = NULL, $component = NULL)
{
$this->node = $node;
// @todo $component should be a fully loaded object, need to make our own ParamConverterInterface.
$this->component = isset($node->webform['components'][$component]) ? $node->webform['components'][$component] : FALSE;
return parent::buildForm($form, $form_state);
}
开发者ID:Progressable,项目名称:openway8,代码行数:10,代码来源:WebformComponentDeleteForm.php
示例7: buildForm
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state, $tempstore_id = NULL, $machine_name = NULL, $context_id = NULL)
{
$this->tempstore_id = $tempstore_id;
$this->machine_name = $machine_name;
$this->context_id = $context_id;
return parent::buildForm($form, $form_state);
}
开发者ID:Progressable,项目名称:openway8,代码行数:10,代码来源:ContextDelete.php
示例8: buildForm
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state, $actions = NULL)
{
$cart_links_config = $this->config('uc_cart_links.settings');
$this->actions = $actions;
// Fail if the link is restricted.
$data = $cart_links_config->get('restrictions');
if (!empty($data)) {
$restrictions = explode("\n", $cart_links_config->get('restrictions'));
$restrictions = array_map('trim', $restrictions);
if (!empty($restrictions) && !in_array($this->actions, $restrictions)) {
unset($_GET['destination']);
$path = $cart_links_config->get('invalid_page');
if (empty($path)) {
return $this->redirect('<front>', [], ['absolute' => TRUE]);
}
return new RedirectResponse(Url::fromUri('internal:/' . $path, ['absolute' => TRUE])->toString());
}
}
// Confirm with the user if the form contains a destructive action.
$cart = Cart::create(\Drupal::getContainer());
$items = $cart->getContents();
if ($cart_links_config->get('empty') && !empty($items)) {
$actions = explode('-', urldecode($this->actions));
foreach ($actions as $action) {
$action = Unicode::substr($action, 0, 1);
if ($action == 'e' || $action == 'E') {
$form = parent::buildForm($form, $form_state);
$form['actions']['cancel']['#href'] = $cart_links_config->get('invalid_page');
return $form;
}
}
}
// No destructive actions, so process the link immediately.
return $this->submitForm($form, $form_state);
}
开发者ID:pedrocones,项目名称:hydrotools,代码行数:38,代码来源:CartLinksForm.php
示例9: buildForm
/**
* {@inheritdoc}
*
* @param string $ban_id
* The IP address record ID to unban.
*/
public function buildForm(array $form, FormStateInterface $form_state, $ban_id = '')
{
if (!($this->banIp = $this->ipManager->findById($ban_id))) {
throw new NotFoundHttpException();
}
return parent::buildForm($form, $form_state);
}
开发者ID:papillon-cendre,项目名称:d8,代码行数:13,代码来源:BanDelete.php
示例10: buildForm
/**
* {@inheritdoc}
*/
public function buildForm(array $form, array &$form_state, $browser_langcode = NULL)
{
$this->browserLangcode = $browser_langcode;
$form = parent::buildForm($form, $form_state);
// @todo Convert to getCancelRoute() after http://drupal.org/node/2082071.
$form['actions']['cancel']['#href'] = 'admin/config/regional/language/detection/browser';
return $form;
}
开发者ID:alnutile,项目名称:drunatra,代码行数:11,代码来源:NegotiationBrowserDeleteForm.php
示例11: buildForm
/**
* Builds the form array.
*
* Note that when adding arguments to buildForm(), you need to give
* them default values, to avoid PHP errors.
*/
public function buildForm(array $form, FormStateInterface $form_state, $id = '')
{
// Sanitize and save the ID.
$id = (int) $id;
$this->to_delete_id = $id;
$form = parent::buildForm($form, $form_state);
return $form;
}
开发者ID:Jamesadamar,项目名称:programmers_guide_to_drupal,代码行数:14,代码来源:ConfirmDeleteForm.php
示例12: buildForm
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state,
FlagInterface $flag = NULL, $entity_id = NULL) {
$this->flag = $flag;
$flag_service = \Drupal::service('flag');
$this->entity = $flag_service->getFlaggableById($this->flag, $entity_id);
return parent::buildForm($form, $form_state);
}
开发者ID:AshishNaik021,项目名称:iimisac-d8,代码行数:11,代码来源:FlagConfirmFormBase.php
示例13: buildForm
/**
* {@inheritdoc}
*
* @param int $id
* (optional) The ID of the item to be deleted.
*/
public function buildForm(array $form, FormStateInterface $form_state, $file = '') {
// @todo update access!
$this->id = $file;
if (!$this->id) {
throw new NotFoundHttpException();
}
// @todo set album type?
return parent::buildForm($form, $form_state);
}
开发者ID:AshishNaik021,项目名称:iimisac-d8,代码行数:15,代码来源:PhotosImageDeleteForm.php
示例14: buildForm
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state, OrderInterface $uc_order = NULL, $payment = NULL)
{
$this->payment = uc_payment_load($payment);
// Make sure the payment is for the specified order.
if ($this->payment->order_id != $uc_order->id()) {
throw new NotFoundHttpException();
}
return parent::buildForm($form, $form_state);
}
开发者ID:pedrocones,项目名称:hydrotools,代码行数:12,代码来源:PaymentDeleteForm.php
示例15: buildForm
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state, ProfileInterface $linkit_profile = NULL, $plugin_instance_id = NULL) {
$this->linkitProfile = $linkit_profile;
if (!$this->linkitProfile->getAttributes()->has($plugin_instance_id)) {
throw new NotFoundHttpException();
}
$this->linkitAttribute = $this->linkitProfile->getAttribute($plugin_instance_id);
return parent::buildForm($form, $form_state);
}
开发者ID:eloiv,项目名称:botafoc.cat,代码行数:13,代码来源:DeleteForm.php
示例16: buildForm
/**
* @param array $form
* @param \Drupal\Core\Form\FormStateInterface $form_state
* @param null $backup_migrate_destination
* @param null $backup_id
* @return array
*/
public function buildForm(array $form, FormStateInterface $form_state, $backup_migrate_destination = NULL, $backup_id = NULL)
{
$this->destination = $backup_migrate_destination;
$this->backup_id = $backup_id;
$bam = backup_migrate_get_service_object();
$form['source_id'] = DrupalConfigHelper::getPluginSelector($bam->sources(), $this->t('Restore To'));
$conf_schema = $bam->plugins()->map('configSchema', array('operation' => 'restore'));
$form += DrupalConfigHelper::buildFormFromSchema($conf_schema, $bam->plugins()->config());
return parent::buildForm($form, $form_state);
}
开发者ID:r-daneelolivaw,项目名称:chalk,代码行数:17,代码来源:BackupRestoreForm.php
示例17: buildForm
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state)
{
$form = parent::buildForm($form, $form_state);
// Remove the cancel button if this is an AJAX request since Drupals built
// in modal dialogues does not handle buttons that are not a primary
// button very well.
if ($this->getRequest()->isXmlHttpRequest()) {
unset($form['actions']['cancel']);
}
return $form;
}
开发者ID:oddhill,项目名称:entity_layout,代码行数:14,代码来源:BlockDeleteForm.php
示例18: buildForm
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state, $user = NULL, $role = NULL)
{
$expiration = db_query('SELECT expiration FROM {uc_roles_expirations} WHERE uid = :uid AND rid = :rid', [':uid' => $user->id(), ':rid' => $role])->fetchField();
if ($expiration) {
$role_name = _uc_role_get_name($role);
$form['user'] = array('#type' => 'value', '#value' => $user->getUsername());
$form['uid'] = array('#type' => 'value', '#value' => $user->id());
$form['role'] = array('#type' => 'value', '#value' => $role_name);
$form['rid'] = array('#type' => 'value', '#value' => $role);
}
return parent::buildForm($form, $form_state);
}
开发者ID:justincletus,项目名称:webdrupalpro,代码行数:15,代码来源:RoleDeleteForm.php
示例19: buildForm
/**
* {@inheritdoc}
*/
public function buildForm(array $form, array &$form_state, PageInterface $page = NULL, $page_variant_id = NULL, $layout_region_id = NULL, $block_id = NULL)
{
$this->page = $page;
$this->displayVariant = $this->page->getVariant($page_variant_id);
$this->displayVariant->init($this->page->getExecutable());
$this->block = $this->displayVariant->getBlock($block_id);
$form = parent::buildForm($form, $form_state, $page, $page_variant_id, $layout_region_id, $block_id);
if ($this->getRequest()->isXmlHttpRequest()) {
$form['actions']['submit']['#ajax'] = array('callback' => array($this, 'submitForm'));
}
return $form;
}
开发者ID:andypost,项目名称:layout,代码行数:15,代码来源:LayoutDeleteBlockForm.php
示例20: buildForm
public function buildForm(array $form, FormStateInterface $form_state, $field_group_name = NULL, $entity_type_id = NULL, $bundle = NULL, $context = NULL)
{
if ($context == 'form') {
$mode = $this->getRequest()->attributes->get('form_mode_name');
} else {
$mode = $this->getRequest()->attributes->get('view_mode_name');
}
if (empty($mode)) {
$mode = 'default';
}
$this->fieldGroup = field_group_load_field_group($field_group_name, $entity_type_id, $bundle, $context, $mode);
return parent::buildForm($form, $form_state);
}
开发者ID:frankcr,项目名称:sftw8,代码行数:13,代码来源:FieldGroupDeleteForm.php
注:本文中的Drupal\Core\Form\ConfirmFormBase类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论