[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_content/src/Field/ -> VoteradioField.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Administrator
   5   * @subpackage  com_content
   6   *
   7   * @copyright   (C) 2005 Open Source Matters, Inc. <https://www.joomla.org>
   8   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   9   */
  10  
  11  namespace Joomla\Component\Content\Administrator\Field;
  12  
  13  use Joomla\CMS\Form\Field\RadioField;
  14  use Joomla\CMS\Plugin\PluginHelper;
  15  
  16  // phpcs:disable PSR1.Files.SideEffects
  17  \defined('_JEXEC') or die;
  18  // phpcs:enable PSR1.Files.SideEffects
  19  
  20  /**
  21   * Voteradio Field class.
  22   *
  23   * @since  3.8.0
  24   */
  25  class VoteradioField extends RadioField
  26  {
  27      /**
  28       * The form field type.
  29       *
  30       * @var    string
  31       * @since  3.8.0
  32       */
  33      protected $type = 'Voteradio';
  34  
  35      /**
  36       * Method to attach a form object to the field.
  37       *
  38       * @param   \SimpleXMLElement  $element  The SimpleXMLElement object representing the `<field>` tag for the form field object.
  39       * @param   mixed              $value    The form field value to validate.
  40       * @param   string             $group    The field name group control value. This acts as as an array container for the field.
  41       *                                       For example if the field has name="foo" and the group value is set to "bar" then the
  42       *                                       full field name would end up being "bar[foo]".
  43       *
  44       * @return  boolean  True on success.
  45       *
  46       * @since  4.0.0
  47       */
  48      public function setup(\SimpleXMLElement $element, $value, $group = null)
  49      {
  50          // Requires vote plugin enabled
  51          if (!PluginHelper::isEnabled('content', 'vote')) {
  52              return false;
  53          }
  54  
  55          return parent::setup($element, $value, $group);
  56      }
  57  }


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