DrupalBin
Submit Code
About
Recent Posts
Problemas com o submit
Fix for extranet
extranet
Fix for drush make snippet for apachesolr library
Fix for Embedding Google Maps, use object instead of iframe with XHTML Strict
Code
Serializable closures
Closures in menu item arguments
dpr($content['field_headshot'])
Fix for Git push error
more
User login
Log in using OpenID:
What is OpenID?
Username:
*
Password:
*
Log in using OpenID
Cancel OpenID login
Create new account
Request new password
Tags
CCK
drupal
fapi
jquery
menu
module
php
simpletest
taxonomy
test
theme
views
more tags
Home
›
Wim Leers
›
Recent Posts
Wim Leers
View
Posts
CDN integration: mixing static file servers and CDNs
June 19, 2009 - 8:32pm —
Wim Leers
function
driverpacksnet_map_country_to_server
(
$country_code
)
{
$countries_for_driverpacks_server
= continents_api_get_countries
(
'EU'
)
+
array
(
'RU'
)
;
if
(
in_array
(
$country_code
,
$countries_for_dr
cdn
Read more
Use pathauto to create an alias for url of a custom node tab
February 17, 2009 - 7:44pm —
Wim Leers
/**
* REMARK: make sure your nodeapi implementation is called
* AFTER pathauto's, to ensure that you'll be using the latest
* alias information. pathauto has weight 1, so your module
pathauto
Read more
_pathauto_build_alias_string() … or something like that?
February 17, 2009 - 7:39pm —
Wim Leers
// Replace the placeholders with the values provided by the module,
// and optionally lower-case the result
$alias
=
str_replace
(
$placeholders
[
'tokens'
]
,
$placeholders
[
'values'
]
,
$pattern
)
;
pathauto
Read more
Initial code for new HS implementation: hs_smallhierarchy (or has somebody got a better name?)
February 15, 2009 - 2:22pm —
Wim Leers
/**
* Automatically transform a given hierarchy with this format:
* array(
* 'win' => array(
* 'label' => 'Windows',
* 'children' => array(
hierarchical-select
Read more
AHAH in core: edge case
February 14, 2009 - 11:30am —
Wim Leers
// If the form is being rebuilt due to something else than a pressed button,
// e.g. a select that was changed, then $_POST['op'] will be empty. As a
ahah
Read more
Code
February 13, 2009 - 2:13pm —
Wim Leers
function
ahah_helper_render
(
$form_item_to_render
=
FALSE
)
{
$form_state
=
array
(
'storage'
=
>
NULL
,
'submitted'
=
>
FALSE
)
;
$form_build_id
=
$_POST
[
'form_build_id'
]
;
ahah
Read more
Code
November 30, 2008 - 8:21pm —
Wim Leers
/**
* Helper function to reconstruct the lineages given a set of selected items
* and the fact that the "save lineage" setting is enabled.
*
hierarchical-select
Read more
The Most Monstrous Function Ever
November 30, 2008 - 8:19pm —
Wim Leers
/**
* Hierarchical select form element type #process callback.
*/
function
hierarchical_select_process
(
$element
)
{
static
$hsid
;
if
(
!
isset
(
$hsid
)
)
{
$hsid
=
0
;
}
else
{
hierarchical-select
Read more
Code
November 21, 2008 - 3:47pm —
Wim Leers
First of all - the form you see on screen and the $form array stored in the cache should always be the same.
docs
Read more
IE sucks
September 18, 2008 - 11:36am —
Wim Leers
<
div
class
=
"hierarchical-select-wrapper"
>
<
div
class
=
"hierarchical-select"
>
<
div
class
=
"wrapper"
>
<
select
><
option
value
=
"bleh"
>
bleh
<
/
option
><
/
select
>
<
div
class
=
"grippie"
/
>
css
Read more
With inline comments this time!
September 18, 2008 - 8:20am —
Wim Leers
/**
* Definition of our hierarchy.
*/
function
hs_tutorial_hierarchy
(
)
{
static
$internal_hierarchy
;
// The user-visible hierarchy. Only defines labels. Has 3 levels.
hierarchical-select
Read more
Code
September 18, 2008 - 8:08am —
Wim Leers
/**
* Definition of our hierarchy.
*/
function
hs_tutorial_hierarchy
(
)
{
static
$internal_hierarchy
;
// The user-visible hierarchy. Only defines labels. Has 3 levels.
hierarchical-select
Read more
jQuery UI resizables
September 16, 2008 - 5:49am —
Wim Leers
$
(
'#hierarchical-select-'
+
hsid
+
'-wrapper .hierarchical-select'
)
// Make the selects of the hierarchical select resizable.
.
find
(
'select'
)
.
each
(
function
(
)
{
jquery ui resizables
Read more
Menu tasks
August 14, 2008 - 9:23am —
Wim Leers
// I want local tasks to appear… but it doesn't seem to be working very reliably!
// This works.
$items
[
'admin/subscriptions'
]
=
array
(
'title'
=
>
'Mollom subscriptions'
,
menu
Read more
Schema API weirdness
August 14, 2008 - 4:09am —
Wim Leers
'customer'
=
>
array
(
'type'
=
>
'int'
,
'size'
=
>
'tiny'
,
'unsigned'
=
>
TRUE
,
'not null'
=
>
TRUE
,
'default'
=
>
127
,
Read more
Code
July 30, 2008 - 11:08am —
Wim Leers
<?php
// In the form definition:
$default
=
$form_state
[
'storage'
]
[
'billing_info'
]
;
$form
[
'visible'
]
[
'step2'
]
[
'billing_info'
]
[
'new'
]
[
'usage'
]
=
array
(
Read more
Code
July 30, 2008 - 11:04am —
Wim Leers
<?php
function
poll_choice_js
(
)
{
$delta
=
count
(
$_POST
[
'choice'
]
)
;
// Build our new form element.
$form_element
=
_poll_choice_form
(
$delta
)
;
Read more
Adding submit handlers in D6
July 18, 2008 - 12:13pm —
Wim Leers
/**
* Implementation of hook_form_alter().
*/
function
hs_taxonomy_form_alter
(
&
$form
,
&
$form_state
,
$form_id
)
{
// Add per-vocabulary settings for Hierarchical Select.
fapi
Read more
Code
July 5, 2008 - 1:32pm —
Wim Leers
/**
* Render callback.
*/
function
theme_panels_tabs_style_render_panel
(
$display
,
$owner_id
,
$panes
,
$settings
)
{
$output
=
''
;
Read more
Panels caching drupal_add_js somehow… WTF?
July 4, 2008 - 1:26pm —
Wim Leers
This is part of a dump of $javascript in drupal_get_js() in common.inc. See #3 and #4.
[setting] => Array
(
[0] => Array
(
Read more
1
2
3
next ›
last »