Advertisement
Guest User

Untitled

a guest
Jun 18th, 2018
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.85 KB | None | 0 0
  1. <?php
  2. /**
  3.  * @package     Joomla.Administrator
  4.  * @subpackage  Templates.joomla-london
  5.  *
  6.  * @copyright   Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
  7.  * @license     GNU General Public License version 2 or later; see LICENSE.txt
  8.  */
  9. defined('_JEXEC') or die;
  10. /**
  11.  * This is a file to add template specific chrome to module rendering.  To use it you would
  12.  * set the style attribute for the given module(s) include in your template to use the style
  13.  * for each given modChrome function.
  14.  *
  15.  * This gives template designers ultimate control over how modules are rendered.
  16.  *
  17.  * NOTICE: All chrome wrapping methods should be named: modChrome_{STYLE} and take the same
  18.  * two arguments.
  19.  */
  20. /*
  21.  * Module chrome for rendering the module in a belowBanner
  22.  */
  23.  
  24. // make sure you name it correctly.  it always starts modChrome and I have named it bootstrap4 as I will be using that framework.  I could have called it anything, but I thought this was the most meaningful/descriptive name.
  25. function modChrome_bootstrap4($module, &$params, &$attribs)
  26. {
  27.     // if the module has content
  28.     if ($module->content)
  29.     {
  30.         // get Bootstrap size and make sure it is returned as an integer
  31.         $bootstrapSize = (int) $params->get('bootstrap_size');
  32.  
  33.         // Default empty string for column size
  34.         $cols = '';
  35.  
  36.         // if the bootstrap class is anything except 0 then insert the class cols- and add the bootstrap size class
  37.         if ($bootstrapSize != '0')
  38.         {
  39.             $cols = ' col-' . $bootstrapSize;
  40.         }
  41.  
  42.         // If the modules title is set to show... then show it
  43.         if ($module->showtitle)
  44.         {
  45.             echo '<h2>' . $module->title . '</h2>';
  46.         }
  47.     ?>
  48.  
  49.     <div class="items<?php echo $columnClass; ?>">
  50.         <div class="item">
  51.             <?php echo $module->content; ?>
  52.         </div>
  53.     </div>
  54.  
  55. <?php
  56.     }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement