Skip to content

Instantly share code, notes, and snippets.

@betweenbrain
Created July 24, 2012 17:17
Show Gist options
  • Save betweenbrain/3171294 to your computer and use it in GitHub Desktop.
Save betweenbrain/3171294 to your computer and use it in GitHub Desktop.
Construct Framework module chrome example
function modChrome_div($module, $params, $attribs)
{
$id = isset($attribs['id']) ? $attribs['id'] : null;
$headerLevel = isset($attribs['level']) ? (int)$attribs['level'] : 3;
$headerClass = isset($attribs['header-class']) ? $attribs['header-class'] : 'je-header';
$moduleClass = isset($attribs['module-class']) ? $attribs['module-class'] : null;
if (!empty($module->content)) : ?>
<div <?php if ($id) echo 'id="' . $id . '"'; ?> class="moduletable<?php echo $params->get('moduleclass_sfx') ?><?php if ($moduleClass) echo ' ' . $moduleClass ?>">
<?php if ($module->showtitle) : ?>
<h<?php echo $headerLevel ?> class="<?php echo $headerClass ?>"><?php echo $module->title ?><?php echo '</h' . $headerLevel ?>>
<?php endif ?>
<?php echo $module->content ?>
</div>
<?php endif;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment