This file contains 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 | |
/** | |
* Custom function to find an array key/value pair inside another array | |
*/ | |
function _array_search($array, $key, $value) { | |
$results = array(); | |
if (is_array($array)) { | |
if (isset($array[$key]) && $array[$key] == $value) { | |
$results[] = $array; | |
} |
This file contains 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 | |
//check if pg is node | |
if (arg(0) == 'node') { | |
$nid = arg(1); | |
//load current node | |
if ($nid) { | |
$node = node_load($nid); | |
if($node->type == 'blog') { |
This file contains 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_block_list_alter(). | |
*/ | |
function hook_block_list_alter(&$blocks) { | |
//dpm($blocks); | |
//check if pg is node | |
if (arg(0) == 'node') { | |
$nid = arg(1); |
This file contains 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 | |
/** | |
* Implementation of hook_node_update(). | |
*/ | |
function sas_health_custom_node_node_update($node) { | |
if ($node->type == 'department') { | |
//act on the unpublishing of a department. | |
if ($node->original->status == 1 && $node->status == 0) { | |
// | |
return $node; |