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 | |
class UntoldDrupalValetDriver extends DrupalValetDriver { | |
private function documentRoot($sitePath) { | |
return $sitePath . '/drupal'; | |
} | |
public function serves($sitePath, $siteName, $uri) { | |
return parent::serves($this->documentRoot($sitePath), $siteName, $uri); | |
} |
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
/** | |
* Hijack IMCE Profile Loading to add a check for directory access coming from | |
* a field on the access vocabulary term. | |
* | |
* @param $imce | |
* @param $user | |
*/ | |
function custom_workbench_imce_alter_profiles(&$imce, $user) { | |
// Find access rules/terms for current user. | |
$access_tree = workbench_access_get_user_tree($user); |
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
/** | |
* Retroactively bulk assigns all existing nodes w/ taxonomy terms | |
* to their respective workbench_access sections. | |
*/ | |
function custom_workbench_retroactive_assign_all() { | |
$active = workbench_access_get_active_tree(); | |
if (!$active) { | |
return; | |
} | |
$tree = $active['tree']; |
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
/** | |
* Implements hook_pathauto_pattern_alter(). | |
* Hack up blog paths to use custom variable assignment. | |
* | |
* @param $pattern | |
* @param array $context | |
*/ | |
function custom_pathauto_pattern_alter(&$pattern, array $context) { | |
switch ($context['op']) { | |
case 'update': |
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_form_alter(). | |
* | |
* Adds validation to Booking node forms. | |
*/ | |
function custom_form_alter(&$form, &$form_state, $form_id) { | |
if ($form_id == 'booking_node_form') { | |
$form['#validate'][] = 'custom_booking_validate'; |
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 | |
/** | |
* Example: get all terms attached to a given taxonomy term. | |
* | |
* Can be done with any entity. | |
*/ | |
function custom_example($term) { | |
$related_term_links = array(); | |
$related_tids = _get_entity_terms('taxonomy_term', $term->vocabulary_machine_name, $term); |
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 | |
/** | |
* Returns a single "Last Updated" date. | |
* | |
* $types -- an array of content type machine names. Defaults to 'page'. | |
*/ | |
function custom_last_updated($types = array('page')) { | |
$query = db_select('node', 'n'); |
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
config.allowedContent = true; | |
config.extraAllowedContent = 'iframe[*]'; |
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 | |
$alias = explode('/', drupal_get_path_alias(current_path())); |
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_entity_info_alter(). | |
*/ | |
function custom_entity_info_alter(&$entity_info) { | |
$entity_info['taxonomy_term']['uri callback'] = 'custom_taxonomy_term_uri'; | |
} | |
/** |
NewerOlder