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 | |
/** | |
* @file | |
* Drush module to check if all translatable strings are safe to translate. | |
*/ | |
/** | |
* Implements hook_drush_help(). | |
*/ | |
function i18n_check_drush_help($section) { |
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
$build = field_view_field('user', $context['entity'], 'field_picture', array( | |
'label' => 'hidden', | |
'type' => 'colorbox', | |
'settings' => array( | |
'colorbox_node_style' => 'user_large', | |
'colorbox_image_style' => 'colorbox', | |
), | |
)); |
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
'settings' => array( | |
'handler' => 'og', | |
'handler_settings' => array( | |
'behaviors' => array( | |
'og_behavior' => array( | |
'status' => TRUE, | |
), | |
'views-select-list' => array( | |
'status' => 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 | |
/** | |
* Get all users of a group who contributed. | |
*/ | |
function _events_resource_get_users_in_group($gid) { | |
$query = db_select('og_membership', 'ogm'); | |
$query->join('node', 'n', "n.nid = ogm.etid AND ogm.entity_type = 'node'"); | |
$query->join('user', 'u', 'n.uid = u.uid'); | |
$query->fields('n', array('uid')) |
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
function entity_access($op, $entity_type, $entity = NULL, $account = NULL) { | |
if (($info = entity_get_info()) && isset($info[$entity_type]['access callback'])) { | |
return $info[$entity_type]['access callback']($op, $entity, $account, $entity_type); | |
} | |
} |
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
/** | |
* View a tracking item. | |
*/ | |
function ise_tracking_item_view($tracking_item) { | |
$semaphore = &drupal_static(__FUNCTION__, FALSE); | |
if (empty($semaphore)) { | |
$semaphore = TRUE; | |
return entity_view('tracking_item', array($tracking_item)); | |
} | |
} |
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_mail_alter(). | |
* | |
* Add the wanted attachment to submission email. | |
* | |
* @param Array $message | |
*/ | |
function MODULE_mail_alter(&$message) { |
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
[alias] | |
a = add | |
aa = add -A | |
ac = "!f() { curl $@ | git apply --index; }; f" | |
ac3 = "!f() { curl $@ | git apply -3 --index; }; f" | |
amend = commit --amend -C HEAD | |
ap = add -p | |
app = apply --index | |
br = branch | |
cb = checkout -b |
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 | |
/** | |
* @file | |
* Code for the Feature Content Timelines feature. | |
*/ | |
/** | |
* Implements hook_install(). | |
*/ | |
function feature_content_timelines_install() { |
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_default_rules_configuration(). | |
*/ | |
function MYMODULE_default_rules_configuration() { | |
$rules = array(); | |
// Custom rule : calculate the weight of a line item | |
$rule = rule($variables, $provides); |