[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/plugins/fields/editor/ -> editor.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Plugin
   5   * @subpackage  Fields.Editor
   6   *
   7   * @copyright   (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
   8   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   9  
  10   * @phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace
  11   */
  12  
  13  use Joomla\CMS\Form\Form;
  14  
  15  // phpcs:disable PSR1.Files.SideEffects
  16  \defined('_JEXEC') or die;
  17  // phpcs:enable PSR1.Files.SideEffects
  18  
  19  /**
  20   * Fields Editor Plugin
  21   *
  22   * @since  3.7.0
  23   */
  24  class PlgFieldsEditor extends \Joomla\Component\Fields\Administrator\Plugin\FieldsPlugin
  25  {
  26      /**
  27       * Transforms the field into a DOM XML element and appends it as a child on the given parent.
  28       *
  29       * @param   stdClass    $field   The field.
  30       * @param   DOMElement  $parent  The field node parent.
  31       * @param   Form        $form    The form.
  32       *
  33       * @return  DOMElement
  34       *
  35       * @since   3.7.0
  36       */
  37      public function onCustomFieldsPrepareDom($field, DOMElement $parent, Form $form)
  38      {
  39          $fieldNode = parent::onCustomFieldsPrepareDom($field, $parent, $form);
  40  
  41          if (!$fieldNode) {
  42              return $fieldNode;
  43          }
  44  
  45          $fieldNode->setAttribute('buttons', $field->fieldparams->get('buttons', $this->params->get('buttons', 0)) ? 'true' : 'false');
  46          $fieldNode->setAttribute('hide', implode(',', $field->fieldparams->get('hide', array())));
  47  
  48          return $fieldNode;
  49      }
  50  }


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