コード例 #1
0
    /**
     * Renders a single service's row.
     *
     * @param string $serviceKey The service key to access the service.
     * @param array $serviceInformation registration information of the service.
     * @return string HTML row for the service.
     */
    protected function renderServiceRow($serviceKey, $serviceInformation)
    {
        $serviceDescription = '
			<p class="service-header">
				<span class="service-title">' . $serviceInformation['title'] . '</span> (' . $serviceInformation['extKey'] . ': ' . $serviceKey . ')
			</p>';
        if (!empty($serviceInformation['description'])) {
            $serviceDescription .= '<p class="service-description">' . $serviceInformation['description'] . '</p>';
        }
        $serviceSubtypes = empty($serviceInformation['serviceSubTypes']) ? '-' : implode(', ', $serviceInformation['serviceSubTypes']);
        $serviceOperatingSystem = empty($serviceInformation['os']) ? $GLOBALS['LANG']->getLL('any') : $serviceInformation['os'];
        $serviceRequiredExecutables = empty($serviceInformation['exec']) ? '-' : $serviceInformation['exec'];
        $serviceAvailabilityClass = 'typo3-message message-error';
        $serviceAvailable = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:no');
        try {
            $serviceDetails = \t3lib_extmgm::findServiceByKey($serviceKey);
            if ($serviceDetails['available']) {
                $serviceAvailabilityClass = 'typo3-message message-ok';
                $serviceAvailable = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:yes');
            }
        } catch (\TYPO3\CMS\Core\Exception $e) {
        }
        $serviceRow = '
		<tr class="service">
			<td class="first-cell ' . $serviceAvailabilityClass . '">' . $serviceDescription . '</td>
			<td class="cell ' . $serviceAvailabilityClass . '">' . $serviceInformation['priority'] . '</td>
			<td class="cell ' . $serviceAvailabilityClass . '">' . $serviceInformation['quality'] . '</td>
			<td class="cell ' . $serviceAvailabilityClass . '">' . $serviceSubtypes . '</td>
			<td class="cell ' . $serviceAvailabilityClass . '">' . $serviceOperatingSystem . '</td>
			<td class="cell ' . $serviceAvailabilityClass . '">' . $serviceRequiredExecutables . '</td>
			<td class="last-cell ' . $serviceAvailabilityClass . '">' . $serviceAvailable . '</td>
		</tr>';
        return $serviceRow;
    }