[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/layouts/joomla/content/icons/ -> edit.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Site
   5   * @subpackage  Layout
   6   *
   7   * @copyright   (C) 2016 Open Source Matters, Inc. <https://www.joomla.org>
   8   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   9   */
  10  
  11  defined('_JEXEC') or die;
  12  
  13  use Joomla\CMS\Factory;
  14  use Joomla\CMS\Language\Text;
  15  
  16  $article = $displayData['article'];
  17  $tooltip = $displayData['tooltip'];
  18  $nowDate = strtotime(Factory::getDate());
  19  
  20  $icon = $article->state ? 'edit' : 'eye-slash';
  21  $currentDate   = Factory::getDate()->format('Y-m-d H:i:s');
  22  $isUnpublished = ($article->publish_up > $currentDate)
  23      || !is_null($article->publish_down) && ($article->publish_down < $currentDate);
  24  
  25  if ($isUnpublished) {
  26      $icon = 'eye-slash';
  27  }
  28  $aria_described = 'editarticle-' . (int) $article->id;
  29  
  30  ?>
  31  <span class="icon-<?php echo $icon; ?>" aria-hidden="true"></span>
  32      <?php echo Text::_('JGLOBAL_EDIT'); ?>
  33  <div role="tooltip" id="<?php echo $aria_described; ?>">
  34      <?php echo $tooltip; ?>
  35  </div>


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