commands for creating previews can be set

This commit is contained in:
Uwe Steinmann 2017-11-21 17:34:24 +01:00
parent 1d8743fd7f
commit 1d21c18aa3
2 changed files with 40 additions and 11 deletions

View File

@ -194,12 +194,24 @@ if ($action == "saveSettings")
$settings->_maxExecutionTime = intval($_POST["maxExecutionTime"]); $settings->_maxExecutionTime = intval($_POST["maxExecutionTime"]);
$settings->_cmdTimeout = (intval($_POST["cmdTimeout"]) > 0) ?intval($_POST["cmdTimeout"]) : 1; $settings->_cmdTimeout = (intval($_POST["cmdTimeout"]) > 0) ?intval($_POST["cmdTimeout"]) : 1;
// SETTINGS - ADVANCED - INDEX CMD // SETTINGS - ADVANCED - INDEX CMD
$settings->_converters['fulltext'] = $_POST["converters"]; if(isset($_POST["converters"]["fulltext"]))
$newmimetype = preg_replace('#[^A-Za-z0-9_/+.*-]+#', '', $_POST["converters_newmimetype"]); $settings->_converters['fulltext'] = $_POST["converters"]["fulltext"];
if($newmimetype && trim($_POST["converters_newcmd"])) { else
$settings->_converters['fulltext'][$newmimetype] = trim($_POST["converters_newcmd"]); $settings->_converters['fulltext'] = $_POST["converters"];
} $newmimetype = preg_replace('#[^A-Za-z0-9_/+.*-]+#', '', $settings->_converters["fulltext"]["newmimetype"]);
if($newmimetype && trim($settings->_converters['fulltext']['newcmd']))
$settings->_converters['fulltext'][$newmimetype] = trim($settings->_converters['fulltext']['newcmd']);
unset($settings->_converters['fulltext']['newmimetype']);
unset($settings->_converters['fulltext']['newcmd']);
if(isset($_POST["converters"]["preview"]))
$settings->_converters['preview'] = $_POST["converters"]["preview"];
$newmimetype = preg_replace('#[^A-Za-z0-9_/+.*-]+#', '', $settings->_converters["preview"]["newmimetype"]);
if($newmimetype && trim($settings->_converters['preview']['newcmd']))
$settings->_converters['preview'][$newmimetype] = trim($settings->_converters['preview']['newcmd']);
unset($settings->_converters['preview']['newmimetype']);
unset($settings->_converters['preview']['newcmd']);
// SETTINGS - EXTENSIONS // SETTINGS - EXTENSIONS
$settings->_extensions = isset($_POST["extensions"]) ? $_POST["extensions"] : array(); $settings->_extensions = isset($_POST["extensions"]) ? $_POST["extensions"] : array();

View File

@ -740,20 +740,37 @@ if(!is_writeable($settings->_configFilePath)) {
?> ?>
<tr title="<?php echo $mimetype;?>"> <tr title="<?php echo $mimetype;?>">
<td><?php echo $mimetype;?>:</td> <td><?php echo $mimetype;?>:</td>
<td><?php $this->showTextField("converters[".$mimetype."]", htmlspecialchars($cmd)); ?></td> <td><?php $this->showTextField("converters[fulltext][".$mimetype."]", htmlspecialchars($cmd)); ?></td>
</tr> </tr>
<?php <?php
} }
?> ?>
<tr title=""> <tr title="">
<td><?php $this->showTextField("converters_newmimetype", "", '', getMLText('mimetype')); ?></td> <td><?php $this->showTextField("converters[fulltext][newmimetype]", "", '', getMLText('converter_new_mimetype')); ?>:</td>
<td><?php $this->showTextField("converters_newcmd", "", '', getMLText('command')); ?></td> <td><?php $this->showTextField("converters[fulltext][newcmd]", "", "", getMLText('converter_new_cmd')); ?></td>
</tr>
<tr ><td><b> <?php printMLText("preview_converters");?></b></td> </tr>
<?php
if(isset($settings->_converters['preview'])) {
foreach($settings->_converters['preview'] as $mimetype=>$cmd) {
?>
<tr title="<?php echo $mimetype;?>">
<td><?php echo $mimetype;?>:</td>
<td><?php $this->showTextField("converters[preview][".$mimetype."]", htmlspecialchars($cmd)); ?></td>
</tr>
<?php
}
}
?>
<tr title="">
<td><?php $this->showTextField("converters[preview][newmimetype]", "", '', getMLText('mimetype')); ?>:</td>
<td><?php $this->showTextField("converters[preview][newcmd]", "", '', getMLText('command')); ?></td>
</tr> </tr>
</table> </table>
<?php $this->contentContainerEnd(); ?> <?php $this->contentContainerEnd(); ?>
</div> </div>
<div class="tab-pane <?php if($currenttab == 'extensions') echo 'active'; ?>" id="extensions"> <div class="tab-pane <?php if($currenttab == 'extensions') echo 'active'; ?>" id="extensions">
<?php $this->contentContainerStart(); ?> <?php $this->contentContainerStart(); ?>
<table class="table-condensed"> <table class="table-condensed">
<!-- <!--
@ -762,7 +779,7 @@ if(!is_writeable($settings->_configFilePath)) {
<?php <?php
foreach($GLOBALS['EXT_CONF'] as $extname=>$extconf) { foreach($GLOBALS['EXT_CONF'] as $extname=>$extconf) {
?> ?>
<tr><td><a name="<?php echo $extname;?>"></a><b><?php echo $extconf['title'];?></b></td></tr> <tr><td><a name="<?php echo $extname;?>"></a><b><?php echo $extconf['title'];?></b></td></tr>
<?php <?php
foreach($extconf['config'] as $confkey=>$conf) { foreach($extconf['config'] as $confkey=>$conf) {
?> ?>