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
$conf['shortcut_max_slots'] = 10; |
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 | |
/** | |
* Creates an order for the given user containing the product with the given id. | |
* This example may be extended easily to create an order containing several | |
* products, a shipping and so far. | |
* | |
* Returns a commerce order that's now saved in the database with the status | |
* "processing and can be finished by an administrator in the UI. | |
* Throws an exception, if something is wrong. |
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
$(document).ready(function() { | |
$('.myClass').not('.slick-initialized').slick({ | |
vertical: true, | |
slidesToShow: 2, | |
slidesToScroll: 1, | |
verticalSwiping: true, | |
infinite: false, | |
}); | |
}); |
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 declOfNum(number, titles) { | |
cases = [2, 0, 1, 1, 1, 2]; | |
return titles[ (number%100>4 && number%100<20)? 2 : cases[(number%10<5)?number%10:5] ]; | |
} | |
declOfNum(count, ['отзыв', 'отзыва', 'отзывов']); |
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 mytheme_js_alter(&$js){ | |
unset($js['settings']); | |
} |
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
/** | |
* Get display node id for a commerce product. | |
* @param $product_id | |
* An integer value of the product id. | |
* @param string $product_field_name | |
* Name of the commerce_product_reference field used to reference products from display node. | |
* @return FALSE|node_id | |
* Returns FALSE if no results or display node id on success. | |
*/ | |
function MY_CUSTOM_MODULE_get_display_node_by_product_id($product_id, $product_field_name = 'product_reference') { |
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
<? | |
/** | |
* Impliment hook_menu(). | |
*/ | |
function myjspass_menu() { | |
$items = array(); | |
// Configuration Page | |
$items['admin/config/myjspass'] = array( |
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_views_pre_execute(). | |
* | |
* Rewrite SQL query to prevent duplicates based on NID | |
*/ | |
function my_module_views_pre_execute(&$view) { | |
if ($view->name == '') { | |
$query = $view->build_info['query']; | |
$count_query = $view->build_info['count_query']; | |
$query->groupBy('nid'); |
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 themename_preprocess_field(&$variables, $hook) { | |
$element = &$variables['element']; | |
if ($element['#entity_type'] == 'NAME'){ | |
foreach ($variables['items'] as $key => $val) { | |
$output = $val['#markup']; | |
$delta = str_replace('src', 'data-src', $output); | |
}; | |
$variables['items'] = array( |