Skip to content

Instantly share code, notes, and snippets.

@opi
opi / .gitignore
Last active December 16, 2015 19:40 — forked from jbudziak/.gitignore
# Ignore configuration files that may contain sensitive information.
sites/*/*settings*.php
# Ignore paths that contain generated content.
cache/
files/
sites/*/files
sites/*/private
# Server configuration files
<?php
/**
* Implements hook_drush_command().
*/
function custom_local_drush_command() {
$items['files-fix-permissions'] = array(
'description' => 'Fix file permissions',
'aliases' => array('ffp'),
);
@opi
opi / gist:4268945
Created December 12, 2012 15:57 — forked from GoZOo/gist:4268937
Drupal: Add class and attributes from custom blocks
/*
* Add class and attributes from custom blocks
*/
function phptemplate_preprocess_block(&$vars) {
if(isset($vars['block']->attributes)) {
if(isset($vars['block']->attributes['class'])) {
$vars['classes_array'] = array_merge($vars['classes_array'], $vars['block']->attributes['class']);
unset($vars['block']->attributes['class']);
}
if(!empty($vars['block']->attributes)) {