This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="ru"> | |
<head> | |
<title>Испытание: другой вариант главной</title> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href="style.css"> | |
</head> | |
<body> | |
<header class="page-header"> | |
<div class="logo"><img src="logo.svg" width="90" height="90" alt="Cat Energy"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (in_array($hook, ['input', 'form_element'])) { | |
if ( | |
isset($variables['element']['#name']) && | |
'ai_expertise' === $variables['element']['#name'] | |
) { | |
$suggestions[] = $hook . '__' . str_replace('-', '_', $variables['element']['#name']); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Returned list of team in current phase. | |
*/ | |
public function getView() { | |
$challenge_id = $this->challenge->id(); | |
return views_embed_view('registration_phase', 'block_1', $challenge_id); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_update_N(). | |
*/ | |
function pfbreakthrough_profile_update_8005() { | |
$database = \Drupal::database(); | |
if ($database->schema()->tableExists('user__field_color')) { | |
$database->truncate('user__field_color')->execute(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\internal_dashboard\Controller; | |
use Drupal\user\Entity\User; | |
/** | |
* The controller for SettingsController. | |
*/ | |
class SettingsController extends ManageChallengesController { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Returns a first letter of the last name of a User. | |
* | |
* @return string | |
* Last letter of the first name of a User. | |
*/ | |
public function getLastLetterFirstName(): string { | |
return (string) substr($this->get('field_last_name'), 0, 1); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* {@inheritdoc} | |
*/ | |
public function preSave(): void { | |
$this->entity->activate(); | |
if ($this->entity->isNew()) { | |
if ($this->entity->hasField('field_color')) { | |
$field_color = $this->entity->get('field_color'); | |
$allowed_values = $field_color->getFieldDefinition()->getSetting('allowed_values'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$nids = \Drupal::entityQuery('node')->condition('type','your_resources')->execute(); | |
$nodes = \Drupal\node\Entity\Node::loadMultiple($nids); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Get field_related_documents field. | |
* | |
* @return string |null | |
*/ | |
protected function getDocLink() { | |
$id = \Drupal::entityQuery('node') | |
->condition('type', 'your_resources') | |
->execute(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pfallabouth_theme_preprocess_node(array &$variables) { | |
if ($variables['node']->getType() === 'event') { | |
$node = \Drupal::routeMatch()->getParameter('node'); | |
$timezone = Drupal::currentUser()->getTimeZone(); | |
/* @var Drupal\Core\Datetime\DateFormatter $formatter */ | |
$formatter = \Drupal::service('date.formatter'); | |
$time_user = $formatter->format((int) strtotime($node->get('field_date')->getString()), 'custom', 'd M Y | H:i A', $timezone); | |
$variables['event_date_user'] = $time_user; | |
} | |
} |