[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_scheduler/src/Field/ -> WebcronLinkField.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Administrator
   5   * @subpackage  com_scheduler
   6   *
   7   * @copyright   (C) 2021 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\Scheduler\Administrator\Field;
  12  
  13  use Joomla\CMS\Form\Field\TextField;
  14  
  15  // phpcs:disable PSR1.Files.SideEffects
  16  \defined('_JEXEC') or die;
  17  // phpcs:enable PSR1.Files.SideEffects
  18  
  19  /**
  20   * Field to override the text field layout to add a copy-text button, used in the com_scheduler
  21   * configuration form.
  22   * This field class is only needed because the layout file is in a non-global directory, so this should
  23   * be made redundant and removed if/once the layout is shifted to `JPATH_SITE/layout/`
  24   *
  25   * @since 4.1.0
  26   */
  27  class WebcronLinkField extends TextField
  28  {
  29      /**
  30       * We use a custom layout that allows for the link to be copied.
  31       *
  32       * @var  string
  33       * @since  4.1.0
  34       */
  35      protected $layout = 'form.field.webcron_link';
  36  
  37      /**
  38       * Override layout paths.
  39       *
  40       * @inheritDoc
  41       * @return string[]
  42       *
  43       * @since  4.1.0
  44       */
  45      protected function getLayoutPaths(): array
  46      {
  47          $s = DIRECTORY_SEPARATOR;
  48  
  49          return array_merge(
  50              [JPATH_ADMINISTRATOR . "$s}/components$s}com_scheduler$s}layouts$s}"],
  51              parent::getLayoutPaths()
  52          );
  53      }
  54  }


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