Skip to content

Instantly share code, notes, and snippets.

@mackensen
Created October 29, 2014 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mackensen/745578705a5177528f16 to your computer and use it in GitHub Desktop.
Save mackensen/745578705a5177528f16 to your computer and use it in GitHub Desktop.
<?php
/**
* @file
* homebox.tpl.php
* Default layout for homebox.
*/
?>
<?php global $user; ?>
<div id="homebox" class="<?php print $classes ?> clearfix">
<?php if ($user->uid): ?>
<div class="wrapper homebox-actions-navbar">
<div class="content-full">
<?php
if ($user->uid != 1) {
$account = user_load($user->uid);
$givenname = field_get_items('user', $account, 'field_first_name');
$givenname = $givenname[0]['safe_value'];?>
<div class="greeting pull-left hidden-xs">
<span class="glyphicon glyphicon-user"></span><?php print "Hello $givenname";?>
</div>
<?php
}
?>
<div id="homebox-buttons" class="pull-right">
<?php
if (!empty($add_links)):
?>
<a href="javascript:void(0)" class="btn btn-default" id="homebox-add-link"><span class="glyphicon glyphicon-plus"></span><?php print t('Customize') ?></a>
<?php
endif;
?>
<?php print $save_form; ?>
<a class="btn btn-default" href="/caslogout"><span class="glyphicon glyphicon-off"></span>Logout</a>
</div>
</div>
</div>
<?php
endif;
if (!empty($add_links)):
?>
<div id="homebox-add"><?php print $add_links; ?></div>
<?php
endif;
for ($i = 1; $i <= count($regions); $i++):
if ($page->settings['widths'][$i] == 100):
?>
<div class="homebox-column-wrapper content-full homebox-column-wrapper-<?php print $i; ?> homebox-row-<?php print $page->settings['rows'][$i]; ?>">
<div class="homebox-column" id="homebox-column-<?php print $i; ?>">
<?php
endif;
if ($page->settings['widths'][$i] == 33 || $page->settings['widths'][$i] == 34):
?>
<div class="homebox-column-wrapper content-third homebox-column-wrapper-<?php print $i; ?> homebox-row-<?php print $page->settings['rows'][$i]; ?>">
<div class="homebox-column" id="homebox-column-<?php print $i; ?>">
<?php
endif;
foreach ($regions[$i] as $key => $weight):
foreach ($weight as $block):
if ($block->content):
print theme('homebox_block', array('block' => $block, 'page' => $page));
endif;
endforeach;
endforeach;
?>
</div>
</div>
<?php
endfor;
?>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment