[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/src/Form/Field/ -> LastvisitdaterangeField.php (source)

   1  <?php
   2  
   3  /**
   4   * Joomla! Content Management System
   5   *
   6   * @copyright  (C) 2016 Open Source Matters, Inc. <https://www.joomla.org>
   7   * @license    GNU General Public License version 2 or later; see LICENSE.txt
   8   */
   9  
  10  namespace Joomla\CMS\Form\Field;
  11  
  12  use Joomla\CMS\Factory;
  13  use Joomla\CMS\Form\Form;
  14  
  15  // phpcs:disable PSR1.Files.SideEffects
  16  \defined('JPATH_PLATFORM') or die;
  17  // phpcs:enable PSR1.Files.SideEffects
  18  
  19  /**
  20   * Field to show a list of available date ranges to filter on last visit date.
  21   *
  22   * @since  3.6
  23   */
  24  class LastvisitdaterangeField extends PredefinedlistField
  25  {
  26      /**
  27       * Method to instantiate the form field object.
  28       *
  29       * @param   Form  $form  The form to attach to the form field object.
  30       *
  31       * @since   1.7.0
  32       */
  33      public function __construct($form = null)
  34      {
  35          parent::__construct($form);
  36  
  37          // Set the type
  38          $this->type = 'LastvisitDateRange';
  39  
  40          // Load the required language
  41          $lang = Factory::getLanguage();
  42          $lang->load('com_users', JPATH_ADMINISTRATOR);
  43  
  44          // Set the pre-defined options
  45          $this->predefinedOptions = array(
  46              'today'       => 'COM_USERS_OPTION_RANGE_TODAY',
  47              'past_week'   => 'COM_USERS_OPTION_RANGE_PAST_WEEK',
  48              'past_1month' => 'COM_USERS_OPTION_RANGE_PAST_1MONTH',
  49              'past_3month' => 'COM_USERS_OPTION_RANGE_PAST_3MONTH',
  50              'past_6month' => 'COM_USERS_OPTION_RANGE_PAST_6MONTH',
  51              'past_year'   => 'COM_USERS_OPTION_RANGE_PAST_YEAR',
  52              'post_year'   => 'COM_USERS_OPTION_RANGE_POST_YEAR',
  53              'never'       => 'COM_USERS_OPTION_RANGE_NEVER',
  54          );
  55      }
  56  }


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