Returns an element list (`<li>`).

If `$element` is an array, the same `$options` will be applied to all
elements
@param string|array $element Element or elements
@param array $options HTML attributes of the list tag
@return string
@uses tag()
8594
public function li($element, array $options = [])
    {
        if (!is_array($element)) {
            return self::tag('li', $element, $options);
        }

        $element = array_map(function ($element) use ($options) {
            return self::tag('li', $element, $options);
        }, $element);

        return implode(PHP_EOL, $element);
    }
1192159
protected function _asArray(\SimpleXMLElement $element)
    {
        $output = $this->_asData($element);

        if (!$element->count()) {
            return $output;
        }

        return $this->_pushArray($output, $element);
    }
352260
private function getAncestorElement( $element, $types )
	{
		// May be this is already OK
		if ( in_array( $element['substitutionGroup'], XBRL_Constants::$xbrliSubstitutionHeads ) )
		{
			return $element;
		}

		// Look for the type with this substitution group
		$typeElement = $types->getElement( $element['substitutionGroup'] );
		if ( ! $typeElement )
		{
			return false; // Oops
		}

		// Get the corresponding taxonomy
		$taxonomy = $this->context->getTaxonomyWithPrefix( $typeElement['prefix'] );
		if ( ! $taxonomy ) return false;

		// Get the corresponding taxonomy element
		$element = $taxonomy->getElementByName( $typeElement['name'] );
		return $this->getAncestorElement( $element, $types );
	}
1232058
def element_tags(element, options = {})
      if respond_to?(:tag_options)
        tag_options(element_tags_attributes(element, options))
      else
        # Rails 5.1 uses TagBuilder
        tag_builder.tag_options(element_tags_attributes(element, options))
      end
    end
1215558
public static function find($element, array $attributes)
    {
        $operands = [];
        foreach ($attributes as $attribute => $value) {
            if (is_int($attribute)) {
                $operands[] = '@' . $value;
            } else {
                $operands[] = '@' . $attribute . ' = ' . Translator::getXpathLiteral($value);
            }
        }
        return sprintf('//%s[%s]', $element, implode(' and ', $operands));
    }
975214
protected function processGenerate($element, $data)
    {
        $this->prepareElementName($element);

        /** setRootName(null) support */
        if('' === (string) $element)
        {
            $element = array_keys($data)[0];

            return $this->processGenerate($element, $data[$element]);
        }

        /** @var \DOMElement $node */
        $node = $this->getDomDocument()->createElement($element);

        if(is_array($data))
        {
            $this->applyAttributes($data, $node);

            if(isset($data['@value']))
            {
                $this->applyValue($data, $node);

                return $node;
            }
            elseif(isset($data['@cdata']))
            {
                $this->applyCData($data, $node);

                return $node;
            }
            elseif(isset($data['@ns']))
            {
                $this->applyNamespace($data, $node);
            }
        }

        if(is_array($data))
        {
            foreach($data as $key => $value)
            {
                $this->prepareElementName($key);

                if('' === $key || false === $this->isValidElementName($key))
                {
                    continue;
                }

                if(is_array($value) && is_numeric(key($value)))
                {
                    foreach($value as $k => $v)
                    {
                        $node->appendChild($this->processGenerate($key, $v));
                    }
                }
                else
                {
                    $node->appendChild($this->processGenerate($key, $value));
                }

                unset($data[$key]);
            }
        }

        if(!is_array($data))
        {
            $data = $this->getBooleanAsString($data);

            $node->appendChild(
                $this->getDomDocument()->createTextNode($data)
            );
        }

        return $node;
    }
1191945
public function elementsGroup($elements){

        $groups = $this->formGroups;
        $groupNames = [];
        $groupEles = [];
        foreach ($groups as $k=>$v){
            $groupNames[] = $k;
            $groupEles[$v['name']] = ['title'=>$v['title']];
        }

        foreach ($elements as $ele){
            if (isset($ele['group']) && $ele['group']){
                $group = $ele['group'];
                if (in_array($group , $groupNames)){
                    $groupEles[$group]['elements'][] = $ele;
                }else{
                    $groupEles['base']['elements'][] = $ele;
                }
            }else {
                $groupEles['base']['elements'][] = $ele;
            }

        }

        return $groupEles;
    }
319610
private function _parseOptions(SimpleXMLElement $options)
    {
        $array = array();

        /* @var $option SimpleXMLElement */
        foreach ($options as $option) {
            if ($option->count()) {
                $value = $this->_parseOptions($option->children());
            } else {
                $value = (string) $option;
            }

            $attr = $option->attributes();

            if (isset($attr->name)) {
                $array[(string) $attr->name] = $value;
            } else {
                $array[] = $value;
            }
        }

        return $array;
    }
1338368
private function elementAttr(string $element) : string
    {
        if (in_array($element, $this->elements) === true) {
            $attr = '';

            if (count($this->attr[$element]) > 0) {
                $attr = ' style="' . implode(' ', $this->attr[$element]) . '"';
            }

            return $attr;
        } else {
            return '';
        }
    }
733019
protected function parseTables(\SimpleXMLElement $element)
    {
        /** @var \SimpleXMLElement $tableElement */
        foreach ($element as $tableElement) {
            $attributes = $tableElement->attributes();
            
            $tableName = (string) $attributes['table'];
            $tablePhpName = isset($attributes['name']) && !empty((string) $attributes['name'])
                ? (string) $attributes['name']
                : $tableName;
            
            $table = new Table($tableName);
            $table->setName($tablePhpName);
            
            $this->schema->addTable($table);
            $this->parseColumns($tableElement, $table);
            $this->parseRelations($tableElement, $table);
        }
        
        return $this;
    }
477336
protected function extractNodeFromChoiceAttribute($element)
    {
        $keyNodeId = current(array_intersect(array('contentNodeId', 'nodeName', 'nodeToLink'), array_keys($element)));
        $nodeId = $element[$keyNodeId];
        if (isset($element['siteId'])) {
            $siteId = $element['siteId'];
        } else {
            $siteId = $this->currentSiteManager->getSiteId();
        }
        return array('nodeId' => $nodeId, 'siteId' => $siteId);
    }
971465
public function panelBody($html, $options = array()) {
		$defaults = array('class' => '');
		$options = array_merge($defaults, $options);
		$options = $this->addClass($options, 'panel-body');
		return $this->tag('div', $html, $options);
	}
301172
protected function formatFormElement(array $element)
    {
        $sm = $this->getServiceLocator();
        $result = array();
        if (array_key_exists('lazy-set', $element)) {
            $result = $sm->get($this->moduleService)->lazySet($element['lazy-set']);
        }
        $result['name'] = $element['name'];
        $result['type'] = $element['type'];
        if (array_key_exists('label', $element)) {
            $result['options']['label'] = $element['label'];
        }
        return $result;
    }
973173
private function elementClasses(string $element) : string
    {
        if (in_array($element, $this->elements) === true) {
            $class = '';

            if (count($this->classes[$element]) > 0) {
                $class = ' ' . implode(' ', $this->classes[$element]);
            }

            return $class;
        } else {
            return '';
        }
    }
111207
public function generateElementId(Element $element) : string
    {
        preg_match('/^([a-zA-Z0-9]*)/', $element->getName(), $matches);
        $name = $matches[0];

        if (! isset($this->ids[$name])) {
            $this->ids[$name] = 0;
        }

        return $this->getId() . '-' . $name . '-' . $this->ids[$name]++;
    }
1150676
function getElementType($element)
     {
         if (isset($this->_elementIndex[$element])) {
             return $this->_elements[$this->_elementIndex[$element]]->getType();
         }
         return false;
     }
1151990
public function get(& $transport, $options = array (), $element = null) {
        $object = null;
        $element = parent :: get($transport, $options, $element);
        if (isset ($element['class']) && isset ($element['object'])) {
            $vClass = $element['class'];
            if (!empty ($element['package'])) {
                $pkgPrefix = $element['package'];
                $pkgKeys = array_keys($transport->xpdo->packages);
                if ($pkgFound = in_array($pkgPrefix, $pkgKeys)) {
                    $pkgPrefix = '';
                }
                elseif ($pos = strpos($pkgPrefix, '.')) {
                    $prefixParts = explode('.', $pkgPrefix);
                    $prefix = '';
                    foreach ($prefixParts as $prefixPart) {
                        $prefix .= $prefixPart;
                        $pkgPrefix = substr($pkgPrefix, $pos +1);
                        if ($pkgFound = in_array($prefix, $pkgKeys))
                            break;
                        $prefix .= '.';
                        $pos = strpos($pkgPrefix, '.');
                    }
                    if (!$pkgFound)
                        $pkgPrefix = $element['package'];
                }
                $vClass = (!empty ($pkgPrefix) ? $pkgPrefix . '.' : '') . $vClass;
            }
            $object = $transport->xpdo->newObject($vClass);
            if (is_object($object) && $object instanceof xPDOObject) {
                $options = array_merge($options, $element);
                $setKeys = false;
                if (isset ($options[xPDOTransport::PRESERVE_KEYS])) {
                    $setKeys = (boolean) $options[xPDOTransport::PRESERVE_KEYS];
                }
                $object->fromJSON($element['object'], '', $setKeys, true);
            }
        }
        return $object;
    }