.. , - ... .
, :
function render_i18n_block($block_id, $region = "hidden"){
if ($list = block_list($region)) {
foreach ($list as $key => $block) {
// $key == <i>module</i>_<i>delta</i>
$key_str = "block_".$block_id;
if ($key_str == $key){
return theme('block', $block);
}
}
}
}
, node, :
<?php echo render_i18n_block(<block_id>,<region>); ?>
, (, , block_list). "", , block_list.
( , ), , block_list() : includes/blocks/block.inc .
, $theme_key , theme() block_list() ( include/themes.inc).. SQL . SQL :
$result = db_query(db_rewrite_sql("SELECT DISTINCT b.* FROM {blocks} b LEFT JOIN {blocks_roles} r ON b.module = r.module AND b.delta = r.delta WHERE b.theme = '%s' AND b.status = 1 AND (r.rid IN (". db_placeholders($rids) .") OR r.rid IS NULL) ORDER BY b.region, b.weight, b.module", 'b', 'bid'), array_merge(array($theme_key), $rids));
, theme_key , .
, :
if (!isset($theme_key)){$theme_key="<my_theme_name>";}
modules/blocks/block.inc:: block_list() 429. .
- 10 , , , $theme_key block_list:)