[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_templates/tmpl/template/ -> default_tree.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Administrator
   5   * @subpackage  com_templates
   6   *
   7   * @copyright   (C) 2013 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\Router\Route;
  14  
  15  ksort($this->files, SORT_NATURAL);
  16  ?>
  17  
  18  <ul class="directory-tree treeselect">
  19      <?php foreach ($this->files as $key => $value) : ?>
  20          <?php if (is_array($value)) : ?>
  21              <?php
  22              $keyArray  = explode('/', rtrim($key, '\\'));
  23              $fileArray = explode('/', $this->fileName);
  24              $count     = 0;
  25  
  26              $keyArrayCount = count($keyArray);
  27  
  28              if (count($fileArray) >= $keyArrayCount) {
  29                  for ($i = 0; $i < $keyArrayCount; $i++) {
  30                      if ($keyArray[$i] === $fileArray[$i]) {
  31                          $count++;
  32                      }
  33                  }
  34  
  35                  if ($count === $keyArrayCount) {
  36                      $class = 'folder show';
  37                  } else {
  38                      $class = 'folder';
  39                  }
  40              } else {
  41                  $class = 'folder';
  42              }
  43  
  44              ?>
  45              <li class="<?php echo $class; ?>">
  46                  <a class="folder-url" href="">
  47                      <span class="icon-folder icon-fw" aria-hidden="true"></span>&nbsp;<?php $explodeArray = explode('/', $key);
  48                      echo $this->escape(end($explodeArray)); ?>
  49                  </a>
  50                  <?php echo $this->directoryTree($value); ?>
  51              </li>
  52          <?php endif; ?>
  53          <?php if (is_object($value)) : ?>
  54              <li>
  55                  <a class="file" href='<?php echo Route::_('index.php?option=com_templates&view=template&id=' . $this->id . '&file=' . $value->id . '&isMedia=0'); ?>'>
  56                      <span class="icon-file-alt" aria-hidden="true"></span>&nbsp;<?php echo $this->escape($value->name); ?>
  57                  </a>
  58              </li>
  59          <?php endif; ?>
  60      <?php endforeach; ?>
  61  </ul>


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