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
<script type="<hash>-text/javascript">window.smartlook||(function(d) {var o=smartlook=function(){ o.api.push(arguments)},h=d.getElementsByTagName('head')[0];var c=d.createElement('script');o.api=new Array();c.async=true;c.type='text/javascript';c.charset='utf-8';c.src='//rec.smartlook.com/recorder.js';h.appendChild(c);})(document);smartlook('init', '<key goes here>');</script> |
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 | |
$email = '<email>'; | |
$query = \Drupal::service('database')->select('users_field_data', 'users'); | |
$query->join('oneall_social_login_authmap', 'map', 'users.uid=map.uid'); | |
$query->join('oneall_social_login_identities', 'identity', 'identity.aid=map.aid'); | |
$query->addField('identity', 'provider_name', 'provider_name'); | |
$query->condition('users.mail', $email); | |
$result = $query->execute()->fetchAll(); | |
array_walk($result, 'print_r'); |
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\Field\BaseFieldDefinition; | |
$definition_manager = \Drupal::entityDefinitionUpdateManager(); | |
$field_storage_definition = $definition_manager->getFieldStorageDefinition('alternate_payment', 'spending_request'); | |
// IF THIS IS UPDATING AN EXISTING FIELD | |
// $definition_manager->uninstallFieldStorageDefinition($field_storage_definition); | |
$new_field = BaseFieldDefinition::create('integer') | |
->setLabel(t('Alternate Payment')) | |
->setDescription(t('Track spending requests that do not have internal payments.')) | |
->setDisplayOptions('view', [ |
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
public function buildVariationForm(array &$form, FormStateInterface $form_state, $product_variation) { | |
$delta_key = 'section-delta-'. $product_variation->id(); | |
$session_delta = $form_state->get($delta_key); | |
if (empty($session_delta)) { | |
$session_delta = 1; | |
$form_state->set($delta_key, 1); | |
} | |
$element = []; | |
$id = 'wrapper-' . $product_variation->id(); | |
$element['section_container'] = [ |
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
$nodes = node_load_multiple(array(), array('type' => 'trail')); | |
$watermark = 0; | |
$limit = 1000; | |
$offset = 0; | |
foreach($nodes AS $node) { | |
if ($watermark + $offset < $limit + $offset ) { | |
$trail = omf_trails_get_trail($node); | |
omf_trails_save_trail($node, $trail); | |
} | |
$watermark ++; |
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
$nodes = node_load_multiple(array(), array('type' => 'trail')); | |
foreach($nodes AS $node) { | |
if (empty($node->field_trail_type[LANGUAGE_NONE])) { | |
$node->field_trail_type[LANGUAGE_NONE][0]['tid']= 135; | |
node_save($node); | |
} | |
} |
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(ajax) { | |
'use strict'; | |
const ON_TEXT = 'On'; | |
const OFF_TEXT = 'Off'; | |
const LOADING_TEXT = 'loading'; | |
const RESOURCE_URL = '/ze-api'; | |
class Toggle { | |
constructor(wrapper) { | |
this.handleToggle = this.handleToggle.bind(this); | |
this.handleSuccess = this.handleSuccess.bind(this); |
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
AddType application/x-httpd-php55 .php | |
# | |
# Apache/PHP/Drupal settings: | |
# | |
# Protect files and directories from prying eyes. | |
<FilesMatch "\.(engine|inc|install|make|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock))$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$"> | |
<IfModule mod_authz_core.c> | |
Require all denied | |
</IfModule> |
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, window, document, undefined) { | |
// Establish namespaces | |
Drupal.trails = Drupal.trails || {}; | |
Drupal.trails.Views = Drupal.trails.Views || {}; | |
// Establish global pubsub | |
Backbone.pubSub = Backbone.pubSub || _.extend({}, Backbone.Events); | |
// Map config specific vars | |
var styles = [ | |
{ | |
featureType: "poi", |
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 | |
function foop($class_date_nid, $webform_nid) { | |
$sub_query = db_select('webform_submitted_data', 'w'); | |
$sub_query->fields('w', array('sid')); | |
$sub_query->join('webform_component', 'webform_component', 'w.cid=webform_component.cid'); | |
$sub_query->condition('form_key', 'ssl_date_nid', '='); | |
$sub_query->condition('webform_component.nid', $webform_nid, '='); | |
$sub_query->condition('data', $class_date_nid, '='); | |
$query = db_select('webform_submitted_data', 'w'); |
NewerOlder