Results
03.08.2020
tasty_backend 8.x-1.0-beta3 ::
src/Plugin/Derivative/AddContentLocalActions.php
$this->derivatives['tasty_backend.node_add_' . $content_type->id()] = $base_plugin_definition;
$this->derivatives['tasty_backend.node_add_' . $content_type->id()]['title'] = 'Add ' . mb_strtolower($content_type->label());
$this->derivatives['tasty_backend.node_add_' . $content_type->id()]['route_name'] = 'node.add';
$this->derivatives['tasty_backend.node_add_' . $content_type->id()]['route_parameters']['node_type'] = $content_type->id();
$this->derivatives['tasty_backend.node_add_' . $content_type->id()]['appears_on'][] = 'view.tb_manage_content_' . $content_type->id() . '.page_1';
}
return $this->derivatives;
} 03.08.2020
tasty_backend 8.x-1.0-beta3 ::
tasty_backend.module
$links['tasty_backend.node.add.' . $type->id()] = [
'title' => $type->label(),
'route_name' => 'node.add',
'parent' => 'tasty_backend.add_content',
'menu_name' => 'tb-manage',
'route_parameters' => ['node_type' => $type->id()],
];
} 05.01.2019
templating 8.x-2.0 ::
templating.links.action.yml
templating.add_site:
route_name: 'node.add'
route_parameters:
node_type: 'templating'
title: 'Add Templating'
appears_on:
- view.templating.page_1 24.06.2024
toolbar_plus 1.0.x-dev ::
src/EventSubscriber/ShouldNotEditMode.php
private array $ignoredRoutes = [
'node.add',
'entity.node.edit_form',
];
public function __construct(
private readonly AdminContext $routerAdminContext,
private readonly RouteMatchInterface $routeMatch, 05.03.2020
total_control 8.x-2.0 ::
src/Plugin/Block/CreateContent.php
$links[] = Link::fromTextAndUrl($this->t('Add new@space',
['@space' => ' ']) . $object->get('name'),
new Url('node.add', [
'node_type' => $object->get('type'),
'options' => $options,
]))->toString();
}
}
} 01.06.2023
translations_pack 1.0.0-beta3 ::
src/TranslationsPackNodeHandler.php
protected function getOriginalAddRoute(RouteCollection $collection) {
return $collection->get('node.add');
}
protected function hasAddLink() {
return TRUE;
}
protected function getAddTasksConfig() {
return [
'route_name' => 'node.add',
'base_name' => 'node.add',
'parent' => 'base_route',
'parent_name' => 'node.add',
];
}
protected function singleTabPermission() {
return 'access node single';
} 25.06.2024
trinion_base 1.0.x-dev ::
src/Theme/TrinionBackendNegotiator.php
return TRUE;
}
elseif ($route_name == 'node.add') {
$bundle = $route_match->getParameter('node_type')->id();
if ($has_trinion_tp && in_array($bundle, \Drupal::service('trinion_tp.helper')->getProductBundles()))
return TRUE;
switch ($bundle) {
case 'contact':
case 'lead': 06.06.2024
trinion_crm 1.0.x-dev ::
trinion_crm.module
elseif ($route_name == 'node.add') {
$node_type = $route_match->getParameter('node_type');
if ($node_type && in_array($node_type->id(), ['sdelki', ])) {
$variables['#attached']['library'][] = 'trinion_crm/crm';
}
}
} 15.08.2024
trinion_mrp 1.0.x-dev ::
src/Plugin/Field/FieldWidget/StrokiMpsFieldWidget.php
public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
$route_match = \Drupal::routeMatch();
if ($route_match->getRouteName() == 'node.add' && $route_match->getParameter('node_type')->id() == 'mps') {
\Drupal::messenger()->addError(t('For start planning, save document'));
return [];
}
$node = $route_match->getParameter('node');
$period_count = $node->get('field_mrp_kolichestvo_periodov')->getString(); 15.08.2024
trinion_mrp 1.0.x-dev ::
trinion_mrp.module
elseif ($route_name == 'node.add') {
$node_type = $route_match->getParameter('node_type');
if ($node_type && in_array($node_type->id(), ['mps', ])) {
$variables['#attached']['library'][] = 'trinion_tp/tp';
}
}
} 26.06.2024
trinion_tp 1.0.x-dev ::
src/Form/PoluchenniyPlatezhSozdanieForm.php
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
$form_state->setRedirect('node.add', ['node_type' => 'poluchennyy_platezh'], ['query' => ['companiya' => $form_state->getValue('companiya')]]);
}
} 26.06.2024
trinion_tp 1.0.x-dev ::
src/Form/OtpravlenniyPlatezhSozdanieForm.php
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
$form_state->setRedirect('node.add', ['node_type' => 'otpravlennyy_platezh'], ['query' => ['companiya' => $form_state->getValue('companiya')]]);
}
} 26.06.2024
trinion_tp 1.0.x-dev ::
src/Controller/SozdanieTovara.php
'#type' => 'link',
'#title' => $type->label(),
'#url' => Url::fromRoute('node.add', ['node_type' => $type_id]),
];
}
}
return $content;
}
} 26.06.2024
trinion_tp 1.0.x-dev ::
trinion_tp.module
elseif ($route_name == 'node.add') {
$node_type = $route_match->getParameter('node_type');
if ($node_type && in_array($node_type->id(), ['kommercheskoe_predlozhenie', 'zakaz_klienta', 'zakaz_postavschiku', 'schet', 'schet_postavschika', 'otgruzka', 'postuplenie_tovarov', 'peremeshchenie_tovarov', 'trebovanie_nakladnaya', 'vypusk_produkcii', 'mrp_specifikaciya', 'tp_sales_plan', ])) {
$variables['#attached']['library'][] = 'trinion_tp/tp';
}
}
}
$bundle = $entity->bundle();
if ($bundle == 'schet') {
if ($route_name == 'node.add') {
$scheta = \Drupal::service('trinion_tp.helper')->schetaCompaniiDliaOplati(1, [], 'schet');
$neoplacheno = 0;
foreach ($scheta as $schet_id) {
if ($schet = \Drupal\node\Entity\Node::load($schet_id)) {
$summa = $schet->get('field_tp_itogo')->getString();
$oplachenaya_summa = $schet->get('field_tp_oplachennaya_summa')->getString();
$form['field_tp_tovar']['widget'][0]['target_id']['#default_value'] = $tovar;
}
if ($route_name == 'node.add') {
if (isset($form['field_tp_otvetstvennyy']))
$form['field_tp_otvetstvennyy']['widget'][0]['target_id']['#default_value'] = \Drupal\user\Entity\User::load(Drupal::currentUser()->id());
}
}
function trinion_tp_field_tp_tovar_harakterisitka_callback($form, \Drupal\Core\Form\FormState $form_state) { 26.06.2024
trinion_zadachnik 1.0.x-dev ::
src/Plugin/EntityReferenceSelection/TaskResponsibleByProjectSelection.php
public function getReferenceableEntities($match = NULL, $match_operator = 'CONTAINS', $limit = 0) {
$route_name = \Drupal::routeMatch()->getRouteName();
if ($route_name == 'node.add' && !empty($_COOKIE['proekt']) && is_numeric($_COOKIE['proekt']) && $_COOKIE['proekt'] != \Drupal::config('trinion_zadachnik.settings')->get('project_nerazobrannaya_tid')) {
$project_id = $_COOKIE['proekt'];
}
else {
if ($project_id = \Drupal::request()->get('field_tz_proekt')) ;
else {
$route_match = \Drupal::routeMatch(); 14.03.2021
type_tray 1.0.x-dev ::
src/Controller/TypeTrayController.php
$build['#items'][$category][$type->id()] = [
'#theme' => 'type_tray_teaser',
'#content_type_link' => Link::createFromRoute($type->label(), 'node.add', ['node_type' => $type->id()]),
'#thumbnail_url' => $this->fileUrlGenerator->generateString($thumbnail_url),
'#thumbnail_alt' => $this->t('Thumbnail of a @label content type.', [
'@label' => $type->label(),
]),
'#icon_url' => $this->fileUrlGenerator->generateString($icon_url),
'#icon_alt' => $this->t('Icon of a @label content type.', [ 03.08.2021
updated 1.x-dev ::
tests/src/Functional/EntityTest.php
$title = $this->randomString();
// When initially installed, a node's updated display will default to "off".
$this->drupalGet(Url::fromRoute('node.add', ['node_type' => 'test']));
$this->assertSession()->fieldValueEquals('display_updated[value]', '');
// User sets the display to "on".
$this->getSession()->getPage()->checkField('display_updated[value]');
$this->getSession()->getPage()->fillField('title[0][value]', $title);
$this->getSession()->getPage()->findButton('Save')->submit();
$node = $this->getNodeByTitle($title); 19.10.2020
varbase_total_control 9.0.0-alpha1 ::
src/Plugin/Block/VarbaseCreateContent.php
],
];
$url = new Url('node.add', ['node_type' => $object->get('type')], $options);
$url->setOptions($link_options);
$links[] = Link::fromTextAndUrl($object->get('name'),
$url);
}
}
} 23.04.2020
video_embed_field 8.x-2.4 ::
tests/src/Functional/WidgetTest.php
// Test an invalid input.
$this->drupalGet(Url::fromRoute('node.add', ['node_type' => $this->contentTypeName])->toString());
$this->submitForm([
'title[0][value]' => $node_title,
$this->fieldName . '[0][value]' => 'Some useless value.',
], 'Save');
$this->assertSession()->pageTextContains('Could not find a video provider to handle the given URL.'); 12.06.2020
video_embed_spotify 8.x-1.5 ::
tests/src/Functional/WidgetTest.php
// Test an invalid input.
$this->drupalGet(Url::fromRoute('node.add', ['node_type' => $this->contentTypeName])->toString());
$this->submitForm([
'title[0][value]' => $node_title,
$this->fieldName . '[0][value]' => 'Some useless value.',
], 'Save');
$this->assertSession()->pageTextContains('Could not find a video provider to handle the given URL.'); 