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 | |
// Get download uri of actual file. | |
$uri = file_entity_download_uri($file); | |
// We need query-params for download-token here. | |
$dl_link = l(t('Download'), $uri['path'], array('query' => $uri['options']['query'])); | |
print $dl_link; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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_leaflet_views_alter_points_data_alter(). | |
*/ | |
function fewo_map_leaflet_views_alter_points_data_alter($result, &$points) { | |
// Get node object of result. | |
$wrapped_node = entity_metadata_wrapper('node', $result->nid); | |
// Check if we have a category attached to node. | |
$category = $wrapped_node->field_sight_category->value(); | |
if (!empty($category)) { |
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 | |
$query = db_select("og_membership", "ogm"); | |
$query->fields("ogm", array('etid')); | |
$query->condition("ogm.gid", $og_context['gid']); | |
$query->condition("ogm.entity_type", 'user'); | |
$result = $query->execute(); | |
$og_member_count = $result->rowCount(); | |
?> |
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
/* Smartphones (portrait and landscape) ----------- */ | |
@media only screen | |
and (min-device-width : 320px) | |
and (max-device-width : 480px) { | |
/* Styles */ | |
} | |
/* Smartphones (landscape) ----------- */ | |
@media only screen | |
and (min-width : 321px) { |
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
(function($) { | |
Drupal.behaviors.date_popup_custom = {}; | |
Drupal.behaviors.date_popup_custom.attach = function(context, settings) { | |
// Add departure date same as arrival date | |
$('.form-item-d-departure-date').find('input').click(function() { | |
var arrival_date = $('.form-item-d-arrival-date').find('input').val(); | |
$('.form-item-d-departure-date').find('input').datepicker( "setDate" , arrival_date ); | |
}); | |
}; |
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 | |
function mymodule_views_pre_execute(&$view) { | |
switch ($view->name) { | |
case 'my_view_name': | |
dpq($view->build_info['query']); | |
break; | |
} | |
} | |
?> |
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
// Set zoom for leaflet map on specific pages. | |
$(document).bind('leaflet.map', function(e, map, lMap) { | |
// Zoom out map on specific node pages. | |
if ($('body').hasClass('node-type-YOURNODETYPE')) { | |
lMap.setZoom(10); | |
} | |
}); |
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 | |
/** | |
* Override variables used in views template for fields. | |
* | |
* @see views-view-fields.tpl.php | |
*/ | |
function theme_preprocess_views_view_fields(&$vars) { | |
// Until http://drupal.org/node/939462 lands for Drupal 7 we need to specify | |
// the specific preprocess functions ourself. | |
$preprocess_names = 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 | |
if (function_exists('node_export_import')) { | |
$path = '.' . base_path() . drupal_get_path('module', 'my_module'); | |
$my_node = file_get_contents($path . '/my_module_exported.drupal'); | |
node_export_import($my_node); | |
} | |
?> |