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 | |
declare(strict_types = 1); | |
namespace Drupal\harlib_surprise_me\Controller; | |
use Drupal\Core\Controller\ControllerBase; | |
use Drupal\node\Entity\Node; | |
use Symfony\Component\HttpFoundation\JsonResponse; |
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 | |
declare(strict_types = 1); | |
namespace Drupal\harlib_surprise_me\Controller; | |
use Drupal\Core\Controller\ControllerBase; | |
use Drupal\node\Entity\Node; | |
use Symfony\Component\HttpFoundation\JsonResponse; |
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 | |
/** | |
* Class ResourceNotFoundController. | |
*/ | |
class ResourceNotFoundController extends ControllerBase { | |
/** | |
* Display the Resource Not Found message. | |
* |
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 | |
declare(strict_types = 1); | |
namespace Drupal\harlib_open_now\Controller; | |
use Drupal\Core\Controller\ControllerBase; | |
use Symfony\Component\HttpFoundation\JsonResponse; | |
use Symfony\Component\DependencyInjection\ContainerInterface; | |
use Drupal\Component\Serialization\Json; |
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\harlib_random_entity_display\Plugin\Field\FieldFormatter; | |
use Drupal\Core\Field\FieldItemListInterface; | |
use Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceEntityFormatter; | |
/** | |
* Plugin implementation of the 'random_entity_field_formatter' formatter. | |
* |
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 | |
declare(strict_types = 1); | |
namespace Drupal\harlib_restful_normalizer\Normalizer; | |
use Drupal\Core\Entity\EntityTypeManagerInterface; | |
use Drupal\Core\Url; | |
use Drupal\harlib_libcal_api\LibCalApi; | |
use Drupal\image\Entity\ImageStyle; |
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_preprocess_paragraph(). | |
*/ | |
function mytheme_preprocess_paragraph(&$variables) { | |
$paragraph = $variables['elements']['#paragraph']; | |
$bundle = $paragraph->getType(); | |
if ($bundle == 'fancy_links') { |
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_preprocess_field(). | |
*/ | |
function mytheme_preprocess_field(&$variables) { | |
if ($variables['element']['#entity_type'] == 'paragraph' && $variables['field_name'] == 'field_reference_link') { | |
foreach ($variables['items'] as $key => $item) { | |
$variables['items'][$key]['content']['#options']['attributes']['class'][] = 'hl__link-tag'; | |
} |
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
package main | |
import "fmt" | |
import "net/http" | |
import "io/ioutil" | |
import "time" | |
import "log" | |
func main() { | |
var url = "[redacted]/api/v1/room" |
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 | |
use Drupal\Core\Database\Database; | |
/** | |
* Implements hook_install(). | |
*/ | |
function mymodule_install() { | |
$connection = Database::getConnection('default'); |