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 theme_suggestions_HOOK_alter(). | |
*/ | |
function mytheme_theme_suggestions_paragraph_alter(array &$suggestions, array $variables) { | |
if ($node = \Drupal::routeMatch()->getParameter('node')) { | |
$paragraph = $variables['elements']['#paragraph']; | |
array_push($suggestions, 'paragraph__' . $paragraph->getType() . '__' . $node->getType()); | |
} | |
} |
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 ($) { | |
Drupal.behaviors.mymodule_charts = { | |
attach:function () { | |
if (Drupal.settings.mymodule.charts) { | |
for (var chart in Drupal.settings.mymodule.charts) { | |
new Highcharts.Chart(Drupal.settings.mymodule.charts[chart]); | |
} | |
} | |
} | |
}; |
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 | |
/** | |
* @file | |
* Contains Drupal\akamai\Plugin\Purge\Purger\AkamaiPurger. | |
*/ | |
namespace Drupal\akamai\Plugin\Purge\Purger; | |
use Drupal\purge\Plugin\Purge\Purger\PurgerBase; | |
use Drupal\purge\Plugin\Purge\Purger\PurgerInterface; | |
use Drupal\Core\Config\ConfigFactoryInterface; | |
use Symfony\Component\DependencyInjection\ContainerInterface; |
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
$purgeQueue = \Drupal::service('purge.queue'); | |
$items = $purgeQueue->claim(); | |
$newitems = array(); | |
$uris = array(); | |
foreach($items as $item) { | |
if($item->getPluginId()==='url') { | |
$newitems[] = $item; | |
} | |
} |