Skip to content

Instantly share code, notes, and snippets.

View lifedraft's full-sized avatar

Stanislav lifedraft

View GitHub Profile
@lifedraft
lifedraft / gist:7351155
Created November 7, 2013 08:36
Using drupal's webform_token module to replace values of confirmation message. e.q: Congratulations, [webform:val-salutation]. [webform:val-last_name]
function hook_preprocess_webform_confirmation(&$vars) {
module_load_include('inc', 'webform', 'includes/webform.submissions');
$node = $vars['node'];
$webform = $node->webform;
$submission = webform_get_submission($node->nid, $vars["sid"]);
$confirmation = $node->webform['confirmation'];
$confirmation = token_replace($confirmation, array('webform' => $submission), array('webform_tokens'));
$vars['confirmation_message'] = $confirmation;
@lifedraft
lifedraft / gist:1019109
Created June 10, 2011 15:49
Alternative to adaptjs (http://adapt.960.gs/)
(function(w,d, ranges) {
var html = document.documentElement
window.onresize = function() {
var width = w.innerWidth || d.documentElement.clientWidth || d.body.clientWidth || 0;
for (var i=0; i < ranges.length; i++) {
if (ranges[i] < width) {
break;
};
@lifedraft
lifedraft / gist:964184
Created May 10, 2011 09:39
SQL Queries to find bad drupal data
We couldn’t find that file to show.