Mit neuen Manfest
This commit is contained in:
@@ -1,38 +1,72 @@
|
||||
<?php defined('_JEXEC') or die;
|
||||
<?php
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Session\Session;
|
||||
|
||||
$item = $this->getItem();
|
||||
$pdfPath = $item['pdf_path'] ?? '';
|
||||
// Wert aus der View (HtmlView::getPdfPath()), Fallback leer
|
||||
$pdfPath = method_exists($this, 'getPdfPath') ? (string) $this->getPdfPath() : '';
|
||||
?>
|
||||
<h2 class="mb-3">
|
||||
<?php echo Text::_('COM_EIS_SETTINGS_TITLE') ?: 'Einstellungen'; ?>
|
||||
</h2>
|
||||
|
||||
<h2><?php echo Text::_('COM_EIS_CONFIG_TITLE'); ?></h2>
|
||||
<form action="<?php echo Route::_('index.php?option=com_eis&task=config.save'); ?>"
|
||||
method="post"
|
||||
name="adminForm"
|
||||
id="adminForm"
|
||||
novalidate>
|
||||
<div class="form-horizontal">
|
||||
<fieldset class="adminform">
|
||||
<legend><?php echo Text::_('COM_EIS_FIELDSET_GENERAL') ?: 'Allgemein'; ?></legend>
|
||||
|
||||
<form action="<?php echo Route::_('index.php?option=com_eis&task=config.save'); ?>" method="post" name="adminForm" id="adminForm">
|
||||
<div class="form-horizontal">
|
||||
<fieldset class="adminform">
|
||||
<legend><?php echo Text::_('COM_EIS_FIELDSET_SETTINGS'); ?></legend>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="document_root">
|
||||
<?php echo Text::_('COM_EIS_FIELD_DOCUMENT_ROOT_LABEL') ?: 'Basis-Verzeichnis für PDFs'; ?>
|
||||
</label>
|
||||
<div class="controls">
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
name="document_root"
|
||||
id="document_root"
|
||||
value="<?php echo htmlspecialchars($pdfPath, ENT_QUOTES, 'UTF-8'); ?>"
|
||||
placeholder="/var/www/pdf"
|
||||
size="60"
|
||||
required
|
||||
/>
|
||||
<p class="help-block" style="margin-top:.35rem;">
|
||||
<?php echo Text::_('COM_EIS_FIELD_DOCUMENT_ROOT_DESC')
|
||||
?: 'Absoluter Serverpfad, in dem die PDF-Dateien liegen (z. B. /var/www/pdf).'; ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="pdf_path">
|
||||
<?php echo Text::_('COM_EIS_FIELD_PDF_PATH'); ?>
|
||||
</label>
|
||||
<div class="controls">
|
||||
<input type="text" name="pdf_path" id="pdf_path" value="<?php echo htmlspecialchars($pdfPath, ENT_QUOTES); ?>" size="60" />
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<?php echo Text::_('JSAVE') ?: 'Speichern'; ?>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<?php echo Text::_('JSAVE'); ?>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<?php echo HTMLHelper::_('form.token'); ?>
|
||||
<?php echo HTMLHelper::_('form.token'); ?>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const form = document.getElementById('adminForm');
|
||||
if (!form) return;
|
||||
|
||||
form.addEventListener('submit', function (e) {
|
||||
const input = document.getElementById('document_root');
|
||||
if (!input || !input.value.trim()) {
|
||||
e.preventDefault();
|
||||
alert('<?php echo Text::_('COM_EIS_MSG_INVALID_PATH') ?: 'Bitte einen gültigen Pfad angeben.'; ?>');
|
||||
input?.focus();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user