Skip to content
Extraits de code Groupes Projets
Valider 83db2858 rédigé par esj's avatar esj
Parcourir les fichiers

Retour du bon controle des idref (désolé Cédric, les objets en PHP c'est...

Retour du bon controle des idref (désolé Cédric, les objets en PHP c'est encore pire qu'ailleurs). Et donner la liste des attributs licites, mais au survol de la souris parce dit des dizaines de fois c'est insupportable tellement il y en a.
parent 16538e30
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -148,16 +148,15 @@ function validerElement($parser, $name, $attrs)
$pere = $r[1];
if (isset($phraseur_xml->elements[$pere]))
if (!@in_array($name, $phraseur_xml->elements[$pere])) {
$bons_peres = @join ('</b>, <b>', $phraseur_xml->peres[$name]);
$phraseur_xml->err[]= " <b>$name</b>"
. _L(" n'est pas un fils de ")
. '<b>'
. $pere
. '</b>'
. (!$bons_peres ? ''
: (_L( '<p style="font-size: 80%"> mais de <b>') . $bons_peres . '</b></p>'))
. coordonnees_erreur($parser);
}
$bons_peres = @join ('</b>, <b>', $phraseur_xml->peres[$name]);
$phraseur_xml->err[]= " <b>$name</b>"
. _L(" n'est pas un fils de ")
. '<b>'
. $pere
. '</b>'
. (!$bons_peres ? ''
: (_L( '<p style="font-size: 80%"> mais de <b>') . $bons_peres . '</b></p>'));
}
}
}
if (isset($phraseur_xml->attributs[$name])) {
......@@ -184,12 +183,20 @@ function validerAttribut($parser, $name, $val, $bal)
return ;
$a = $phraseur_xml->attributs[$bal];
if (!isset($a[$name]))
if (!isset($a[$name])) {
$bons = join(', ',array_keys($a));
if ($bons)
$bons = " title=' " .
_L('attributs connus: ') .
$bons .
"'";
$bons .= " style='font-weight: bold'";
$phraseur_xml->err[]= " <b>$name</b>"
. _L(' attribut inconnu de ')
. "<b>$bal</b>"
. "<a$bons>$bal</a>"
. _L(" (survoler pour voir les corrects)")
. coordonnees_erreur($parser);
else{
} else{
$type = $a[$name][0];
if ($type[0]=='/') {
if (!preg_match($a[$name][0], $val)) {
......@@ -261,8 +268,10 @@ function defautElement($phraseur, $data)
// http://doc.spip.org/@phraserTout
function phraserTout($phraseur, $data)
{
global $phraseur_xml;
validateur($data);
if (isset($this->entites['HTMLsymbol']))
if (isset($phraseur_xml->entites['HTMLsymbol']))
$data = unicode2charset(html2unicode($data, true));
......@@ -272,7 +281,7 @@ function phraserTout($phraseur, $data)
foreach ($this->idrefs as $idref) {
list($nom, $ligne, $col) = $idref;
if (!isset($phraseur_xml->ids[$nom]))
$this->err[]= " <p><b>$nom</b>"
$phraseur_xml->err[]= " <p><b>$nom</b>"
. _L(" ID inconnu ")
. $ligne
. " "
......
......@@ -536,7 +536,19 @@ function emboite_texte($texte, $fonc='',$self='')
$GLOBALS['xhtml_error'],
$regs,
PREG_SET_ORDER);
$err = '<tr><th>#</th><th>Occ.</th><th>Li.</th><th>Col.</th><th>Err.</th></tr>';
$err = '<tr><th>'
. _L('Numero')
. "</th><th>"
. _L('Occurrence')
. "</th><th>"
. _L('Ligne')
. "</th><th>"
. _L('Colonne')
. "</th><th>"
. _L('Erreur')
. "</th></tr>";
$fautifs = array();
$i = 0;
$encore = array();
......@@ -572,7 +584,7 @@ function emboite_texte($texte, $fonc='',$self='')
. $i
. "<a href='#fin_err'>"
. _L(' erreur(s)')
. "</a></h2><table id='debut_err'>"
. "</a></h2><table id='debut_err' style='width: 100%'>"
. $err
. " </table><a id='fin_err'></a>";
return array(ancre_texte($texte, $fautifs), $err);
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter