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 | |
$field = field_info_field(OG_GROUP_FIELD); | |
$table_name = _field_sql_storage_tablename($field); | |
$revision_name = _field_sql_storage_revision_tablename($field); | |
db_insert($table_name); |
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
$dummy_form_state = $form_state; | |
if (empty($form_state['rebuild'])) { | |
// Form is "fresh" (i.e. not call from field_add_more_submit()), so | |
// re-set the items-count, to show the correct amount for the mocked | |
// instance. | |
$dummy_form_state['field'][$field_name][LANGUAGE_NONE]['items_count'] = !empty($dummy_entity->{$field_name}[LANGUAGE_NONE]) ? count($dummy_entity->{$field_name}[LANGUAGE_NONE]) : 0; | |
} |
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
foreach (field_info_instances('node', 'post') as $field_name => $instance) { | |
if (empty($instance['settings']['jekyll_map'])) { | |
continue; | |
} | |
// The Jekyll variable name. | |
$jekyll = $instance['settings']['jekyll_map']; | |
$field = field_info_field($field_name); | |
switch ($field['type']) { |
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
# Create an application in github https://github.com/settings/applications/new | |
# And add it to your install.sh | |
# Set github connect | |
drush vset github_connect_client_id "XXX" | |
drush vset github_connect_client_secret "XXX" |
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
angular.module("appName") | |
.factory("productService", function() { | |
var cache = $cacheFactory("productService"); | |
return { | |
gettingProducts: function(id){ | |
var defer = $q.defer(); | |
var product = store.get(id); | |
if (!product){ |
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
--- | |
title: Black | |
field_product_color_image: | |
- /products/galina/black/images/black.jpg | |
entity_id: 'commerce_product:1' | |
field_product: | |
- 'commerce_product:1' | |
- 'commerce_product:2' | |
layout: product_page | |
field_images: |
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 | |
$style_name = 'bibtex'; | |
ctools_include('plugins'); | |
$plugin = biblio_get_biblio_style($style_name); | |
$class = ctools_plugin_load_class('biblio', 'biblio_style', $style_name, 'class'); | |
$biblio_style = new $class($plugin); | |
$data = ' |
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
Drupal.Nodejs.socket.on('message', function(data) { | |
console.log(data); | |
}); |
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 | |
/** | |
* Gets the path of system-appropriate temporary directory. | |
*/ | |
function file_directory_temp() { | |
$temporary_directory = variable_get('file_temporary_path', NULL); | |
if (empty($temporary_directory)) { | |
$directories = 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
<?php | |
$this | |
->addFieldMapping('field_category', 'field_category') | |
->separator('|') | |
->arguments(array('create_term' => TRUE)); |