2
0
Derivar 0

Change FieldWizard to FieldInformation

Este cometimento está contido em:
Sebastian Meyer 2021-01-04 13:59:29 +01:00
ascendente f71e10b463
cometimento 55592ee7cf
9 ficheiros modificados com 19 adições e 18 eliminações

Ver ficheiro

@ -16,7 +16,7 @@ use Kitodo\Dlf\Common\Helper;
use TYPO3\CMS\Backend\Form\AbstractNode;
/**
* FieldWizard renderType for TYPO3 FormEngine
* FieldInformation renderType for TYPO3 FormEngine
*
* @author Sebastian Meyer <sebastian.meyer@slub-dresden.de>
* @package TYPO3

Ver ficheiro

@ -17,7 +17,7 @@ use Kitodo\Dlf\Common\Solr;
use TYPO3\CMS\Backend\Form\AbstractNode;
/**
* FieldWizard renderType for TYPO3 FormEngine
* FieldInformation renderType for TYPO3 FormEngine
*
* @author Sebastian Meyer <sebastian.meyer@slub-dresden.de>
* @package TYPO3
@ -49,15 +49,16 @@ class SolrCoreStatus extends AbstractNode
$action = $coreAdminQuery->createStatus();
$action->setCore($core);
$coreAdminQuery->setAction($action);
$result = $solr->service->coreAdmin($coreAdminQuery)->getStatusResult();
$uptime = $result->getUptime();
$numDocuments = $result->getNumberOfDocuments();
$startTime = $result->getStartTime() ? date_format($result->getStartTime(), 'c') : 'N/A';
$lastModified = $result->getLastModified() ? date_format($result->getLastModified(), 'c') : 'N/A';
$response = $solr->service->coreAdmin($coreAdminQuery)->getStatusResult();
$uptimeInSeconds = floor($response->getUptime() / 1000);
$uptime = floor($uptimeInSeconds / 3600) . gmdate(":i:s.", $uptimeInSeconds % 3600) . $response->getUptime() % 1000;
$numDocuments = $response->getNumberOfDocuments();
$startTime = $response->getStartTime() ? date_format($response->getStartTime(), 'c') : 'N/A';
$lastModified = $response->getLastModified() ? date_format($response->getLastModified(), 'c') : 'N/A';
// Create flash message.
Helper::addMessage(
nl2br(htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('flash.coreStatusDetails'), $startTime, $uptime, $lastModified, $numDocuments))),
htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('flash.coreStatus'), $core)),
htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('flash.coreStatusDetails'), $startTime, $uptime, $lastModified, $numDocuments)),
htmlspecialchars($GLOBALS['LANG']->getLL('flash.coreStatus')),
\TYPO3\CMS\Core\Messaging\FlashMessage::INFO
);
} else {

Ver ficheiro

@ -125,7 +125,7 @@ return [
'max' => 255,
'eval' => 'required,uniqueInPid',
'default' => '',
'fieldWizard' => [
'fieldInformation' => [
'editInProductionWarning' => [
'renderType' => 'editInProductionWarning',
],

Ver ficheiro

@ -89,7 +89,7 @@ return [
'max' => 255,
'eval' => 'required,uniqueInPid',
'default' => '',
'fieldWizard' => [
'fieldInformation' => [
'editInProductionWarning' => [
'renderType' => 'editInProductionWarning',
],

Ver ficheiro

@ -101,7 +101,7 @@ return [
'max' => 255,
'eval' => 'required,nospace,alphanum_x,uniqueInPid',
'default' => '',
'fieldWizard' => [
'fieldInformation' => [
'editInProductionWarning' => [
'renderType' => 'editInProductionWarning',
],

Ver ficheiro

@ -50,7 +50,7 @@ return [
'eval' => 'alphanum,nospace,required,unique',
'default' => '',
'readOnly' => true,
'fieldWizard' => [
'fieldInformation' => [
'solrCoreStatus' => [
'renderType' => 'solrCoreStatus',
],

Ver ficheiro

@ -111,7 +111,7 @@ return [
'max' => 255,
'eval' => 'required,nospace,alphanum_x,uniqueInPid',
'default' => '',
'fieldWizard' => [
'fieldInformation' => [
'editInProductionWarning' => [
'renderType' => 'editInProductionWarning',
],

Ver ficheiro

@ -19,7 +19,7 @@
<label index="flash.done">Done!</label>
<label index="flash.warning">Warning!</label>
<label index="flash.error">Error!</label>
<label index="flash.coreStatus">Status of Solr Core "%s"</label>
<label index="flash.coreStatus">Status of Solr Core</label>
<label index="flash.coreStatusDetails">Start Time: %s\nUptime: %s\nLast Modified: %s\nNumber of Documents: %s</label>
<label index="flash.running">Please wait...</label>
<label index="flash.newCollection">New collection "%s" [%u] added to database.</label>
@ -94,7 +94,7 @@
<label index="flash.done">Fertig!</label>
<label index="flash.warning">Warnung!</label>
<label index="flash.error">Fehler!</label>
<label index="flash.coreStatus">Status des Solr-Kerns "%s"</label>
<label index="flash.coreStatus">Status des Solr-Kerns</label>
<label index="flash.coreStatusDetails">Start Time: %s\nUptime: %s\nLast Modified: %s\nNumber of Documents: %s</label>
<label index="flash.running">Indexierung läuft...</label>
<label index="flash.newCollection">Neue Sammlung "%s" [%u] zur Datenbank hinzugefügt.</label>

Ver ficheiro

@ -254,10 +254,10 @@ if (\TYPO3_MODE === 'FE') {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][] = [
'nodeName' => 'editInProductionWarning',
'priority' => 30,
'class' => \Kitodo\Dlf\Hooks\Form\FieldWizard\EditInProductionWarning::class
'class' => \Kitodo\Dlf\Hooks\Form\FieldInformation\EditInProductionWarning::class
];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][] = [
'nodeName' => 'solrCoreStatus',
'priority' => 30,
'class' => \Kitodo\Dlf\Hooks\Form\FieldWizard\SolrCoreStatus::class
'class' => \Kitodo\Dlf\Hooks\Form\FieldInformation\SolrCoreStatus::class
];