Fichier source |
mes_documents.php
[ 0]
<?php
[ 1] require_once "include/global.php";
[ 2] require_once "include/preferences.php";
[ 3] require_once "include/menubar.php";
[ 4] // pour une imprimante ou une sortie a l'écran...
[ 5] require_once "include/xml_doctype.php";
[ 6]
[ 7]
[ 8] $initialiser_preferences();
[ 9] if ($sourcefile != "")
[ 10] {
[ 11] $titre = substr ($sourcefile , 0, -4);
[ 12] $titre = strtolower(substr (strrchr($titre, "/"), 1));
[ 13] }
[ 14] $entete_html();
[ 15] afficher_top_bar();
[ 16]
[ 17] // Split the main frame
[ 18] debut_mosaique_horizontale();
[ 19]
[ 20] // Standard Left Bar
[ 21] afficher_standard_left_bar();
[ 22] fin_mosaique_gauche();
[ 23]
[ 24] ///////////////////////////
[ 25] // Begin of the main Bar //
[ 26] ///////////////////////////
[ 27] $dir = "./docs/MyDocuments";
[ 28]
[ 29] if ($sourcefile == "")
[ 30] { // if there is no file specified
[ 31] // display the list of files
[ 32] $T = "";
[ 33] $path = $dir ."/desc.txt" ;
[ 34] $fd = fopen($path, "r");
[ 35] $contents = fread($fd, filesize ($path));
[ 36] fclose($fd);
[ 37] $T .= $contents;
[ 38] $rep = opendir($dir);
[ 39] while ($file = readdir($rep))
[ 40] {
[ 41] if (($file <> ".") and ($file <>".."))
[ 42] {
[ 43] $path = $dir ."/". $file;
[ 44] $prefixe = substr ($file, 0, -4);
[ 45] $suffixe = substr (strrchr($file, "."), 1);
[ 46] $suffixe = strtolower($suffixe);
[ 47] if ($suffixe=="pdf")
[ 48] {
[ 49] // $T .= "<A href=\"$path\">$file</a><BR />\n";
[ 50] $T .= $inserer_lien( $path, $prefixe ). " <BR />\n";
[ 51] }
[ 52] else if ($suffixe=="jpg")
[ 53] {
[ 54] $T .= "<BR /><A href=\"$path\">\n";
[ 55] $T .= "<IMG border=0 src=\"$path\" width=150 alt=\"$file\">\n";
[ 56] $T .= "</a><BR />\n";
[ 57] }
[ 58] else if ($suffixe=="xml")
[ 59] {
[ 60] $source = $path;
[ 61] $T .= $inserer_lien( "mes_documents.php", $prefixe ). " <BR />\n";
[ 62] }
[ 63] }
[ 64] }
[ 65] $i = $nb_desc +1;
[ 66] $encadre($T, $Largeur_Mainbar, $COL_bg_yellow, "Mes Documents");
[ 67] //$T .= $inserer_lien( "index1.php", $contents)."<BR>";
[ 68] unset($fd);
[ 69] unset($contents);
[ 70] }
[ 71] else
[ 72] { // If there is a file specified
[ 73] // Display the file
[ 74] $prefixe = substr ($file, 0, -4);
[ 75]
[ 76] //$encadre_fichier( "cv.htm", $Largeur_Mainbar, white );
[ 77] // les fichiers xml et xsl
[ 78] //$xmlFile = "accueil.xml";
[ 79] //$xslFile = "include/".DeviceType();
[ 80] $xslFile = "include/screen_news.xsl";
[ 81] // xslt processeur
[ 82] $th = xslt_create();
[ 83] if (!$th)
[ 84] print xslt_error();
[ 85]
[ 86] $args = array();
[ 87] $params = array("xml_dir" => "$dir/");
[ 88]
[ 89] // transforme le fichier xml
[ 90] $result = @xslt_process($th, $sourcefile, $xslFile, NULL, $args, $params);
[ 91] if ($result)
[ 92] {
[ 93] // affiche la transformation
[ 94] $encadre($result, $Largeur_Mainbar, $COL_bg_yellow, "Accueil");
[ 95] }
[ 96] else
[ 97] {
[ 98] print "Une erreur est survenue durant la transformation du fichier xml<br/>";
[ 99] print "Message d'erreur : " . xslt_error($th) . "<br/>";
[100] // exit;
[101] }
[102]
[103] // fin
[104] xslt_free($th);
[105] }
[106] fin_mosaique_horizontale();
[107] afficher_foot_bar();
[108]
[109] $ferme_html();
[110] ?>
[111]
|
|
|