Mercurial > hg > isophonics-drupal-site
comparison core/modules/node/src/NodeForm.php @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:46:53 +0100 |
parents | 4c8ae668cc8c |
children | 129ea1e6d783 |
comparison
equal
deleted
inserted
replaced
13:5fb285c0d0e3 | 14:1fec387a4317 |
---|---|
6 use Drupal\Core\Entity\ContentEntityForm; | 6 use Drupal\Core\Entity\ContentEntityForm; |
7 use Drupal\Core\Entity\EntityManagerInterface; | 7 use Drupal\Core\Entity\EntityManagerInterface; |
8 use Drupal\Core\Entity\EntityTypeBundleInfoInterface; | 8 use Drupal\Core\Entity\EntityTypeBundleInfoInterface; |
9 use Drupal\Core\Form\FormStateInterface; | 9 use Drupal\Core\Form\FormStateInterface; |
10 use Drupal\Core\Session\AccountInterface; | 10 use Drupal\Core\Session\AccountInterface; |
11 use Drupal\user\PrivateTempStoreFactory; | 11 use Drupal\Core\TempStore\PrivateTempStoreFactory; |
12 use Symfony\Component\DependencyInjection\ContainerInterface; | 12 use Symfony\Component\DependencyInjection\ContainerInterface; |
13 | 13 |
14 /** | 14 /** |
15 * Form handler for the node edit forms. | 15 * Form handler for the node edit forms. |
16 * | |
17 * @internal | |
16 */ | 18 */ |
17 class NodeForm extends ContentEntityForm { | 19 class NodeForm extends ContentEntityForm { |
18 | 20 |
19 /** | 21 /** |
20 * The tempstore factory. | 22 * The tempstore factory. |
21 * | 23 * |
22 * @var \Drupal\user\PrivateTempStoreFactory | 24 * @var \Drupal\Core\TempStore\PrivateTempStoreFactory |
23 */ | 25 */ |
24 protected $tempStoreFactory; | 26 protected $tempStoreFactory; |
25 | 27 |
26 /** | 28 /** |
27 * The Current User object. | 29 * The Current User object. |
33 /** | 35 /** |
34 * Constructs a NodeForm object. | 36 * Constructs a NodeForm object. |
35 * | 37 * |
36 * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager | 38 * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager |
37 * The entity manager. | 39 * The entity manager. |
38 * @param \Drupal\user\PrivateTempStoreFactory $temp_store_factory | 40 * @param \Drupal\Core\TempStore\PrivateTempStoreFactory $temp_store_factory |
39 * The factory for the temp store object. | 41 * The factory for the temp store object. |
40 * @param \Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info | 42 * @param \Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info |
41 * The entity type bundle service. | 43 * The entity type bundle service. |
42 * @param \Drupal\Component\Datetime\TimeInterface $time | 44 * @param \Drupal\Component\Datetime\TimeInterface $time |
43 * The time service. | 45 * The time service. |
54 * {@inheritdoc} | 56 * {@inheritdoc} |
55 */ | 57 */ |
56 public static function create(ContainerInterface $container) { | 58 public static function create(ContainerInterface $container) { |
57 return new static( | 59 return new static( |
58 $container->get('entity.manager'), | 60 $container->get('entity.manager'), |
59 $container->get('user.private_tempstore'), | 61 $container->get('tempstore.private'), |
60 $container->get('entity_type.bundle.info'), | 62 $container->get('entity_type.bundle.info'), |
61 $container->get('datetime.time'), | 63 $container->get('datetime.time'), |
62 $container->get('current_user') | 64 $container->get('current_user') |
63 ); | 65 ); |
64 } | 66 } |
140 '#title' => $this->t('Author'), | 142 '#title' => $this->t('Author'), |
141 '#markup' => $node->getOwner()->getUsername(), | 143 '#markup' => $node->getOwner()->getUsername(), |
142 '#wrapper_attributes' => ['class' => ['entity-meta__author']], | 144 '#wrapper_attributes' => ['class' => ['entity-meta__author']], |
143 ]; | 145 ]; |
144 | 146 |
145 $form['footer'] = [ | |
146 '#type' => 'container', | |
147 '#weight' => 99, | |
148 '#attributes' => [ | |
149 'class' => ['node-form-footer'] | |
150 ] | |
151 ]; | |
152 $form['status']['#group'] = 'footer'; | 147 $form['status']['#group'] = 'footer'; |
153 | 148 |
154 // Node author information for administrators. | 149 // Node author information for administrators. |
155 $form['author'] = [ | 150 $form['author'] = [ |
156 '#type' => 'details', | 151 '#type' => 'details', |