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


PHP block_load函数代码示例

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


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

示例1: 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

示例2: __construct

 /**
  * Constructor
  *
  * Creates a new block object.
  *
  * @param string $module The module the block belongs to.
  * @param string $delta  The name of the block within the
  *                       module.
  */
 public function __construct($module, $delta)
 {
     $block = block_load($module, $delta);
     if (!$block) {
         throw new \Exception("The block ({$module}, {$delta}) doesn't exist!");
     }
     $this->base = $block;
 }
开发者ID:ryne-andal,项目名称:ablecore,代码行数:17,代码来源:Block.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: render_block_content

/**
 * Helper function to find and render a block by Jeremy Cerda @FreighthouseNYC
 * PS. - Necessary to support i18n
 */
function render_block_content($module, $delta)
{
    $output = '';
    if ($block = block_load($module, $delta)) {
        if ($build = module_invoke($module, 'block_view', $delta)) {
            $delta = str_replace('-', '_', $delta);
            drupal_alter(array('block_view', "block_view_{$module}_{$delta}"), $build, $block);
            if (!empty($build['content'])) {
                return is_array($build['content']) ? render($build['content']) : $build['content'];
            }
        }
    }
    return $output;
}
开发者ID:freighthouse,项目名称:code,代码行数:18,代码来源:template.php

示例8: block_load

<div id="dlor-frontpage-threeup">
  <div class="dlor-frontpage-threeup-item">
    <? 
      //ABOUT BLOCK
      $block = block_load('block',18);  //get block id from custom blocks table
      $render_block = _block_get_renderable_array(_block_render_blocks(array($block)));
      $out = drupal_render($render_block);
      echo $out;
    ?>
  </div>
  <div class="dlor-frontpage-threeup-item">
    <h2 class="block-title">Search</h2>
    <? 
      //SEARCH FORM
      $block = block_load('block','20');  //get block id from custom blocks table
      $render_block = _block_get_renderable_array(_block_render_blocks(array($block)));
      $out = drupal_render($render_block);
      echo $out;
    ?>
  </div>
  <div class="dlor-frontpage-threeup-item">
    <? //RECENT ITEMS ?>
    <h2 class="block-title">Recent Entries</h2>
    <div class="<?php 
print $classes;
?>
">
      <?php 
print render($title_prefix);
?>
开发者ID:BCLibCoop,项目名称:toolshed-drupal-sky-theme,代码行数:30,代码来源:views-view--frontpage--page.tpl.php

示例9: node_load

$node = node_load(7);
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>-->
开发者ID:ph3l1x,项目名称:mydea,代码行数:31,代码来源:default_html.php

示例10: block_load

 * - $footer: The view footer
 * - $rows: The results of the view query, if any
 * - $empty: The empty text to display if the view is empty
 * - $pager: The pager next/prev links to display, if any
 * - $exposed: Exposed widget form/info to display
 * - $feed_icon: Feed icon to display, if any
 * - $more: A link to view more, if any
 *
 * @ingroup views_templates
 */
?>

<div class="panel-display panel-2col clearfix">
  <div class="panel-col-first">
    <?php 
$block = block_load('odp_dashboard_blocks', 'dataset_nav');
print drupal_render(_block_get_renderable_array(_block_render_blocks(array($block))));
?>

    <?php 
if (!empty($node->current_revision_id) && $node->current_revision_id != $node->vid) {
    ?>
      <?php 
    if (user_access('revert revisions')) {
        ?>
        <a class="btn btn-create-dataset" href="/node/<?php 
        echo $node->nid;
        ?>
/revisions/<?php 
        echo $node->vid;
        ?>
开发者ID:ECOGIG,项目名称:ecogig-odp,代码行数:31,代码来源:views-view--workflow-history--page.tpl.php

示例11: render

            <?php 
        print render($page['navigation']);
        ?>
            <?php 
    }
    ?>
        </nav>
      </div>
    <?php 
}
?>
  <div class="iha_menus">
    <div class="meta_navigation">
      <span class="iha_user_menu">
        <?php 
$block = block_load('superfish', 3);
$render_array = _block_get_renderable_array(_block_render_blocks(array($block)));
$output = drupal_render($render_array);
print $output;
?>
        <span class="iha_search">
          <a data-toggle="modal" href="#iha_search_form" title="Search">
            <span class="icon glyphicon glyphicon-search" aria-hidden="true"></span>
          </a>
          <div class="modal fade" id="iha_search_form">
            <div class="modal-dialog modal-sm">
              <div class="modal-content">
                <div class="modal-body">
                    <?php 
print $search_box;
?>
开发者ID:freighthouse,项目名称:code,代码行数:31,代码来源:page.tpl.php

示例12: 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

示例13: views_embed_view

<?php

if ($view_name != '') {
    print views_embed_view($view_name, $block_id);
} else {
    if ($module_name != '') {
        $block = block_load($module_name, $block_id);
        $output = drupal_render(_block_get_renderable_array(_block_render_blocks(array($block))));
        print $output;
    }
}
开发者ID:vnzacky,项目名称:smu,代码行数:11,代码来源:embeded.tpl.php

示例14: render

        <div class="collapse navbar-collapse" id="navbar-collapse">
          <?php 
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 
开发者ID:Code4SA,项目名称:dkan-drops-7,代码行数:31,代码来源:page--front.tpl.php

示例15: rwom_node__article__full

/**
 * theme_node__article
 */
function rwom_node__article__full($variables)
{
    module_load_include('inc', 'custom_render', 'custom_render_menu');
    //Possibly render the comment box here as well
    $output = array();
    $node = menu_get_object();
    if (is_object($node) && $node->type === 'article') {
        $body = $variables['content']['body'];
        //drupal_set_message("<pre>" . print_r($variables, TRUE) . "</pre>");
        //Submitted
        $submitted_date = format_date($node->changed, 'custom', 'F, jS Y');
        $submitted = "<div class='submitted-time'><i class='fa fa-calendar'></i> {$submitted_date}</div>";
        $disqus_recent_comments_block = block_load('disqus', 'disqus_recent_comments');
        $disqus_recent_comments = _block_get_renderable_array(_block_render_blocks(array($disqus_recent_comments_block)));
        $disqus_comments_block = block_load('disqus', 'disqus_comments');
        $disqus_comments = _block_get_renderable_array(_block_render_blocks(array($disqus_comments_block)));
        $output = array('#markup' => "<div class='article-view-mode-full'>" . render($submitted) . render($body) . "</div>", '#suffix' => "<div class='l-featured-section'><div class='l-featured-inner'>" . _custom_render_blogs_featured() . "</div></div>", '#attached' => array('css' => array(drupal_get_path('theme', 'rwom') . '/css/pages/blogs.css')));
    }
    return render($output);
}
开发者ID:rwaery11,项目名称:ardoubleyou.com,代码行数:23,代码来源:template.php


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