Exemple #1
0
/**
 * 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)));
}
Exemple #2
0
 /**
  * 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;
 }
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;
}
Exemple #4
0
/**
 * 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);
}
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;
}
/**
 * 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.
}
Exemple #7
0
/**
 * 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;
}
<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);
?>
Exemple #9
0
$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>-->
 * - $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;
        ?>
Exemple #11
0
            <?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;
?>
Exemple #12
0
/**
 * 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;
}
Exemple #13
0
<?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;
    }
}
        <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 
Exemple #15
0
/**
 * 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);
}
Exemple #16
0
/**
 * 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;
}
<div class="register row">

	<div class="col-xs-12 col-md-4 left-sidebar"><?php 
$block = _block_get_renderable_array(_block_render_blocks(array(block_load('block', '7'))));
echo render($block);
?>
	</div>
	
	<div class="col-xs-12 col-md-8 row">
		
	  <div class="introduction"><?php 
$block = _block_get_renderable_array(_block_render_blocks(array(block_load('block', '8'))));
echo render($block);
?>
</div>
		
		<div class="col-xs-12 col-md-6">
			<?php 
echo drupal_render($form['account']['name']);
?>
		</div>
		<div class="col-xs-12 col-md-6">
			<?php 
echo drupal_render($form['account']['mail']);
?>
		</div>
		
		<div class="col-xs-12 col-md-6">
			<?php 
echo drupal_render($form['account']['pass']['pass1']);
      <?php 
}
?>

      <?php 
print render($page['navigation']);
?>

    </div>


  </div>

<!--     <div id="benefits-left">
       <?php 
$block = block_load('block', '1');
$block_loaded = _block_get_renderable_array(_block_render_blocks(array($block)));
print drupal_render($block_loaded);
?>
     </div> -->

  <?php 
print render($page['footer']);
?>

</div>

<?php 
print render($page['bottom']);
?>
Exemple #19
0
    }
    ?>
        </nav>
      </div>
    <?php 
}
?>
  </div>
   <div class="hero-text-box">
      <h1><span>UNLOCK YOUR PHONE!</span></h1>
      <a href="#" class="js-scroll-to-featured-services btn btn-full">UNLOCK NOW</a>
      <a href="#" class="btn btn-ghost js-scroll-to-how-it-works">HOW IT WORKS</a>

  </div>
              <?php 
$blockObject = block_load('imeidata', 'imeidata');
$block = _block_get_renderable_array(_block_render_blocks(array($blockObject)));
$output = drupal_render($block);
print $output;
?>
</header>

<div class="main-container container">

  <header role="banner" id="page-header">
    <?php 
if (!empty($site_slogan)) {
    ?>
      <p class="lead"><?php 
    print $site_slogan;
    ?>
Exemple #20
0
/**
 * Called from hook_preprocess_node()
 * Insert view or custom blocks in node when meet a specific markup
 * The markup is like <!--[name-of-the-block]-->
 */
function add_blocks_inside_content(&$vars)
{
    $body = $vars['content']['body'][0]['#markup'];
    $pattern = '/(<!--\\[)([(\\w+)(\\-+)(\\_+)(\\d+)]+)(\\]-->)/';
    if (preg_match_all($pattern, $body, $matches)) {
        $blocks = $matches[2];
        foreach ($blocks as $block) {
            //try load a view block
            $block_object = block_load('views', $block);
            //load a custom block
            if (!isset($block_object->bid)) {
                $block_object = block_load('block', $block);
            }
            if (isset($block_object->bid)) {
                $render_array = _block_get_renderable_array(_block_render_blocks(array($block_object)));
                $body = str_replace('<!--[' . $block . ']-->', render($render_array), $body);
            }
        }
        $vars['content']['body'][0]['#markup'] = $body;
    }
}
Exemple #21
0
/**
 * Render a block (to be displayed in a template file).
 */
function ec_resp_17_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;
}
Exemple #22
0
      <div class="row">
        <div class="container">
            <?php 
$block = block_load('views', 'ebooks_block-front_page_resources');
echo drupal_render(_block_get_renderable_array(_block_render_blocks(array($block))));
?>
        </div>
      </div>
    </section>
  </div>
  <div class="news_block"
    <section>
      <div class="row">
        <div class="container">
            <?php 
$block = block_load('views', 'apigee_in_the_news-front_page_news');
echo drupal_render(_block_get_renderable_array(_block_render_blocks(array($block))));
?>
        </div>
      </div>
    </section>
  </div>
  <section>
    <div class="row">
        <?php 
if (!empty($page['front_page_content'])) {
    ?>
        <div>
            <?php 
    print render($page['front_page_content']);
    ?>
<?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 
?>
      <?php 
print render($page['content']);
?>

	  <?php 
$form = drupal_get_form('vrf_module_my_form');
print drupal_render($form);
?>

        <?php 
// Load contestants blocks.
$blocks = ['vrf_contestants_new_block' => 'New contestants', 'vrf_contestants_top_block' => 'Most popular contestants', 'vrf_contestants_all_block' => 'All contestants'];
foreach ($blocks as $block => $title) {
    echo "<h1>{$title}:</h1>";
    $block = block_load('vrf_module', $block);
    $block = array($block);
    $block = _block_render_blocks($block);
    $block = _block_get_renderable_array($block);
    print render($block);
}
?>

      <?php 
print $feed_icons;
?>

    </div></div> <!-- /.section, /#content -->

    <?php 
if ($page['sidebar_second']) {
echo base_path() . $directory . '/images/v_05.jpg';
?>
" class="img-responsive" /></a></li>
				<li class="first"><a href="<?php 
echo url('node/2');
?>
"><img src='<?php 
echo base_path() . $directory . '/images/v_03.jpg';
?>
' class="img-responsive" /></a></li>
			</ul>
		</div>-->
		<div id="ggao" class='col-sm-6 row hidden-xs'>
			<div class="col-sm-7 col-sm-offset-1 ">
			<?php 
$social_block = block_load('block', 11);
if (!empty($social_block->bid)) {
    $block = _block_get_renderable_array(_block_render_blocks(array($social_block)));
    echo render($block);
} else {
    ?>
				<a href="<?php 
    echo url('node/2');
    ?>
"><img src='<?php 
    echo base_path() . $directory . '/images/v_03.jpg';
    ?>
' /></a>
			<?php 
}
?>
Exemple #26
0
}
?>
    <div class="print-site_name"><?php 
print theme('print_published');
?>
</div>
    <p />
    <hr class="print-hr" />

    <div class="print-content"><?php 
print $content;
?>
</div>
    <div>    
    <?php 
$block = block_load('block', '7');
print render(_block_get_renderable_array(_block_render_blocks(array($block))));
?>
    </div>
    <div class="print-footer"><?php 
print theme('print_footer');
?>
</div>
    <hr class="print-hr" />
    <?php 
if ($sourceurl_enabled) {
    ?>
      <div class="print-source_url">
        <?php 
    print theme('print_sourceurl', array('url' => $source_url, 'node' => $node, 'cid' => $cid));
    ?>
    ?>
  <footer class="submitted"><?php 
    print $date;
    ?>
 -- <?php 
    print $name;
    ?>
</footer>
  <?php 
}
?>

<div class="panel-display panel-2col clearfix">
  <div class="panel-col-first">
    <?php 
$block = block_load('odp_dashboard_blocks', 'contribution_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;
        ?>
/revert">Revert</a>
<div class="col-sm-2">
	<?php 
$socialblock = module_invoke('sharethis', 'block_view', 'sharethis_block');
print render($socialblock['content']);
?>
</div>
<div class="col-sm-10">
	<?php 
$block = module_invoke('future_50', 'block_view', 'future_50_content');
print render($block['content']);
echo views_embed_view('future_50', $display_id = 'block');
$block2 = block_load('block', 38);
$output = _block_get_renderable_array(_block_render_blocks(array($block2)));
$output2 = drupal_render($output);
print render($output2);
?>
</div>
Exemple #29
0
            <a href="//linkedin.com/company/467230"><i class="fa fa-linkedin"></i></a>
          </span>
          <span>
            <a href="//facebook.com/IHAConvene"><i class="fa fa-facebook"></i></a>
          </span>
          <span>
            <a href="//twitter.com/ihaconvene"><i class="fa fa-twitter"></i></a>
          </span>
        </span>
      </div>
    </div>
    <div class="col-xs-12 col-sm-4 news_pre">
      <div class="news_foot">
      <h5>Sign up for our newsletter</h5>
        <?php 
$block = block_load('constant_contact', 1);
$render_array = _block_get_renderable_array(_block_render_blocks(array($block)));
$output = drupal_render($render_array);
print $output;
?>
      </div>
    </div>
  </div>
  <div class="col-sm-12 sub_foot">
    <div class="col-md-6 copy_legal">
      <span class="copyright">
        <p>&copy; <?php 
echo date('Y');
?>
 IHA. All rights reserved.</p>
      </span>
    }
}
// Render Left Block 2 for company tags taxonomy page and other.
if ($company_tags == 'Yes') {
    $left_block_2 = block_load('views', '081393740e200cfc34eeaa39f22a517d');
} else {
    if ($random_top_display == 'Yes') {
        $left_block_2 = block_load('randomblocks', 'left_block_2');
    }
}
// Render Left Block 3 for company tags taxonomy page and other.
if ($company_tags == 'Yes') {
    $left_block_3 = block_load('views', 'eb34806d60cd56170767ff3f3b731561');
} else {
    if ($random_top_display == 'Yes') {
        $left_block_3 = block_load('randomblocks', 'left_block_3');
    }
}
?>


<div class="top-header">
  <?php 
if (!empty($page['top_header'])) {
    ?>
    <div>
      <?php 
    print render($page['top_header']);
    ?>
    </div>
  <?php