


/**
* Encode the field and return the encoded value.
*/
function feeds_tamper_utf8_encode_callback($result, $item_key, $element_key, &$field, $settings, $source) {
// $field = utf8_encode($field);
$field = iconv(null, 'utf-8', $field);
}
/**
* Encode the field and return the encoded value.
*/
function feeds_tamper_utf8_encode_callback($result, $item_key, $element_key, &$field, $settings, $source) {
// $field = utf8_encode($field);
$field = iconv(null, 'utf-8', $field);
}
| 添付 | サイズ |
|---|---|
| feeds_tamper_utf_8_encode.zip (11.18 KB) | 11.18 KB |


| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |
/**
* Implements hook_feeds_processor_targets_alter().
*/
function my_module_feeds_feeds_processor_targets_alter(array &$targets, $entity_type, $bundle)
{
if( $entity_type=="node"&&$bundle=="chinese_word"){
$field_info = field_info_instances("node", "chinese_word") ;
if( array_key_exists('field_ch_word_sentences', $field_info ) &&
field_info_field( 'field_ch_word_sentences' )['type'] == "entityreference" ){
$targets["field_ch_word_sentences:drills_hander"] = array(
'name' => check_plain( $field_info['field_ch_word_sentences']['label'] ).t(' (Import multiple value instance field)'),
'callback' => 'drills_custom_feeds_set_target_entity_reference',
'description' => t('This filed for converting Chinese Examples to word reference only.Do not use it for other fields!!'),
);
}
}
}
function drills_custom_feeds_set_target_entity_reference($source, &$entity, $target, $value, $mapping){
if (empty($value)) {
return;
}
$target = str_replace(':drills_hander', '', $target);
$query = db_query("select title, nid, CHAR_LENGTH(title) as char_num from node where title like '%".$value[0]."%' and type='example_sentences' order by char_num limit 100");
$sentences = $query->fetchAll();
$field = array();
foreach( $sentences as $i => $sentence ){
$field[LANGUAGE_NONE][$i]['target_id'] = $sentence->nid;
}
$entity->{$target} = $field;
}
INSERT INTO new_table (title, body, CUSTOM_FIELD_NAME, ・・・・・・) SELECT title, body.body_value, T1.field_data_CUSTOM_FIEDL_NAME_value, ・・・・・・ FROM node left join field_data_body body on nid = body.entity_id left join field_data_CUSTOM_FIELD_NAME T1 on T1.entity_id = nid ・・・・・・

| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |

| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |


| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |


| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |


| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |


| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |


| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |


| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |


| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |


| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |


| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |


| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |


| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |


| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |


| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |


| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |


| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |


| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |


| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |


| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |


| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |


| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |

| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |

| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |

| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |

| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |

| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |

| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |

| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |

| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |

| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |

| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |

| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |

| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |

| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |

| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |

| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |

| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |

| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |

| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |

| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |

| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |
<?php
global $language ;
if ($path = variable_get('languageicons_path', drupal_get_path('module', 'languageicons') . '/flags/*.png')) {
$title = $language->name;
// Build up $image for theme_image() consumption.
$image = array(
'path' => str_replace('*', $language->language, check_plain($path)),
'alt' => $title,
'title' => $title,
'attributes' => array(
'class' => array('language-icon'),
),
);
if ($size = check_plain(variable_get('languageicons_size', '16x12'))) {
list($width, $height) = explode('x', $size);
$image += array('width' => $width, 'height' => $height);
}
print "<a href='#' class='has-anchor-link ripple'>".theme('image', $image)."</a><div class='no-anchor-link'>".theme('image', $image)."<span class='language-title'>".$language->native."</span></div>";
}
?>
<style>
.flag-well {
background-color: #f5f5f5;
border: 1px solid #e3e3e3;
border-radius: 4px;
}
#block-locale-language {
position: absolute;
right: -25px;
top: 35px;
padding: 5px 0;
visibility: hidden;
}
#block-locale-language ul {
padding: 0;
margin: 0 0 0 1em;
width: 100px;
}
#block-locale-language ul li {
list-style: none;
display: inline-block;
}
#block-locale-language ul li a{
color: black;
}
#block-locale-language.opened {
visibility: visible;
}
#block-locale-language.closed {
visibility: visible;
}
#language-setting-block .no-anchor-link {
display: none;
}
#language-setting-block img {
width: 25px;
margin-right: 10px;
opacity: 0.5;
filter: alpha(opacity=50);
}
#language-setting-block img:hover {
opacity: 1.0;
filter: alpha(opacity=100);
}
</style>
<script>
jQuery(document).ready( function($) {
$('#language-setting-block a').on('click',function(e){
var dropdown = $('#block-locale-language');
e.preventDefault();
if(dropdown.hasClass('opened')){
dropdown.removeClass('opened').addClass('closed');
setTimeout(function(){
dropdown.removeClass('closed')
},500);
}else{
dropdown.addClass('opened');
}
});
} );
</script>
<?php
global $language ;
if ($path = variable_get('languageicons_path', drupal_get_path('module', 'languageicons') . '/flags/*.png')) {
$title = $language->name;
// Build up $image for theme_image() consumption.
$image = array(
'path' => str_replace('*', $language->language, check_plain($path)),
'alt' => $title,
'title' => $title,
'attributes' => array(
'class' => array('language-icon'),
),
);
if ($size = check_plain(variable_get('languageicons_size', '16x12'))) {
list($width, $height) = explode('x', $size);
$image += array('width' => $width, 'height' => $height);
}
print "<a href='#' class='has-anchor-link ripple'>".theme('image', $image)."</a><div class='no-anchor-link'>".theme('image', $image)."<span class='language-title'>".$language->native."</span></div>";
}
?>
<style>
.flag-well {
background-color: #f5f5f5;
border: 1px solid #e3e3e3;
border-radius: 4px;
}
#block-locale-language {
position: absolute;
right: -25px;
top: 35px;
padding: 5px 0;
visibility: hidden;
}
#block-locale-language ul {
padding: 0;
margin: 0 0 0 1em;
width: 100px;
}
#block-locale-language ul li {
list-style: none;
display: inline-block;
}
#block-locale-language ul li a{
color: black;
}
#block-locale-language.opened {
visibility: visible;
}
#block-locale-language.closed {
visibility: visible;
}
#language-setting-block .no-anchor-link {
display: none;
}
#language-setting-block img {
width: 25px;
margin-right: 10px;
opacity: 0.5;
filter: alpha(opacity=50);
}
#language-setting-block img:hover {
opacity: 1.0;
filter: alpha(opacity=100);
}
</style>
<script>
jQuery(document).ready( function($) {
$('#language-setting-block a').on('click',function(e){
var dropdown = $('#block-locale-language');
e.preventDefault();
if(dropdown.hasClass('opened')){
dropdown.removeClass('opened').addClass('closed');
setTimeout(function(){
dropdown.removeClass('closed')
},500);
}else{
dropdown.addClass('opened');
}
});
} );
</script>

| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |


| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |


| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |


| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |


| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |


| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |


| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |


| 添付 | サイズ |
|---|---|
| feeds_entity_processor-1033202-217.patch_.txt (16.03 KB) | 16.03 KB |
