Source de page.inc
<?
require_once ("search.inc");
require_once ("theme.inc");
require_once ("bookmarks.inc");
require_once ("preferences.inc");
define("DEFAULT_MAIL_VALUE",' Votre adresse mail');
function getTimeStamp()
{
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
class Page
{
var $version = "12.4.0";
var $titlePrefix = "SAIT : ";
var $header = "Site d'Aide Informatique de Tian";
var $description = "Pour mieux comprendre l'informatique en général et GNU/Linux en particulier";
var $keywords = "";
var $encoding = 'iso-8859-1';
var $author = "Tian";
var $generator = "Emacs, The GIMP";
var $email = "tian@c-sait.net";
var $iconExt = "png";
var $creationYear = 2002;
var $tabIndexLogo = 7;
var $tabIndexTitle = 8;
var $tabIndexNavBegin = 10;
var $tabIndexSectionBegin = 20;
var $tabIndexSponsorBegin = 40;
var $tabIndexThemeBegin = 60;
var $tabIndexBookmarksBegin = 70;
var $tabIndexNewsBegin = 80;
var $withSectionTabIndex = false;
// Label => (Page, Classe, Titre, AccessKey, TabIndex)
var $menuButtons = array("Cours" => array("/cours/","lessons", "Articles informatiques","C","11"),
"Boîte à outils" => array("/boite.php","toolbox","Sources du site + petits outils","B","12"),
"Humeurs" => array("/humeurs.php","misc", "La page détente","H","13"),
"Liens" => array("/liens.php","links", "Liens vers d'autres sites","L","14"),
"Rechercher" => array("/rechercher.php","search", "Rechercher sur ce site","R","15"),
"A propos" => array("/apropos.php","about", "Informations concernant ce site","A","16"),
"Forums" => array("/forums/","forums", "Les forums de ce site","F","17")
);
// Label => (Page, Titre, AccessKey, TabIndex)
var $topNavigation = array("Aide à la navigation" => array("/aide.php","Informations pour faciliter la navigation sur ce site","6","1"),
"Barre de navigation" => array("#navi","Aller au niveau de la barre de navigation","3","2"),
"Contenu de la page" => array("#top","Aller directement au contenu de cette page","2","3")
);
var $title = '';
var $content = '';
var $pageTitle = '';
var $intro = '';
var $extraSponsor = '';
var $extra = '';
var $sections = array();
var $extraTOC = array();
var $newsMail = '';
var $sectionTitle = '';
var $homePageHref = '';
var $homePageName = '';
var $useHomePage = false;
var $sectionTopics;
var $breadcrumb;
var $userTheme;
var $activeNews = true;
var $isPrintable = false;
var $hasUp = true;
var $quickSearchShow = true;
var $quickSearchForum = "";
var $quickSearchWhere = "";
var $noNavigation = false;
var $noRobotIndex = false;
var $noRobotFollow= false;
var $showSourceLink = true;
var $isAAA = true;
// 12/04/2015: Disable statistics
var $hasStat = false;
var $creationDate = "2002-12-01";
var $boxesArray;
function Page()
{
ini_set('default_charset', $this->encoding);
ini_set('arg_separator.output', '&');
ini_set("url_rewriter.tags", "a=href,area=href");
$_SERVER['REQUEST_URI'] = str_replace('&','&',$_SERVER['REQUEST_URI']);
if (isset($_GET['no_navigation']) && ($_GET['no_navigation'] != 0))
{
$this->noNavigation = true;
$this->disableRobotIndex();
}
$this->userTheme = new Theme($this->noNavigation);
if (isset($_REQUEST['change_theme']))
{
$this->disableRobotIndex();
}
$searchEngineWords = getSearchEngineWords();
if ((!isset($_GET['highlight'])) && ($searchEngineWords != ""))
{
$_GET['highlight'] = $searchEngineWords;
}
$this->boxesArray = array();
bookmark();
}
function activateQuickSearch($active, $forum="", $where="")
{
$this->quickSearchShow = $active;
$this->quickSearchForum = $forum;
$this->quickSearchWhere = $where;
}
function activateNews($active)
{
$this->activeNews = $active;
}
function setHomePage($name, $url)
{
$this->homePageHref = $url;
$this->homePageName = $name;
}
function useHomePageNameForBreadCrumb($value)
{
$this->useHomePage = $value;
}
function setPrintable($isPrintable)
{
$this->isPrintable = $isPrintable;
}
function setHasUp($hasUp)
{
$this->hasUp = $hasUp;
}
function disableRobotIndex()
{
$this->noRobotIndex = true;
}
function disableRobotFollow()
{
$this->noRobotFollow = true;
}
function setShowSource($showSource)
{
$this->showSourceLink = $showSource;
}
function setContent($newcontent)
{
$this->content = $newcontent;
}
function setTitle($newtitle)
{
$this->title = $newtitle;
}
function setPageTitle($newtitle)
{
$this->pageTitle = $newtitle;
}
function setExtraSponsor($newSponsor)
{
$this->extraSponsor = $newSponsor;
}
function setIntroduction($newIntro)
{
$this->intro = $newIntro;
}
function setExtra($newExtra)
{
$this->extra = $newExtra;
}
function addNewsMail($newsMail)
{
$this->newsMail = $newsMail;
}
function addTOCLink($url, $name)
{
array_push($this->extraTOC, array($url, $name));
}
function addChapter($id, $title, $content, $shortTitle="")
{
array_push($this->sections, array($id, $title, $content, $shortTitle));
}
function setDescription($newDescription)
{
$this->description = $newDescription;
}
function setKeywords($newKeywords)
{
$this->keywords = $newKeywords;
}
function setCreationDate($newDate)
{
$this->creationDate = $newDate;
}
function setButtons($newbuttons)
{
$this->buttons = $newbuttons;
}
function setSectionContent($title, $topics)
{
$this->sectionTitle = $title;
$this->sectionTopics = $topics;
}
function setBreadCrumb($breadcrumb)
{
$this->breadcrumb = $breadcrumb;
}
function setAAA($value)
{
$this->isAAA = $value;
}
function setStat($value)
{
// 12/04/2015: Disable statistics
$this->hasStat = $value;
}
function getEmail()
{
return $this->email;
}
function getStyleSheetURL()
{
return "http://".$_SERVER["HTTP_HOST"].$this->userTheme->getStyleSheetCommonPath();
}
function getChaptersLinks()
{
$toc = '';
foreach ($this->sections as $item)
{
if ($item[1] != '')
{
if ($item[3] != "")
{
$toc .= ' <link rel="Chapter" href="#'.$item[0].'" title="'.$item[3].'" />
';
}
else
{
$toc .= ' <link rel="Chapter" href="#'.$item[0].'" title="'.$item[1].'" />
';
}
}
else
{
$toc = '';
break;
}
}
return $toc;
}
function getSubSectionsLinks()
{
$result = '';
while (list($title, $tagInfo) = each($this->sectionTopics))
{
if (is_array($tagInfo))
{
$link = $tagInfo[0];
}
else
{
$link = $tagInfo;
}
$result .= ' <link rel="Subsection" href="'.$link.'" title="'.$title.'" />
';
}
reset($this->sectionTopics);
return $result;
}
function display()
{
/*
echo '<?xml version="1.0" encoding="iso-8859-1"?>';
echo "\n";
*/
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"';
echo "\n";
echo ' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
echo "\n";
echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">';
echo "\n";
echo "<head>\n";
if ($this->pageTitle == '')
{
$this->pageTitle = $this->title;
}
$this->displayTitle();
$this->displayMeta();
$this->displayFavoritesIcon();
$this->displayNavigationLinks();
$this->displayStyles();
echo ' <script type="text/javascript" src="/js/utils.js"></script>
';
echo ' <script type="text/javascript" src="/js/font_utils.js"></script>
';
echo ' <script type="text/javascript" src="/js/box_utils.js"></script>
';
echo ' <script type="text/javascript" src="/js/tooltips_utils.js"></script>
';
if (isset($_GET['highlight']))
{
echo ' <script type="text/javascript" src="/js/highlight_utils.js"></script>
';
}
echo "</head>\n\n";
if ($this->userTheme->doesThemeRequireInit() && !$this->noNavigation)
{
echo "<body onload=\"initDisplay();\">\n";
}
else
{
echo "<body onload=\"initTT();\">\n";
}
if (!$this->noNavigation)
{
$this->displayTopBar();
}
echo "<hr />\n";
echo '<div id="main">'."\n";
$this->displayHeader();
echo " <div id=\"page-content\">\n";
$this->displayPageHeader();
$this->displayContent();
$this->displayPageFooter();
echo " </div>\n";
if (!$this->noNavigation)
{
echo " <hr />\n";
$this->displayMenuBar();
}
echo " <hr />\n";
$this -> displayFooter();
echo "</div>\n";
$this->displayCopyright();
echo "</body>\n</html>\n";
}
function displayPageHeader()
{
echo " <div id=\"page-header\">\n";
$this->displayBreadCrumb();
if ($this->isPrintable)
{
if ($this->noNavigation)
{
echo " <div class=\"switch-menu\"><span class=\"link-separator\"> | </span><a href=\"".$_SERVER["PHP_SELF"]."?no_navigation=0\" title=\"Afficher la page avec les menus de navigation\">Version complète</a><span class=\"link-separator\"> | </span></div>\n";
}
else
{
echo " <div class=\"switch-menu\"><span class=\"link-separator\"> | </span><a href=\"".$_SERVER["PHP_SELF"]."?no_navigation=1\" title=\"Afficher la page sans les menus de navigation\">Version sans menu</a><span class=\"link-separator\"> | </span></div>\n";
}
}
if (isset($_GET['highlight']))
{
echo " <div class=\"switch-highlight\"><span class=\"link-separator\"> | </span><a href=\"".$_SERVER['REQUEST_URI']."\" title=\"Enlever la mise en évidence des mots trouvés dans cette page\">Supprimer la colorisation</a><span class=\"link-separator\"> | </span></div>\n";
}
echo " </div>\n";
}
function displayPageFooter()
{
echo " <div id=\"page-footer\">\n";
if (strlen($this->homePageHref)!=0)
{
echo " <div class=\"home\"><span class=\"link-separator\"> | </span><a href=\"$this->homePageHref\">$this->homePageName</a><span class=\"link-separator\"> | </span></div>\n";
}
if ($this->hasUp)
{
echo ' <div class="up"><span class="link-separator"> | </span><a title="Retourner au début de la page" href="#top">Haut de page</a><span class="link-separator"> | </span></div>
';
}
echo " </div>\n";
}
function displayContent()
{
if ($this->content == "")
{
$this->generateContent($this->content);
}
if (isset($_GET['highlight']))
{
if ($_GET['with_preg'] == "on")
{
$withPreg = true;
}
else
{
$withPreg = false;
}
if ($_GET['with_case'] == "on")
{
$withCase = true;
}
else
{
$withCase = false;
}
highlightText($this->content, $_GET['highlight'], $withPreg, $withCase);
}
echo $this->content;
}
function displayTitle()
{
$title = $this->titlePrefix.$this->title;
if (($this->sectionTitle != '') && ($this->homePageHref!=''))
{
$title .= ' - ['.$this->sectionTitle.']';
}
echo ' <title> '.$title." </title>\n";
}
function displayMeta()
{
echo " <meta http-equiv=\"Content-Type\" content=\"text/html; charset=$this->encoding\" />\n";
echo " <meta http-equiv=\"Description\" name=\"description\" xml:lang=\"fr\" lang=\"fr\" content=\"$this->description\" />\n";
//echo " <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n";
echo " <meta http-equiv=\"Content-Script-Type\" content=\"text/javascript\" />\n";
echo " <meta http-equiv=\"Description\" name=\"description\" xml:lang=\"fr\" lang=\"fr\" content=\"$this->description\" />\n";
echo " <meta name=\"keywords\" content=\"$this->keywords\" />\n";
echo " <meta name=\"author\" content=\"$this->author\" />\n";
echo " <meta name=\"reply-to\" content=\"$this->email\" />\n";
echo " <meta name=\"generator\" content=\"$this->generator\" />\n";
$robot = $this->noRobotIndex ? "noindex," : "index,";
$robot .= $this->noRobotFollow ? "nofollow" : "follow";
echo " <meta name=\"robots\" content=\"$robot\" />\n";
}
function displayNavigationLinks()
{
?>
<link rel="start" title="Accueil" href="/" />
<?
if (strlen($this->homePageHref)!=0)
{
echo " <link rel=\"up\" title=\"$this->homePageName\" href=\"$this->homePageHref\" />\n";
}
?>
<link rel="index" title="Plan du site" href="/plan.php" />
<link rel="help" title="Aide à la navigation" href="/aide.php" />
<link rel="search" title="Rechercher" href="/rechercher.php" />
<link rel="author" title="Auteur" href="/info.php#who" />
<link rel="copyright" title="Licences d'utilisation" href="/copyright.php" />
<?
echo $this->getChaptersLinks();
echo $this->getSubSectionsLinks();
echo getBookmarksLinks();
}
function displayFavoritesIcon()
{
echo " <link rel=\"shortcut icon\" type=\"images/x-icon\" href=\"/images/favicon.ico\" />\n";
echo " <link rel=\"icon\" type=\"image/png\" href=\"/images/favicon.png\" />\n";
}
function displayStyles()
{
echo $this->userTheme->getStyleSheetLinks();
echo $this->userTheme->getSizeStylesheetLink();
}
function displayCopyright()
{
?>
<!-- Creative Commons License -->
<!--
<rdf:RDF xmlns="http://web.resource.org/cc/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<Work rdf:about="http://www.c-sait.net/">
<dc:title>Site d'Aide Informatique de Tian</dc:title>
<dc:date>
<?
echo " $this->creationDate\n";
?>
</dc:date>
<dc:description>
<?
echo " $this->description\n";
?>
</dc:description>
<dc:creator>
<Agent>
<dc:title>Tian</dc:title>
</Agent>
</dc:creator>
<dc:rights>
<Agent>
<dc:title>Tian</dc:title>
</Agent>
</dc:rights>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/Text" />
<dc:source rdf:resource="<? echo "http://".$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']?>"/>
<license rdf:resource="http://creativecommons.org/licenses/by-nc-sa/2.0/fr/" />
</Work>
<License rdf:about="http://creativecommons.org/licenses/by-nc-sa/2.0/fr/">
<permits rdf:resource="http://web.resource.org/cc/Reproduction" />
<permits rdf:resource="http://web.resource.org/cc/Distribution" />
<requires rdf:resource="http://web.resource.org/cc/Notice" />
<requires rdf:resource="http://web.resource.org/cc/Attribution" />
<prohibits rdf:resource="http://web.resource.org/cc/CommercialUse" />
<permits rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
<requires rdf:resource="http://web.resource.org/cc/ShareAlike" />
</License>
</rdf:RDF>
-->
<?
}
function displayHeader()
{
echo ' <div id="header">'."\n";
echo " <a class=\"title\" accesskey=\"1\" tabindex=\"".$this->tabIndexTitle."\" href=\"/\" title=\"Retour à l'accueil\">\n";
echo " $this->header\n";
echo " </a>\n";
echo " </div>\n";
}
function displayTopBar()
{
echo "<div id=\"top-bar\">\n";
if ($this->quickSearchShow)
{
echo getQuickSearchForm($this->quickSearchForum, $this->quickSearchWhere);
}
echo " <ul>\n";
while (list($name, $link) = each($this->topNavigation))
{
echo " <li>[<a tabindex=\"$link[3]\" accesskey=\"$link[2]\" title=\"$link[1]\" href=\"$link[0]\">$name</a>] </li>\n";
}
echo " </ul>\n";
echo "</div>\n";
}
function displayBreadCrumb()
{
$breadcrumb = '<div id="breadcrumb">Position : ';
if ($_SERVER["SCRIPT_NAME"] != '/index.php')
{
$breadcrumb .= '<a href="/">Accueil</a> > ';
}
if (is_array($this->breadcrumb))
{
while (list($title, $link) = each($this->breadcrumb))
{
$breadcrumb .= '<a href="'.$link.'">'.
$title.'</a> > ';
}
}
if (strlen($this->homePageHref) != 0)
{
if ($this->useHomePage)
{
$parentName = $this->homePageName;
}
else
{
$parentName = $this->sectionTitle;
}
//preg_replace('Retour (à|aux) (.)(.*)','U\2\E\3',$parentName);
$breadcrumb .= '<a href="'.$this->homePageHref.'">'.
$parentName.'</a> > ';
}
$breadcrumb .= '<strong>'.$this->pageTitle.'</strong>';
$breadcrumb .= '</div>';
echo $breadcrumb;
}
function displayMenuBar()
{
echo " <div id=\"menu-bar\">\n";
echo " <div id=\"logo-box\"><span class=\"link-separator\"> | </span><a tabindex=\"".$this->tabIndexLogo."\" href=\"/\" title=\"Retour à l'accueil\">\n";
echo ' <img class="logo" alt="Retour à l\'accueil" src="/images/logo.jpg" />'."\n";
echo " </a><span class=\"link-separator\"> | </span></div>\n";
$menu = " <ul>\n";
while (list($name, $button) = each($this->menuButtons))
{
$menu .= " <li>";
$menu .= $this->createButton($name, $button, $this->isCurrentPageInSection($button[0]));
$menu .= "</li>\n";
}
$menu .= " </ul>\n";
$this->addBox($menu, "Barre de navigation", "nav-bar", "ul", $this->tabIndexNavBegin, "navi");
$sponsorContent = $this->userTheme->getSponsorBox();
$this->addBox($sponsorContent, "Publicité", "sponsor-bar", "div", $this->tabIndexSponsorBegin);
if (strlen($this->sectionTitle) != 0)
{
$topics = " <ul>\n";
$tabindex = $this->tabIndexSectionBegin + 1;
while (list($title, $tagInfo) = each($this->sectionTopics))
{
if (is_array($tagInfo))
{
$link = $tagInfo[0];
$classString = "class=\"$tagInfo[1]\"";
}
else
{
$link = $tagInfo;
$classString = "";
}
if ($this->withSectionTabIndex)
{
$tabindexString = "tabindex=\"$tabindex\"";
}
else
{
$tabindexString = "";
}
if ($this->isCurrentPage($link))
{
$topics .= " <li><a $classString $tabindexString href=\"$link\"><span class=\"selected\">$title</span></a></li>\n";
}
else
{
$topics .= " <li><a $classString $tabindexString href=\"$link\">$title</a></li>\n";
}
$tabindex++;
}
$topics .= " </ul>\n";
if (strlen($this->homePageHref) != 0)
{
if ($this->withSectionTabIndex)
{
$tabindexString = " tabindex=\"$this->tabIndexSectionBegin\"";
}
else
{
$tabindexString = "";
}
$sectionTitle = "<a class=\"box\"$tabindexString href=\"$this->homePageHref\">$this->sectionTitle</a>";
}
else
{
$sectionTitle = "$this->sectionTitle";
}
$this->addBox($topics, $sectionTitle, "quick-bar", "ul", $this->tabIndexSectionBegin);
}
$themeSelection = $this->userTheme->getThemeForm();
$this->addBox($themeSelection, "Préférences", "themes-bar", "form", $this->tabIndexThemeBegin, "prefs");
$bookmarkPage = preg_replace("/ - \[.*$/", "", $this->title);
$bookmarksBox = getBookmarksForm($bookmarkPage);
$this->addBox($bookmarksBox, "Marque-pages", "bookmarks-bar", "form", $this->tabIndexBookmarksBegin);
if ($this->activeNews)
{
$newsLetter = " <form action=\"/news.php\" method=\"get\">\n <div>\n";
if ( ((strlen(session_id())) != 0) && (!isset($_COOKIE[session_name()])) )
{
$newsLetter .= " <input type=\"hidden\" name=\"".session_name()."\" value=\"".session_id()."\" />\n";
}
$newsTabIndex = $this->tabIndexNewsBegin + 1;
$newsLetter .= " <label for=\"user_email\">Indiquez votre adresse mail ci-dessous pour être informé des mises à jour";
if (strlen($this->newsMail) != 0)
{
$newsLetter .= "</label>\n";
$newsLetter .= ' <input id="sitecb" name="liste" value="news" checked="checked" title="S\'inscrire à la liste de diffusion principale du site" type="radio" class="newscb" /><label id="siteL" for="sitecb" title="S\'inscrire à la liste de diffusion principale du site" class="newscb">du site.</label>
';
$newsLetter .= ' <input id="specialcb" name="liste" value="'.$this->newsMail.'" title="S\'inscrire à la liste de diffusion '.$this->newsMail.'" type="radio" class="newscb" /><label id="specialL" for="specialcb" title="S\'inscrire à la liste de diffusion '.$this->newsMail.'" class="newscb">de '.$this->newsMail.'.</label><br />
';
}
else
{
$newsLetter .= " du site.</label>\n";
}
$newsLetter .= " <input type=\"text\" name=\"user_email\" id=\"user_email\" class=\"mail-input\" size=\"18\" tabindex=\"$newsTabIndex\" title=\"Entrez votre adresse mail\" value=\"".DEFAULT_MAIL_VALUE."\" onfocus=\"return clearInput(this,'".DEFAULT_MAIL_VALUE."')\" /><br />\n";
$newsTabIndex++;
$newsLetter .= " <input type=\"submit\" class=\"submit-button\" value=\"S'inscrire\" tabindex=\"$newsTabIndex\" title=\"Valider la demande d'inscription\" />\n";
$newsLetter .= ' </div>
<div class="box-link" id="news-link">
<a href="/liste_diffusion.php" title="Plus d\'informations à propos de la liste de diffusion">
Plus d\'informations
</a>
</div>
</form>';
$this->addBox($newsLetter, "Liste de diffusion", "news-bar", "form", $this->tabIndexNewsBegin);
}
$this->displayBoxes();
echo " </div>\n";
}
function addBox($content, $title, $id, $tag, $tabindex, $titleid="")
{
$boxContent = " <div id=\"$id\" class=\"box\">\n";
if (strlen($title) > 0)
{
$boxContent .= " <script type=\"text/javascript\">writeMinMaxButton('$id', '$tag', '".strip_tags($title)."', '$tabindex');</script>\n";
if ($titleid != "")
{
$boxContent .= " <h1 id=\"$titleid\">$title</h1>\n";
}
else
{
$boxContent .= " <h1>$title</h1>\n";
}
}
$boxContent .= $content;
$boxContent .= " </div>\n";
$this->boxesArray[$id] = $boxContent;
}
function displayBoxes()
{
if (!isset($_COOKIE[BOXES_COOKIE]))
{
while(list($index, $item) = each($this->boxesArray))
{
echo $item;
}
}
else
{
$boxesList = explode('|', $_COOKIE[BOXES_COOKIE]);
array_shift($boxesList);
if (isset($_COOKIE['boxesState'])
&& (strpos($_COOKIE['boxesState'], 'sponsor-bar') === FALSE))
{
array_splice($boxesList, 1, 0, 'sponsor-bar');
}
while(list($index, $item) = each($boxesList))
{
echo $this->boxesArray[$item];
}
}
}
function isCurrentPage($url)
{
if (strpos( $_SERVER["SCRIPT_FILENAME"], $url )==false)
{
return false;
}
else
{
return true;
}
}
function isCurrentPageInSection($section)
{
if (($this->isCurrentPage($section) == false) &&
(strpos( $this->homePageHref, $section )===false))
{
return false;
}
else
{
return true;
}
}
function createButton($name, $button, $selected = false)
{
$description = $button[2];
$accesskey=$button[3];
$tabindex=$button[4];
if ($selected)
{
$class = $button[1]."-selected";
$name = "<span class=\"selected\">$name</span>";
}
else
{
$class = $button[1];
}
if ($selected)
{
$name = "<span class=\"link-separator\">→ </span>$name";
}
else
{
$name = "$name";
}
$result = "<a tabindex=\"$tabindex\" accesskey=\"$accesskey\" class=\"$class\" title=\"$description\" href = \"$button[0]\">$name</a>";
return $result;
}
function displayFooter()
{
echo " <div id=\"footer\">\n";
echo " Version ";
echo $this->version;
echo " © <a accesskey=\"9\" href=\"/info.php#contact\" title=\"Me contacter\">Tian</a> $this->creationYear";
$currentYear = date("Y");
if ($currentYear > $this->creationYear)
{
echo "-$currentYear";
}
echo ".<br />\n";
echo " Date de dernière modification : ";
// $lastModification = filemtime($_SERVER["SCRIPT_FILENAME"]);
@ $lastModification = filemtime($_SERVER["DOCUMENT_ROOT"]."/page.inc");
if ($lastModification === false)
{
echo date("d/m/Y");
}
else
{
echo date("d/m/Y", $lastModification);
}
echo "<br />\n";
?>
<a href="/plan.php" title="Voir l'arborescence des pages du site">Plan du site</a><br />
<?
if ($this->showSourceLink)
{
/*basename($_SERVER["PHP_SELF"])*/
echo " <a href=\"/affiche_source.php?source=".$_SERVER["PHP_SELF"]."\" title=\"Voir le programme PHP qui a permis de générer cette page\">Voir le source PHP de cette page</a><br />\n";
}
?>
Réalisé uniquement avec des logiciels libres.<br />
Pour savoir dans quelle mesure le contenu de ce site peut être utilisé, consultez les <a href="/copyright.php" title="Connaître les conditions à satisfaire pour utiliser le contenu de ce site">Licences d'utilisation</a>.<br />
<ul>
<li>
<script type="text/javascript"><!--
google_ad_client = "pub-4307499573025532";
google_ad_width = 110;
google_ad_height = 32;
google_ad_format = "110x32_as_rimg";
google_cpa_choice = "CAAQm4X7zwEaCLiCaAp7VchNKM2JwXU";
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</li>
<li>
<a href="http://validator.w3.org/check/referer" title="Vérifier la validité XHTML 1.0 Strict" hreflang="en">
<span class="w3c">W3C</span>
XHTML 1.0
</a>
</li>
<li>
<?
echo ' <a href="http://jigsaw.w3.org/css-validator/validator?uri='.$this->getStyleSheetURL().'" title="Vérifier la validité CSS niveau 2" hreflang="en">';
?>
<span class="w3c">W3C</span>
CSS 2
</a>
</li>
<?
if ($this->isAAA)
{
?>
<li>
<a href="http://www.w3.org/WAI/WCAG1AAA-Conformance" title="Explications sur la conformité de niveau Triple-A" hreflang="en">
<span class="w3c">W3C</span>
WAI-AAA
</a>
</li>
<?
}
if ($this->hasStat)
{
?>
<li>
<script type="text/javascript">
<!--
doc = document; d = new Date(); res = screen.width+"x"+screen.height; c = screen.colorDepth;
src = '/statistiques/phpmyvisites.php?url='+escape(doc.location.pathname+doc.location.search);
src += '&site=1&res='+res;
src += '&siteh='+doc.location.hostname+'&c='+c+'&h='+d.getHours()+'&m='+d.getMinutes()+'&s='+d.getSeconds();
doc.writeln('<img src="'+src+'&ref='+escape(doc.referrer)+'" alt="phpMyVisites" style="border:0" />');
//-->
</script>
<noscript>
<div class="counter">
<?
$time = getdate();
echo ' <img src="/statistiques/phpmyvisites.php?url='.urlencode($_SERVER['REQUEST_URI']).'&site=1&res=Inconnue&siteh='.$_SERVER['SERVER_NAME'].'&c=24&h='.$time['hours'].'&m='.$time['minutes'].'&s='.$time['seconds'].'&ref='.urlencode(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '').'" alt="phpMyVisites" style="border:0" />
';
?>
</div>
</noscript>
</li>
<?
}
?>
<li>
<script type="text/javascript"><!--
google_ad_client = "pub-4307499573025532";
google_ad_width = 110;
google_ad_height = 32;
google_ad_format = "110x32_as_rimg";
google_cpa_choice = "CAAQp-ybzgEaCKmaZbmFlF-uKNGZ5HQ";
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</li>
</ul>
</div>
<?
}
function generateContent(&$content)
{
$content = '<h1 id="top">'.$this->pageTitle.'</h1>
';
if ($this->extraSponsor != '')
{
$sponsor = '<div id="sub-header"><span>'
.$this->extraSponsor
.'</span></div>
'
.$this->userTheme->getSponsorHeader();
//$sponsor = preg_replace('/<div id="(.*?)">/', '<div id="\1"><div id="extra-sponsor">'.$this->extraSponsor.'</div>', $sponsor);
$content .= $sponsor;
}
else
{
$content .= $this->userTheme->getSponsorHeader();
}
if ($this->intro != '')
{
$content .= '
<div id="intro">
'.$this->intro.'
</div>
';
}
$content .= $this->userTheme->getSponsorContent();
$withTOC = true;
$toc = '
<ul class="toc">
';
foreach ($this->extraTOC as $links)
{
$toc .= ' <li><a href="'.$links[0].'">'.$links[1].'</a></li>
';
}
$mainContent = '';
foreach ($this->sections as $item)
{
if ($item[1] != '')
{
if ($item[3] != "")
{
$toc .= ' <li><a href="#'.$item[0].'">'.$item[3].'</a></li>
';
}
else
{
$toc .= ' <li><a href="#'.$item[0].'">'.$item[1].'</a></li>
';
}
$mainContent .= '
<div class="chapter">
<h2 id="'.$item[0].'">'.$item[1].' <span class="link-separator"> | </span><a title="Retourner au début de la page" href="#top">(Haut de page)</a><span class="link-separator"> | </span></h2>'.$item[2].'</div>
';
}
else
{
$mainContent .= '
<div class="chapter">'.$item[2].'</div>
';
$withTOC = false;
}
}
if ( !$withTOC || (count($this->sections) == 0) )
{
$toc = '';
}
else
{
$toc .= '</ul>
';
}
$content .= $toc.$mainContent;
$content .= $this->userTheme->getSponsorFooter();
if ($this->extra != '')
{
$content .= '<hr />'.'
<div id="extra">
'.$this->extra.'
</div>
';
}
}
}
?>
require_once ("search.inc");
require_once ("theme.inc");
require_once ("bookmarks.inc");
require_once ("preferences.inc");
define("DEFAULT_MAIL_VALUE",' Votre adresse mail');
function getTimeStamp()
{
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
class Page
{
var $version = "12.4.0";
var $titlePrefix = "SAIT : ";
var $header = "Site d'Aide Informatique de Tian";
var $description = "Pour mieux comprendre l'informatique en général et GNU/Linux en particulier";
var $keywords = "";
var $encoding = 'iso-8859-1';
var $author = "Tian";
var $generator = "Emacs, The GIMP";
var $email = "tian@c-sait.net";
var $iconExt = "png";
var $creationYear = 2002;
var $tabIndexLogo = 7;
var $tabIndexTitle = 8;
var $tabIndexNavBegin = 10;
var $tabIndexSectionBegin = 20;
var $tabIndexSponsorBegin = 40;
var $tabIndexThemeBegin = 60;
var $tabIndexBookmarksBegin = 70;
var $tabIndexNewsBegin = 80;
var $withSectionTabIndex = false;
// Label => (Page, Classe, Titre, AccessKey, TabIndex)
var $menuButtons = array("Cours" => array("/cours/","lessons", "Articles informatiques","C","11"),
"Boîte à outils" => array("/boite.php","toolbox","Sources du site + petits outils","B","12"),
"Humeurs" => array("/humeurs.php","misc", "La page détente","H","13"),
"Liens" => array("/liens.php","links", "Liens vers d'autres sites","L","14"),
"Rechercher" => array("/rechercher.php","search", "Rechercher sur ce site","R","15"),
"A propos" => array("/apropos.php","about", "Informations concernant ce site","A","16"),
"Forums" => array("/forums/","forums", "Les forums de ce site","F","17")
);
// Label => (Page, Titre, AccessKey, TabIndex)
var $topNavigation = array("Aide à la navigation" => array("/aide.php","Informations pour faciliter la navigation sur ce site","6","1"),
"Barre de navigation" => array("#navi","Aller au niveau de la barre de navigation","3","2"),
"Contenu de la page" => array("#top","Aller directement au contenu de cette page","2","3")
);
var $title = '';
var $content = '';
var $pageTitle = '';
var $intro = '';
var $extraSponsor = '';
var $extra = '';
var $sections = array();
var $extraTOC = array();
var $newsMail = '';
var $sectionTitle = '';
var $homePageHref = '';
var $homePageName = '';
var $useHomePage = false;
var $sectionTopics;
var $breadcrumb;
var $userTheme;
var $activeNews = true;
var $isPrintable = false;
var $hasUp = true;
var $quickSearchShow = true;
var $quickSearchForum = "";
var $quickSearchWhere = "";
var $noNavigation = false;
var $noRobotIndex = false;
var $noRobotFollow= false;
var $showSourceLink = true;
var $isAAA = true;
// 12/04/2015: Disable statistics
var $hasStat = false;
var $creationDate = "2002-12-01";
var $boxesArray;
function Page()
{
ini_set('default_charset', $this->encoding);
ini_set('arg_separator.output', '&');
ini_set("url_rewriter.tags", "a=href,area=href");
$_SERVER['REQUEST_URI'] = str_replace('&','&',$_SERVER['REQUEST_URI']);
if (isset($_GET['no_navigation']) && ($_GET['no_navigation'] != 0))
{
$this->noNavigation = true;
$this->disableRobotIndex();
}
$this->userTheme = new Theme($this->noNavigation);
if (isset($_REQUEST['change_theme']))
{
$this->disableRobotIndex();
}
$searchEngineWords = getSearchEngineWords();
if ((!isset($_GET['highlight'])) && ($searchEngineWords != ""))
{
$_GET['highlight'] = $searchEngineWords;
}
$this->boxesArray = array();
bookmark();
}
function activateQuickSearch($active, $forum="", $where="")
{
$this->quickSearchShow = $active;
$this->quickSearchForum = $forum;
$this->quickSearchWhere = $where;
}
function activateNews($active)
{
$this->activeNews = $active;
}
function setHomePage($name, $url)
{
$this->homePageHref = $url;
$this->homePageName = $name;
}
function useHomePageNameForBreadCrumb($value)
{
$this->useHomePage = $value;
}
function setPrintable($isPrintable)
{
$this->isPrintable = $isPrintable;
}
function setHasUp($hasUp)
{
$this->hasUp = $hasUp;
}
function disableRobotIndex()
{
$this->noRobotIndex = true;
}
function disableRobotFollow()
{
$this->noRobotFollow = true;
}
function setShowSource($showSource)
{
$this->showSourceLink = $showSource;
}
function setContent($newcontent)
{
$this->content = $newcontent;
}
function setTitle($newtitle)
{
$this->title = $newtitle;
}
function setPageTitle($newtitle)
{
$this->pageTitle = $newtitle;
}
function setExtraSponsor($newSponsor)
{
$this->extraSponsor = $newSponsor;
}
function setIntroduction($newIntro)
{
$this->intro = $newIntro;
}
function setExtra($newExtra)
{
$this->extra = $newExtra;
}
function addNewsMail($newsMail)
{
$this->newsMail = $newsMail;
}
function addTOCLink($url, $name)
{
array_push($this->extraTOC, array($url, $name));
}
function addChapter($id, $title, $content, $shortTitle="")
{
array_push($this->sections, array($id, $title, $content, $shortTitle));
}
function setDescription($newDescription)
{
$this->description = $newDescription;
}
function setKeywords($newKeywords)
{
$this->keywords = $newKeywords;
}
function setCreationDate($newDate)
{
$this->creationDate = $newDate;
}
function setButtons($newbuttons)
{
$this->buttons = $newbuttons;
}
function setSectionContent($title, $topics)
{
$this->sectionTitle = $title;
$this->sectionTopics = $topics;
}
function setBreadCrumb($breadcrumb)
{
$this->breadcrumb = $breadcrumb;
}
function setAAA($value)
{
$this->isAAA = $value;
}
function setStat($value)
{
// 12/04/2015: Disable statistics
$this->hasStat = $value;
}
function getEmail()
{
return $this->email;
}
function getStyleSheetURL()
{
return "http://".$_SERVER["HTTP_HOST"].$this->userTheme->getStyleSheetCommonPath();
}
function getChaptersLinks()
{
$toc = '';
foreach ($this->sections as $item)
{
if ($item[1] != '')
{
if ($item[3] != "")
{
$toc .= ' <link rel="Chapter" href="#'.$item[0].'" title="'.$item[3].'" />
';
}
else
{
$toc .= ' <link rel="Chapter" href="#'.$item[0].'" title="'.$item[1].'" />
';
}
}
else
{
$toc = '';
break;
}
}
return $toc;
}
function getSubSectionsLinks()
{
$result = '';
while (list($title, $tagInfo) = each($this->sectionTopics))
{
if (is_array($tagInfo))
{
$link = $tagInfo[0];
}
else
{
$link = $tagInfo;
}
$result .= ' <link rel="Subsection" href="'.$link.'" title="'.$title.'" />
';
}
reset($this->sectionTopics);
return $result;
}
function display()
{
/*
echo '<?xml version="1.0" encoding="iso-8859-1"?>';
echo "\n";
*/
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"';
echo "\n";
echo ' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
echo "\n";
echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">';
echo "\n";
echo "<head>\n";
if ($this->pageTitle == '')
{
$this->pageTitle = $this->title;
}
$this->displayTitle();
$this->displayMeta();
$this->displayFavoritesIcon();
$this->displayNavigationLinks();
$this->displayStyles();
echo ' <script type="text/javascript" src="/js/utils.js"></script>
';
echo ' <script type="text/javascript" src="/js/font_utils.js"></script>
';
echo ' <script type="text/javascript" src="/js/box_utils.js"></script>
';
echo ' <script type="text/javascript" src="/js/tooltips_utils.js"></script>
';
if (isset($_GET['highlight']))
{
echo ' <script type="text/javascript" src="/js/highlight_utils.js"></script>
';
}
echo "</head>\n\n";
if ($this->userTheme->doesThemeRequireInit() && !$this->noNavigation)
{
echo "<body onload=\"initDisplay();\">\n";
}
else
{
echo "<body onload=\"initTT();\">\n";
}
if (!$this->noNavigation)
{
$this->displayTopBar();
}
echo "<hr />\n";
echo '<div id="main">'."\n";
$this->displayHeader();
echo " <div id=\"page-content\">\n";
$this->displayPageHeader();
$this->displayContent();
$this->displayPageFooter();
echo " </div>\n";
if (!$this->noNavigation)
{
echo " <hr />\n";
$this->displayMenuBar();
}
echo " <hr />\n";
$this -> displayFooter();
echo "</div>\n";
$this->displayCopyright();
echo "</body>\n</html>\n";
}
function displayPageHeader()
{
echo " <div id=\"page-header\">\n";
$this->displayBreadCrumb();
if ($this->isPrintable)
{
if ($this->noNavigation)
{
echo " <div class=\"switch-menu\"><span class=\"link-separator\"> | </span><a href=\"".$_SERVER["PHP_SELF"]."?no_navigation=0\" title=\"Afficher la page avec les menus de navigation\">Version complète</a><span class=\"link-separator\"> | </span></div>\n";
}
else
{
echo " <div class=\"switch-menu\"><span class=\"link-separator\"> | </span><a href=\"".$_SERVER["PHP_SELF"]."?no_navigation=1\" title=\"Afficher la page sans les menus de navigation\">Version sans menu</a><span class=\"link-separator\"> | </span></div>\n";
}
}
if (isset($_GET['highlight']))
{
echo " <div class=\"switch-highlight\"><span class=\"link-separator\"> | </span><a href=\"".$_SERVER['REQUEST_URI']."\" title=\"Enlever la mise en évidence des mots trouvés dans cette page\">Supprimer la colorisation</a><span class=\"link-separator\"> | </span></div>\n";
}
echo " </div>\n";
}
function displayPageFooter()
{
echo " <div id=\"page-footer\">\n";
if (strlen($this->homePageHref)!=0)
{
echo " <div class=\"home\"><span class=\"link-separator\"> | </span><a href=\"$this->homePageHref\">$this->homePageName</a><span class=\"link-separator\"> | </span></div>\n";
}
if ($this->hasUp)
{
echo ' <div class="up"><span class="link-separator"> | </span><a title="Retourner au début de la page" href="#top">Haut de page</a><span class="link-separator"> | </span></div>
';
}
echo " </div>\n";
}
function displayContent()
{
if ($this->content == "")
{
$this->generateContent($this->content);
}
if (isset($_GET['highlight']))
{
if ($_GET['with_preg'] == "on")
{
$withPreg = true;
}
else
{
$withPreg = false;
}
if ($_GET['with_case'] == "on")
{
$withCase = true;
}
else
{
$withCase = false;
}
highlightText($this->content, $_GET['highlight'], $withPreg, $withCase);
}
echo $this->content;
}
function displayTitle()
{
$title = $this->titlePrefix.$this->title;
if (($this->sectionTitle != '') && ($this->homePageHref!=''))
{
$title .= ' - ['.$this->sectionTitle.']';
}
echo ' <title> '.$title." </title>\n";
}
function displayMeta()
{
echo " <meta http-equiv=\"Content-Type\" content=\"text/html; charset=$this->encoding\" />\n";
echo " <meta http-equiv=\"Description\" name=\"description\" xml:lang=\"fr\" lang=\"fr\" content=\"$this->description\" />\n";
//echo " <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n";
echo " <meta http-equiv=\"Content-Script-Type\" content=\"text/javascript\" />\n";
echo " <meta http-equiv=\"Description\" name=\"description\" xml:lang=\"fr\" lang=\"fr\" content=\"$this->description\" />\n";
echo " <meta name=\"keywords\" content=\"$this->keywords\" />\n";
echo " <meta name=\"author\" content=\"$this->author\" />\n";
echo " <meta name=\"reply-to\" content=\"$this->email\" />\n";
echo " <meta name=\"generator\" content=\"$this->generator\" />\n";
$robot = $this->noRobotIndex ? "noindex," : "index,";
$robot .= $this->noRobotFollow ? "nofollow" : "follow";
echo " <meta name=\"robots\" content=\"$robot\" />\n";
}
function displayNavigationLinks()
{
?>
<link rel="start" title="Accueil" href="/" />
<?
if (strlen($this->homePageHref)!=0)
{
echo " <link rel=\"up\" title=\"$this->homePageName\" href=\"$this->homePageHref\" />\n";
}
?>
<link rel="index" title="Plan du site" href="/plan.php" />
<link rel="help" title="Aide à la navigation" href="/aide.php" />
<link rel="search" title="Rechercher" href="/rechercher.php" />
<link rel="author" title="Auteur" href="/info.php#who" />
<link rel="copyright" title="Licences d'utilisation" href="/copyright.php" />
<?
echo $this->getChaptersLinks();
echo $this->getSubSectionsLinks();
echo getBookmarksLinks();
}
function displayFavoritesIcon()
{
echo " <link rel=\"shortcut icon\" type=\"images/x-icon\" href=\"/images/favicon.ico\" />\n";
echo " <link rel=\"icon\" type=\"image/png\" href=\"/images/favicon.png\" />\n";
}
function displayStyles()
{
echo $this->userTheme->getStyleSheetLinks();
echo $this->userTheme->getSizeStylesheetLink();
}
function displayCopyright()
{
?>
<!-- Creative Commons License -->
<!--
<rdf:RDF xmlns="http://web.resource.org/cc/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<Work rdf:about="http://www.c-sait.net/">
<dc:title>Site d'Aide Informatique de Tian</dc:title>
<dc:date>
<?
echo " $this->creationDate\n";
?>
</dc:date>
<dc:description>
<?
echo " $this->description\n";
?>
</dc:description>
<dc:creator>
<Agent>
<dc:title>Tian</dc:title>
</Agent>
</dc:creator>
<dc:rights>
<Agent>
<dc:title>Tian</dc:title>
</Agent>
</dc:rights>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/Text" />
<dc:source rdf:resource="<? echo "http://".$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']?>"/>
<license rdf:resource="http://creativecommons.org/licenses/by-nc-sa/2.0/fr/" />
</Work>
<License rdf:about="http://creativecommons.org/licenses/by-nc-sa/2.0/fr/">
<permits rdf:resource="http://web.resource.org/cc/Reproduction" />
<permits rdf:resource="http://web.resource.org/cc/Distribution" />
<requires rdf:resource="http://web.resource.org/cc/Notice" />
<requires rdf:resource="http://web.resource.org/cc/Attribution" />
<prohibits rdf:resource="http://web.resource.org/cc/CommercialUse" />
<permits rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
<requires rdf:resource="http://web.resource.org/cc/ShareAlike" />
</License>
</rdf:RDF>
-->
<?
}
function displayHeader()
{
echo ' <div id="header">'."\n";
echo " <a class=\"title\" accesskey=\"1\" tabindex=\"".$this->tabIndexTitle."\" href=\"/\" title=\"Retour à l'accueil\">\n";
echo " $this->header\n";
echo " </a>\n";
echo " </div>\n";
}
function displayTopBar()
{
echo "<div id=\"top-bar\">\n";
if ($this->quickSearchShow)
{
echo getQuickSearchForm($this->quickSearchForum, $this->quickSearchWhere);
}
echo " <ul>\n";
while (list($name, $link) = each($this->topNavigation))
{
echo " <li>[<a tabindex=\"$link[3]\" accesskey=\"$link[2]\" title=\"$link[1]\" href=\"$link[0]\">$name</a>] </li>\n";
}
echo " </ul>\n";
echo "</div>\n";
}
function displayBreadCrumb()
{
$breadcrumb = '<div id="breadcrumb">Position : ';
if ($_SERVER["SCRIPT_NAME"] != '/index.php')
{
$breadcrumb .= '<a href="/">Accueil</a> > ';
}
if (is_array($this->breadcrumb))
{
while (list($title, $link) = each($this->breadcrumb))
{
$breadcrumb .= '<a href="'.$link.'">'.
$title.'</a> > ';
}
}
if (strlen($this->homePageHref) != 0)
{
if ($this->useHomePage)
{
$parentName = $this->homePageName;
}
else
{
$parentName = $this->sectionTitle;
}
//preg_replace('Retour (à|aux) (.)(.*)','U\2\E\3',$parentName);
$breadcrumb .= '<a href="'.$this->homePageHref.'">'.
$parentName.'</a> > ';
}
$breadcrumb .= '<strong>'.$this->pageTitle.'</strong>';
$breadcrumb .= '</div>';
echo $breadcrumb;
}
function displayMenuBar()
{
echo " <div id=\"menu-bar\">\n";
echo " <div id=\"logo-box\"><span class=\"link-separator\"> | </span><a tabindex=\"".$this->tabIndexLogo."\" href=\"/\" title=\"Retour à l'accueil\">\n";
echo ' <img class="logo" alt="Retour à l\'accueil" src="/images/logo.jpg" />'."\n";
echo " </a><span class=\"link-separator\"> | </span></div>\n";
$menu = " <ul>\n";
while (list($name, $button) = each($this->menuButtons))
{
$menu .= " <li>";
$menu .= $this->createButton($name, $button, $this->isCurrentPageInSection($button[0]));
$menu .= "</li>\n";
}
$menu .= " </ul>\n";
$this->addBox($menu, "Barre de navigation", "nav-bar", "ul", $this->tabIndexNavBegin, "navi");
$sponsorContent = $this->userTheme->getSponsorBox();
$this->addBox($sponsorContent, "Publicité", "sponsor-bar", "div", $this->tabIndexSponsorBegin);
if (strlen($this->sectionTitle) != 0)
{
$topics = " <ul>\n";
$tabindex = $this->tabIndexSectionBegin + 1;
while (list($title, $tagInfo) = each($this->sectionTopics))
{
if (is_array($tagInfo))
{
$link = $tagInfo[0];
$classString = "class=\"$tagInfo[1]\"";
}
else
{
$link = $tagInfo;
$classString = "";
}
if ($this->withSectionTabIndex)
{
$tabindexString = "tabindex=\"$tabindex\"";
}
else
{
$tabindexString = "";
}
if ($this->isCurrentPage($link))
{
$topics .= " <li><a $classString $tabindexString href=\"$link\"><span class=\"selected\">$title</span></a></li>\n";
}
else
{
$topics .= " <li><a $classString $tabindexString href=\"$link\">$title</a></li>\n";
}
$tabindex++;
}
$topics .= " </ul>\n";
if (strlen($this->homePageHref) != 0)
{
if ($this->withSectionTabIndex)
{
$tabindexString = " tabindex=\"$this->tabIndexSectionBegin\"";
}
else
{
$tabindexString = "";
}
$sectionTitle = "<a class=\"box\"$tabindexString href=\"$this->homePageHref\">$this->sectionTitle</a>";
}
else
{
$sectionTitle = "$this->sectionTitle";
}
$this->addBox($topics, $sectionTitle, "quick-bar", "ul", $this->tabIndexSectionBegin);
}
$themeSelection = $this->userTheme->getThemeForm();
$this->addBox($themeSelection, "Préférences", "themes-bar", "form", $this->tabIndexThemeBegin, "prefs");
$bookmarkPage = preg_replace("/ - \[.*$/", "", $this->title);
$bookmarksBox = getBookmarksForm($bookmarkPage);
$this->addBox($bookmarksBox, "Marque-pages", "bookmarks-bar", "form", $this->tabIndexBookmarksBegin);
if ($this->activeNews)
{
$newsLetter = " <form action=\"/news.php\" method=\"get\">\n <div>\n";
if ( ((strlen(session_id())) != 0) && (!isset($_COOKIE[session_name()])) )
{
$newsLetter .= " <input type=\"hidden\" name=\"".session_name()."\" value=\"".session_id()."\" />\n";
}
$newsTabIndex = $this->tabIndexNewsBegin + 1;
$newsLetter .= " <label for=\"user_email\">Indiquez votre adresse mail ci-dessous pour être informé des mises à jour";
if (strlen($this->newsMail) != 0)
{
$newsLetter .= "</label>\n";
$newsLetter .= ' <input id="sitecb" name="liste" value="news" checked="checked" title="S\'inscrire à la liste de diffusion principale du site" type="radio" class="newscb" /><label id="siteL" for="sitecb" title="S\'inscrire à la liste de diffusion principale du site" class="newscb">du site.</label>
';
$newsLetter .= ' <input id="specialcb" name="liste" value="'.$this->newsMail.'" title="S\'inscrire à la liste de diffusion '.$this->newsMail.'" type="radio" class="newscb" /><label id="specialL" for="specialcb" title="S\'inscrire à la liste de diffusion '.$this->newsMail.'" class="newscb">de '.$this->newsMail.'.</label><br />
';
}
else
{
$newsLetter .= " du site.</label>\n";
}
$newsLetter .= " <input type=\"text\" name=\"user_email\" id=\"user_email\" class=\"mail-input\" size=\"18\" tabindex=\"$newsTabIndex\" title=\"Entrez votre adresse mail\" value=\"".DEFAULT_MAIL_VALUE."\" onfocus=\"return clearInput(this,'".DEFAULT_MAIL_VALUE."')\" /><br />\n";
$newsTabIndex++;
$newsLetter .= " <input type=\"submit\" class=\"submit-button\" value=\"S'inscrire\" tabindex=\"$newsTabIndex\" title=\"Valider la demande d'inscription\" />\n";
$newsLetter .= ' </div>
<div class="box-link" id="news-link">
<a href="/liste_diffusion.php" title="Plus d\'informations à propos de la liste de diffusion">
Plus d\'informations
</a>
</div>
</form>';
$this->addBox($newsLetter, "Liste de diffusion", "news-bar", "form", $this->tabIndexNewsBegin);
}
$this->displayBoxes();
echo " </div>\n";
}
function addBox($content, $title, $id, $tag, $tabindex, $titleid="")
{
$boxContent = " <div id=\"$id\" class=\"box\">\n";
if (strlen($title) > 0)
{
$boxContent .= " <script type=\"text/javascript\">writeMinMaxButton('$id', '$tag', '".strip_tags($title)."', '$tabindex');</script>\n";
if ($titleid != "")
{
$boxContent .= " <h1 id=\"$titleid\">$title</h1>\n";
}
else
{
$boxContent .= " <h1>$title</h1>\n";
}
}
$boxContent .= $content;
$boxContent .= " </div>\n";
$this->boxesArray[$id] = $boxContent;
}
function displayBoxes()
{
if (!isset($_COOKIE[BOXES_COOKIE]))
{
while(list($index, $item) = each($this->boxesArray))
{
echo $item;
}
}
else
{
$boxesList = explode('|', $_COOKIE[BOXES_COOKIE]);
array_shift($boxesList);
if (isset($_COOKIE['boxesState'])
&& (strpos($_COOKIE['boxesState'], 'sponsor-bar') === FALSE))
{
array_splice($boxesList, 1, 0, 'sponsor-bar');
}
while(list($index, $item) = each($boxesList))
{
echo $this->boxesArray[$item];
}
}
}
function isCurrentPage($url)
{
if (strpos( $_SERVER["SCRIPT_FILENAME"], $url )==false)
{
return false;
}
else
{
return true;
}
}
function isCurrentPageInSection($section)
{
if (($this->isCurrentPage($section) == false) &&
(strpos( $this->homePageHref, $section )===false))
{
return false;
}
else
{
return true;
}
}
function createButton($name, $button, $selected = false)
{
$description = $button[2];
$accesskey=$button[3];
$tabindex=$button[4];
if ($selected)
{
$class = $button[1]."-selected";
$name = "<span class=\"selected\">$name</span>";
}
else
{
$class = $button[1];
}
if ($selected)
{
$name = "<span class=\"link-separator\">→ </span>$name";
}
else
{
$name = "$name";
}
$result = "<a tabindex=\"$tabindex\" accesskey=\"$accesskey\" class=\"$class\" title=\"$description\" href = \"$button[0]\">$name</a>";
return $result;
}
function displayFooter()
{
echo " <div id=\"footer\">\n";
echo " Version ";
echo $this->version;
echo " © <a accesskey=\"9\" href=\"/info.php#contact\" title=\"Me contacter\">Tian</a> $this->creationYear";
$currentYear = date("Y");
if ($currentYear > $this->creationYear)
{
echo "-$currentYear";
}
echo ".<br />\n";
echo " Date de dernière modification : ";
// $lastModification = filemtime($_SERVER["SCRIPT_FILENAME"]);
@ $lastModification = filemtime($_SERVER["DOCUMENT_ROOT"]."/page.inc");
if ($lastModification === false)
{
echo date("d/m/Y");
}
else
{
echo date("d/m/Y", $lastModification);
}
echo "<br />\n";
?>
<a href="/plan.php" title="Voir l'arborescence des pages du site">Plan du site</a><br />
<?
if ($this->showSourceLink)
{
/*basename($_SERVER["PHP_SELF"])*/
echo " <a href=\"/affiche_source.php?source=".$_SERVER["PHP_SELF"]."\" title=\"Voir le programme PHP qui a permis de générer cette page\">Voir le source PHP de cette page</a><br />\n";
}
?>
Réalisé uniquement avec des logiciels libres.<br />
Pour savoir dans quelle mesure le contenu de ce site peut être utilisé, consultez les <a href="/copyright.php" title="Connaître les conditions à satisfaire pour utiliser le contenu de ce site">Licences d'utilisation</a>.<br />
<ul>
<li>
<script type="text/javascript"><!--
google_ad_client = "pub-4307499573025532";
google_ad_width = 110;
google_ad_height = 32;
google_ad_format = "110x32_as_rimg";
google_cpa_choice = "CAAQm4X7zwEaCLiCaAp7VchNKM2JwXU";
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</li>
<li>
<a href="http://validator.w3.org/check/referer" title="Vérifier la validité XHTML 1.0 Strict" hreflang="en">
<span class="w3c">W3C</span>
XHTML 1.0
</a>
</li>
<li>
<?
echo ' <a href="http://jigsaw.w3.org/css-validator/validator?uri='.$this->getStyleSheetURL().'" title="Vérifier la validité CSS niveau 2" hreflang="en">';
?>
<span class="w3c">W3C</span>
CSS 2
</a>
</li>
<?
if ($this->isAAA)
{
?>
<li>
<a href="http://www.w3.org/WAI/WCAG1AAA-Conformance" title="Explications sur la conformité de niveau Triple-A" hreflang="en">
<span class="w3c">W3C</span>
WAI-AAA
</a>
</li>
<?
}
if ($this->hasStat)
{
?>
<li>
<script type="text/javascript">
<!--
doc = document; d = new Date(); res = screen.width+"x"+screen.height; c = screen.colorDepth;
src = '/statistiques/phpmyvisites.php?url='+escape(doc.location.pathname+doc.location.search);
src += '&site=1&res='+res;
src += '&siteh='+doc.location.hostname+'&c='+c+'&h='+d.getHours()+'&m='+d.getMinutes()+'&s='+d.getSeconds();
doc.writeln('<img src="'+src+'&ref='+escape(doc.referrer)+'" alt="phpMyVisites" style="border:0" />');
//-->
</script>
<noscript>
<div class="counter">
<?
$time = getdate();
echo ' <img src="/statistiques/phpmyvisites.php?url='.urlencode($_SERVER['REQUEST_URI']).'&site=1&res=Inconnue&siteh='.$_SERVER['SERVER_NAME'].'&c=24&h='.$time['hours'].'&m='.$time['minutes'].'&s='.$time['seconds'].'&ref='.urlencode(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '').'" alt="phpMyVisites" style="border:0" />
';
?>
</div>
</noscript>
</li>
<?
}
?>
<li>
<script type="text/javascript"><!--
google_ad_client = "pub-4307499573025532";
google_ad_width = 110;
google_ad_height = 32;
google_ad_format = "110x32_as_rimg";
google_cpa_choice = "CAAQp-ybzgEaCKmaZbmFlF-uKNGZ5HQ";
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</li>
</ul>
</div>
<?
}
function generateContent(&$content)
{
$content = '<h1 id="top">'.$this->pageTitle.'</h1>
';
if ($this->extraSponsor != '')
{
$sponsor = '<div id="sub-header"><span>'
.$this->extraSponsor
.'</span></div>
'
.$this->userTheme->getSponsorHeader();
//$sponsor = preg_replace('/<div id="(.*?)">/', '<div id="\1"><div id="extra-sponsor">'.$this->extraSponsor.'</div>', $sponsor);
$content .= $sponsor;
}
else
{
$content .= $this->userTheme->getSponsorHeader();
}
if ($this->intro != '')
{
$content .= '
<div id="intro">
'.$this->intro.'
</div>
';
}
$content .= $this->userTheme->getSponsorContent();
$withTOC = true;
$toc = '
<ul class="toc">
';
foreach ($this->extraTOC as $links)
{
$toc .= ' <li><a href="'.$links[0].'">'.$links[1].'</a></li>
';
}
$mainContent = '';
foreach ($this->sections as $item)
{
if ($item[1] != '')
{
if ($item[3] != "")
{
$toc .= ' <li><a href="#'.$item[0].'">'.$item[3].'</a></li>
';
}
else
{
$toc .= ' <li><a href="#'.$item[0].'">'.$item[1].'</a></li>
';
}
$mainContent .= '
<div class="chapter">
<h2 id="'.$item[0].'">'.$item[1].' <span class="link-separator"> | </span><a title="Retourner au début de la page" href="#top">(Haut de page)</a><span class="link-separator"> | </span></h2>'.$item[2].'</div>
';
}
else
{
$mainContent .= '
<div class="chapter">'.$item[2].'</div>
';
$withTOC = false;
}
}
if ( !$withTOC || (count($this->sections) == 0) )
{
$toc = '';
}
else
{
$toc .= '</ul>
';
}
$content .= $toc.$mainContent;
$content .= $this->userTheme->getSponsorFooter();
if ($this->extra != '')
{
$content .= '<hr />'.'
<div id="extra">
'.$this->extra.'
</div>
';
}
}
}
?>
Si avez des problèmes ou des questions concernant ce fichier source, vous pouvez utiliser le Forum Sources du site