Generate the tag config for give cell element

@param  string $elName Element's name, either "td" or "th"
@return array          Tag config
544907
protected function generateCellTagConfig($elName)
	{
		$alignFilter = new ChoiceFilter(['left', 'center', 'right', 'justify'], true);

		return	[
			'attributes' => [
				'align' => [
					'filterChain' => ['strtolower', $alignFilter],
					'required' => false
				]
			],
			'rules' => ['createParagraphs' => false],
			'template' =>
				'<' . $elName . '>
					<xsl:if test="@align">
						<xsl:attribute name="style">text-align:<xsl:value-of select="@align"/></xsl:attribute>
					</xsl:if>
					<xsl:apply-templates/>
				</' . $elName . '>'
		];
	}
264123
protected static function generateId($elementName)
    {
        $stop      =  !self::getOption('id_force_append_index');
        $tokens    =  strlen($elementName)
                      ? explode('[', str_replace(']', '', $elementName))
                      : ($stop? array('qfauto', ''): array('qfauto'));
        $container =& self::$ids;
        $id        =  '';

        do {
            $token = array_shift($tokens);
            // Handle the 'array[]' names
            if ('' === $token) {
                if (empty($container)) {
                    $token = 0;
                } else {
                    $keys  = array_keys($container);
                    $token = end($keys);
                    while (isset($container[$token])) {
                        $token++;
                    }
                }
            }
            $id .= '-' . $token;
            if (!isset($container[$token])) {
                $container[$token] = array();
            // Handle duplicate names when not having mandatory indexes
            } elseif (empty($tokens) && $stop) {
                $tokens[] = '';
            }
            // Handle mandatory indexes
            if (empty($tokens) && !$stop) {
                $tokens[] = '';
                $stop     = true;
            }
            $container =& $container[$token];
        } while (!empty($tokens));

        return substr($id, 1);
    }
432325
protected function getElementGroup($elementName)
    {
        $returnValue =  '';

		foreach($this->groups as $groupName => $group){
				if(in_array($elementName, $group['elements'])){
					$returnValue = $groupName;
					break;
				}
		}

        return $returnValue;
    }
896716
public function getTagsByTagName( $tagName )
	{
		$list	= array();
		$nodes	= $this->document->getElementsByTagName( $tagName );
		foreach( $nodes as $node )
			$list[]	= $node;
		return $list;
	}
1043311
public function asConfig()
	{
		if (empty($this->elements) && empty($this->aliases))
		{
			return;
		}

		/**
		* Regexp used to match an attributes definition (name + value if applicable)
		*
		* @link http://dev.w3.org/html5/spec/syntax.html#attributes-0
		*/
		$attrRegexp = '[a-z][-a-z0-9]*(?>\\s*=\\s*(?>"[^"]*"|\'[^\']*\'|[^\\s"\'=<>`]+))?';
		$tagRegexp  = RegexpBuilder::fromList(array_merge(
			array_keys($this->aliases),
			array_keys($this->elements)
		));

		$endTagRegexp   = '/(' . $tagRegexp . ')';
		$startTagRegexp = '(' . $tagRegexp . ')((?>\\s+' . $attrRegexp . ')*+)\\s*/?';

		$regexp = '#<(?>' . $endTagRegexp . '|' . $startTagRegexp . ')\\s*>#i';

		$config = [
			'quickMatch' => $this->quickMatch,
			'prefix'     => $this->prefix,
			'regexp'     => $regexp
		];

		if (!empty($this->aliases))
		{
			// Preserve the aliases array's keys in JavaScript
			$config['aliases'] = new Dictionary;
			foreach ($this->aliases as $elName => $aliases)
			{
				$config['aliases'][$elName] = new Dictionary($aliases);
			}
		}

		return $config;
	}
804515
protected function getNodePropertyByTagName(\DOMElement $node, $tagName, $propertyName)
    {
        $values = array();
        $results = $node->getElementsByTagName($tagName);
        if ($results->length) {
            foreach ($results as $result) {
                if ($result->getAttribute($propertyName)) {
                    $values[] = $result->getAttribute($propertyName);
                }
            }
        }

        return $values;
    }
225593
function createAndPublishElement( $elementName, &$ret )
    {
        $element = $this->Document->createElement( $elementName );
        $element->setAttributeNS( 'http://ez.no/namespaces/ezpublish3/temporary/', 'tmp:new-element', 'true' );

        if ( !isset( $ret['new_elements'] ) )
        {
            $ret['new_elements'] = array();
        }

        $ret['new_elements'][] = $element;
        return $element;
    }
822358
protected static function generateTag($tag, $content, $attributes = [])
	{
		$text = '';
		$attribute = self::attribute($attributes);
		if (is_string($tag))
			$text .= "<{$tag}{$attribute}>".PHP_EOL;
		
		if (is_array($content)) {
			if (isset($content['type']) and $content['type'] = 'cdata') {
				$text .="<![CDATA[".PHP_EOL;
				$text .= $content['data'].PHP_EOL;
				$text .="]]>".PHP_EOL;
			} else {
				foreach ($content as $tg => $ct) {
					if (is_array($ct) && isset($ct['content']) && isset($ct['attribute']))
						$text .= self::generateTag($tg, $ct['content'], $ct['attribute']);
					else
						$text .= self::generateTag($tg, $ct);
				}
			}
		} elseif (is_string($content)) {
			$text .= $content;
		}
		
		if (is_string($tag))
			$text .= "</{$tag}>".PHP_EOL;
		return $text;
	}
521974
public function getNodeByTagName($tagName)
    {
        $result = [];

        foreach ($this as $node) {
            if ($node->tagName === $tagName) {
                $result[] = $node;
            }
        }

        return $result;
    }
1081563
public function isElementHidden($elementName)
	{
		if( $this->settingExists($elementName) ? $settings = $this->getSetting($elementName) : false)
		{
			if(isset($settings['hidden']) && $settings['hidden'] == true)
			{
				return true;
			}
		}
		return false;
	}
1031389
private function prepareGetTagName()
    {
        $fragment = new CNabuPHPMethodBuilder(
            $this, 'getTagName', CNabuPHPMethodBuilder::METHOD_PROTECTED, true, false, false, true, 'string'
        );
        $fragment->addComment("Static method to get the Tag name of this XML Element.");
        $fragment->addComment("@return string Return the Tag name.");

        $fragment->addFragment("return '$this->element';");

        $this->addFragment($fragment);
    }
514218
protected function writeTag($tagName, array $attributes, $content)
	{
		$xml = '<' . $tagName;
		foreach ($attributes as $attrName => $attrValue)
		{
			$xml .= ' ' . $attrName . '="' . htmlspecialchars($attrValue) . '"';
		}
		if ($content === '')
		{
			$xml .= '/>';
		}
		else
		{
			$xml .= '>' . $content . '</' . $tagName . '>';
		}

		return $xml;
	}
781367
public static function td(
        string $content = null, 
        array $attributes = []
    ) : string
    {
        return self::tag("td", $content, $attributes);
    }
1069081
public function getPropertiesByTagName($tagName)
    {
        $properties = [];

        foreach ($this->properties as $property) {
            foreach ($property->tags as $tag) {
                if ($tag['name'] == $tagName) {
                    $properties[$property->name] = $property;
                }
            }
        }

        return $properties;
    }
483470
protected function prepareElementName(&$elementName)
    {
        $tempElementName = explode('_', $elementName);
        $elementName = isset($tempElementName[0]) && is_numeric($tempElementName[0])
            ? $tempElementName[1]
            : $elementName;
    }
513276
function getTag(el) {
    return (el.firstChild === null) ? {'UL':'LI','DL':'DT','TR':'TD'}[el.tagName] || el.tagName : el.firstChild.tagName;
}
692166
public function tag($name, Array $options = array(), $content = null, $open = false)
    {
        if (!$name) {
            return '';
        }
        $htmlOptions = '';
        foreach ($options as $key => $value) {
            $htmlOptions .= ' ' . $key . '="' . \htmlspecialchars($value, \ENT_COMPAT) . '"';
        }
        if ($content !== null) {
            return '<' . $name . $htmlOptions . '>' . $content . '</' . $name . '>';
        } else {
            return '<' . $name . $htmlOptions . (($open) ? '>' : ' />');
        }
    }