Commit 56d4f610 authored by Feu's avatar Feu

micro optmisations

parent b214e155
......@@ -548,18 +548,18 @@ class sqltable2 extends stdcontents
{
$t = ($lnum+1)%2;
$this->buffer .= "<tr id=\"".$this->nom."_l$lnum\" class=\"ln$t\" ".
"onmouseout=\"stdc(this,'l',$t);\" ".
"onmouseover=\"stdc(this,'o',$t);\" ";
$this->buffer .= "<tr id=\"".$this->nom."_l".$lnum."\" class=\"ln".$t."\" ".
"onmouseout=\"stdc(this,'l',".$t.");\" ".
"onmouseover=\"stdc(this,'o',".$t.");\" ";
if ( count($this->batch) > 0 )
{
$this->buffer .= "onmousedown=\"stckl(this,'".$this->id_name."',$lnum);\">\n";
$this->buffer .= "onmousedown=\"stckl(this,'".$this->id_name."',".$lnum.");\">\n";
$this->buffer .= "<td>".
"<input type=\"checkbox\" class=\"chkbox\" ".
"name=\"".$this->id_name."s[$lnum]\" value=\"".$row[$this->id_name]."\" ".
"id=\"".$this->nom."_c$lnum\" ".
"onclick=\"stsck(this,$lnum,$t);\" /></td>\n";
"name=\"".$this->id_name."s[".$lnum."]\" value=\"".$row[$this->id_name]."\" ".
"id=\"".$this->nom."_c".$lnum."\" ".
"onclick=\"stsck(this,".$lnum.",".$t.");\" /></td>\n";
}
else
$this->buffer .= ">\n";
......@@ -717,7 +717,7 @@ class sqltable2 extends stdcontents
if ( $this->page_self )
{
$this->buffer .= " <a href=\"#\" onclick=\"stst('".$this->nom."','$key'); return false;\"><img src=\"".$wwwtopdir."images/icons/16/sort_a.png\" id=\"".$this->nom."_s".$key."_i\" class=\"icon\" alt=\"\" /></a>";
$this->buffer .= " <a href=\"#\" onclick=\"stst('".$this->nom."','".$key."'); return false;\"><img src=\"".$wwwtopdir."images/icons/16/sort_a.png\" id=\"".$this->nom."_s".$key."_i\" class=\"icon\" alt=\"\" /></a>";
switch ( $col[0] )
{
......@@ -746,13 +746,13 @@ class sqltable2 extends stdcontents
{
if ( count($col[2]) == 1 ) // Ne fonctionne que dans ce cas
{
$this->buffer .= " <a href=\"#\" onclick=\"stft('".$this->nom."','$key'); return false;\"><img src=\"".$wwwtopdir."images/icons/16/find.png\" class=\"icon\" alt=\"\" /></a>";
$this->buffer .= " <a href=\"#\" onclick=\"stft('".$this->nom."','".$key."'); return false;\"><img src=\"".$wwwtopdir."images/icons/16/find.png\" class=\"icon\" alt=\"\" /></a>";
$this->buffer .= "<div id=\"".$this->nom."_f".$key."\" class=\"filter\" style=\"display:none;\">";
$this->buffer .= "<h4>Filtrer</h4>";
$this->buffer .= "<div class=\"fcts\">";
$this->buffer .= "<div><select id=\"".$this->nom."_f".$key."_s\" ";
$this->buffer .= "onchange=\"stftcf('".$this->nom."','$key');\">";
$this->buffer .= "onchange=\"stftcf('".$this->nom."','".$key."');\">";
$this->buffer .= "<option value=\"\">Tout afficher</option>";
$this->buffer .= "<option value=\"=\">&eacute;gal &agrave;</option>";
$this->buffer .= "<option value=\"!\">diff&eacute;rent de</option>";
......@@ -760,17 +760,17 @@ class sqltable2 extends stdcontents
$this->buffer .= "<option value=\"&lt;\">&lt;=</option>";
$this->buffer .= "</select>\n";
$this->buffer .= "<input type=\"text\" id=\"".$this->nom."_f".$key."_v\" class=\"val\" /></div>";
$this->buffer .= "<input type=\"button\" onclick=\"stcft('".$this->nom."','$key','".$col[2][0]."');\" value=\"Filtrer\" />";
$this->buffer .= "<input type=\"button\" onclick=\"stcft('".$this->nom."','".$key."','".$col[2][0]."');\" value=\"Filtrer\" />";
$this->buffer .= "</div></div>\n";
}
}
else // Liste les valeurs de chaque colonne
{
$this->buffer .= " <a href=\"#\" onclick=\"stft('".$this->nom."','$key'); return false;\"><img src=\"".$wwwtopdir."images/icons/16/find.png\" class=\"icon\" alt=\"\" /></a>";
$this->buffer .= " <a href=\"#\" onclick=\"stft('".$this->nom."','".$key."'); return false;\"><img src=\"".$wwwtopdir."images/icons/16/find.png\" class=\"icon\" alt=\"\" /></a>";
$this->buffer .= "<div id=\"".$this->nom."_f".$key."\" class=\"filter\" style=\"display:none;\">";
$this->buffer .= "<h4>Filtrer</h4>";
$this->buffer .= "<ul>";
$this->buffer .= "<li class=\"sel\"><a href=\"#\" onclick=\"stuft(this,'".$this->nom."','$key'); return false;\">Tout afficher</a></li>";
$this->buffer .= "<li class=\"sel\"><a href=\"#\" onclick=\"stuft(this,'".$this->nom."','".$key."'); return false;\">Tout afficher</a></li>";
foreach ( $domains[$key] as $field => $values )
{
asort($values);
......@@ -778,7 +778,7 @@ class sqltable2 extends stdcontents
{
$value = htmlentities(addslashes($value),ENT_COMPAT,"UTF-8");
$this->buffer .= "<li><a href=\"#\" onclick=\"stftv(this,'".$this->nom."','$key','$field','$value'); return false;\">";
$this->buffer .= "<li><a href=\"#\" onclick=\"stftv(this,'".$this->nom."','".$key."','".$field."','".$value."'); return false;\">";
switch ( $col[0] )
{
case "image" :
......@@ -827,7 +827,7 @@ class sqltable2 extends stdcontents
$this->buffer .= "<p class=\"batch\">Pour la s&eacute;lection : <select name=\"action\">\n";
foreach ( $this->batch as $action => $col )
$this->buffer .= "<option value=\"$action\">".htmlentities($col[0],ENT_COMPAT,"UTF-8")."</option>\n";
$this->buffer .= "<option value=\"".$action."\">".htmlentities($col[0],ENT_COMPAT,"UTF-8")."</option>\n";
$this->buffer .= "</select>\n<input type=\"submit\" value=\"Valider\" />\n</p>\n";
$this->buffer .= "</form>\n";
......
......@@ -203,27 +203,27 @@ class interfaceweb
echo "<head>\n";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n"; // (IE6 Legacy support)
echo "<title>".$this->title." - association des etudiants de l'utbm</title>\n";
echo "<title>".htmlentities($this->title,ENT_COMPAT,"UTF-8")." - association des etudiants de l'utbm</title>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . $wwwtopdir . "themes/default/css/site.css\" title=\"AE2-NEW2\" />\n";
foreach ( $this->extracss as $url )
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . htmlentities($wwwtopdir . $url,ENT_NOQUOTES,"UTF-8"). "\" />\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . htmlentities($wwwtopdir . $url,ENT_COMPAT,"UTF-8"). "\" />\n";
foreach ( $this->alternate as $row )
{
echo "<link rel=\"alternate\" ".
"type=\"".htmlentities($row[0],ENT_NOQUOTES,"UTF-8")."\" ".
"title=\"".htmlentities($row[1],ENT_NOQUOTES,"UTF-8")."\" ".
"href=\"".htmlentities($row[2],ENT_NOQUOTES,"UTF-8")."\" />\n";
"type=\"".htmlentities($row[0],ENT_COMPAT,"UTF-8")."\" ".
"title=\"".htmlentities($row[1],ENT_COMPAT,"UTF-8")."\" ".
"href=\"".htmlentities($row[2],ENT_COMPAT,"UTF-8")."\" />\n";
}
if ( !empty($this->meta_keywords) )
echo "<meta name=\"keywords\" content=\"".htmlentities($this->meta_keywords,ENT_NOQUOTES,"UTF-8")."\" />\n";
echo "<meta name=\"keywords\" content=\"".htmlentities($this->meta_keywords,ENT_COMPAT,"UTF-8")."\" />\n";
if ( !empty($this->meta_description) )
echo "<meta name=\"description\" content=\"".htmlentities($this->meta_description,ENT_NOQUOTES,"UTF-8")."\" />\n";
echo "<meta name=\"description\" content=\"".htmlentities($this->meta_description,ENT_COMPAT,"UTF-8")."\" />\n";
echo "<link rel=\"SHORTCUT ICON\" href=\"" . $wwwtopdir . "favicon.ico\" />\n";
echo "<script type=\"text/javascript\">var site_topdir='$wwwtopdir';</script>\n";
echo "<script type=\"text/javascript\">var site_topdir='".$wwwtopdir."';</script>\n";
echo "<script type=\"text/javascript\" src=\"" . $wwwtopdir . "js/site.js\"></script>\n";
echo "<script type=\"text/javascript\" src=\"" . $wwwtopdir . "js/ajax.js\"></script>\n";
echo "<script type=\"text/javascript\" src=\"" . $wwwtopdir . "js/dnds.js\"></script>\n";
......@@ -245,7 +245,7 @@ class interfaceweb
echo "<div id=\"fsearchbox\">\n";
echo "<form action=\"".$wwwtopdir."fsearch.php\" method=\"post\">";
echo "<input type=\"text\" id=\"fsearchpattern\" name=\"pattern\" onblur=\"fsearch_stop_delayed();\" onkeyup=\"fsearch_keyup(event,'$wwwtopdir');\" value=\"\" />\n";
echo "<input type=\"text\" id=\"fsearchpattern\" name=\"pattern\" onblur=\"fsearch_stop_delayed();\" onkeyup=\"fsearch_keyup(event);\" value=\"\" />\n";
echo "</form>";
echo "<div class=\"fend\"></div></div>\n";
......@@ -283,7 +283,7 @@ class interfaceweb
foreach ( $links as $entry )
{
if ( ereg("http://(.*)",$entry[0]) )
if ( strncmp("http://",$entry[0],7) )
echo "<a href=\"".$entry[0]."\">".$entry[1]."</a>\n";
else
echo "<a href=\"".$wwwtopdir.$entry[0]."\">".$entry[1]."</a>\n";
......@@ -331,19 +331,19 @@ class interfaceweb
else
$ref = null;
echo "<div id=\"$side\">\n";
echo "<div id=\"".$side."\">\n";
foreach ( $names as $name )
{
if ( $cts = $this->boxes[$name] )
{
echo "<div class=\"box\" id=\"sbox_$name\">\n";
echo "<div class=\"box\" id=\"sbox_".$name."\">\n";
if ( $cts->title && ($ref != null) )
echo "<h1><a onmousedown=\"dnds_startdrag(event,'sbox_$name','$ref');\" class=\"dragstartzone\">".$cts->title."</a></h1>\n";
echo "<h1><a onmousedown=\"dnds_startdrag(event,'sbox_".$name."','".$ref."');\" class=\"dragstartzone\">".$cts->title."</a></h1>\n";
elseif ( $cts->title )
echo "<h1>".$cts->title."</h1>\n";
echo "<div class=\"body\" id=\"sbox_body_$name\">\n";
echo "<div class=\"body\" id=\"sbox_body_".$name."\">\n";
echo $cts->html_render();
......@@ -359,7 +359,7 @@ class interfaceweb
if ( $idpage == "" ) $idpage = "n";
echo "\n<!-- page -->\n";
echo "<div class=\"page\" id=\"$idpage\">\n";
echo "<div class=\"page\" id=\"".$idpage."\">\n";
$i=0;
foreach ( $this->contents as $cts )
......@@ -372,11 +372,11 @@ class interfaceweb
$i++;
echo "<div class=\"$cssclass\"";
echo "<div class=\"".$cssclass."\"";
if ( $cts->divid )
echo " id=\"".$cts->divid."\"";
else
echo " id=\"cts$i\"";
echo " id=\"cts".$i."\"";
echo ">\n";
if ( $cts->toolbox )
......@@ -448,17 +448,18 @@ class interfaceweb
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:v=\"urn:schemas-microsoft-com:vml\">\n";
echo "<head>\n";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n";
echo "<title>".$this->title." - association des etudiants de l'utbm</title>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . $wwwtopdir . "themes/default/css/site.css\" title=\"AE2-NEW Base\" />\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . $wwwtopdir . "css/popup.css\" title=\"AE2-NEW Base\" />\n";
echo "<title>".htmlentities($this->title,ENT_COMPAT,"UTF-8")." - association des etudiants de l'utbm</title>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . $wwwtopdir . "themes/default/css/site.css\" title=\"AE2-NEW2\" />\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . $wwwtopdir . "css/popup.css\" />\n";
foreach ( $this->extracss as $url )
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . htmlentities($wwwtopdir . $url,ENT_NOQUOTES,"UTF-8"). "\" />\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . htmlentities($wwwtopdir . $url,ENT_COMPAT,"UTF-8"). "\" />\n";
foreach ( $this->rss as $title => $url )
echo "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"".htmlentities($title,ENT_NOQUOTES,"UTF-8")."\" href=\"".htmlentities($url,ENT_NOQUOTES,"UTF-8")."\" />";
echo "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"".htmlentities($title,ENT_COMPAT,"UTF-8")."\" href=\"".htmlentities($url,ENT_COMPAT,"UTF-8")."\" />";
echo "<link rel=\"SHORTCUT ICON\" href=\"" . $wwwtopdir . "favicon.ico\" />\n";
echo "<script type=\"text/javascript\" src=\"" . $wwwtopdir . "js/site.js\">var site_topdir='$wwwtopdir';</script>\n";
echo "<script type=\"text/javascript\">var site_topdir='".$wwwtopdir."';</script>\n";
echo "<script type=\"text/javascript\" src=\"" . $wwwtopdir . "js/site.js\"></script>\n";
echo "<script type=\"text/javascript\" src=\"" . $wwwtopdir . "js/ajax.js\"></script>\n";
echo "<script type=\"text/javascript\" src=\"" . $wwwtopdir . "js/dnds.js\"></script>\n";
......@@ -481,11 +482,11 @@ class interfaceweb
$cssclass = $cts->cssclass;
$i++;
echo "<div class=\"$cssclass\"";
echo "<div class=\"".$cssclass."\"";
if ( $cts->divid )
echo " id=\"".$cts->divid."\"";
else
echo " id=\"cts$i\"";
echo " id=\"cts".$i."\"";
echo ">\n";
if ( $cts->toolbox )
......
......@@ -144,7 +144,7 @@ var fsearch_display_query='';
var fsearch_sequence=0;
var fsearch_actual_sequence=0;
function fsearch_keyup(event,topdir)
function fsearch_keyup(event)
{
if ( event != null )
{
......@@ -162,7 +162,7 @@ function fsearch_keyup(event,topdir)
fsearch_sequence=fsearch_sequence+1;
evalCommand( topdir + "gateway.php", "module=fsearch&fsearch_sequence="+fsearch_sequence+"&topdir="+topdir+"&pattern="+obj.value );
evalCommand( site_topdir + "gateway.php", "module=fsearch&fsearch_sequence="+fsearch_sequence+"&topdir="+site_topdir+"&pattern="+obj.value );
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment