[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/components/com_users/tmpl/profile/ -> default_custom.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Site
   5   * @subpackage  com_users
   6   *
   7   * @copyright   (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
   8   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   9   */
  10  
  11  defined('_JEXEC') or die;
  12  
  13  use Joomla\CMS\HTML\HTMLHelper;
  14  use Joomla\CMS\Language\Text;
  15  
  16  $fieldsets = $this->form->getFieldsets();
  17  
  18  if (isset($fieldsets['core'])) {
  19      unset($fieldsets['core']);
  20  }
  21  
  22  if (isset($fieldsets['params'])) {
  23      unset($fieldsets['params']);
  24  }
  25  
  26  $tmp          = $this->data->jcfields ?? array();
  27  $customFields = array();
  28  
  29  foreach ($tmp as $customField) {
  30      $customFields[$customField->name] = $customField;
  31  }
  32  
  33  ?>
  34  <?php foreach ($fieldsets as $group => $fieldset) : ?>
  35      <?php $fields = $this->form->getFieldset($group); ?>
  36      <?php if (count($fields)) : ?>
  37          <fieldset id="users-profile-custom-<?php echo $group; ?>" class="com-users-profile__custom users-profile-custom-<?php echo $group; ?>">
  38              <?php if (isset($fieldset->label) && ($legend = trim(Text::_($fieldset->label))) !== '') : ?>
  39                  <legend><?php echo $legend; ?></legend>
  40              <?php endif; ?>
  41              <?php if (isset($fieldset->description) && trim($fieldset->description)) : ?>
  42                  <p><?php echo $this->escape(Text::_($fieldset->description)); ?></p>
  43              <?php endif; ?>
  44              <dl class="dl-horizontal">
  45                  <?php foreach ($fields as $field) : ?>
  46                      <?php if (!$field->hidden && $field->type !== 'Spacer') : ?>
  47                          <dt>
  48                              <?php echo $field->title; ?>
  49                          </dt>
  50                          <dd>
  51                              <?php if (array_key_exists($field->fieldname, $customFields)) : ?>
  52                                  <?php echo strlen($customFields[$field->fieldname]->value) ? $customFields[$field->fieldname]->value : Text::_('COM_USERS_PROFILE_VALUE_NOT_FOUND'); ?>
  53                              <?php elseif (HTMLHelper::isRegistered('users.' . $field->id)) : ?>
  54                                  <?php echo HTMLHelper::_('users.' . $field->id, $field->value); ?>
  55                              <?php elseif (HTMLHelper::isRegistered('users.' . $field->fieldname)) : ?>
  56                                  <?php echo HTMLHelper::_('users.' . $field->fieldname, $field->value); ?>
  57                              <?php elseif (HTMLHelper::isRegistered('users.' . $field->type)) : ?>
  58                                  <?php echo HTMLHelper::_('users.' . $field->type, $field->value); ?>
  59                              <?php else : ?>
  60                                  <?php echo HTMLHelper::_('users.value', $field->value); ?>
  61                              <?php endif; ?>
  62                          </dd>
  63                      <?php endif; ?>
  64                  <?php endforeach; ?>
  65              </dl>
  66          </fieldset>
  67      <?php endif; ?>
  68  <?php endforeach; ?>


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