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
›
chx
›
Recent Posts
chx
View
Posts
theme drupal alter
September 30, 2009 - 1:56am —
chx
=== modified
file
'includes/common.inc'
--- includes
/
common.inc 2009-09-25 15:20:12 +0000
+++ includes
/
common.inc 2009-09-30 05:55:35 +0000
@@
-3989,6 +3989,7
@@
function
drupal_system_listing
(
$mas
Read more
Code
August 3, 2009 - 10:41pm —
chx
// Version compare treats 'x' as lower than '0'. So <2.x is
// handled properly as 2.0-anything is higher than 2.x.
Read more
dd
August 3, 2009 - 5:02pm —
chx
function
dd
(
$data
,
$label
=
NULL
,
$print_r
=
FALSE
)
{
// Print $data contents to string.
$string
=
(
$print_r
?
print_r
(
$data
,
TRUE
)
:
var_export
(
$data
,
TRUE
)
)
.
Read more
dependency on version
July 25, 2009 - 12:49am —
chx
function
_module_build_dependencies
(
$files
)
{
require_once
DRUPAL_ROOT .
Read more
Code
July 12, 2009 - 9:09pm —
chx
foreach
(
array
(
'module'
,
'theme'
)
as
$type
)
{
if
(
$dir
=
drupal_get_path
(
$type
,
$name
)
)
{
return
array
(
'type'
=
>
constant
(
"UPDATE_EXTENSION_TYPE_$type"
)
,
'location'
=
>
$dir
)
;
}
}
return
F
Read more
more fapi half oop code
June 15, 2009 - 10:09pm —
chx
<?php
class
drupalFormElement implements ArrayAccess, IteratorAggregate
{
protected
$storage
=
array
(
)
;
protected
$input
=
TRUE
;
function
getIterator
(
)
{
return
new
ArrayIterator
(
Read more
Code
June 14, 2009 - 7:27pm —
chx
<?php
function
_element_children_replace
(
$matches
)
{
$element
=
$matches
[
1
]
;
$key
=
$matches
[
2
]
;
return
'foreach ('
.
$element
.
' as $element_child) '
.
str_replace
(
$element
.
'['
.
Read more
New menu local tasks code with examples
June 14, 2009 - 4:43pm —
chx
function
menu_local_tasks
(
$return_level
)
{
static
$output
;
if
(
!
isset
(
$output
)
)
{
$output
=
array
(
)
;
$tasks
=
array
(
)
;
$item
=
menu_get_item
(
)
;
// Collect local tasks.
$
Read more
Fix for Code
June 14, 2009 - 4:17pm —
chx
/**
* Redirects comment links to the correct page depending on comment settings.
*/
function
comment_
(
)
{
$node
= menu_get_object
(
)
;
$comment
= menu_get_object
(
'comment'
, 3
)
;
if
(
$node
&
Read more
new menu local tasks code
June 13, 2009 - 11:05pm —
chx
function
menu_local_tasks
(
$return_level
)
{
static
$output
;
if
(
!
isset
(
$output
)
)
{
$tasks
=
array
(
)
;
$links
=
array
(
)
;
$output
=
array
(
)
;
$item
=
menu_get_item
(
)
;
$defaul
Read more
Half OOP FAPI: no methods
June 13, 2009 - 1:18pm —
chx
<?php
class
DrupalInputElement
extends
ArrayObject
{
/**
* This elements accepts user input.
*/
protected
$input
=
TRUE
;
public
$default_value
;
function
__construct
(
$args
)
{
Read more
New menu local tasks code
June 13, 2009 - 1:23am —
chx
function
menu_local_tasks
(
$return_level
)
{
static
$output
;
if
(
!
isset
(
$output
)
)
{
$tasks
=
array
(
)
;
$links
=
array
(
)
;
$output
=
array
(
)
;
$item
=
menu_get_item
(
)
;
$defaul
Read more
Code
June 9, 2009 - 1:44am —
chx
function
update_untar
(
$untar_methods
,
$file
,
$directory
)
{
if
(
substr
(
$directory
,0,1
)
!
= DIRECTORY_SEPARATOR
)
{
$directory
= DIRECTORY_SEPARATOR .
Read more
Code
June 9, 2009 - 1:34am —
chx
if
(
substr
(
$directory
,0,1
)
!
= DIRECTORY_SEPARATOR
)
{
$directory
= DIRECTORY_SEPARATOR .
$directory
;
}
$directory
=
file_directory_temp
(
)
.
'/update-extraction'
.
Read more
Code
June 9, 2009 - 12:44am —
chx
function
__get
(
$name
)
{
static
$connection
;
if
(
$name
==
'connection'
)
{
if
(
empty
(
$connection
)
)
{
$connection
=
$this
-
>
connect
(
)
;
}
return
$connection
;
Read more
Code
June 7, 2009 - 2:44am —
chx
public
function
condition
(
$field
,
$value
=
NULL
,
$operator
=
NULL
)
{
$this
-
>
where
-
>
condition
(
$field
,
$value
,
$operator
)
;
return
$this
;
}
Fix for removing INs patch with debug YesCT
June 7, 2009 - 2:12am —
chx
if
(
!
isset
(
$data
)
)
{
// Build and run the query, and build the tree.
if
(
$item
[
'access'
]
)
{
Read more
Code
June 21, 2008 - 11:27am —
chx
=== modified
file
'includes/database.inc'
--- includes
/
database.inc
2008
-04-
20
18
:
23
:
21
+0000
+++ includes
/
database.inc
2008
-06-
19
07:02:
46
+0000
Read more