Example #1
0
	/**
	 * Processes the list of actions for a given extension and adds
	 * a link to the manual(s), if available.
	 *
	 * @param array $extension
	 * @param array $actions
	 * @return void
	 */
	public function processActions(array $extension, array &$actions) {
		if (static::$documents === NULL) {
			/** @var \TYPO3\CMS\Documentation\Controller\DocumentController $documentController */
			$documentController = $this->objectManager->get(\TYPO3\CMS\Documentation\Controller\DocumentController::class);
			static::$documents = $documentController->getDocuments();
		}

		$extensionKey = $extension['key'];
		$documentKey = 'typo3cms.extensions.' . $extensionKey;

		if (isset(static::$documents[$documentKey])) {
			$document = static::$documents[$documentKey];

			foreach ($document->getTranslations() as $documentTranslation) {
				$actions[] = FormatsViewHelper::renderStatic(
					array(
						'documentTranslation' => $documentTranslation,
					),
					function() {},
					new RenderingContext()
				);
			}
		} else {
			$actions[] = '<span class="btn btn-default disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</span>';
			$actions[] = '<span class="btn btn-default disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</span>';
			$actions[] = '<span class="btn btn-default disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</span>';
		}
	}
Example #2
0
 /**
  * Processes the list of actions for a given extension and adds
  * a link to the manual(s), if available.
  *
  * @param array $extension
  * @param array $actions
  * @return void
  */
 public function processActions(array $extension, array &$actions)
 {
     if (static::$documents === NULL) {
         /** @var \TYPO3\CMS\Documentation\Controller\DocumentController $documentController */
         $documentController = $this->objectManager->get('TYPO3\\CMS\\Documentation\\Controller\\DocumentController');
         static::$documents = $documentController->getDocuments();
     }
     $extensionKey = $extension['key'];
     $documentKey = 'typo3cms.extensions.' . $extensionKey;
     if (isset(static::$documents[$documentKey])) {
         $document = static::$documents[$documentKey];
         /** @var \TYPO3\CMS\Documentation\ViewHelpers\FormatsViewHelper $formatsViewHelper */
         $formatsViewHelper = $this->objectManager->get('TYPO3\\CMS\\Documentation\\ViewHelpers\\FormatsViewHelper');
         foreach ($document->getTranslations() as $documentTranslation) {
             $actions[] = $formatsViewHelper->render($documentTranslation);
         }
     }
 }
Example #3
0
 /**
  * Processes the list of actions for a given extension and adds
  * a link to the manual(s), if available.
  *
  * @param array $extension
  * @param array $actions
  * @return void
  */
 public function processActions(array $extension, array &$actions)
 {
     if (static::$documents === null) {
         /** @var \TYPO3\CMS\Documentation\Controller\DocumentController $documentController */
         $documentController = $this->objectManager->get(\TYPO3\CMS\Documentation\Controller\DocumentController::class);
         static::$documents = $documentController->getDocuments();
     }
     $extensionKey = $extension['key'];
     $documentKey = 'typo3cms.extensions.' . $extensionKey;
     if (isset(static::$documents[$documentKey])) {
         $document = static::$documents[$documentKey];
         foreach ($document->getTranslations() as $documentTranslation) {
             $actions[] = FormatsViewHelper::renderStatic(['documentTranslation' => $documentTranslation], function () {
             }, new RenderingContext());
         }
     } else {
         $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
         $emptyIcon = $iconFactory->getIcon('empty-empty', Icon::SIZE_SMALL)->render();
         $actions[] = '<span class="btn btn-default disabled">' . $emptyIcon . '</span>';
         $actions[] = '<span class="btn btn-default disabled">' . $emptyIcon . '</span>';
         $actions[] = '<span class="btn btn-default disabled">' . $emptyIcon . '</span>';
     }
 }