[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_plugins/tmpl/plugin/ -> edit.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Administrator
   5   * @subpackage  com_plugins
   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  defined('_JEXEC') or die;
  12  
  13  use Joomla\CMS\Factory;
  14  use Joomla\CMS\HTML\HTMLHelper;
  15  use Joomla\CMS\Language\Text;
  16  use Joomla\CMS\Layout\LayoutHelper;
  17  use Joomla\CMS\Router\Route;
  18  
  19  /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
  20  $wa = $this->document->getWebAssetManager();
  21  $wa->useScript('keepalive')
  22      ->useScript('form.validate');
  23  
  24  $this->fieldsets = $this->form->getFieldsets('params');
  25  $this->useCoreUI = true;
  26  
  27  $input = Factory::getApplication()->input;
  28  
  29  // In case of modal
  30  $isModal  = $input->get('layout') === 'modal';
  31  $layout   = $isModal ? 'modal' : 'edit';
  32  $tmpl     = $isModal || $input->get('tmpl', '', 'cmd') === 'component' ? '&tmpl=component' : '';
  33  ?>
  34  
  35  <form action="<?php echo Route::_('index.php?option=com_plugins&view=plugin&layout=' . $layout . $tmpl . '&extension_id=' . (int) $this->item->extension_id); ?>" method="post" name="adminForm" id="style-form" aria-label="<?php echo Text::_('COM_PLUGINS_FORM_EDIT'); ?>" class="form-validate">
  36      <div class="main-card">
  37  
  38          <?php echo HTMLHelper::_('uitab.startTabSet', 'myTab', ['active' => 'general', 'recall' => true, 'breakpoint' => 768]); ?>
  39  
  40          <?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'general', Text::_('COM_PLUGINS_PLUGIN')); ?>
  41  
  42          <div class="row mt-2">
  43              <div class="col-lg-9">
  44                  <?php if ($this->item->xml) : ?>
  45                      <?php if ($this->item->xml->description) : ?>
  46                          <h2>
  47                          <?php
  48                          if ($this->item->xml) {
  49                              echo ($text = (string) $this->item->xml->name) ? Text::_($text) : $this->item->name;
  50                          } else {
  51                              echo Text::_('COM_PLUGINS_XML_ERR');
  52                          }
  53                          ?>
  54                          </h2>
  55                          <div class="info-labels mb-1">
  56                              <span class="badge bg-secondary">
  57                                  <?php echo $this->form->getValue('folder'); ?>
  58                              </span> /
  59                              <span class="badge bg-secondary">
  60                                  <?php echo $this->form->getValue('element'); ?>
  61                              </span>
  62                          </div>
  63                          <div>
  64                              <?php
  65                              $this->fieldset    = 'description';
  66                              $short_description = Text::_($this->item->xml->description);
  67                              $long_description  = LayoutHelper::render('joomla.edit.fieldset', $this);
  68  
  69                              if (!$long_description) {
  70                                  $truncated = HTMLHelper::_('string.truncate', $short_description, 550, true, false);
  71  
  72                                  if (strlen($truncated) > 500) {
  73                                      $long_description  = $short_description;
  74                                      $short_description = HTMLHelper::_('string.truncate', $truncated, 250);
  75  
  76                                      if ($short_description == $long_description) {
  77                                          $long_description = '';
  78                                      }
  79                                  }
  80                              }
  81                              ?>
  82                              <p><?php echo $short_description; ?></p>
  83                              <?php if ($long_description) : ?>
  84                                  <p class="readmore">
  85                                      <a href="#" onclick="document.querySelector('[aria-controls=description]').click();">
  86                                          <?php echo Text::_('JGLOBAL_SHOW_FULL_DESCRIPTION'); ?>
  87                                      </a>
  88                                  </p>
  89                              <?php endif; ?>
  90                          </div>
  91                      <?php endif; ?>
  92                  <?php else : ?>
  93                          <div class="alert alert-danger">
  94                          <span class="icon-exclamation-triangle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('ERROR'); ?></span>
  95                              <?php echo Text::_('COM_PLUGINS_XML_ERR'); ?>
  96                          </div>
  97                  <?php endif; ?>
  98                  <?php
  99                  $this->fieldset = 'basic';
 100                  $html = LayoutHelper::render('joomla.edit.fieldset', $this);
 101                  echo $html ? '<hr>' . $html : '';
 102                  ?>
 103              </div>
 104              <div class="col-lg-3">
 105                  <?php
 106                  // Set main fields.
 107                  $this->fields = array(
 108                      'enabled',
 109                      'access',
 110                      'ordering',
 111                      'folder',
 112                      'element',
 113                      'note',
 114                  ); ?>
 115                  <?php echo LayoutHelper::render('joomla.edit.global', $this); ?>
 116              </div>
 117          </div>
 118          <?php echo HTMLHelper::_('uitab.endTab'); ?>
 119  
 120          <?php if (isset($long_description) && $long_description != '') : ?>
 121              <?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'description', Text::_('JGLOBAL_FIELDSET_DESCRIPTION')); ?>
 122              <?php echo $long_description; ?>
 123              <?php echo HTMLHelper::_('uitab.endTab'); ?>
 124          <?php endif; ?>
 125  
 126          <?php
 127          $this->fieldsets = array();
 128          $this->ignore_fieldsets = array('basic', 'description');
 129          echo LayoutHelper::render('joomla.edit.params', $this);
 130          ?>
 131  
 132          <?php echo HTMLHelper::_('uitab.endTabSet'); ?>
 133      </div>
 134  
 135      <input type="hidden" name="task" value="">
 136      <?php echo HTMLHelper::_('form.token'); ?>
 137  </form>


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