This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$node = (object) array( | |
'uid' => UID, | |
'name' => NAME, | |
'type' => TYPE, | |
'language' => LANGCODE, | |
); | |
$form_state['build_info']['args'] = array($node); | |
form_load_include($form_state, 'inc', 'node', 'node.pages'); | |
$output = drupal_build_form('TYPE_node_form', $form_state); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = YOUR NAME | |
email = YOUR EMAIL | |
[color] | |
ui = true | |
[color "branch"] | |
current = yellow reverse | |
local = yellow | |
remote = green |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_css_alter(). | |
* Force every CSS file on every_page in the same group, in order to have only one aggregated file, and reduce http requests. | |
*/ | |
function YOURTHEME_css_alter(&$css) { | |
foreach($css as $file => $info) { | |
if ($info['type'] == 'file') { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_js_alter(). | |
* Force every JS file on every_page in the same group, in order to have only one aggregated file, and reduce http requests. | |
*/ | |
function YOURTHEME_js_alter(&$js) { | |
foreach($js as $file => $info) { | |
if ($info['type'] == 'file') { | |
$js[$file]['every_page'] = TRUE; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Shell Aliases | |
*/ | |
$options['shell-aliases']['pull'] = '!git pull'; // We've all done it. | |
$options['shell-aliases']['pulldb'] = '!git pull && drush updatedb'; | |
$options['shell-aliases']['noncore'] = 'pm-list --no-core'; | |
$options['shell-aliases']['wipe'] = 'cache-clear all'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_views_ajax_data_alter() | |
*/ | |
function mymodule_views_ajax_data_alter(&$commands, $view) { | |
// Do not scroll when using views_load_more module | |
if ($view->query->pager->definition['handler'] == 'views_plugin_pager_load_more') { | |
foreach($commands as $k => $command) { | |
if ($command['command'] == 'viewsScrollTop') { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// For a view with user/%/foo path | |
// My module must have a weight greater than views (ex:11) | |
function mymodule_menu_alter(&$items){ | |
$items['user/%views_arg/foo']['access callback'] = 'mymodule_edit_access'; | |
$items['user/%views_arg/foo']['access arguments'] = array(1); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
drupal_add_library('system', 'ui.accordion'); | |
drupal_add_js('jQuery(document).ready(function(){ | |
jQuery("#wrapper").accordion({ | |
header: ".header", | |
autoHeight: false, | |
clearStyle: true, | |
collapsible: true | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#goz git bash | |
c_cyan=`tput setaf 6` | |
c_blue=`tput setaf 4` | |
c_red=`tput setaf 1` | |
c_green=`tput setaf 2` | |
c_sgr0=`tput sgr0` | |
parse_git_branch () |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function MYMODULE_drush_command() { | |
$items = array(); | |
$items['languages-domain'] = array( | |
'aliases' => array('lang-domain'), | |
'bootstrap' => DRUSH_BOOTSTRAP_DRUSH, // No bootstrap at all. | |
'options' => array( | |
'domain' => 'Specify domain (local, dev, prod)', |