This file contains hidden or 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 | |
// Include the autoload that includes our packages. | |
require_once 'vender/autoload.php'; | |
// Test the debugging tool! | |
r('hallow testing'); | |
// Keep track of count. | |
$i = 0; |
This file contains hidden or 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 ($) { | |
Drupal.behaviors.collapsibleTable = { | |
attach: function(settings, content) { | |
$('tr.collapsitablesection').toggle( | |
function() { | |
$(this).nextUntil('tr.collapsitablesection').hide(); | |
}, | |
function() { | |
$(this).nextUntil('tr.collapsitablesection').show(); | |
} |
This file contains hidden or 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 | |
if (isset($data['table']['base']['defaults']['field'])) { | |
$default_field = $data['table']['base']['defaults']['field']; | |
} | |
else { | |
foreach ($data as $default_field => $field_data) { | |
if (isset($field_data['field']['id'])) { | |
break; | |
} | |
} |
This file contains hidden or 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
custom.event.view: | |
path: '/admin/structure/custom/{custom}/manage/{custom_event}' | |
defaults: | |
_content: '\Drupal\custom\Controller\CustomEventController::page' | |
_title_callback: '\Drupal\custom\Controller\CustomEventController::pageTitle' | |
requirements: | |
_permission: 'administer custom' | |
custom.event.edit: | |
path: '/admin/structure/custom/{custom}/manage/{custom_event}/edit' | |
defaults: |
This file contains hidden or 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 | |
// DatabaseStorateController::save() | |
public function save(EntityInterface $entity) { | |
$transaction = $this->database->startTransaction(); | |
try { | |
// Load the stored entity, if any. | |
if (!$entity->isNew() && !isset($entity->original)) { | |
$entity->original = entity_load_unchanged($this->entityType, $entity->id()); | |
} |