first commit

This commit is contained in:
2024-07-15 11:28:08 +02:00
commit f52d538ea5
21891 changed files with 6161164 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
<?php
/**
* @package solo
* @copyright Copyright (c)2014-2019 Nicholas K. Dionysopoulos / Akeeba Ltd
* @license GNU GPL version 3 or later
*/
use Awf\Html;
use Awf\Text\Text;
defined('_AKEEBA') or die();
// Used for type hinting
/** @var \Solo\View\Log\Html $this */
$router = $this->container->router;
$inCMS = $this->container->segment->get('insideCMS', false);
?>
<?php if(count($this->logs)): ?>
<form name="adminForm" id="adminForm" action="<?php echo $router->route('index.php?view=log') ?>" method="POST"
class="akeeba-form--inline">
<div class="akeeba-form-group">
<label for="tag">
<?php echo Text::_('COM_AKEEBA_LOG_CHOOSE_FILE_TITLE'); ?>
</label>
<?php echo Html\Select::genericList($this->logs, 'tag', 'onchange=this.form.submit()', 'value', 'text', $this->tag, 'tag') ?>
</div>
<?php if(!empty($this->tag)): ?>
<div class="akeeba-form-group--actions">
<button class="akeeba-btn--teal" onclick="window.location='<?php echo $router->route('index.php?view=log&format=raw&task=download&tag=' . urlencode($this->tag)); ?>'; return false;">
<span class="akion-android-download"></span>
<?php echo Text::_('COM_AKEEBA_LOG_LABEL_DOWNLOAD'); ?>
</button>
</div>
<br/>
<hr/>
<div class="iframe-holder" id="frame-holder">
<?php if ($this->logTooBig):?>
<p class="alert alert-info">
<?php echo Text::sprintf('COM_AKEEBA_LOG_SIZE_WARNING', number_format($this->logSize / (1024 * 1024), 2))?>
</p>
<span class="akeeba-btn--orange" id="showlog">
<?php echo Text::_('COM_AKEEBA_LOG_SHOW_LOG')?>
</span>
<?php else:?>
<iframe
src="<?php echo $router->route('index.php?view=log&task=iframe&tmpl=component&layout=raw&tag=' . urlencode($this->tag)) ?>"
width="99%" height="500px">
</iframe>
<?php endif;?>
</div>
<?php endif; ?>
<input type="hidden" name="token" value="<?php echo $this->container->session->getCsrfToken()->getValue() ?>" >
</form>
<?php else: ?>
<div class="alert alert-danger">
<?php echo Text::_('COM_AKEEBA_LOG_NONE_FOUND') ?>
</div>
<?php endif; ?>

View File

@@ -0,0 +1,76 @@
<?php
/**
* @package solo
* @copyright Copyright (c)2014-2019 Nicholas K. Dionysopoulos / Akeeba Ltd
* @license GNU GPL version 3 or later
*/
use Awf\Text\Text;
defined('_AKEEBA') or die();
// Used for type hinting
/** @var \Solo\View\Log\Html $this */
$router = $this->container->router;
// -- Get the log's file name
$tag = $this->tag;
$logName = \Akeeba\Engine\Factory::getLog()->getLogFilename($tag);
if(!@file_exists($logName))
{
// Oops! The log doesn't exist!
echo '<p>' . Text::sprintf('SOLO_LOG_ERR_LOGFILENOTEXISTS', $logName).'</p>';
return;
}
else
{
// Allright, let's load and render it
$fp = fopen( $logName, "rt" );
if ($fp === FALSE)
{
// Oops! The log isn't readable?!
echo '<p>'.Text::_('COM_AKEEBA_LOG_ERROR_UNREADABLE').'</p>';
return;
}
echo "<table class='akeeba-table-striped'>\n";
echo "<thead><tr><th width='80'>Type</th><th width='150'>Time</th><th>Message</th></tr></thead>";
while( !feof($fp) )
{
$line = fgets( $fp );
if(!$line) return;
$exploded = explode( "|", $line, 3 );
unset( $line );
$class = '';
switch( trim($exploded[0]) )
{
case "ERROR":
$fmtString = "<span class='akeeba-label--red'>ERROR</span>";
$class = 'bg-danger';
break;
case "WARNING":
$fmtString = "<span class='akeeba-label--orange'>WARNING</span>";
$class = 'bg-warning';
break;
case "INFO":
$fmtString = "<span class='akeeba-label--teal'>INFO</span>";
$class = 'bg-info';
break;
case "DEBUG":
$fmtString = "<span class='akeeba-label--grey'>DEBUG</span>";
$class = 'text-muted';
break;
default:
$fmtString = "";
break;
}
echo '<tr class="' . $class . '"><td>' . $fmtString . '</td><td>' . $exploded[1] . '</td><td>' . htmlspecialchars($exploded[2]) . "</td></tr>\n";
unset( $exploded );
unset( $fmtString );
}
echo "</table>";
}