Génère une balise HTML.

@param string     $key     Clé unique.
@param array|null $attrAdd Liste des attributs additionnels.

@return string HTML
763242
public function form_html($key, array $attrAdd = null)
    {
        $item = $this->getItem($key);
        $attr = $this->merge_attr($item[ 'attr' ], $attrAdd);
        if (isset($attr[ '_content' ])) {
            $content = $attr[ '_content' ];
            unset($attr[ '_content' ]);
        } else {
            $content = '';
        }

        return str_replace(
                [ ':css', ':attr', ':_content' ],
            [ $this->getAttributesCSS($attr),
                $this->getAttributesInput($attr), $content ],
            $item[ 'html' ]
            ) . "\r\n";
    }
1097583
private function mapa(array $atributos, $entrada){
        $objeto = array('dn'=>ldap_get_dn($this->conexionLdap, $entrada));
        foreach ($atributos as $attr) {
            if (($valor = @ldap_get_values($this->conexionLdap, $entrada, $attr))){
                // Elimino el índice count
                array_pop($valor);
                // $valor es un array.
                // En caso de ser valor único, tomamos el indíce cero, caso contrario 
                // metemos todo el array
                $objeto[$attr] = count($valor)==1 ? $valor[0]:  $valor;
            } // TODO: ¿Un else para configurar un valor por defecto
        }
        return $objeto;
    }
225970
public function document($attrib = [], $content = null)
    {
        if ($content === null) {
            $content = $attrib;
            $attrib = [];
        }
        if (!isset($attrib['version']) || empty($attrib['version'])) {
            $attrib['version'] = $this->version;
        }

        return $this->elem('rss', $attrib, $content);
    }
105658
public function show($attrib = null)
    {
        if (is_array($attrib)) {
            $this->attrib = array_merge($this->attrib, $attrib);
        }

        $thead = $tbody = "";

        // include <thead>
        if (!empty($this->header)) {
            $rowcontent = '';
            foreach ($this->header as $c => $col) {
                $rowcontent .= self::tag($this->_head_tagname(), $col->attrib, $col->content);
            }
            $thead = $this->tagname == 'table' ? self::tag('thead', null, self::tag('tr', null, $rowcontent, parent::$common_attrib)) :
                self::tag($this->_row_tagname(), array('class' => 'thead'), $rowcontent, parent::$common_attrib);
        }

        foreach ($this->rows as $r => $row) {
            $rowcontent = '';
            foreach ($row->cells as $c => $col) {
                $rowcontent .= self::tag($this->_col_tagname(), $col->attrib, $col->content);
            }

            if ($r < $this->rowindex || count($row->cells)) {
                $tbody .= self::tag($this->_row_tagname(), $row->attrib, $rowcontent, parent::$common_attrib);
            }
        }

        if ($this->attrib['rowsonly']) {
            return $tbody;
        }

        // add <tbody>
        $this->content = $thead . ($this->tagname == 'table' ? self::tag('tbody', null, $tbody) : $tbody);

        unset($this->attrib['cols'], $this->attrib['rowsonly']);
        return parent::show();
    }
17229
static public function build(array $attr, callable $callback = null): string
    {
        if (!count($attr)) {
            return '';
        }

        $html = array_map(function ($val, $key) use ($callback) {
            if (is_bool($val)) {
                return $val ? self::getKey($key) : '';
            }

            if (isset($val)) {
                if ($val instanceof \Closure) {
                    $val = $val();
                } elseif ($val instanceof \JsonSerializable) {
                    $val = \json_encode($val->jsonSerialize(), (JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
                } elseif (is_callable([$val, 'toArray'])) {
                    $val = $val->toArray();
                } elseif (is_callable([$val, '__toString'])) {
                    $val = strval($val);
                }

                if (is_array($val)) {
                    $val = \json_encode($val);
                }

                if (is_callable($callback)) {
                    $val = call_user_func($callback, $val);
                } else {
                    $val = htmlspecialchars($val, ENT_QUOTES);
                }

                if (is_string($val)) {
                    return sprintf('%1$s="%2$s"', self::getKey($key), $val);
                }
            }

            return self::getKey($key);
        }, $attr, array_keys($attr));

        return implode(' ', $html);
    }
199297
function tpl_keys_rowcount($attrib)
    {
        if (!$attrib['id'])
            $attrib['id'] = 'rcmcountdisplay';

        $this->rc->output->add_gui_object('countdisplay', $attrib['id']);

        return html::span($attrib, $this->get_rowcount_text());
    }
1057376
public function getAttribute($key)
    {
        try {
            return $this->_stmt->getAttribute($key);
        } catch (PDOException $e) {
            // require_once 'Zend/Db/Statement/Exception.php';
            throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
        }
    }
1166840
public function attribute(string $key)
    {
        if (! isset($this->attributes[$key])) {
            return '';
        }

        return $this->attributes[$key];
    }
1135700
public static String getStringForJavascript(String key) {
		final String string = getString(key);
		// ici, le résultat ne contient pas de valeur variable ni d'attaque puisque ce sont des messages internes et fixes,
		// donc pas besoin d'encoder avec javascriptEncode, et on conserve les apostrophes lisibles dans les messages
		return string.replace("\\", "\\\\").replace("\n", "\\n").replace("\"", "\\\"").replace("'",
				"\\'");
	}
372276
function tpl_keys_list($attrib)
    {
        // add id to message list table if not specified
        if (!strlen($attrib['id'])) {
            $attrib['id'] = 'rcmenigmakeyslist';
        }

        // define list of cols to be displayed
        $a_show_cols = array('name');

        // create XHTML table
        $out = $this->rc->table_output($attrib, array(), $a_show_cols, 'id');

        // set client env
        $this->rc->output->add_gui_object('keyslist', $attrib['id']);
        $this->rc->output->include_script('list.js');

        // add some labels to client
        $this->rc->output->add_label('enigma.keyremoveconfirm', 'enigma.keyremoving',
            'enigma.keyexportprompt', 'enigma.withprivkeys', 'enigma.onlypubkeys', 'enigma.exportkeys'
        );

        return $out;
    }
777053
private function _index_attribs($attrs)
    {
        $this->attr_idx = $this->attrs = $aix = $six = $iix = $iax = self::$_ar_;
        $i              = 0;
        $ian            = self::$_index_attribs;
        foreach ($ian as $atn) {
            if (!isset($iax[$atn])) {
                $iax[$atn] = self::$_ar_;
            }
        }

        foreach ($attrs as $str => $v) {
            $a = self::html_parseAttrStr($str, true, false);
            unset($attrs[$str]); // free mem
            foreach ($ian as $atn) {
                if (isset($a[$atn])) {
                    // href attribute has a separate index
                    if (is_array($v)) {
                        foreach ($v as $e) {
                            $iax[$atn][$e] = $a[$atn];
                        }

                    } else {
                        $iax[$atn][$v] = $a[$atn];
                    }
                    unset($a[$atn]);
                }
            }
            if (empty($a)) {
                continue;
            }

            $str = self::html_attr2str($a);
            $aid = $i;
            if (isset($six[$str])) {
                $aid = $six[$str];
                if (!is_array($iix[$aid])) {
                    $iix[$aid] = array($iix[$aid]);
                }

                if (is_array($v)) {
                    foreach ($v as $v_) {
                        $iix[$aid][] = $v_;
                    }
                } else {
                    $iix[$aid][] = $v;
                }

            } else {
                $six[$str] = $aid;
                $aix[$aid] = $a;
                $iix[$aid] = $v;
                ++$i;
            }
        }
        unset($six, $attrs, $i); // free mem
        foreach ($aix as $aid => $a) {
            $v = $iix[$aid];
            if (is_array($v)) {
                if (count($v) == 1) {
                    $v = reset($v);
                } elseif ($v) {
                    $u = array();
                    foreach ($v as $e) {
                        $u[$e]           = $this->ids[$e];
                        $this->attrs[$e] = $aid;
                    }
                    $v = $u;unset($u);
                }
            }
            if (!is_array($v)) {
                $this->attrs[$v] = $aid;
            }

            $this->attr_idx[$aid] = $v; // ids for this attr
        }
        foreach ($iax as $atn => $v) {
            if (!$v) {
                unset($iax[$atn]);
            }
        }

        $this->idx_attr = $iax;
        $this->attribs  = $aix;

        return $this->attr_idx;
    }
677435
function getHTML()
    {
        $html="";
        if ($this->getCountOnglets()>0) {
            /*
             * assignation des styles en dur : a changer à terme,
             * les styles sont les memes que pour le site en ligne
             * => a ajouter dans la feuille de style
             * */
            if (isset($this->stylesOnglets) && $this->stylesOnglets!='') {
                $html=$this->stylesOnglets;
            }

            if (!isset($this->hauteurEtiquettes)) {
                $this->hauteurEtiquettes=25;
            }
            
            if (!isset($this->styleTable)) {
                $this->styleTable="";
            }
            
            if (!isset($this->styleTableEtiquettes)) {
                $this->styleTableEtiquettes ="";
            }
            
            if (!isset($this->styleBorderHautContenu)) {
                $this->styleBorderHautContenu
                    ="style='border-bottom:1px solid #000000;'";
            }
                
            $html.="<a name='onglet'></a>";
            $html.="<table width='".$this->largeurTotale.
            "' cellspacing=0 cellpadding=0 border=0><tr><td height=".
            $this->hauteurEtiquettes." ".$this->styleTable.">";            
            $html.="<table cellspacing=0 cellpadding=0 border=0 ".
            $this->styleTableEtiquettes."><tr class='onglets'>";
            // construction du tableau contenant les intitules
            $i=0;
            $largeurGauche = 0;
            if (isset($this->largeurGauche)) {
                    $largeurGauche = $this->largeurGauche;
                    $html.="<td height=".$this->hauteurEtiquettes." ".
                    $this->styleBorderHautContenu." width='".
                    $this->largeurGauche."'>&nbsp;</td>";
            }
            
            foreach ($this->ongletsArray as $fieldName => $fieldValue) {
                $className='OngletOff';
                if ($i==$this->numOngletSelected) {
                    $className='OngletOn';
                }
                
                $link = "";
                if ($this->isAncreOnglet==true) {
                    $link = "href='#onglet'";
                }
                
                $link="";
                switch($this->typeOngletsArray[$fieldName]) {
                case 'link':
                    $link = "href='".$this->optionsOngletParType[$fieldName]."'";
                    break;
                default:
                    $link = "onclick=\"".$this->createJSDivCalls($i);
                    /* lien le champs hiddenCourant est un champs cache
                    du formulaire permettant de stocker l'onglet actif courant
                    * */
                    if (isset($this->champHiddenCourant)
                        && $this->champHiddenCourant<>""
                    ) {
                        $link.="document.getElementById('".
                        $this->champHiddenCourant."').value='".$i."';";
                    }
                    $link.="\"";
                    break;
                }
                
                $spaces="";
                if ($this->isSpaceInLibelle == true) {
                    $spaces = "&nbsp;&nbsp;&nbsp;";
                }
                
                $html.="<td height='".$this->hauteurEtiquettes."' width='".
                $this->largeurEtiquette."' id='".
                $this->convertIntituleOnglet($fieldName.$i).$this->idOngletBuilder.
                "_onglet' class='".$className."' >".$spaces.
                "<a style='cursor:pointer;' ".$link;
                $html.=">".$fieldName."</a>".$spaces.
                "</td><td width='4' height='".$this->hauteurEtiquettes.
                "' ".">&nbsp</td>";
                $i++;
                
            }
            // dernier td => pour affichage du border //
            
            
            $html.="<td height='".$this->hauteurEtiquettes."' width='".
            ( $this->largeurTotale - ($i * ($this->largeurEtiquette+4))
            -$largeurGauche).
            "' >&nbsp;</td>";
            
            $styleContours = "";
            if ($this->isContours==true) {
                if (isset($this->styleContoursContenu)) {
                    $styleContours = $this->styleContoursContenu;
                } else {
                    $styleContours = "style='border-left:1px solid #000000;".
                    "border-right:1px solid #000000;".
                    "border-bottom:1px solid #000000;'";
                }
            }
            
            $html.="</tr></table></td></tr><tr><td class='event ".$styleContours.">";
            
            
            // construction des contenus
            $i=0;
            foreach ($this->ongletsArray as $fieldName => $fieldValue) {
                if ($i==$this->numOngletSelected) {
                    $styleDisplay='block';
                    
                } else {
                    $styleDisplay='none';    
                }
                $testedFieldValue=="<table cellspacing='0' cellpadding='0' ".
                "border='0'></table>";
                // cas ou il n'y a pas de photo dans la liste
                if ($fieldValue==$testedFieldValue) {
                    $fieldValue="<table cellspacing='0' width='100%' ".
                    "cellpadding='0'".
                    " border='1'><tr><td><br><center>Pas de document</center>".
                    "</br></td></tr></table>";
                }
                
                $html.="<div id='".$this->convertIntituleOnglet($fieldName.$i).
                $this->idOngletBuilder."' style='display:".$styleDisplay.
                ";'>".$fieldValue."</div>";
                $i++;
            }
            
            
            $html.="</td></tr></table>";
        }
        return $html;
        
    }
103989
public function form_group($key, array $attrAdd = null)
    {
        $item = $this->getItem($key);
        $attr = $this->merge_attr($item[ 'attr' ], $attrAdd);

        $balise = in_array($attr[ 'balise' ], $this->baliseGroup)
            ? $attr[ 'balise' ]
            : 'div';

        return '<' . $balise . $this->getAttributesCSS($attr) . ">\r\n"
            . $item[ 'subform' ]->renderSubForm()
            . '</' . $balise . ">\r\n";
    }
582807
function shortcodeHandler( $atts, $content = '' ) {

		global $id; // This is the Post ID, [@see WP_Query::setup_postdata, ...]

		$a = shortcode_atts(
			[
				'numbered' => 'yes',
				'symbol' => '*',
				'suptext' => ' ',
			], $atts
		);

		if ( ! $content ) {
			return '';
		}

		if ( ! isset( $this->footnotes[ $id ] ) ) {
			$this->footnotes[ $id ] = [];
			if ( 'no' === $a['numbered'] ) {
				$this->numbered[ $id ] = false;
			} else {
				$this->numbered[ $id ] = true;
			}
		}

		$this->footnotes[ $id ][] = $content;
		$footnotes = $this->footnotes[ $id ];
		$num = count( $footnotes );
		$numlabel = "$id-$num";

		$retval = '<a class="footnote" title="' . \Pressbooks\Sanitize\sanitize_xml_attribute( wp_strip_all_tags( $content ) ) . '" id="return-footnote-' . $numlabel . '" href="#footnote-' . $numlabel . '"><sup class="footnote">[';

		if ( $this->numbered[ $id ] ) {
			$retval .= $num;
		} else {
			$retval .= $a['symbol'];
		}

		if ( trim( $a['suptext'] ) ) {
			if ( $this->numbered[ $id ] ) {
				$retval .= '. ';
			}

			$retval .= $a['suptext'];
		}
		$retval .= ']</sup></a>';

		return $retval;
	}
45325
public function confiscateAttr(&$attr, $key)
    {
        if (!isset($attr[$key])) {
            return null;
        }
        $value = $attr[$key];
        unset($attr[$key]);
        return $value;
    }
1029517
function(att) {
		var val = this[att],
			html = "";
		switch (gui.Type.of(val)) {
			case "null":
			case "undefined":
				break;
			default:
				val = edbml.Att.$encode(this[att]);
				html += att + "=\"" + val + "\" ";
				break;
		}
		return html;
	}
382777
public function inline($style, array $attr = null)
    {
        $attr = $this->escaper->attr(
            $this->fixInlineAttr($attr)
        );
        return "<style {$attr}>{$style}</style>";
    }