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
/** | |
* The following function will make BlockTube act in a whitelist-only mode. | |
* | |
* Any videos coming from channels other that those you have set in the | |
* "allowedChannels" variable will get hidden from display. | |
*/ | |
(video, objectType) => { | |
/* | |
* Add here the channel IDs you want to be displayed. | |
*/ |
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_process_page(). | |
*/ | |
function MYTHEME_process_page(&$variables) { | |
if (!empty($_GET['iframe'])) { | |
foreach (element_children($variables['page']) as $index) { | |
if ($index == 'content') { | |
continue; | |
} |
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 | |
/* | |
* The callback function to process the image. | |
* | |
* @param string $filepath | |
* The file to the path. | |
* @param string $color | |
* The HEX value of the color. | |
* @param string $bgcolor |
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
# | |
# Apache/PHP/Drupal settings: | |
# | |
# Protect files and directories from prying eyes. | |
<FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock))$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig\.save)$"> | |
<IfModule mod_authz_core.c> | |
Require all denied | |
</IfModule> | |
<IfModule !mod_authz_core.c> |
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($) { | |
// Initialize slick slider on elements having the .slick class. | |
var slider = $('.slick'); | |
slider.slick({ | |
// There is no reason for cloned divs to appear when infinite is set to false. | |
infinite: true | |
}); | |
slider.on('beforeChange', function(event, slick, currentSlide, targetSlide) { | |
var $targetSlide = $(slick.$slides[targetSlide]), |
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 the hierarchy of the first found instance of a key in an array. | |
*/ | |
function drupal_array_get_nested_key_parents($needle, $haystack, &$parents = array()) { | |
foreach ($haystack as $key => $value) { | |
if ((string) $key == (string) $needle) { | |
$parents[] = $key; | |
return TRUE; | |
} |
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($) { | |
/* | |
* Disable the Checkout Continue button when an AJAX request is pending but | |
* reenable it when all AJAX requests have ended. | |
*/ | |
Drupal.behaviors.commerceOverridesCheckoutContinueButton = { | |
attach: function (context, settings) { | |
var submitButton = $('body.page-checkout-checkout form[id^="commerce-checkout-form-checkout"] input.checkout-continue'); | |
if (submitButton.length) { | |
// Disable the submit button when an AJAX request starts. |
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 | |
* The following code is retrieved from a comment in drupal.org/forum with | |
* minor modifications, mostly in comments. | |
* | |
* @see https://www.drupal.org/forum/support/module-development-and-code-questions/2010-12-29/drupal-7-and-bootstrapinc-problem#comment-4327272 | |
*/ | |
$uid = 1; | |
// Prevent this from running under Apache. |
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 | |
/** | |
* Function to check existence of mPDF library. | |
* | |
* @return bool | |
* TRUE if mPDF library path exists and FALSE if it isn't. | |
*/ | |
function module_mpdf_exists() { | |
// Search for mpdf tool first. | |
$pattern = '/^mpdf.php$/'; |
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 | |
/** | |
* Render a block anywhere with its title. | |
* | |
* To render the block of the "ep_socialchannels" module with the | |
* "social_channels" delta, call this function, like this: | |
* @code | |
* THEME_render_block('ep_socialchannels', 'social_channels'); | |
* @encode | |
* |
NewerOlder