Get icons list, compiled from FontAwesome variables list

@param NodeInterface $node The node that is currently edited (optional)
@param array $arguments Additional arguments (key / value)
@return array JSON serializable data
554505
public function getData(NodeInterface $node = null, array $arguments)
    {
        $data = [];

        foreach ($this->parseListOfIcons() as $iconName) {
            $data['fa-' . $iconName] = [
                'label' => $iconName,
                'icon' => 'fa fa-' . $iconName,
            ];
        }

        return $data;
    }
47794
public function addNode(NodeInterface $node): NodeInterface
    {
        $this->_nodes[$node->getId()] = $node;

        if ($this->getParent()) {
            $this->getParent()->addNode($node);
        }

        return $this;
    }
469967
private function getTextNode(NodeInterface $node)
    {
        $textNode = $this->textNodeManager->findTextNodeByNode($node);

        if (null === $textNode) {
            $textNode = $this->textNodeManager->create();
            $text = $this->textManager->create();

            $textNode->setText($text);
            $textNode->setNode($node);
            $this->textManager->add($text);
            $this->textNodeManager->add($textNode);
        }

        return $textNode;
    }
1222504
public function getData(NodeInterface $node = null, array $arguments)
    {
        if (!isset($arguments['stat'])) {
            throw new \InvalidArgumentException('Missing "stat" argument', 1416864525);
        }

        $startDateArgument = isset($arguments['startDate']) ? $arguments['startDate'] : '3 months ago';
        $endDateArgument = isset($arguments['endDate']) ? $arguments['endDate'] : '1 day ago';
        try {
            $startDate = new \DateTime($startDateArgument);
        } catch (\Exception $exception) {
            return ['error' => ['message' => 'Invalid date format for argument "startDate"', 'code' => 1417435564]];
        }
        try {
            $endDate = new \DateTime($endDateArgument);
        } catch (\Exception $exception) {
            return ['error' => ['message' => 'Invalid date format for argument "endDate"', 'code' => 1417435581]];
        }
        try {
            $stats = $this->reporting->getNodeStat($node, $this->controllerContext, $arguments['stat'], $startDate, $endDate);
            $data = [
                'data' => $stats
            ];

            return $data;
        } catch (\Google_Service_Exception $exception) {
            $errors = $exception->getErrors();

            return [
                'error' => [
                    'message' => isset($errors[0]['message']) ? $errors[0]['message'] : 'Google API returned error',
                    'code' => isset($errors[0]['reason']) ? $errors[0]['reason'] : 1417606128
                ]
            ];
        } catch (Exception $exception) {
            return [
                'error' => [
                    'message' => $exception->getMessage(),
                    'code' => $exception->getCode()
                ]
            ];
        }
    }
1314732
static public function getIconsFromFont($fontPath)
	{
		if (!$fontPath || !file_exists(TL_ROOT . '/' . $fontPath)) {
			return array();
		}

		// calculate the cache key
		$cacheKey = md5_file(TL_ROOT . '/' . $fontPath);
		if (file_exists($infoFilePath = TL_ROOT . '/' . substr($fontPath, 0, -4) . '.html')) {
			$cacheKey = md5($cacheKey . md5_file($infoFilePath));
		}
		if (file_exists($infoFilePath = TL_ROOT . '/' . substr($fontPath, 0, -4) . '.css')) {
			$cacheKey = md5($cacheKey . md5_file($infoFilePath));
		}
		$cacheDirPaths = static::getCacheDirPaths();
		$cacheFilePath = $cacheDirPaths['path'] . '/' . $cacheKey . '.php';
		$cacheFileFullPath = $cacheDirPaths['fullPath'] . '/' . $cacheKey . '.php';
		if (file_exists($cacheFileFullPath)) {
			return include $cacheFileFullPath;
		}

		$font = new \SimpleXMLElement(TL_ROOT . '/' . $fontPath, null, true);
		if(
			!isset($font->defs[0]->font[0]->glyph) ||
			!count($font->defs[0]->font[0]->glyph)
		) {
			return array();
		}

		$glyphs = array();

		foreach ($font->defs[0]->font[0]->glyph as $xmlGlyph) {

			if ($xmlGlyph['unicode']) {

				$glyph = array();
				$char = (string)$xmlGlyph['unicode'];

				$unicode = unpack('N', mb_convert_encoding($char, 'UCS-4BE', 'UTF-8'));
				$glyph['code'] = dechex($unicode[1]);

				if(isset($xmlGlyph['glyph-name'])){
					$glyph['name'] = (string)$xmlGlyph['glyph-name'];
				}

				// ignore white space and control characters
				if (hexdec($glyph['code']) > 32 && !empty($xmlGlyph['d']) && (string)$xmlGlyph['d'] !== 'M0 0v0v0v0v0z') {
					$glyphs[] = $glyph;
				}
			}

		}

		if (
			file_exists($infoFilePath = TL_ROOT . '/' . substr($fontPath, 0, -4) . '.html') ||
			file_exists($infoFilePath = TL_ROOT . '/' . substr($fontPath, 0, -4) . '.css')
		) {

			$infoFileContents = file_get_contents($infoFilePath);

			if (
				preg_match_all(
					'(\\sdata-icon="(?P<key>[^"]+)".*?\\sclass="class-name"[^>]*>icon-(?P<value>[0-9a-z_-]*))is',
					$infoFileContents,
					$matches
				) ||
				preg_match_all(
					'((?P<value>[^}]+)?content\\s*:\\s*["\'](?P<key>[^"\']+)["\'])is',
					$infoFileContents,
					$matches
				)
			) {

				$iconNames = array_combine(array_map(function($key) {
					if (substr($key, 0, 3) === '&#x') {
						return rtrim(substr($key, 3), ';');
					}
					if (substr($key, 0, 1) === '\\') {
						return substr($key, 1);
					}
					if (mb_strlen($key, 'UTF-8') === 1) {
						return ltrim(implode('',
							unpack('H*', mb_convert_encoding($key, 'UCS-4BE', 'UTF-8'))
						), '0');
					}
					return '';

				}, $matches['key']), $matches['value']);

				$iconNames = array_map('trim', preg_replace(
					array('(/\\*.*?\\*/|:before|:after)is', '([^a-z0-9]+)is'),
					array('', ' '),
					$iconNames
				));

				foreach ($glyphs as $key => $glyph) {
					if (isset($iconNames[$glyph['code']]) && (empty($glyph['name']) || stripos($glyph['name'], $iconNames[$glyph['code']]) === false)) {
						$glyphs[$key]['name'] = (empty($glyph['name']) ? '' : $glyph['name'] . ' ')
							. $iconNames[$glyph['code']];
					}
				}

			}

		}

		$cacheFile = new \File($cacheFilePath, true);
		$cacheFile->write('<?php' . "\n" . 'return ' . var_export($glyphs, true) . ';');
		$cacheFile->close();

		return $glyphs;
	}
154387
public function afterNodeCreate(NodeInterface $node)
    {
        if (!($nodeType = $node->getNodeType())) {
            return;
        }
        // array with [beforeNodes, childNodes, afterNodes] keys
        $config = $this->getAssistanceConfigForNodeType($nodeType->getName());

        switch ($nodeType->getName()) {
            case 'TYPO3.Neos.NodeTypes:Image':
                $this->configureImage($node, $nodeType, $config);
                break;

            case 'M12.Foundation:GridRow1Col':
            case 'M12.Foundation:GridRow2Col':
            case 'M12.Foundation:GridRow3Col':
            case 'M12.Foundation:GridRow4Col':
                $this->configureGridRow($node, $nodeType);
                break;

            case 'M12.Foundation:GridColumn':
                break; // assistance text nodes are created from $this->configureGridRow()

            case 'M12.Foundation:RevealModal':
                $this->configureLinkingButton($node, $nodeType, $config, 'htmlDataRevealId');
                break;

            case 'M12.Foundation:Dropdown':
            case 'M12.Foundation:DropdownContent':
                $this->configureLinkingButton($node, $nodeType, $config, 'htmlDataDropdownId');
                break;

            default:
                $this->configureCreateAssistanceChildNodes($node, $nodeType, $config);
                break;
        }
    }
107576
public function getParamTypeInfos(Node $node): array
    {
        if ($node->getDocComment() === null) {
            return [];
        }

        $phpDocInfo = $this->createPhpDocInfoFromNode($node);
        $types = $phpDocInfo->getParamTagValues();

        if ($types === []) {
            return [];
        }

        $fqnTypes = $phpDocInfo->getParamTagValues();

        $paramTypeInfos = [];
        /** @var AttributeAwareParamTagValueNode $paramTagValueNode */
        foreach ($types as $i => $paramTagValueNode) {
            $fqnParamTagValueNode = $fqnTypes[$i];

            $paramTypeInfo = new ParamTypeInfo(
                $paramTagValueNode->parameterName,
                $this->typeAnalyzer,
                $paramTagValueNode->getAttribute(Attribute::TYPE_AS_ARRAY),
                $fqnParamTagValueNode->getAttribute(Attribute::RESOLVED_NAMES)
            );

            $paramTypeInfos[$paramTypeInfo->getName()] = $paramTypeInfo;
        }

        return $paramTypeInfos;
    }
325107
private function getClassType($node, TypeInterface $parent): string
    {
        $phpFile = RootRetrieverHelper::getRoot($parent);

        switch (true) {
            case $node instanceof Node\Identifier:
            case $node->isRelative():
            case $node->isUnqualified():
                $name = $this->getUnqualifiedClassType($node, $phpFile);
                break;
            case $node->isFullyQualified():
                $name = $node->toString();
                break;
            case $node->isQualified():
                $name = $this->getQualifiedClassType($node, $phpFile);
                break;
            default:
                return TypeInterface::UNKNOWN_CUSTOM;
        }

        // Get the last name part
        $nameArray = explode('\\', $name);
        $lastPart  = end($nameArray);

        $phpFile->addConcreteUse($name, $lastPart);

        return $lastPart;
    }
674830
public function getResourceTypeForNode(INode $node)
    {
        $result = [];
        foreach ($this->resourceTypeMapping as $className => $resourceType) {
            if ($node instanceof $className) {
                $result[] = $resourceType;
            }
        }

        return $result;
    }
851899
protected function getDisplayText(Node $node) {
    if ($this->isRootTypeNode($node->getOID())) {
      $mapper = $node->getMapper();
      return $mapper->getTypeDisplayName($this->getMessage());
    }
    else {
      return strip_tags(preg_replace("/[\r\n']/", " ", NodeUtil::getDisplayValue($node)));
    }
  }
915529
public static function getClosestAggregateNode(NodeInterface $node)
    {
        while ($node !== null && !$node->getNodeType()->isAggregate()) {
            $node = $node->getParent();
        }
        return $node;
    }
242157
protected function getQueryNodes(AbstractNode $node): array
    {
        $methodPostfix = $node->findChildrenOfType('MethodPostfix');
        $classOrInterfaceReference = $node->findChildrenOfType('ClassOrInterfaceReference');

        return array_merge($methodPostfix, $classOrInterfaceReference);
    }
428801
public static function createIcon(string $icon, array $arguments = null) {
		$element = Html::el("i");
		
		if($icon == "b" or $icon == "l" or $icon == "s" or $icon == "r") {
			// Markup of icon which use Font Awesome 5.
			$class = ["fa".$icon];
		} else {
			// Markup of icon which use Font Awesome 4.
			$class = ["fa fa-".$icon];
		}
		
		if(isset($arguments)) {
			foreach($arguments as $argument) {
				$class[] = "fa-".$argument;
			}
		}
		
		$element->addAttributes(["class" => $class, "aria-hidden" => "true"]);
		return $element;
	}
205166
public function getNodeCampNode(NodeInterface $node) {
    $camp = NULL;
    switch ($node->bundle()) {
      case 'camp':
        $camp = $node;
        break;

      case 'landing_page':
        $camp = $this->getLandingPageCampNode($node);
        break;
    }

    return $camp;
  }
938072
public function createForNode(NodeInterface $node)
    {
        $site = $this->siteRepository->findOneBySiteId($node->getSiteId());
        $nodes = $this->nodeRepository->findPublishedByPathAndLanguage($node->getPath(), $site->getSiteId(), $node->getLanguage());

        $routePattern = $this->nodeRepository->findAllRoutePattern($node->getLanguage(), $site->getSiteId());
        $routePattern = $this->computeRoutePattern($routePattern);
        $routes = array();

        foreach ($nodes as $node) {
            $routes = array_merge($this->generateRoutesForNode($node, $site, $routePattern), $routes);
        }

        return $routes;
    }
975992
public function showWinners(NodeInterface $node) {
    $winnersList = views_embed_view('campaign_winners', 'campaign_winners_page', $node->id());
    $winnersCalculateForm = $this->formBuilder()->getForm(WinnersCalculateForm::class, $node->id());

    $build = [
      'view' => $winnersList,
      'form' => $winnersCalculateForm,
    ];

    return $build;
  }
1239614
protected function parseNodeProperties(NodeInterface $node)
    {
        $properties = [];

        // Run through all node properties
        foreach ($node->getProperties() as $name => $property) {
            // Skip the node type
            if ($name === Node::TYPE) {
                continue;
            }

            // Initialize the property (if necessary)
            $this->initializeNodeProperty($name, $properties);

            // Parse and process the property value
            $this->processNodeProperty($name, $this->parse($property), $properties);
        }

        return $properties;
    }