[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_banners/src/Field/ -> ImptotalField.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Administrator
   5   * @subpackage  com_banners
   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  namespace Joomla\Component\Banners\Administrator\Field;
  12  
  13  use Joomla\CMS\Form\FormField;
  14  use Joomla\CMS\Language\Text;
  15  
  16  // phpcs:disable PSR1.Files.SideEffects
  17  \defined('_JEXEC') or die;
  18  // phpcs:enable PSR1.Files.SideEffects
  19  
  20  /**
  21   * Total Impressions field.
  22   *
  23   * @since  1.6
  24   */
  25  class ImptotalField extends FormField
  26  {
  27      /**
  28       * The form field type.
  29       *
  30       * @var    string
  31       * @since  1.6
  32       */
  33      protected $type = 'ImpTotal';
  34  
  35      /**
  36       * Method to get the field input markup.
  37       *
  38       * @return  string  The field input markup.
  39       *
  40       * @since   1.6
  41       */
  42      protected function getInput()
  43      {
  44          $class    = ' class="form-control validate-numeric text_area"';
  45          $onchange = ' onchange="document.getElementById(\'' . $this->id . '_unlimited\').checked=document.getElementById(\'' . $this->id
  46              . '\').value==\'\';"';
  47          $onclick  = ' onclick="if (document.getElementById(\'' . $this->id . '_unlimited\').checked) document.getElementById(\'' . $this->id
  48              . '\').value=\'\';"';
  49          $value    = empty($this->value) ? '' : $this->value;
  50          $checked  = empty($this->value) ? ' checked="checked"' : '';
  51  
  52          return '<input type="text" name="' . $this->name . '" id="' . $this->id . '" size="9" value="' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8')
  53              . '" ' . $class . $onchange . '>'
  54              . '<fieldset class="form-check impunlimited"><input class="form-check-input" id="' . $this->id . '_unlimited" type="checkbox"' . $checked . $onclick . '>'
  55              . '<label for="' . $this->id . '_unlimited" id="jform-imp" class="form-check-label">' . Text::_('COM_BANNERS_UNLIMITED') . '</label></fieldset>';
  56      }
  57  }


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