Listing du fichier statghfns.php
00001<?php
00002 # (gH) -_- statghfns.php ; TimeStamp (unix) : 25 Août 2012 vers 11:55
00003
00004 include("../std.php") ;
00005
00006 ######################################################
00007
00008 # pn avec cr() dont anaTcr() fournit incorrectement un exemple...
00009
00010 $fichierDesFonctions = "statgh.r" ;
00011 $fichierDesExemples = "statgh.xmp" ;
00012 $verStatgh = "???" ;
00013
00014 # tableau des noms de fonctions
00015
00016 $tfns = array() ;
00017 $nbfns = -1 ;
00018 $fh = fopen($fichierDesFonctions,"r") ;
00019 while ($lig=fgets($fh,4096)) {
00020 if (mot($lig,1) == "version_gH") {
00021 $verStatgh = mot($lig,3) ;
00022 } ; # fin de si
00023 if (mot($lig,2) == "<-") {
00024 if (substr(mot($lig."12345678",3),0,8) == "function") {
00025 $nfns = mot($lig,1) ;
00026 if (($nfns=="vnorm") or ($nfns=="format.record") ){
00027 # non, ce sont des fonctions "locales"
00028 } else {
00029 $tfns[$nbfns++] = $nfns ;
00030 } ; # fin de si
00031 } ; # fin de si
00032 } ; # fin de si
00033 } ; # fin tant que
00034 fclose($fh) ;
00035 sort($tfns) ;
00036
00037 ######################################################
00038
00039 $titre1 = "Les $nbfns fonctions de $fichierDesFonctions " ;
00040 $titre2 = "Les $nbfns fonctions de ".s_span("$fichierDesFonctions","grouge")." (version ".s_span($verStatgh,"gvert").")" ;
00041 debutPage($titre1,"strict","","statghfns.js") ;
00042 debutSection() ;
00043 h1($titre2) ;
00044
00045 p() ;
00046 echo "Chargement des fonctions :" ;
00047 finp() ;
00048
00049 p() ;
00050 nbsp(10) ;
00051 echo href("statgh.r",'source("https://gilles-hunault.leria-info.univ-angers.fr/wstat/statgh.r",encoding="latin1")',"gbleuf nou") ;
00052 finp() ;
00053
00054 ######################################################
00055
00056 sdl() ;
00057
00058 $lafns = "" ;
00059 if (isset($_GET["lafns"])) { $lafns = $_GET["lafns"] ; } ;
00060
00061 form("statghfns.php","get") ;
00062 table(0,15) ;
00063 tr() ;
00064
00065 ## ---------------------------------------------------
00066
00067 td("","valigntop") ;
00068 p() ;
00069 echo "Choisissez la fonction : " ;
00070 finp() ;
00071 p() ;
00072
00073 $lafnsel = "aide" ;
00074 if (!$lafns=="") { $lafnsel = $lafns ; } ;
00075
00076 input_select("lafns","size=\"20\"") ;
00077 foreach ($tfns as $nfns) {
00078 $selected = "" ;
00079 $plus = " ondblclick='window.location.replace(\"statghfns.php?lafns=$nfns\")' " ;
00080 if ($nfns==$lafnsel) {
00081 $selected = "selected" ;
00082 } ; # fin si
00083 input_option($nfns,"",$selected,"",$plus) ;
00084 } ; # fin pour chaque
00085 finselect() ;
00086 finp() ;
00087 p("centre") ;
00088 input_submit("montrer","montrer","vert_pastel") ;
00089 finp() ;
00090 fintd() ;
00091
00092 ## ---------------------------------------------------
00093
00094 td() ;
00095 if ($lafns!="") {
00096
00097 h2("Exemples d'utilisation de la fonction ".s_span($lafns,"gbleuf")) ;
00098 textarea("","cadre tajaunec",10,120) ;
00099 echo "\n" ;
00100 $fh = fopen($fichierDesExemples,"r") ;
00101 $ok = 0 ;
00102 while ($lig=fgets($fh,4096)) {
00103 if (strpos(" $lig"," $lafns(")) {
00104 echo $lig."\n" ;
00105 } ; # fin si
00106 } ; # fin tant que
00107 fclose($fh) ;
00108 fintextarea() ;
00109
00110 h2("Corps de la fonction ".s_span($lafns,"gbleuf")) ;
00111 textarea("","cadre",20,120) ;
00112 echo "\n" ;
00113 $fh = fopen($fichierDesFonctions,"r") ;
00114 $ok = 0 ;
00115 while ($lig=fgets($fh,4096)) {
00116 if (( (mot($lig,2) == "<-") and (substr(mot($lig."12345678",3),0,8) == "function") and (mot($lig,1)==$lafns) )
00117 or ( $ok==1)) {
00118 $lig = preg_replace("/</","<",$lig) ;
00119 $lig = preg_replace("/>/",">",$lig) ;
00120 echo $lig ;
00121 $ok = 1 ;
00122 } ; # fin de si
00123 if (strpos($lig,"fin de fonction")) { $ok = 0 ; } ;
00124 } ; # fin tant que
00125 fclose($fh) ;
00126 fintextarea() ;
00127
00128 } else {
00129 textarea_fichier("","cadre",25,120,"statgh","statgh.r") ;
00130 } ; # fin si
00131 fintd() ;
00132
00133 ## ---------------------------------------------------
00134
00135 fintr() ;
00136 fintable() ;
00137 finform() ;
00138
00139 p("centre") ;
00140 echo "Cliquer ".href("statghfns.php?lafns=","ici","bouton_fin nou orange_pastel")." pour revenir à la page de départ" ; ;
00141 finp() ;
00142
00143 pvide() ;
00144 p() ;
00145 echo href("montresource.php?nomfic=statghfns.php","Code-source de la page","orange_stim nou") ;
00146 nbsp(4) ;
00147 echo href("statgh.php","explications","nou") ;
00148 nbsp(4) ;
00149 echo href("statgh.r.zip","archive zip du code de statgh.r","gvert") ;
00150 finp() ;
00151
00152 ######################################################
00153 finSection() ;
00154 finPage() ;
00155 ?>
Pour ne pas voir les numéros de ligne, ajoutez &nl=non à la suite du nom du fichier.
Retour à la page principale de (gH)