[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/installation/template/ -> error.php (source)

   1  <?php
   2  
   3  /**
   4   * @package Joomla.Installation
   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  defined('_JEXEC') or die;
  11  
  12  use Joomla\CMS\Language\Text;
  13  use Joomla\CMS\Router\Route;
  14  
  15  /** @var \Joomla\CMS\Document\ErrorDocument $this */
  16  // Add required assets
  17  $this->getWebAssetManager()
  18      ->registerAndUseStyle('template.installation', 'template' . ($this->direction === 'rtl' ? '-rtl' : '') . '.css')
  19      ->useScript('core')
  20      ->registerAndUseScript('template.installation', 'installation/template/js/template.js', [], [], ['core']);
  21  
  22  $this->getWebAssetManager()
  23      ->useStyle('webcomponent.joomla-alert')
  24      ->useScript('messages');
  25  
  26  // Add script options
  27  $this->addScriptOptions('system.installation', ['url' => Route::_('index.php')]);
  28  
  29  // Set page title
  30  $this->setTitle($this->error->getCode() . ' - ' . htmlspecialchars($this->error->getMessage(), ENT_QUOTES, 'UTF-8'));
  31  
  32  $this->setMetaData('viewport', 'width=device-width, initial-scale=1');
  33  
  34  ?>
  35  <!DOCTYPE html>
  36  <html lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
  37      <head>
  38          <jdoc:include type="metas" />
  39          <jdoc:include type="styles" />
  40      </head>
  41      <body>
  42          <div class="j-install">
  43              <!-- Header -->
  44              <header class="j-header" role="banner">
  45                  <div class="j-header-logo">
  46                      <img src="<?php echo $this->baseurl; ?>/template/images/logo.svg" alt="" class="logo"/>
  47                  </div>
  48                  <div class="j-header-help">
  49                      <a href="https://docs.joomla.org/Special:MyLanguage/J4.x:Installing_Joomla">
  50                          <span class="icon-lightbulb" aria-hidden="true"></span>
  51                          <span class="visually-hidden"><?php echo Text::_('INSTL_HELP_LINK'); ?></span>
  52                      </a>
  53                  </div>
  54              </header>
  55              <!-- Container -->
  56              <section class="j-container">
  57                  <jdoc:include type="message" />
  58                  <div id="javascript-warning">
  59                      <noscript>
  60                          <?php echo Text::_('INSTL_WARNJAVASCRIPT'); ?>
  61                      </noscript>
  62                  </div>
  63                  <div id="container-installation" class="container-installation flex">
  64                      <div class="j-install-step active">
  65                          <div class="j-install-step-header">
  66                              <span class="icon-exclamation" aria-hidden="true"></span> <?php echo Text::_('INSTL_ERROR'); ?>
  67                          </div>
  68                          <div class="j-install-step-form">
  69                              <div class="alert preinstall-alert">
  70                                  <div class="alert-icon">
  71                                      <span class="alert-icon icon-exclamation-triangle" aria-hidden="true"></span>
  72                                  </div>
  73                                  <div class="alert-text">
  74                                      <h2><?php echo Text::_('JERROR_LAYOUT_ERROR_HAS_OCCURRED_WHILE_PROCESSING_YOUR_REQUEST'); ?></h2>
  75                                      <p class="form-text small"><span class="badge bg-secondary"><?php echo $this->error->getCode(); ?></span> <?php echo htmlspecialchars($this->error->getMessage(), ENT_QUOTES, 'UTF-8'); ?></p>
  76                                  </div>
  77                              </div>
  78                              <?php if ($this->debug) : ?>
  79                                  <div>
  80                                      <?php echo $this->renderBacktrace(); ?>
  81                                      <?php // Check if there are more Exceptions and render their data as well ?>
  82                                      <?php if ($this->error->getPrevious()) : ?>
  83                                          <?php $loop = true; ?>
  84                                          <?php // Reference $this->_error here and in the loop as setError() assigns errors to this property and we need this for the backtrace to work correctly ?>
  85                                          <?php // Make the first assignment to setError() outside the loop so the loop does not skip Exceptions ?>
  86                                          <?php $this->setError($this->_error->getPrevious()); ?>
  87                                          <?php while ($loop === true) : ?>
  88                                              <p><strong><?php echo Text::_('JERROR_LAYOUT_PREVIOUS_ERROR'); ?></strong></p>
  89                                              <p><?php echo htmlspecialchars($this->_error->getMessage(), ENT_QUOTES, 'UTF-8'); ?></p>
  90                                              <?php echo $this->renderBacktrace(); ?>
  91                                              <?php $loop = $this->setError($this->_error->getPrevious()); ?>
  92                                          <?php endwhile; ?>
  93                                          <?php // Reset the main error object to the base error ?>
  94                                          <?php $this->setError($this->error); ?>
  95                                      <?php endif; ?>
  96                                  </div>
  97                              <?php endif; ?>
  98                          </div>
  99                      </div>
 100                  </div>
 101              </section>
 102              <jdoc:include type="scripts" />
 103              <footer class="j-footer">
 104                  <a href="https://www.joomla.org" target="_blank">Joomla!</a>
 105                  is free software released under the
 106                  <a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.html" target="_blank" rel="noopener noreferrer">GNU General Public License</a>
 107              </footer>
 108          </div>
 109      </body>
 110  </html>


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