Skip to content

Instantly share code, notes, and snippets.

View kasperg's full-sized avatar

Kasper Garnæs kasperg

View GitHub Profile
<?php
// $Id$
/**
* @file
* template includes + preprocess
*/
// Auto-rebuild the theme registry during theme development.
if (theme_get_setting('mothership_rebuild_registry')) {
drupal_rebuild_theme_registry();
$date = date_make_date($value[$v], $value['timezone_db']);
if ($date) {
date_timezone_set($date, timezone_open($value['timezone']));
//If the time is not midnight (0:00) when use medium format containing hours and minutes
$format = (intval(date_format_date($date, 'custom', 'Gi')) > 0) ? 'medium' : 'small';
$date_values[] = date_format_date($date, $format);
}
<script type="text/javascript">
//<![CDATA[
var _tag=new WebTrends();
_tag.fpcdom = ".billundbib.dk"; //<-- Hostnavn for det enkelte biblioteksite
_tag.dcsid = "dcst7m99iu3uwyezcx7vn3ajc_2z5j"; //<-- Trackingkode for det enkelte bibliotek
_tag.dcsGetId();
//]]>
</script>
<script type="text/javascript">
//<![CDATA[
function mymodule_form_alter(&$form, &$form_state, $form_id) {
if (strpos($form_id, 'webform_client_form') === 0) {
//Do stuff
}
}
@kasperg
kasperg / gist:1892739
Created February 23, 2012 13:14
D6 vid & tid handling
<?php
/**
* Configuration for the mealplan specific vocabularies
*/
function fdb_platform_mealplan_vocabularies() {
// Configuration for the mealplan specific vocabularies
$vocabularies = array();
$vocabularies['meal_type'] = array('name' => t('Måltidstype'),
@kasperg
kasperg / gist:1901270
Created February 24, 2012 14:34
Drupal menu nolink function
<?php
/**
* @file modulename.module
*/
/**
* Implements hook_menu()
*/
function modulename_menu() {
// Special item to use as path for menu items that shouldn't link.
@kasperg
kasperg / gist:2413373
Created April 18, 2012 12:47
Drupal CTools Modal sizing
(function($) {
/**
* For this approach to work we need our click handler to trigger before
* the CTools modal handler. This is currently handled by setting the weight
* when including this file.
*/
Drupal.behaviors.setCtoolsModalSize = {
attach: function(context, settings) {
$('a.ctools-use-modal').once('modal-size', function() {
$(this).click(function() {
{
"name": "wsdl2phpgenerator/wsdl2phpgenerator-test",
"description": "Composer test for Wsdl2PhpGenerator",
"minimum-stability": "stable",
"authors": [
{
"name": "Kasper Garnæs",
"email": "kasper.garnaes@gmail.com"
}
],
@kasperg
kasperg / ProjectItem.php
Created July 24, 2014 17:15
wsdl2phpgenerator base type generation demo
<?php
class ProjectTypeItem
{
/**
*
* @var string $project
* @access public
*/
@kasperg
kasperg / NAICSList.php
Created November 11, 2014 20:12
wsdl2phpgenerator-arrayof-types
<?php
class NAICSList
{
/**
*
* @var int $Records
*/
protected $Records = null;