当前位置: 首页>>代码示例>>PHP>>正文


PHP _block_render_blocks函数代码示例

本文整理汇总了PHP中_block_render_blocks函数的典型用法代码示例。如果您正苦于以下问题:PHP _block_render_blocks函数的具体用法?PHP _block_render_blocks怎么用?PHP _block_render_blocks使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了_block_render_blocks函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: doRenderBlock

 /**
  * Render a Drupal block
  */
 public function doRenderBlock($module, $delta)
 {
     // $block = block_load($module, $delta);
     $blocks = module_invoke($module, 'block_info');
     if (!isset($blocks[$delta])) {
         return;
     }
     $block = (object) $blocks[$delta];
     $block->module = $module;
     $block->delta = $delta;
     $block->status = 1;
     $block->region = 'content';
     $block->weight = 0;
     $block->theme = $GLOBALS['theme_key'];
     // Those won't serve any purpose but avoid nasty PHP warnings
     $block->title = '';
     $block->pages = '';
     $block->visibility = 0;
     // BLOCK_VISIBILITY_NOTLISTED (block module could be disabled)
     $block->custom = null;
     $blockList = [$block];
     drupal_alter('block_list', $blockList);
     $render_array = _block_get_renderable_array(_block_render_blocks($blockList));
     return drupal_render($render_array);
 }
开发者ID:makinacorpus,项目名称:drupal-sf-dic,代码行数:28,代码来源:DrupalBlockExtension.php

示例2: cpr_foundation_access_preprocess_user_profile

/**
 * Implements template_preprocess_user_profile.
 */
function cpr_foundation_access_preprocess_user_profile(&$vars)
{
    $vars['displayname'] = '';
    if (isset($vars['field_first_name'][0]['safe_value'])) {
        $vars['displayname'] .= $vars['field_first_name'][0]['safe_value'] . ' ';
    }
    if (isset($vars['field_last_name'][0]['safe_value'])) {
        $vars['displayname'] .= $vars['field_last_name'][0]['safe_value'];
    }
    if (isset($vars['field_display_name'][0]['safe_value'])) {
        $vars['displayname'] .= ' | ' . $vars['field_display_name'][0]['safe_value'];
    }
    if (empty($vars['displayname'])) {
        $vars['displayname'] = $vars['user_name'];
    }
    if (!empty($vars['field_user_photo'])) {
        $vars['field_user_photo'][0]['attributes'] = array('class' => array('circle', 'ferpa-protect'));
        $vars['field_user_photo'][0]['alt'] = t('Picture of @name', array('@name' => $vars['displayname']));
        $vars['field_user_photo'][0]['path'] = $vars['field_user_photo'][0]['uri'];
        $vars['photo'] = theme('image', $vars['field_user_photo'][0]);
    } else {
        $vars['photo'] = '<img src="' . base_path() . drupal_get_path('theme', 'foundation_access') . '/img/user.png" class="ferpa-protect circle" />';
    }
    if (!empty($vars['field_user_banner'])) {
        $vars['banner'] = $vars['user_profile']['field_user_banner'];
    } else {
        $vars['banner'] = '<img class="background" src="http://materializecss.com/images/office.jpg" alt="">';
    }
    // load up related user data
    $blockObject = block_load('elmsln_core', 'elmsln_core_user_xapi_data');
    $vars['user_data'] = _block_get_renderable_array(_block_render_blocks(array($blockObject)));
}
开发者ID:mmilutinovic1313,项目名称:elmsln,代码行数:35,代码来源:template.php

示例3: block_render

function block_render($module, $block_id)
{
    $block = block_load($module, $block_id);
    $block_content = _block_render_blocks(array($block));
    $build = _block_get_renderable_array($block_content);
    $block_rendered = drupal_render($build);
    print $block_rendered;
}
开发者ID:Virprince,项目名称:drupal7,代码行数:8,代码来源:template-override-utile.php

示例4: bc_theme_preprocess_page

/**
 * Implements HOOK_preprocess_page().
 */
function bc_theme_preprocess_page(&$vars)
{
    // Render logo block for presentation region.
    $block = block_load('bc_blocks', 'bc_pres_logo');
    $vars['pres_logo'] = _block_get_renderable_array(_block_render_blocks(array($block)));
    // Is moderator.
    $vars['is_moderator'] = in_array('moderator', $vars['user']->roles);
}
开发者ID:renanmfd,项目名称:bc_bluehost,代码行数:11,代码来源:template.php

示例5: customPrintViewsBlock

function customPrintViewsBlock($blockName)
{
    $block = block_load("views", $blockName);
    $blocks_to_render = _block_render_blocks(array($block));
    if (count($blocks_to_render) > 0) {
        $render_array = _block_get_renderable_array($blocks_to_render);
        print render($render_array);
        return true;
    }
    return false;
}
开发者ID:jeddobson,项目名称:LacunaStories,代码行数:11,代码来源:user-profile.tpl.php

示例6: nuboot_radix_menu_tree__primary

/**
 * NuBoot theme wrapper function for the primary menu links.
 */
function nuboot_radix_menu_tree__primary(&$variables)
{
    return '<ul class="menu nav navbar-nav">' . $variables['tree'] . '</ul>';
    // Add views exposed search.
    $block = block_load('dkan_sitewide', 'dkan_sitewide_search_bar');
    if ($block) {
        $search = _block_get_renderable_array(_block_render_blocks(array($block)));
        print render($search);
    }
    // End views exposed search.
}
开发者ID:newswim,项目名称:dkan-drops-7,代码行数:14,代码来源:menu-tree.func.php

示例7: viewBlock

 /**
  * Render a specific block.
  *
  * @param string $module
  *   The module machine name.
  * @param string $delta
  *   The block delta.
  *
  * @return array
  *   The render array of the block output.
  */
 public static function viewBlock($module, $delta)
 {
     $block = new stdClass();
     $block->module = $module;
     $block->delta = $delta;
     $block->enabled = TRUE;
     $block->page_match = TRUE;
     $blocks = array();
     $blocks[$module . "_" . $delta] = $block;
     $block_content = _block_render_blocks($blocks);
     return _block_get_renderable_array($block_content);
 }
开发者ID:juampynr,项目名称:DrupalCampEs,代码行数:23,代码来源:RenderHelper.php

示例8: render

 /**
  * Render
  *
  * Renders the loaded block.
  *
  * @return string The rendered content of the block.
  */
 public function render()
 {
     $output = '';
     try {
         $first_child = new \stdClass();
         foreach (_block_render_blocks(array($this->base)) as $item) {
             $first_child = $item;
             break;
         }
         $output = drupal_render($first_child->content);
     } catch (\Exception $ex) {
         watchdog('ac_base', 'Block insertion exception: <pre>' . print_r($ex, 1) . '</pre>');
         $output = '<pre>There was an error inserting the block. Details: ' . print_r($ex, 1) . '</pre>';
     }
     return $output;
 }
开发者ID:ryne-andal,项目名称:ablecore,代码行数:23,代码来源:Block.php

示例9: tfd_view_block

/**
 * Get a block from the DB
 *
 * @param string $delta
 * @param null $module Optional name of the module this block belongs to.
 * @param boolean $render return the raw data instead of the rendered content.
 * @return bool|string
 */
function tfd_view_block($delta, $module = NULL, $render = TRUE)
{
    $output = FALSE;
    if (is_null($module)) {
        global $theme;
        if (FALSE !== ($block = db_query('SELECT * FROM {block} WHERE theme= :theme AND delta = :delta', array(':theme' => $theme, ':delta' => $delta))->fetchObject())) {
            $module = $block->module;
        }
    } else {
        $block = db_query('SELECT * FROM {block} WHERE module = :module AND delta = :delta', array(':module' => $module, ':delta' => $delta))->fetchObject();
    }
    if ($block) {
        $block->region = 'tfd_block';
        $block->status = 1;
        $block_data = array($block->delta => $block);
        $blockdata = _block_render_blocks($block_data);
        $build = _block_get_renderable_array($blockdata);
        $output = $render ? render($build) : $build;
    }
    return $output;
}
开发者ID:sulav,项目名称:TFD7,代码行数:29,代码来源:Extension.php

示例10: footmali_headline_articles

<?php

$headlines = footmali_headline_articles();
$block = block_load('views', 'news-most_read_articles');
$block_array = _block_render_blocks(array($block));
$block_render = _block_get_renderable_array($block_array);
?>

<div class="widget kopa-tab-1-widget">
    <div class="kopa-tab style7">
        <ul class="nav nav-tabs">
            <?php 
if (count($headlines) > 0) {
    ?>
                <li class="active"><a href="#headlines" data-toggle="tab"><span><?php 
    echo t('Headlines');
    ?>
</span></a></li>
            <?php 
}
?>
            <li><a href="#news" data-toggle="tab"><span><?php 
echo t('Most Popular');
?>
</span></a></li>
        </ul>
        <!-- nav-tabs -->
        <div class="tab-content">
            <div class="tab-pane active" id="headlines">
                <ul class="kopa-list clearfix">
                    <?php 
开发者ID:souleyHype,项目名称:footmali-drupal-theme,代码行数:31,代码来源:_news_headlines_popular.php

示例11: logic_block_get_block_content

/**
 * Gets a block's content.
 *
 * @param integer $data
 *   Bid for this block.
 */
function logic_block_get_block_content($data)
{
    $result = db_query('SELECT module,delta from {block} where bid = :bid', array(":bid" => $data));
    $block_data = $result->fetch();
    $block = block_load($block_data->module, $block_data->delta);
    $renderable_block = _block_get_renderable_array(_block_render_blocks(array($block)));
    return drupal_render($renderable_block);
}
开发者ID:annamarriap,项目名称:sig,代码行数:14,代码来源:form_library.php

示例12: webform_node_view

webform_node_view($node, 'full');
print theme_webform_view($node->content);
?>
        </div>
    </div>
</div>





/* TESTIMONIALS SECTION */
<div class="sections testimonials_section">
<?php 
$block = block_load('views', 'testimonial_slider-block');
$output = _block_get_renderable_array(_block_render_blocks(array($block)));
$output = drupal_render($output);
print $output;
?>
    <!--  <div class="boxes-2">-->
    <!--    <ul>-->
    <!--      <li>-->
    <!--        <div class="test-content">-->
    <!--          <i class="fa fa-quote-left"></i>Mydea is a high-value partner. I've-->
    <!--          worked with them while leading account development teams at two-->
    <!--          separate organizations over the past five years and have consistently-->
    <!--          received best-in-class service from their customer and prospect-->
    <!--          engagement services. We've been able to leverage the information that-->
    <!--          they've uncovered from customer engagement activities to win business-->
    <!--          and strengthen customer relationship. Mydea delivers.<i class="fa fa-quote-right"></i>-->
    <!--          <div class="test-title"> – Senior Manager, Market Development</div>-->
开发者ID:ph3l1x,项目名称:mydea,代码行数:31,代码来源:default_html.php

示例13: _humanitarianresponse_block_render

/**
 * Custom function to render a block so I can manually position it in the markup
 */
function _humanitarianresponse_block_render($module, $block_id) {
  $block = block_load($module, $block_id);
  $block_content = _block_render_blocks(array($block));
  $build = _block_get_renderable_array($block_content);
  $block_rendered = drupal_render($build);
  return $block_rendered;
}
开发者ID:pcambra,项目名称:site,代码行数:10,代码来源:template.php

示例14: render

if ($main_menu) {
    ?>
            <ul id="main-menu" class="menu nav navbar-nav">
              <?php 
    print render($main_menu);
    ?>
            </ul>
          <?php 
}
?>
          
          <!-- user menu -->
          <?php 
$block = block_load('dkan_sitewide', 'dkan_sitewide_user_menu');
if ($block) {
    $user_menu = _block_get_renderable_array(_block_render_blocks(array($block)));
    print render($user_menu);
}
?>
        </div><!-- /.navbar-collapse -->
      </nav><!-- /.navbar -->
    </div><!-- /.container -->
  </div> <!-- /.navigation -->
</header>

<div id="main-wrapper">
  <div id="main" class="main">

    <?php 
//if (!empty($breadcrumb)): print $breadcrumb; endif;
?>
开发者ID:Code4SA,项目名称:dkan-drops-7,代码行数:31,代码来源:page--front.tpl.php

示例15: islandora_camp_block_render

/**
 * Render a block unique to this themes layouts.
 *
 * @param string $module
 *   The module providing the block.
 * @param string $delta
 *   The delta of the block
 *
 * @return string
 *   The rendered block's HTML content.
 */
function islandora_camp_block_render($module, $delta, $as_renderable = FALSE)
{
    $block = block_load($module, $delta);
    $block_content = _block_render_blocks(array($block));
    $build = _block_get_renderable_array($block_content);
    if ($as_renderable) {
        return $build;
    }
    $block_rendered = drupal_render($build);
    return $block_rendered;
}
开发者ID:rosiel,项目名称:islandora_camp,代码行数:22,代码来源:template.php


注:本文中的_block_render_blocks函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。