Create AbstractTypifiedElement from a given NodeElements.

@param array|NodeElement[] $node_elements Node Elements.

@return ITypifiedElement
@throws FormException When unable to create typified element.
495232
public function typify(array $node_elements)
	{
		$node_element = $node_elements[0];
		$tag_name = $node_element->getTagName();

		if ( $tag_name == 'input' ) {
			$input_type = $node_element->getAttribute('type');

			if ( $input_type == self::CHECKBOX_INPUT ) {
				return Checkbox::fromNodeElement($node_element, $this->getPageFactory());
			}
			elseif ( $input_type == self::RADIO_INPUT ) {
				return RadioGroup::fromNodeElements($node_elements, null, $this->getPageFactory());
			}
			elseif ( $input_type == self::FILE_INPUT ) {
				return FileInput::fromNodeElement($node_element, $this->getPageFactory());
			}
			else {
				/*if ( is_null($input_type)
					|| ($input_type == self::TEXT_INPUT)
					|| ($input_type == self::PASSWORD_INPUT)
				) {*/
				return TextInput::fromNodeElement($node_element, $this->getPageFactory());
			}
		}
		elseif ( $tag_name == 'select' ) {
			return Select::fromNodeElement($node_element, $this->getPageFactory());
		}
		elseif ( $tag_name == 'textarea' ) {
			return TextInput::fromNodeElement($node_element, $this->getPageFactory());
		}

		$web_element = WebElement::fromNodeElement($node_element, $this->getPageFactory());
		throw new FormException(
			'Unable create typified element for ' . (string)$web_element,
			FormException::TYPE_UNKNOWN_FIELD
		);
	}
581496
public Element createElementNS(String namespaceURI, String qualifiedName)
          throws DOMException
  {

    error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);

    return null;
  }
793246
static function createAttributeLookupElement( $attributeValues = array(), $variablePlacement = false )
    {
        if ( is_numeric( $attributeValues ) )
            $attributeValues = array( eZTemplateNodeTool::createNumericElement( $attributeValues, $variablePlacement ) );
        else if ( !is_array( $attributeValues ) )
            $attributeValues = array( eZTemplateNodeTool::createStringElement( $attributeValues, $variablePlacement ) );
        return array( eZTemplate::TYPE_ATTRIBUTE,
                      $attributeValues, $variablePlacement );
    }
1371937
public static function fromLegacyToolbarAction(\SimpleXMLElement $node, $structureExtensionId) {
        $data = array(
            'id'          => (string)$node['id'],
            'extension'   => $structureExtensionId,
            'name'		  => (string)$node['title'],
            'level'		  => (int)$node['level'],
            'description' => empty($text) ? null : $text,
            'binding'     => isset($node['binding']) ? (string)$node['binding'] :  (isset($node['js']) ? (string)$node['js'] : null),
            'structure'   => isset($node['structure']) ? (string)$node['structure'] : null,
            'group'       => self::GROUP_SETTINGS,
            'icon'        => isset($node['icon']) ? Icon::fromArray(array('id' => (string)$node['icon']), $structureExtensionId) : null
        );
        $children = array();
        if (isset($node['structure'])) {
            $children = array();
            // (string)$node['structure']
        }
        return new static($data, $children); 
    }
666079
protected function createElementEntity($type, $name, array $attributes, array $options)
    {
            return $this->getPrototype(
                $this->elementTypes[$type],
                ['umi\form\element\IElement']
            )
            ->createInstance([$name, $attributes, $options]);
    }
1290980
private function createStructureNodes(\DOMDocument $dom, ElementStructure $structure)
    {
        $structureNode = $dom->createElement('structure');

        $idAttr = $dom->createAttribute('id');
        $idAttr->value = $structure->getId();
        $structureNode->appendChild($idAttr);

        $dsIdAttr = $dom->createAttribute('dsId');
        $dsIdAttr->value = $structure->getDsId();
        $structureNode->appendChild($dsIdAttr);

        $parentDsIdAttr = $dom->createAttribute('parentDsId');
        $parentDsIdAttr->value = $structure->getDsId();
        $structureNode->appendChild($parentDsIdAttr);

        $nameAttr = $dom->createAttribute('name');
        $nameAttr->value = $structure->getName();
        $structureNode->appendChild($nameAttr);

        $parentNameAttr = $dom->createAttribute('parentName');
        $parentNameAttr->value = $structure->getParentName();
        $structureNode->appendChild($parentNameAttr);

        foreach ($structure->getStructures() as $childStructure) {
            $structureNode->appendChild(
                $this->createStructureNodes($dom, $childStructure)
            );
        }

        foreach ($structure->getValues() as $value) {
            $valueNode = $dom->createElement('value');

            $idAttr = $dom->createAttribute('id');
            $idAttr->value = $value->getId();
            $valueNode->appendChild($idAttr);

            $dsIdAttr = $dom->createAttribute('dsId');
            $dsIdAttr->value = $value->getDsId();
            $valueNode->appendChild($dsIdAttr);

            $languageAttr = $dom->createAttribute('language');
            $languageAttr->value = $value->getLanguage();
            $valueNode->appendChild($languageAttr);

            $nameAttr = $dom->createAttribute('name');
            $nameAttr->value = $value->getName();
            $valueNode->appendChild($nameAttr);

            $typeAttr = $dom->createAttribute('type');
            $typeAttr->value = $value->getType();
            $valueNode->appendChild($typeAttr);

            $dataTypeAttr = $dom->createAttribute('dataType');
            $dataTypeAttr->value = $value->getDataType();
            $valueNode->appendChild($dataTypeAttr);

            $rawValue = $value->getValue();
            if ($value->getDataType() === 'array') {
                $rawValue = json_encode($rawValue);
            }
            $valueNode->appendChild($dom->createCDATASection($rawValue));

            $structureNode->appendChild($valueNode);
        }

        return $structureNode;
    }
1267849
protected function createElement($nodeName, $textContent = '')
	{
		$methodName = 'createElement';
		$args       = [$nodeName];

		// Add the text content for the new element
		if ($textContent !== '')
		{
			$args[] = htmlspecialchars($textContent, ENT_NOQUOTES, 'UTF-8');
		}

		// Handle namespaced elements
		$prefix = strstr($nodeName, ':', true);
		if ($prefix > '')
		{
			$methodName .= 'NS';
			array_unshift($args, $this->ownerDocument->lookupNamespaceURI($prefix));
		}

		return call_user_func_array([$this->ownerDocument, $methodName], $args);
	}
643112
public function createElement(Node $parent, $name)
    {
        foreach ($this->registry[ElementExtension::class] as $extension) {
            $node = $extension->createElement($parent, $name);
            if ($node) {
                return $node;
            }
        }

        return null;
    }
706469
public function toModel()
    {
        $nodeClass = $this->getElement()->NodeClass;
        if ($nodeClass === 'Node') {
            throw new LogicException('You must set a custom node in <node_class/> for element: ' . $this->getElement()->getSlug());
        } else {
            throw new LogicException('You must create a toModel method in: ' . $nodeClass);
        }
    }
451932
function _createElementsIfNotExist()
    {
        if (empty($this->_elements)) {
            $this->_createElements();
            if ($this->_flagFrozen) {
                $this->freeze();
            }
        }
    }
1253555
public function createElement($tag, $attributes = null)
    {
        $node = parent::createElement($tag);
        $text = false;
        if (is_string($attributes)) {
            $node->setAttribute('class', $attributes);
        } else {
            if (is_array($attributes)) {
                foreach ($attributes as $key => $value) {
                    if ($key == 'text') {
                        $node->appendChild($this->createTextNode($value));
                        $text = true;
                    } else {
                        if (!is_null($value)) {
                            $node->setAttribute($key, $value);
                        }
                    }
                }
            }
        }
        if (!$text && !in_array($tag, ['img', 'br', 'input'])) {
            $node->appendChild($this->createTextNode(''));
        }
        return $node;
    }
1314151
private FormInput formInputMatchingNode(Node element) {
		NamedNodeMap attributes = element.getAttributes();
		Identification id;

		if (attributes.getNamedItem("id") != null
				&& formFillMode != FormFillMode.XPATH_TRAINING) {
			id = new Identification(Identification.How.id,
					attributes.getNamedItem("id").getNodeValue());
			FormInput input = this.formInputs.get(id);
			if (input != null) {
				return input;
			}
		}

		if (attributes.getNamedItem("name") != null
				&& formFillMode != FormFillMode.XPATH_TRAINING) {
			id = new Identification(Identification.How.name,
					attributes.getNamedItem("name").getNodeValue());
			FormInput input = this.formInputs.get(id);
			if (input != null) {
				return input;
			}
		}

		String xpathExpr = XPathHelper.getXPathExpression(element);
		if (xpathExpr != null && !xpathExpr.equals("")) {
			id = new Identification(Identification.How.xpath, xpathExpr);
			FormInput input = this.formInputs.get(id);
			if (input != null) {
				return input;
			}
		}

		return null;
	}
423382
public function appendFormattedElement(XMLElement &$wrapper, $data, $encode = false, $mode = null, $entry_id = null)
    {
        $value = ($data['value'] === 'yes' ? 'Yes' : 'No');

        $wrapper->appendChild(new XMLElement($this->get('element_name'), ($encode ? General::sanitize($value) : $value)));
    }
952001
function initElement(\HTML_QuickForm2_Node $element) {
        \Debugbar::addMessage(($this->namespace ? $this->namespace . '::' : '') . 'models/' . $this->model->getEntity() . '.' . $element->getName());
        $config = \Config::get(($this->namespace ? $this->namespace . '::' : '') . 'models/' . $this->model->getEntity() . '.' . $element->getName());
        if (is_array($config)) {
            foreach ($config as $k => $v) {
                $method = \Str::camel('set_' . $k);
                if (is_callable([$element, $method])) {
                    call_user_func([$element, $method], $v);
                }
            }
        }
        return $element;
    }
855472
public function buildForm(NodeTypeContract $nodeType)
    {
        $this->formBuilder->build($nodeType->getName(), $nodeType->getFields());
    }
156440
public function assertElementType(NodeElement $element, $type) {
    if ($element->getTagName() !== $type) {
      throw new ExpectationException("The element is not a '$type'' field.", $this->getSession());
    }
  }
13385
static function processNodeTransformationNodes( $tpl, &$node, &$nodes, &$privateData )
    {
        $useComments = $privateData['use-comments'];
        $php =& $privateData['php-creator'];
        $resourceData =& $privateData['resource-data'];
        return eZTemplateCompiler::processNodeTransformationChildren( $useComments, $php, $tpl, $node, $nodes, $resourceData );
    }