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 | |
// Array of content types. | |
$types = array('page', 'article'); | |
foreach ($types as $type) { | |
// Gather all the example content that might have been created while this | |
// module was enabled. Simple selects still use db_query(). | |
// api.drupal.org/api/function/db_query/7 | |
$sql = 'SELECT nid FROM {node} n WHERE n.type = :type'; | |
$result = db_query($sql, array(':type' => $type)); |
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 | |
// Create a variable to store the path to this module | |
define('MY_MODULE_PATH', drupal_get_path('module', 'pricing_calculator')); | |
/** | |
* Implements hook_theme_registry_alter(). | |
* | |
* Makes Drupal find our page template file. | |
* Found this at: http://drupal.org/node/715160 |
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
.parent-of-iframe { | |
float: left; | |
clear: left; | |
position: relative; | |
margin: 1.5em 0; | |
padding-bottom: 56.25%; /* 16/9 ratio */ | |
padding-top: 30px; /* IE6 workaround */ | |
width: 100%; | |
height: 0; | |
overflow: hidden; |
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_page_delivery_callback_alter(). | |
* | |
* The idea for this came from this page: | |
* http://drupal.stackexchange.com/questions/327/how-can-a-module-detect-when-drupal-is-outputting-the-access-denied-page | |
*/ | |
function custom_page_delivery_callback_alter(&$callback) { | |
if ($callback == 'drupal_deliver_html_page') { |
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 | |
/* Normally you would override theme function in your theme! However, if you want to | |
override something in the admin area where you are using an admin theme, you can do | |
the following */ | |
/** | |
* Implements hook_theme_registry_alter(). | |
*/ | |
function custom_theme_registry_alter(&$theme_registry) { | |
if (isset($theme_registry['file_link'])) { |
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_field_formatter_info(). | |
*/ | |
function custom_field_formatter_info() { | |
$formatters = array(); | |
$formatters['custom_event_time'] = array( | |
'label' => t('CUSTOM: Event Time'), | |
'description' => t('Displays this field normally if it has a value, if empty, it displays the time from field_event_date.'), | |
'field types' => array('text'), |