[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/layouts/chromes/ -> html5.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Site
   5   * @subpackage  Layout
   6   *
   7   * @copyright   (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
   8   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   9   *
  10   * html5 (chosen html5 tag and font header tags)
  11   */
  12  
  13  defined('_JEXEC') or die;
  14  
  15  use Joomla\Utilities\ArrayHelper;
  16  
  17  $module  = $displayData['module'];
  18  $params  = $displayData['params'];
  19  
  20  if ((string) $module->content === '') {
  21      return;
  22  }
  23  
  24  $moduleTag              = htmlspecialchars($params->get('module_tag', 'div'), ENT_QUOTES, 'UTF-8');
  25  $moduleAttribs          = [];
  26  $moduleAttribs['class'] = 'moduletable ' . htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_QUOTES, 'UTF-8');
  27  $bootstrapSize          = (int) $params->get('bootstrap_size', 0);
  28  $moduleAttribs['class'] .= $bootstrapSize !== 0 ? ' col-md-' . $bootstrapSize : '';
  29  $headerTag              = htmlspecialchars($params->get('header_tag', 'h3'), ENT_QUOTES, 'UTF-8');
  30  $headerClass            = htmlspecialchars($params->get('header_class', ''), ENT_QUOTES, 'UTF-8');
  31  $headerAttribs          = [];
  32  
  33  // Only output a header class if one is set
  34  if ($headerClass !== '') {
  35      $headerAttribs['class'] = $headerClass;
  36  }
  37  
  38  // Only add aria if the moduleTag is not a div
  39  if ($moduleTag !== 'div') {
  40      if ($module->showtitle) :
  41          $moduleAttribs['aria-labelledby'] = 'mod-' . $module->id;
  42          $headerAttribs['id']              = 'mod-' . $module->id;
  43      else :
  44          $moduleAttribs['aria-label'] = $module->title;
  45      endif;
  46  }
  47  
  48  $header = '<' . $headerTag . ' ' . ArrayHelper::toString($headerAttribs) . '>' . $module->title . '</' . $headerTag . '>';
  49  ?>
  50  <<?php echo $moduleTag; ?> <?php echo ArrayHelper::toString($moduleAttribs); ?>>
  51      <?php if ((bool) $module->showtitle) : ?>
  52          <?php echo $header; ?>
  53      <?php endif; ?>
  54      <?php echo $module->content; ?>
  55  </<?php echo $moduleTag; ?>>


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer