add sensmotdire

This commit is contained in:
egarette@silique.fr 2022-12-25 17:09:37 +01:00
parent ae4fe7e931
commit 63e6b966cc
41 changed files with 3585 additions and 0 deletions

View file

@ -0,0 +1,9 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.10">
<services>
<service name="sensmotdire" manage="False">
<file>/etc/sensmotdire/config.php</file>
<file source="sensmotdire.nginx.conf">/etc/nginx/default.d/sensmotdire.conf</file>
</service>
</services>
</rougail>

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<rougail version="0.10">
<variables>
<variable name="var_size" redefine="True">
<value>256</value>
</variable>
<variable name="add_tmp" redefine="True">
<value>False</value>
</variable>
<variable name="add_srv" redefine="True">
<value>False</value>
</variable>
<variable name="add_swap" redefine="True">
<value>False</value>
</variable>
<variable name='memory' redefine="True" exists="True">
<value>512</value>
</variable>
</variables>
</rougail>

View file

@ -0,0 +1,8 @@
set -e
mkdir -p "$IMAGE_NAME_RISOTTO_IMAGE_DIR_TMP/usr/local/share"
cp -a $IMAGE_DIR_RECIPIENT_IMAGE/postinstall/sensmotdire "$IMAGE_NAME_RISOTTO_IMAGE_DIR_TMP/usr/local/share"
chown -R root: "$IMAGE_NAME_RISOTTO_IMAGE_DIR_TMP/usr/local/share/sensmotdire"
ln -s /etc/sensmotdire/config.php "$IMAGE_NAME_RISOTTO_IMAGE_DIR_TMP/usr/local/share/sensmotdire/config.php"
cd $ORIPWD

View file

@ -0,0 +1,14 @@
<?php
require "lib.php";
$title=translate("About");
$display = new display_html($title);
$display->head();
$content="\n\t<div>";
$content.="\n\t\t<p><img src=\"images/sensmotdire-logo.png\" alt=\"sensmotdire\" /></p>";
$content.="<h1>sensmotdire</h1>";
$content.=display_about();
$content.="\n\t\t" . display_close_button();
$content.="\n\t</div>";
$display->body($content, "about");
print $display->close();

View file

@ -0,0 +1,13 @@
<?php
require "lib.php";
$title=translate("Accessibility policy");
$display = new display_html($title);
$display->head();
$content="\n\t<div>";
$content.="\n\t\t<h1>" . $title . "</h1>";
$content.=display_access();
$content.="\n\t\t" . display_close_button();
$content.="\n\t</div>";
$display->body($content, "access");
print $display->close();

View file

@ -0,0 +1,15 @@
<?php
require "lib.php";
$title=translate("Add sensmotdire to your browser");
$display = new display_html($title);
$display->head();
$content="\n\t<div>";
$content.="\n\t\t<h1>$title</h1>";
$content.=display_add_browser();
$content.="\n\t\t" . '<p id="paddbrowser"><a href="sensmotdire.src" id="aaddbrowser" type="text/smartbookmark" rel="' . $URL . '%s.html" title="sensmotdire">' . translate("Add sensmotdire to your browser") . '</a></p>';
$content.="\n\t\t" . display_close_button();
$content.="\n\t" .'</div>';
$display->body($content, "addbrowser");
print $display->close();
?>

View file

@ -0,0 +1,76 @@
<?php
/*
Copyright (C) sensmotdire GnunuX http://sensmotdire.gnunux.info/dist/
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
require "lib.php";
if (isset($_GET['firefox']))
$firefox="yes";
$limit=10;
if (isset($_GET['limit']))
$limit=min($limit,$_GET['limit']);
$input_orig=$word=stripword( $_GET['input'] );
$input_array=explode(" ",$input_orig);
$num=count($input_array)-1;
if ( $input_array[$num] == "" )
$num=count($input_array)-2;
$input=$input_array[$num];
$input_array[$num]="";
$old=implode(" ",$input_array);
if ($input[0] == "")
exit;
if ( checkword($input) ) {
$all_allow_letter="[a-zéèêâàïîôç]";
$input=mb_eregi_replace("e", "(e|é|è|ê)", $input);
$input=mb_eregi_replace("a", "(a|â|à)", $input);
$input=mb_eregi_replace("i", "(i|ï|î)", $input);
$input=mb_eregi_replace("o", "(o|ô)", $input);
$input=mb_eregi_replace("c", "(c|ç)", $input);
$input=mb_eregi_replace("\*", "$all_allow_letter+", $input);
$input=mb_eregi_replace("\?", "$all_allow_letter", $input);
$search = new dataBase ($config_dsn);
$search->execRequest("SELECT infinitif FROM `verbsfr` WHERE `infinitif` REGEXP \"^" . $input . "\" LIMIT 0 , $limit");
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header ("Pragma: no-cache"); // HTTP/1.0
header("Content-Type: application/json; charset=UTF-8");
if (isset($firefox))
echo "[\"$input_orig\", [";
else
echo "{ \"results\": [";
$id=1;
$arr=array();
while ($row = $search->nextResult())
{
if (isset($firefox))
$arr[]= " \"" . $old . $row['infinitif'] . "\" ";
else
$arr[]= "{ \"id\": \"$id\", \"value\": \"" . $old . $row['infinitif'] . "\", \"info\": \"\" }";
$id++;
}
echo implode(", ", $arr);
$search->close();
if (isset($firefox))
echo "] ]";
else
echo "] }";
}
?>

View file

@ -0,0 +1,394 @@
body {
font-family: 'Lucida Grande', Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
font-size: 12px;
position: relative;
margin: 0px;
}
#index {
background: white url(../images/sensmotdire-background.png) no-repeat right top;
}
#about {
text-align: center;
}
#addbrowser {
background: white url(../images/sensmotdire-background.png) no-repeat center center;
}
h1 {
padding: 1em;
clear: right;
color: #448;
}
.error {
clear: both;
text-align: center;
color: red;
font-weight: bold;
margin-bottom: 2em;
}
.wiktionary, .verbiste {
border: 1px dotted #778;
padding: .5em;
clear: both;
margin-bottom: 1em;
}
span.combined {
color: #448;
}
strong {
color: #F00;
}
strong span.combined {
color: #F55;
}
#menu {
border-bottom: 1px dotted #778;
border-left: 1px dotted #778;
font-size: 8px;
margin: 0px;
float: right;
text-align: right;
}
p.report {
text-align: center;
background-color: #DDE;
border: 1px dotted #778;
padding: .5px;
}
#menu ul li {
padding-left: 1em;
display: inline;
}
#menu ul li a:hover, #menu ul li a:link, #menu ul li a:visited {
color: #448;
font-weight: bold;
}
#addbrowser h2 {
color: #636363;
}
#addbrowser p {
margin-left: 3em;
}
#paddbrowser {
font-weight:bold;
text-align: center;
}
#pclose {
text-align: center;
margin-bottom: 2em;
}
div.suggest {
clear: left;
}
form {
margin: 0px;
}
fieldset {
margin: 1em;
border: 1px dotted #778;
padding: 1em;
}
a.hidden img {
border: none;
}
a.hidden {
text-decoration: none;
}
#fieldword {
float: left;
}
h1 span {
border: 1px dotted #778;
padding: .5em;
}
fieldset legend {
color: #448;
padding: .4em .5em;
border: 1px dotted #778;
font-weight: bold;
background-color:white;
}
textarea {
margin-top: 1em;
}
div.tab {
float:left;
margin-left: 1em;
}
div.tabbertab {
clear: both;
border-bottom: 1px solid #778;
border-left: 1px solid #778;
border-right: 1px solid #778;
float:left;
min-width: 640px;
}
div.mod {
margin:1px;
margin-bottom: 1em;
float:left;
display:block;
border:1px solid #B3B3B3;
background-color:white;
min-width: 10em;
}
div.tense {
float:left;
display:block;
min-width: 10em;
}
p {
margin:0px;
padding:0px;
border:0px;
padding-top:2px;
}
div.mod h3 {
margin:0px;
padding:0px;
border:0px;
background-color:#B3B3B3;
text-align: center;
}
div.mod h4 {
margin:0px;
padding:0px;
border:0px;
background-color:#E3E3E3;
text-align: center;
}
ul {
list-style: none;
padding: 5px;
border: 0px;
margin: 0px;
}
li {
width: 100%;
}
li.impaire {
background-color:#EBEBEB;
}
/*tabber*/
/*--------------------------------------------------
REQUIRED to hide the non-active tab content.
But do not hide them in the print stylesheet!
--------------------------------------------------*/
.tabberlive .tabbertabhide {
display:none;
}
/*--------------------------------------------------
.tabber = before the tabber interface is set up
.tabberlive = after the tabber interface is set up
--------------------------------------------------*/
.tabberlive {
margin-top:1em;
}
/*--------------------------------------------------
ul.tabbernav = the tab navigation list
li.tabberactive = the active tab
--------------------------------------------------*/
ul.tabbernav
{
margin:0;
padding: 3px 0;
border-bottom: 1px solid #778;
font-weight: bold ;
}
ul.tabbernav li
{
list-style: none;
margin: 0;
display: inline;
}
ul.tabbernav li.tabberactive a
{
background-color: #fff;
border-bottom: 1px solid #fff;
}
ul.tabbernav li.tabberactive a:hover
{
color: #000;
background: white;
border-bottom: 1px solid white;
}
ul.tabbernav li a
{
padding: 3px 0.5em;
margin-left: 3px;
border: 1px solid #778;
border-bottom: none;
background: #DDE;
text-decoration: none;
}
ul.tabbernav li a:link, #tabbernav li a:visited { color: #448; }
ul.tabbernav li a:hover
{
color: #000;
background: #AAE;
border-color: #227;
}
ul.tabbernav li.tabberactive a
{
background-color: #fff;
border-bottom: 1px solid #fff;
}
ul.tabbernav li.tabberactive a:hover
{
color: #000;
background: white;
border-bottom: 1px solid white;
}
/*--------------------------------------------------
.tabbertab = the tab content
Add style only after the tabber interface is set up (.tabberlive)
--------------------------------------------------*/
.tabberlive .tabbertab {
padding:5px;
border-top:0;
}
.tabberlive .tabbertab h2 {
display:none;
}
/*
================================================
autosuggest, inquisitor style
================================================
*/
div.autosuggest
{
position: absolute;
background-image: url(../images/as_pointer.gif);
background-position: top;
background-repeat: no-repeat;
padding: 10px 0 0 0;
}
div.autosuggest ul
{
background-color: transparent;
list-style: none;
margin: -1px 0 -4px 0;
padding: 0;
overflow: hidden;
background-color: #FFF;
border: 1px dotted #778;
}
div.autosuggest ul li
{
color: #448;
padding: 0;
margin: 0 0 0;
text-align: left;
}
div.autosuggest ul li a
{
color: #448;
display: block;
text-decoration: none;
background-color: transparent;
position: relative;
padding: 0;
width: 100%;
}
div.autosuggest ul li a:hover
{
background-color: #FFF;
}
div.autosuggest ul li.as_highlight a:hover
{
background-color: #778;
}
div.autosuggest ul li a span
{
display: block;
padding: 3px 6px;
font-weight: bold;
}
div.autosuggest ul li a span small
{
font-weight: normal;
color: #999;
}
div.autosuggest ul li.as_highlight a span small
{
color: #448;
}
div.autosuggest ul li.as_highlight a
{
color: #fff;
background-color: #778;
background-image: url(../images/hl_corner_br.gif);
background-position: bottom right;
background-repeat: no-repeat;
}
div.autosuggest ul li.as_highlight a span
{
background-image: url(../images/hl_corner_bl.gif);
background-position: bottom left;
background-repeat: no-repeat;
}
div.autosuggest ul li a .tl,
div.autosuggest ul li a .tr
{
width: 6px;
height: 6px;
position: absolute;
top: 0;
padding: 0;
margin: 0;
}
div.autosuggest ul li a .tr
{
right: 0;
}
div.autosuggest ul li.as_highlight a .tl
{
left: 0;
background-image: url(../images/hl_corner_tl.gif);
background-position: bottom left;
}
div.autosuggest ul li.as_highlight a .tr
{
right: 0;
background-image: url(../images/hl_corner_tr.gif);
background-position: bottom right;
}
div.autosuggest ul li.as_warning
{
font-weight: bold;
text-align: center;
}
div.autosuggest ul em
{
font-style: normal;
color: #000;
}

View file

@ -0,0 +1,53 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/2001/REC-xhtml11-20010531/DTD/xhtml11-flat.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<title>sensmotdire - conjugaison francaise libre</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="robots" content="index,follow" />
<meta name="description" content="Interface en ligne de conjugaison francaise sensmotdire" />
<meta name="keyword" content="sensmotdire - la conjugaison francaise libre en ligne" />
<meta name="author" content="GnunuX" />
<link href="css/sensmotdire.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/bsn.AutoSuggest_c_2.0.js"></script>
<link rel="icon" type="image/png" href="images/sensmotdire.png" />
<link rel ="search" title="sensmotdire" type="application/opensearchdescription+xml" href="sensmotdire.xml" />
<link rel="alternate" title="rss" type="application/rss+xml" href="rss20.xml" />
</head>
<body id="indexwidget"><!--
Copyright (C) sensmotdire GnunuX http://sensmotdire.gnunux.info/dist/
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-->
<form id="formwidget" method="get" action="redirect/">
<fieldset id="fieldwidget">
<?php $title="yes"; if ( isset ( $_GET['title'] ) AND $_GET['title'] == "no" ) { $title="no"; }; if ( $title == "yes" ) { echo "<legend>Verbe à conjuguer</legend>"; }; ?>
<input type="text" id="textwidget" name="word" accesskey="4" <?php if ( isset ($_GET['size']) ) { echo 'size="' . $_GET['size'] . '"'; } ?> /><br />
<label><input type="checkbox" name="accent" id="checkword" accesskey="5" />j'écris sans accent</label><br /><br />
<input type="submit" value="Conjuguer" id="conjuguer" onClick="window.open('http://sensmotdire.gnunux.info/'+document.getElementById('textwidget').value + '.html', 'sensmotdire');return(false)"/>
</fieldset>
</form>
<script>
var options1 = {
script:"autosuggest.php?limit=<?php if ( isset ($_GET['limit']) ) { echo $_GET['limit']; } else { echo '3'; } ?>&",
varname:"input",
json: true,
minchars:1,
noresults:"Pas de résultat",
cache:false
};
var as1 = new AutoSuggest('textwidget', options1);
</script>
</body>
</html>

View file

@ -0,0 +1,13 @@
<?php
require "lib.php";
$title=translate("F.A.Q. of sensmotdire");
$display = new display_html($title);
$display->head();
$content="\n\t<div>";
$content.="\n\t\t<h1>$title</h1>";
$content.=display_faq();
$content.="\n\t\t" . display_close_button();
$content.="\n\t</div>";
$display->body($content, "faq");
print $display->close();

Binary file not shown.

After

Width:  |  Height:  |  Size: 727 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 727 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 834 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 837 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7 KiB

View file

@ -0,0 +1,123 @@
<?php
require "lib.php";
$return = '';
$error_404="unknown";
//if index.php => index.html
$uri=explode("/",$_SERVER['REQUEST_URI']);
if ( $uri[count($uri)-1] == "index.php" )
{
header("Location: /index.html\n\n");
exit;
}
//is word var : stripword
if (isset($_GET['word']))
{
$word=stripword($_GET['word']);
if ( $word == "" )
$wrong_char=1;
} else
$word="";
//check accent var
$add_accent="no";
if (array_key_exists('accent', $_COOKIE) && $_COOKIE['accent'] == 'yes')
{
$add_accent="yes";
}
if ( mb_substr($word, 0, 1) == ":" )
{
$word = removeaccent(mb_substr($word, 1));
$add_accent="yes";
setcookie("accent", $add_accent, time()+3600*24*30, "/");
}
//title
$title = "sensmotdire - conjugaison francaise libre";
if (($word != "") and (!isset($wrong_char)))
$title .= " de $word";
//class display_html
$display_html = new display_html($title);
$display_html->head();
//default charset : UTF-8
mb_internal_encoding("UTF-8");
//menu
$content = "\n\t<div id=\"menu\">";
$content .= "\n\t\t<ul>";
$content .= "\n\t\t\t<li><a href=\"add_browser.php\" id=\"aaddbrowser\">" . translate("Add to your browser") ."</a></li>";
$content .= "\n\t\t\t<li><a href=\"accessibility.php\" id=\"aaccess\" accesskey=\"0\">" . translate("Accessibility") . "</a></li>";
$content .= "\n\t\t\t<li><a href=\"rss20.xml\" id=\"anews\">" . translate("News") ."</a></li>";
$content .= "\n\t\t\t<li><a href=\"faq.php\" id=\"afaq\">F.A.Q.</a></li>";
$content .= "\n\t\t\t<li><a href=\"about.php\" id=\"aabout\">" . translate("About") . "</a></li>";
$content .= "\n\t\t</ul>";
$content .= "\n\t</div>";
//search form
$content .= "\t" . '<form id="formword" method="get" action="index.php">' . "\n\t\t<fieldset id=\"fieldword\"><legend>" . translate("Verb to be combined") . "</legend>\n\t\t\t" . '<input type="text" id="textword" name="word" accesskey="4"';
if ( ! $word == "" )
$content .= " value=\"" . $word . "\"";
$content .= "/>\n\t\t\t" . '<label><input type="checkbox" name="accent" id="checkword"';
if ( $add_accent == "yes" )
$content .= ' checked="checked" ';
$content .= ' accesskey="5" />' . translate("I write without accent") . '</label>' . "\n\t\t\t" . '<input type="submit" value="' . translate("Combine") . '" id="conjuguer" />' . "\n\t\t</fieldset>\n\t</form>";
//if forbidden char
if (isset($wrong_char))
$content .= "\n\t\t\t<div class=\"error\">" . translate("Only alphabetical characters, accentuated characters, apostrophe and space are accepted.") . "</div>" . display_suggest("error");
else {
//array with all the search word (remove null word)
if ($word != "")
{
$orig_word=$word;
$word_array=is_a_conjugated_verb($word, $add_accent);
$content .= "\n\t<h1><span>" . translate("Conjugation to") . " $word</span></h1>\n\t<div class=\"tab\">\n\t\t<div class=\"tabber\">";
if ($word != "" and mb_strlen($word) < 25 )
{
// if array $verbs with all infinitive verb exist
if (isset($word_array))
{
$i=0;
foreach ($word_array as $verb=>$info)
{
$i++;
$display = new display($verb, $word);
$display->display_tenses($tenses, $add_accent, $info);
$return .= $display->close();
if ($i > $NB_VERBS)
break;
}
$error_404="no";
} else {
// if $verbs is not set
if ( $error_404 == "unknown" )
$error_404="yes";
// if (is_array($add_pronouns))
// $return .= "\n\t\t\t<div class=\"tabbertab\" id=\"" . $word . '">' . "\n\t\t\t\t<h2>" . translate("Unknown verb") . ': ' . $word . "</h2>\n\t\t\t\t<div class=\"error\">" . translate("Unknown verb or wrong conjugation") . ": $orig_word</div>";
// else
$return .= "\n\t\t\t<div class=\"tabbertab\" id=\"" . $word . '">' . "\n\t\t\t\t<h2>" . translate("Unknown verb") . ': ' . $word . "</h2>\n\t\t\t\t<div class=\"error\">" . translate("Unknown verb") . ": $word</div>";
$return .= display_suggest($word);
$return .= "\n\t\t\t</div>";
}
// display all
unset($verbs);
} else
$return .= "\n\t\t\t<div class=\"tabbertab\" id=\"" . $word . '">' . "\n\t\t\t\t<h2>" . translate("Wrong verb") . ': ' . $word . "</h2>\n\t\t\t\t<div class=\"error\">" . translate("Your demand is too long") . ": $orig_word</div>";
}
}
if (isset($return))
$return .= "\n\t\t</div>\n\t</div>";
else
$return = "";
if ($error_404 == "yes")
header("HTTP/1.1 404 Not Found");
$display_html->body($content . $return, "index");
print $display_html->close();

View file

@ -0,0 +1,4 @@
<FilesMatch "^sensmotdire.js">
ForceType application/x-httpd-php
</FilesMatch>

View file

@ -0,0 +1,745 @@
/**
* author: Timothy Groves - http://www.brandspankingnew.net
* version: 1.2 - 2006-11-17
* 1.3 - 2006-12-04
* 2.0 - 2007-02-07
*
*/
var useBSNns;
if (useBSNns)
{
if (typeof(bsn) == "undefined")
bsn = {}
_bsn = bsn;
}
else
{
_bsn = this;
}
if (typeof(_bsn.Autosuggest) == "undefined")
_bsn.Autosuggest = {}
_bsn.AutoSuggest = function (fldID, param)
{
// no DOM - give up!
//
if (!document.getElementById)
return false;
// get field via DOM
//
this.fld = _bsn.DOM.getElement(fldID);
if (!this.fld)
return false;
// init variables
//
this.sInput = "";
this.nInputChars = 0;
this.aSuggestions = [];
this.iHighlighted = 0;
// parameters object
//
this.oP = (param) ? param : {};
// defaults
//
if (!this.oP.minchars) this.oP.minchars = 1;
if (!this.oP.method) this.oP.meth = "get";
if (!this.oP.varname) this.oP.varname = "input";
if (!this.oP.className) this.oP.className = "autosuggest";
if (!this.oP.timeout) this.oP.timeout = 2500;
if (!this.oP.delay) this.oP.delay = 500;
if (!this.oP.offsety) this.oP.offsety = -5;
if (!this.oP.shownoresults) this.oP.shownoresults = true;
if (!this.oP.noresults) this.oP.noresults = "No results!";
if (!this.oP.maxheight && this.oP.maxheight !== 0) this.oP.maxheight = 250;
if (!this.oP.cache && this.oP.cache != false) this.oP.cache = true;
// set keyup handler for field
// and prevent autocomplete from client
//
var pointer = this;
// NOTE: not using addEventListener because UpArrow fired twice in Safari
//_bsn.DOM.addEvent( this.fld, 'keyup', function(ev){ return pointer.onKeyPress(ev); } );
this.fld.onkeypress = function(ev){ return pointer.onKeyPress(ev); }
this.fld.onkeyup = function(ev){ return pointer.onKeyUp(ev); }
this.fld.setAttribute("autocomplete","off");
}
_bsn.AutoSuggest.prototype.onKeyPress = function(ev)
{
var key = (window.event) ? window.event.keyCode : ev.keyCode;
// set responses to keydown events in the field
// this allows the user to use the arrow keys to scroll through the results
// ESCAPE clears the list
// TAB sets the current highlighted value
//
var RETURN = 13;
var TAB = 9;
var ESC = 27;
var bubble = true;
switch(key)
{
case RETURN:
this.setHighlightedValue();
bubble = false;
this.clearHighlight();
break;
case ESC:
this.clearSuggestions();
this.clearHighlight();
break;
}
return bubble;
}
_bsn.AutoSuggest.prototype.onKeyUp = function(ev)
{
var key = (window.event) ? window.event.keyCode : ev.keyCode;
// set responses to keydown events in the field
// this allows the user to use the arrow keys to scroll through the results
// ESCAPE clears the list
// TAB sets the current highlighted value
//
var ARRUP = 38;
var ARRDN = 40;
var bubble = true;
switch(key)
{
case ARRUP:
this.changeHighlight(key);
bubble = false;
break;
case ARRDN:
this.changeHighlight(key);
bubble = false;
break;
default:
this.getSuggestions(this.fld.value);
}
return bubble;
}
_bsn.AutoSuggest.prototype.getSuggestions = function (val)
{
// if input stays the same, do nothing
//
if (val == this.sInput)
return false;
// input length is less than the min required to trigger a request
// reset input string
// do nothing
//
if (val.length < this.oP.minchars)
{
this.sInput = "";
return false;
}
// if caching enabled, and user is typing (ie. length of input is increasing)
// filter results out of aSuggestions from last request
//
if (val.length>this.nInputChars && this.aSuggestions.length && this.oP.cache)
{
var arr = [];
for (var i=0;i<this.aSuggestions.length;i++)
{
if (this.aSuggestions[i].value.substr(0,val.length).toLowerCase() == val.toLowerCase())
arr.push( this.aSuggestions[i] );
}
this.sInput = val;
this.nInputChars = val.length;
this.aSuggestions = arr;
this.createList(this.aSuggestions);
return false;
}
else
// do new request
//
{
this.sInput = val;
this.nInputChars = val.length;
var pointer = this;
clearTimeout(this.ajID);
this.ajID = setTimeout( function() { pointer.doAjaxRequest() }, this.oP.delay );
}
return false;
}
_bsn.AutoSuggest.prototype.doAjaxRequest = function ()
{
var pointer = this;
// create ajax request
var url = this.oP.script+this.oP.varname+"="+escape(this.fld.value);
var meth = this.oP.meth;
var onSuccessFunc = function (req) { pointer.setSuggestions(req) };
var onErrorFunc = function (status) { alert("AJAX error: "+status); };
var myAjax = new _bsn.Ajax();
myAjax.makeRequest( url, meth, onSuccessFunc, onErrorFunc );
}
_bsn.AutoSuggest.prototype.setSuggestions = function (req)
{
this.aSuggestions = [];
if (this.oP.json)
{
if (req.responseText != '')
{
var jsondata = eval('(' + req.responseText + ')');
for (var i=0;i<jsondata.results.length;i++)
{
if (typeof this.aSuggestions.push != "undefined")
{
this.aSuggestions.push( { 'id':jsondata.results[i].id, 'value':jsondata.results[i].value, 'info':jsondata.results[i].info } );
} else {
var new_arr=new Array( { 'id':jsondata.results[i].id, 'value':jsondata.results[i].value, 'info':jsondata.results[i].info } );
this.aSuggestions=this.aSuggestions.concat(new_arr);
}
}
}
}
else
{
var xml = req.responseXML;
// traverse xml
//
var results = xml.getElementsByTagName('results')[0].childNodes;
for (var i=0;i<results.length;i++)
{
if (results[i].hasChildNodes())
this.aSuggestions.push( { 'id':results[i].getAttribute('id'), 'value':results[i].childNodes[0].nodeValue, 'info':results[i].getAttribute('info') } );
}
}
this.idAs = "as_"+this.fld.id;
this.createList(this.aSuggestions);
}
_bsn.AutoSuggest.prototype.createList = function(arr)
{
var pointer = this;
// get rid of old list
// and clear the list removal timeout
//
_bsn.DOM.removeElement(this.idAs);
this.killTimeout();
// create holding div
//
var div = _bsn.DOM.createElement("div", {id:this.idAs, className:this.oP.className});
var hcorner = _bsn.DOM.createElement("div", {className:"as_corner"});
var hbar = _bsn.DOM.createElement("div", {className:"as_bar"});
var header = _bsn.DOM.createElement("div", {className:"as_header"});
header.appendChild(hcorner);
header.appendChild(hbar);
div.appendChild(header);
// create and populate ul
//
var ul = _bsn.DOM.createElement("ul", {id:"as_ul"});
// loop throught arr of suggestions
// creating an LI element for each suggestion
//
for (var i=0;i<arr.length;i++)
{
// format output with the input enclosed in a EM element
// (as HTML, not DOM)
//
var val = arr[i].value;
var st = val.toLowerCase().indexOf( this.sInput.toLowerCase() );
var output = val.substring(0,st) + "<em>" + val.substring(st, st+this.sInput.length) + "</em>" + val.substring(st+this.sInput.length);
var span = _bsn.DOM.createElement("span", {}, output, true);
if (arr[i].info != "")
{
var br = _bsn.DOM.createElement("br", {});
span.appendChild(br);
var small = _bsn.DOM.createElement("small", {}, arr[i].info);
span.appendChild(small);
}
var a = _bsn.DOM.createElement("a", { href:"#" });
var tl = _bsn.DOM.createElement("span", {className:"tl"}, " ");
var tr = _bsn.DOM.createElement("span", {className:"tr"}, " ");
a.appendChild(tl);
a.appendChild(tr);
a.appendChild(span);
a.name = i+1;
a.onclick = function () { pointer.setHighlightedValue(); return false; }
a.onmouseover = function () { pointer.setHighlight(this.name); }
var li = _bsn.DOM.createElement( "li", {}, a );
ul.appendChild( li );
}
// no results
//
if (arr.length == 0)
{
var li = _bsn.DOM.createElement( "li", {className:"as_warning"}, this.oP.noresults );
ul.appendChild( li );
}
div.appendChild( ul );
var fcorner = _bsn.DOM.createElement("div", {className:"as_corner"});
var fbar = _bsn.DOM.createElement("div", {className:"as_bar"});
var footer = _bsn.DOM.createElement("div", {className:"as_footer"});
footer.appendChild(fcorner);
footer.appendChild(fbar);
div.appendChild(footer);
// get position of target textfield
// position holding div below it
// set width of holding div to width of field
//
var pos = _bsn.DOM.getPos(this.fld);
div.style.left = pos.x + "px";
div.style.top = ( pos.y + this.fld.offsetHeight + this.oP.offsety ) + "px";
div.style.width = this.fld.offsetWidth + "px";
// set mouseover functions for div
// when mouse pointer leaves div, set a timeout to remove the list after an interval
// when mouse enters div, kill the timeout so the list won't be removed
//
div.onmouseover = function(){ pointer.killTimeout() }
div.onmouseout = function(){ pointer.resetTimeout() }
// add DIV to document
//
document.getElementsByTagName("body")[0].appendChild(div);
// currently no item is highlighted
//
this.iHighlighted = 0;
// remove list after an interval
//
var pointer = this;
this.toID = setTimeout(function () { pointer.clearSuggestions() }, this.oP.timeout);
}
_bsn.AutoSuggest.prototype.changeHighlight = function(key)
{
var list = _bsn.DOM.getElement("as_ul");
if (!list)
return false;
var n;
if (key == 40)
n = this.iHighlighted + 1;
else if (key == 38)
n = this.iHighlighted - 1;
if (n > list.childNodes.length)
n = list.childNodes.length;
if (n < 1)
n = 1;
this.setHighlight(n);
}
_bsn.AutoSuggest.prototype.setHighlight = function(n)
{
var list = _bsn.DOM.getElement("as_ul");
if (!list)
return false;
if (this.iHighlighted > 0)
this.clearHighlight();
this.iHighlighted = Number(n);
list.childNodes[this.iHighlighted-1].className = "as_highlight";
this.killTimeout();
}
_bsn.AutoSuggest.prototype.clearHighlight = function()
{
var list = _bsn.DOM.getElement("as_ul");
if (!list)
return false;
if (this.iHighlighted > 0)
{
list.childNodes[this.iHighlighted-1].className = "";
this.iHighlighted = 0;
}
}
_bsn.AutoSuggest.prototype.setHighlightedValue = function ()
{
if (this.iHighlighted)
{
this.sInput = this.fld.value = this.aSuggestions[ this.iHighlighted-1 ].value;
// move cursor to end of input (safari)
//
this.fld.focus();
if (this.fld.selectionStart)
this.fld.setSelectionRange(this.sInput.length, this.sInput.length);
this.clearSuggestions();
// pass selected object to callback function, if exists
//
if (typeof(this.oP.callback) == "function")
this.oP.callback( this.aSuggestions[this.iHighlighted-1] );
} else {
if (document.getElementById('conjuguer')) {
//document.formword.submit();
document.getElementById('conjuguer').click();
}
}
}
_bsn.AutoSuggest.prototype.killTimeout = function()
{
clearTimeout(this.toID);
}
_bsn.AutoSuggest.prototype.resetTimeout = function()
{
clearTimeout(this.toID);
var pointer = this;
this.toID = setTimeout(function () { pointer.clearSuggestions() }, 1000);
}
_bsn.AutoSuggest.prototype.clearSuggestions = function ()
{
this.killTimeout();
var ele = _bsn.DOM.getElement(this.idAs);
var pointer = this;
if (ele)
{
var fade = new _bsn.Fader(ele,1,0,250,function () { _bsn.DOM.removeElement(pointer.idAs) });
}
this.clearHighlight();
}
// AJAX PROTOTYPE _____________________________________________
if (typeof(_bsn.Ajax) == "undefined")
_bsn.Ajax = {}
_bsn.Ajax = function ()
{
this.req = {};
this.isIE = false;
}
_bsn.Ajax.prototype.makeRequest = function (url, meth, onComp, onErr)
{
if (meth != "POST")
meth = "GET";
this.onComplete = onComp;
this.onError = onErr;
var pointer = this;
// branch for native XMLHttpRequest object
if (window.XMLHttpRequest)
{
this.req = new XMLHttpRequest();
this.req.onreadystatechange = function () { pointer.processReqChange() };
this.req.open("GET", url, true); //
this.req.send(null);
// branch for IE/Windows ActiveX version
}
else if (window.ActiveXObject)
{
this.req = new ActiveXObject("Microsoft.XMLHTTP");
if (this.req)
{
this.req.onreadystatechange = function () { pointer.processReqChange() };
this.req.open(meth, url, true);
this.req.send();
}
}
}
_bsn.Ajax.prototype.processReqChange = function()
{
// only if req shows "loaded"
if (this.req.readyState == 4) {
// only if "OK"
if (this.req.status == 200)
{
this.onComplete( this.req );
} else {
this.onError( this.req.status );
}
}
}
// DOM PROTOTYPE _____________________________________________
if (typeof(_bsn.DOM) == "undefined")
_bsn.DOM = {}
_bsn.DOM.createElement = function ( type, attr, cont, html )
{
var ne = document.createElement( type );
if (!ne)
return false;
for (var a in attr)
ne[a] = attr[a];
if (typeof(cont) == "string" && !html)
ne.appendChild( document.createTextNode(cont) );
else if (typeof(cont) == "string" && html)
ne.innerHTML = cont;
else if (typeof(cont) == "object")
ne.appendChild( cont );
return ne;
}
_bsn.DOM.clearElement = function ( id )
{
var ele = this.getElement( id );
if (!ele)
return false;
while (ele.childNodes.length)
ele.removeChild( ele.childNodes[0] );
return true;
}
_bsn.DOM.removeElement = function ( ele )
{
var e = this.getElement(ele);
if (!e)
return false;
else if (e.parentNode.removeChild(e))
return true;
else
return false;
}
_bsn.DOM.replaceContent = function ( id, cont, html )
{
var ele = this.getElement( id );
if (!ele)
return false;
this.clearElement( ele );
if (typeof(cont) == "string" && !html)
ele.appendChild( document.createTextNode(cont) );
else if (typeof(cont) == "string" && html)
ele.innerHTML = cont;
else if (typeof(cont) == "object")
ele.appendChild( cont );
}
_bsn.DOM.getElement = function ( ele )
{
if (typeof(ele) == "undefined")
{
return false;
}
else if (typeof(ele) == "string")
{
var re = document.getElementById( ele );
if (!re)
return false;
else if (typeof(re.appendChild) != "undefined" ) {
return re;
} else {
return false;
}
}
else if (typeof(ele.appendChild) != "undefined")
return ele;
else
return false;
}
_bsn.DOM.appendChildren = function ( id, arr )
{
var ele = this.getElement( id );
if (!ele)
return false;
if (typeof(arr) != "object")
return false;
for (var i=0;i<arr.length;i++)
{
var cont = arr[i];
if (typeof(cont) == "string")
ele.appendChild( document.createTextNode(cont) );
else if (typeof(cont) == "object")
ele.appendChild( cont );
}
}
_bsn.DOM.getPos = function ( ele )
{
var ele = this.getElement(ele);
var obj = ele;
var curleft = 0;
if (obj.offsetParent)
{
while (obj.offsetParent)
{
curleft += obj.offsetLeft
obj = obj.offsetParent;
}
}
else if (obj.x)
curleft += obj.x;
var obj = ele;
var curtop = 0;
if (obj.offsetParent)
{
while (obj.offsetParent)
{
curtop += obj.offsetTop
obj = obj.offsetParent;
}
}
else if (obj.y)
curtop += obj.y;
return {x:curleft, y:curtop}
}
// FADER PROTOTYPE _____________________________________________
if (typeof(_bsn.Fader) == "undefined")
_bsn.Fader = {}
_bsn.Fader = function (ele, from, to, fadetime, callback)
{
if (!ele)
return false;
this.ele = ele;
this.from = from;
this.to = to;
this.callback = callback;
this.nDur = fadetime;
this.nInt = 50;
this.nTime = 0;
var p = this;
this.nID = setInterval(function() { p._fade() }, this.nInt);
}
_bsn.Fader.prototype._fade = function()
{
this.nTime += this.nInt;
var ieop = Math.round( this._tween(this.nTime, this.from, this.to, this.nDur) * 100 );
var op = ieop / 100;
if (typeof this.ele.filters != "undefined") // internet explorer
{
try
{
this.ele.filters.item("DXImageTransform.Microsoft.Alpha").opacity = ieop;
} catch (e) {
// If it is not set initially, the browser will throw an error. This will set it if it is not set yet.
this.ele.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity='+ieop+')';
}
}
else // other browsers
{
this.ele.style.opacity = op;
}
if (this.nTime == this.nDur)
{
clearInterval( this.nID );
if (this.callback != "undefined")
this.callback();
}
}
_bsn.Fader.prototype._tween = function(t,b,c,d)
{
return b + ( (c-b) * (t/d) );
}

View file

@ -0,0 +1,296 @@
<?php require "../config.php";
header("Content-Type: application/x-javascript");
?>
/* Optional: Temporarily hide the "tabber" class so it does not "flash"
on the page as plain HTML. After tabber runs, the class is changed
to "tabberlive" and it will appear. */
document.write('<style type="text/css">.tabber{display:none;}<\/style>');
function in_array(arry, toFind){
return ('_|_'+arry.join('_|_')+'_|_').indexOf('_|_'+toFind+'_|_') > -1;
}
function remove_element_array (arry, toRemove) {
var tmpArray = new Array();
// --- Rebuild the array
for (var i = 0; i < arry.length; i++)
{
if (arry[i] != toRemove)
{
tmpArray[tmpArray.length] = arry[i];
}
}
// --- And set it to the boxlist of map
return tmpArray;
}
function display_undisplay(fieldset, begin, elemt, link)
{
var cookie=readCookie("OptionsAffichage");
var cookies=((cookie==null) ? "conj" : (cookie));
cookies=cookies.split(/;/);
for (var i = 0; i < document.getElementById(link).childNodes.length; i++) {
if (document.getElementById(link).childNodes[i].className == "twisty")
twisty=document.getElementById(link).childNodes[i];
}
if (begin == "no")
{
var img = document.getElementsByTagName('img');
for(var i = 0; i < img.length; ++i) {
if (img[i].className == 'twisty') {
if (img[i].src.indexOf('images/twisty-do-down.gif') != -1) {
img[i].setAttribute ('src', 'images/twisty-down.gif');
} else if (img[i].src.indexOf('images/twisty-do-hidden.gif') != -1) {
img[i].setAttribute ('src', 'images/twisty-hidden.gif');
}
}
}
}
undisplay="unknown";
if (document.getElementById(fieldset))
{
field=document.getElementById(fieldset);
if (field.style.display == "none")
{
if (typeof twisty != "undefined")
twisty.setAttribute('src', 'images/twisty-do-down.gif');
if (typeof Effect != "undefined" && begin == "no" && elemt != "conj") {
Effect.toggle(field.id, "Slide", {duration:.4});
} else {
field.style.display="block";
}
focused = fieldset + 't';
if (document.getElementById(focused))
{
document.getElementById(focused).focus();
}
undisplay="no";
} else {
if (typeof twisty != "undefined")
if(begin == "yes")
twisty.setAttribute('src', 'images/twisty-hidden.gif');
else
twisty.setAttribute('src', 'images/twisty-do-hidden.gif');
if (typeof Effect != "undefined" && begin == "no" && elemt != "conj") {
Effect.toggle(field.id, "Slide", {duration:.4});
} else {
field.style.display="none";
}
undisplay="yes";
}
}
if (begin == "no")
{
if (undisplay == "no")
{
if (!(in_array(cookies, elemt)))
{
if (typeof cookies.push != "undefined")
{
cookies.push(elemt);
} else {
var new_cook=new Array(elemt);
cookies=cookies.concat(new_cook);
}
}
}
if(undisplay == "yes")
{
if (in_array(cookies, elemt))
{
cookies=(remove_element_array(cookies, elemt));
}
}
writeCookie("OptionsAffichage", cookies.join(";"));
}
}
function addEngine()
{
if ( typeof window.external == "object" ) {
try {
window.external.AddSearchProvider("<?php echo $URL; ?>sensmotdire.xml");
} catch (e) {
window.external.AddFavorite("<?php echo $URL; ?>", "sensmotdire");
}
} else if ((typeof window.sidebar == "object") && (typeof window.sidebar.addSearchEngine == "function")) {
window.sidebar.addSearchEngine(
"<?php echo $URL; ?>sensmotdire.src",
"<?php echo $URL; ?>images/sensmotdire.png", "sensmotdire", "General" );
} else {
window.sidebar.addPanel("sensmotdire", "<?php echo $URL; ?>", "");
}
}
function getCookieVal(offset)
{
var endstr=document.cookie.indexOf (";", offset);
if (endstr==-1) endstr=document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function readCookie(nom)
{
var arg=nom+"=";
var alen=arg.length;
var clen=document.cookie.length;
var i=0;
while (i<clen)
{
var j=i+alen;
if (document.cookie.substring(i, j)==arg) return getCookieVal(j);
i=document.cookie.indexOf(" ",i)+1;
if (i==0) break;
}
return null;
}
function writeCookie(cname, cvalue)
{
expires=new Date;
expires.setMonth(expires.getMonth()+1);
document.cookie=cname + "=" + escape(cvalue) + "; expires=" + expires.toGMTString() + "; SameSite=None; Secure;";
}
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
if (oldonload) {
oldonload();
}
func();
}
}
}
function attacherAction() {
if (document.getElementById('close')) {
link=document.getElementById('close');
link.onclick = function() {
window.close();
}
}
if ( document.getElementById('index') ) {
if (document.getElementById) {
if (document.getElementById('textword')) {
var options1 = {
script:"autosuggest.php?",
varname:"input",
json: true,
minchars:1,
noresults:"Pas de résultat",
cache:false
};
var as1 = new AutoSuggest('textword', options1);
}
if (document.getElementById('aabout')) {
link=document.getElementById('aabout');
link.onclick = function() {
window.open(this.href,'about','height=400, width=400, menubar=no, toolbar=no, scrollbars=yes');
return false;
}
}
if (document.getElementById('aaddbrowser')) {
link=document.getElementById('aaddbrowser');
link.onclick = function() {
window.open(this.href,'addbrowser','height=600, width=600, menubar=no, toolbar=no, scrollbars=yes');
return false;
}
}
if (document.getElementById('afaq')) {
link=document.getElementById('afaq');
link.onclick = function() {
window.open(this.href,'faq');
return false;
}
}
if (document.getElementById('acopyright')) {
link=document.getElementById('acopyright');
link.onclick = function() {
window.open(this.href,'copyright','height=400, width=400, menubar=no, toolbar=no, scrollbars=yes');
return false;
}
}
if (document.getElementById('anews')) {
link=document.getElementById('anews');
link.onclick = function() {
window.open(this.href,'news');
return false;
}
}
if (document.getElementById('aaccess')) {
link=document.getElementById('aaccess');
link.onclick = function() {
window.open(this.href,'accessibility');
return false;
}
}
var as = document.getElementsByTagName('a')
var cookie=readCookie("OptionsAffichage");
var cookies=((cookie==null) ? "conj" : (cookie));
cookies=cookies.split(/;/);
for(var i = 0; i < as.length; ++i) {
if (as[i].className == 'hidden') {
divsearch=as[i].id + "iv";
if (document.getElementById(divsearch).className)
{
var elemt=document.getElementById(divsearch).className
if (!(in_array(cookies, elemt)))
{
display_undisplay(as[i].id + "iv", "yes", elemt, as[i].id);
}
} else {
display_undisplay(as[i].id + "iv", "yes", "", as[i].id);
}
as[i].onclick = function() {
display_undisplay(this.id + "iv", "no", document.getElementById(this.id + "iv").className, this.id);
return false;
}
}
}
if (document.getElementById('conjuguer')) {
document.getElementById('conjuguer').onclick = function() {
if(document.getElementById('textword').value != "")
{
if (document.getElementById('checkword').checked == true )
{
writeCookie("accent", "yes");
} else {
writeCookie("accent", "no");
}
}
}
}
document.getElementById('textword').focus();
}
} else if ( document.getElementById('about') ) {
if (document.getElementById) {
var as = document.getElementsByTagName('a');
for(var i = 0; i < as.length; ++i) {
if (as[i].id != 'close') {
as[i].onclick = function() {
window.open(this.href,'','');
return false;
}
}
}
}
} else if ( document.getElementById('addbrowser') ) {
if (document.getElementById('aaddbrowser')) {
link=document.getElementById('aaddbrowser');
link.onclick = function() {
addEngine();
return false;
}
}
}
}
addLoadEvent(attacherAction);
<?php
#desactive pour ie5
#include("prototype.js");
include("bsn.AutoSuggest_c_2.0.js");
include("tabber.js");
?>

View file

@ -0,0 +1,522 @@
/*==================================================
$Id: tabber.js,v 1.9 2006/04/27 20:51:51 pat Exp $
tabber.js by Patrick Fitzgerald pat@barelyfitz.com
Documentation can be found at the following URL:
http://www.barelyfitz.com/projects/tabber/
License (http://www.opensource.org/licenses/mit-license.php)
Copyright (c) 2006 Patrick Fitzgerald
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==================================================*/
function tabberObj(argsObj)
{
var arg; /* name of an argument to override */
/* Element for the main tabber div. If you supply this in argsObj,
then the init() method will be called.
*/
this.div = null;
/* Class of the main tabber div */
this.classMain = "tabber";
/* Rename classMain to classMainLive after tabifying
(so a different style can be applied)
*/
this.classMainLive = "tabberlive";
/* Class of each DIV that contains a tab */
this.classTab = "tabbertab";
/* Class to indicate which tab should be active on startup */
this.classTabDefault = "tabbertabdefault";
/* Class for the navigation UL */
this.classNav = "tabbernav";
/* When a tab is to be hidden, instead of setting display='none', we
set the class of the div to classTabHide. In your screen
stylesheet you should set classTabHide to display:none. In your
print stylesheet you should set display:block to ensure that all
the information is printed.
*/
this.classTabHide = "tabbertabhide";
/* Class to set the navigation LI when the tab is active, so you can
use a different style on the active tab.
*/
this.classNavActive = "tabberactive";
/* Elements that might contain the title for the tab, only used if a
title is not specified in the TITLE attribute of DIV classTab.
*/
this.titleElements = ['h2','h3','h4','h5','h6'];
/* Should we strip out the HTML from the innerHTML of the title elements?
This should usually be true.
*/
this.titleElementsStripHTML = true;
/* If the user specified the tab names using a TITLE attribute on
the DIV, then the browser will display a tooltip whenever the
mouse is over the DIV. To prevent this tooltip, we can remove the
TITLE attribute after getting the tab name.
*/
this.removeTitle = true;
/* If you want to add an id to each link set this to true */
this.addLinkId = false;
/* If addIds==true, then you can set a format for the ids.
<tabberid> will be replaced with the id of the main tabber div.
<tabnumberzero> will be replaced with the tab number
(tab numbers starting at zero)
<tabnumberone> will be replaced with the tab number
(tab numbers starting at one)
<tabtitle> will be replaced by the tab title
(with all non-alphanumeric characters removed)
*/
this.linkIdFormat = '<tabberid>nav<tabnumberone>';
/* You can override the defaults listed above by passing in an object:
var mytab = new tabber({property:value,property:value});
*/
for (arg in argsObj) { this[arg] = argsObj[arg]; }
/* Create regular expressions for the class names; Note: if you
change the class names after a new object is created you must
also change these regular expressions.
*/
this.REclassMain = new RegExp('\\b' + this.classMain + '\\b', 'gi');
this.REclassMainLive = new RegExp('\\b' + this.classMainLive + '\\b', 'gi');
this.REclassTab = new RegExp('\\b' + this.classTab + '\\b', 'gi');
this.REclassTabDefault = new RegExp('\\b' + this.classTabDefault + '\\b', 'gi');
this.REclassTabHide = new RegExp('\\b' + this.classTabHide + '\\b', 'gi');
/* Array of objects holding info about each tab */
this.tabs = new Array();
/* If the main tabber div was specified, call init() now */
if (this.div) {
this.init(this.div);
/* We don't need the main div anymore, and to prevent a memory leak
in IE, we must remove the circular reference between the div
and the tabber object. */
this.div = null;
}
}
/*--------------------------------------------------
Methods for tabberObj
--------------------------------------------------*/
tabberObj.prototype.init = function(e)
{
/* Set up the tabber interface.
e = element (the main containing div)
Example:
init(document.getElementById('mytabberdiv'))
*/
var
childNodes, /* child nodes of the tabber div */
i, i2, /* loop indices */
t, /* object to store info about a single tab */
defaultTab=0, /* which tab to select by default */
DOM_ul, /* tabbernav list */
DOM_li, /* tabbernav list item */
DOM_a, /* tabbernav link */
aId, /* A unique id for DOM_a */
headingElement; /* searching for text to use in the tab */
/* Verify that the browser supports DOM scripting */
if (!document.getElementsByTagName) { return false; }
/* If the main DIV has an ID then save it. */
if (e.id) {
this.id = e.id;
}
/* Clear the tabs array (but it should normally be empty) */
this.tabs.length = 0;
/* Loop through an array of all the child nodes within our tabber element. */
childNodes = e.childNodes;
for(i=0; i < childNodes.length; i++) {
/* Find the nodes where class="tabbertab" */
if(childNodes[i].className &&
childNodes[i].className.match(this.REclassTab)) {
/* Create a new object to save info about this tab */
t = new Object();
/* Save a pointer to the div for this tab */
t.div = childNodes[i];
/* Add the new object to the array of tabs */
this.tabs[this.tabs.length] = t;
/* If the class name contains classTabDefault,
then select this tab by default.
*/
if (childNodes[i].className.match(this.REclassTabDefault)) {
defaultTab = this.tabs.length-1;
}
}
}
/* Create a new UL list to hold the tab headings */
DOM_ul = document.createElement("ul");
DOM_ul.className = this.classNav;
/* Loop through each tab we found */
for (i=0; i < this.tabs.length; i++) {
t = this.tabs[i];
/* Get the label to use for this tab:
From the title attribute on the DIV,
Or from one of the this.titleElements[] elements,
Or use an automatically generated number.
*/
t.headingText = t.div.title;
/* Remove the title attribute to prevent a tooltip from appearing */
if (this.removeTitle) { t.div.title = ''; }
if (!t.headingText) {
/* Title was not defined in the title of the DIV,
So try to get the title from an element within the DIV.
Go through the list of elements in this.titleElements
(typically heading elements ['h2','h3','h4'])
*/
for (i2=0; i2<this.titleElements.length; i2++) {
headingElement = t.div.getElementsByTagName(this.titleElements[i2])[0];
if (headingElement) {
t.headingText = headingElement.innerHTML;
if (this.titleElementsStripHTML) {
t.headingText.replace(/<br>/gi," ");
t.headingText = t.headingText.replace(/<[^>]+>/g,"");
}
break;
}
}
}
if (!t.headingText) {
/* Title was not found (or is blank) so automatically generate a
number for the tab.
*/
t.headingText = i + 1;
}
/* Create a list element for the tab */
DOM_li = document.createElement("li");
/* Save a reference to this list item so we can later change it to
the "active" class */
t.li = DOM_li;
/* Create a link to activate the tab */
DOM_a = document.createElement("a");
DOM_a.appendChild(document.createTextNode(t.headingText));
DOM_a.href = "javascript:void(null);";
DOM_a.title = t.headingText;
DOM_a.onclick = this.navClick;
/* Add some properties to the link so we can identify which tab
was clicked. Later the navClick method will need this.
*/
DOM_a.tabber = this;
DOM_a.tabberIndex = i;
/* Do we need to add an id to DOM_a? */
if (this.addLinkId && this.linkIdFormat) {
/* Determine the id name */
aId = this.linkIdFormat;
aId = aId.replace(/<tabberid>/gi, this.id);
aId = aId.replace(/<tabnumberzero>/gi, i);
aId = aId.replace(/<tabnumberone>/gi, i+1);
aId = aId.replace(/<tabtitle>/gi, t.headingText.replace(/[^a-zA-Z0-9\-]/gi, ''));
DOM_a.id = aId;
}
/* Add the link to the list element */
DOM_li.appendChild(DOM_a);
/* Add the list element to the list */
DOM_ul.appendChild(DOM_li);
}
/* Add the UL list to the beginning of the tabber div */
e.insertBefore(DOM_ul, e.firstChild);
/* Make the tabber div "live" so different CSS can be applied */
e.className = e.className.replace(this.REclassMain, this.classMainLive);
/* Activate the default tab, and do not call the onclick handler */
this.tabShow(defaultTab);
/* If the user specified an onLoad function, call it now. */
if (typeof this.onLoad == 'function') {
this.onLoad({tabber:this});
}
return this;
};
tabberObj.prototype.navClick = function(event)
{
/* This method should only be called by the onClick event of an <A>
element, in which case we will determine which tab was clicked by
examining a property that we previously attached to the <A>
element.
Since this was triggered from an onClick event, the variable
"this" refers to the <A> element that triggered the onClick
event (and not to the tabberObj).
When tabberObj was initialized, we added some extra properties
to the <A> element, for the purpose of retrieving them now. Get
the tabberObj object, plus the tab number that was clicked.
*/
var
rVal, /* Return value from the user onclick function */
a, /* element that triggered the onclick event */
self, /* the tabber object */
tabberIndex, /* index of the tab that triggered the event */
onClickArgs; /* args to send the onclick function */
a = this;
if (!a.tabber) { return false; }
self = a.tabber;
tabberIndex = a.tabberIndex;
/* Remove focus from the link because it looks ugly.
I don't know if this is a good idea...
*/
a.blur();
/* If the user specified an onClick function, call it now.
If the function returns false then do not continue.
*/
if (typeof self.onClick == 'function') {
onClickArgs = {'tabber':self, 'index':tabberIndex, 'event':event};
/* IE uses a different way to access the event object */
if (!event) { onClickArgs.event = window.event; }
rVal = self.onClick(onClickArgs);
if (rVal === false) { return false; }
}
self.tabShow(tabberIndex);
return false;
};
tabberObj.prototype.tabHideAll = function()
{
var i; /* counter */
/* Hide all tabs and make all navigation links inactive */
for (i = 0; i < this.tabs.length; i++) {
this.tabHide(i);
}
};
tabberObj.prototype.tabHide = function(tabberIndex)
{
var div;
if (!this.tabs[tabberIndex]) { return false; }
/* Hide a single tab and make its navigation link inactive */
div = this.tabs[tabberIndex].div;
/* Hide the tab contents by adding classTabHide to the div */
if (!div.className.match(this.REclassTabHide)) {
div.className += ' ' + this.classTabHide;
}
this.navClearActive(tabberIndex);
return this;
};
tabberObj.prototype.tabShow = function(tabberIndex)
{
/* Show the tabberIndex tab and hide all the other tabs */
var div;
if (!this.tabs[tabberIndex]) { return false; }
/* Hide all the tabs first */
this.tabHideAll();
/* Get the div that holds this tab */
div = this.tabs[tabberIndex].div;
/* Remove classTabHide from the div */
div.className = div.className.replace(this.REclassTabHide, '');
/* Mark this tab navigation link as "active" */
this.navSetActive(tabberIndex);
/* If the user specified an onTabDisplay function, call it now. */
if (typeof this.onTabDisplay == 'function') {
this.onTabDisplay({'tabber':this, 'index':tabberIndex});
}
return this;
};
tabberObj.prototype.navSetActive = function(tabberIndex)
{
/* Note: this method does *not* enforce the rule
that only one nav item can be active at a time.
*/
/* Set classNavActive for the navigation list item */
this.tabs[tabberIndex].li.className = this.classNavActive;
return this;
};
tabberObj.prototype.navClearActive = function(tabberIndex)
{
/* Note: this method does *not* enforce the rule
that one nav should always be active.
*/
/* Remove classNavActive from the navigation list item */
this.tabs[tabberIndex].li.className = '';
return this;
};
/*==================================================*/
function tabberAutomatic(tabberArgs)
{
/* This function finds all DIV elements in the document where
class=tabber.classMain, then converts them to use the tabber
interface.
tabberArgs = an object to send to "new tabber()"
*/
var
tempObj, /* Temporary tabber object */
divs, /* Array of all divs on the page */
i; /* Loop index */
if (!tabberArgs) { tabberArgs = {}; }
/* Create a tabber object so we can get the value of classMain */
tempObj = new tabberObj(tabberArgs);
/* Find all DIV elements in the document that have class=tabber */
/* First get an array of all DIV elements and loop through them */
divs = document.getElementsByTagName("div");
for (i=0; i < divs.length; i++) {
/* Is this DIV the correct class? */
if (divs[i].className &&
divs[i].className.match(tempObj.REclassMain)) {
/* Now tabify the DIV */
tabberArgs.div = divs[i];
divs[i].tabber = new tabberObj(tabberArgs);
}
}
return this;
}
/*==================================================*/
function tabberAutomaticOnLoad(tabberArgs)
{
/* This function adds tabberAutomatic to the window.onload event,
so it will run after the document has finished loading.
*/
var oldOnLoad;
if (!tabberArgs) { tabberArgs = {}; }
/* Taken from: http://simon.incutio.com/archive/2004/05/26/addLoadEvent */
oldOnLoad = window.onload;
if (typeof window.onload != 'function') {
window.onload = function() {
tabberAutomatic(tabberArgs);
};
} else {
window.onload = function() {
oldOnLoad();
tabberAutomatic(tabberArgs);
};
}
}
/*==================================================*/
/* Run tabberAutomaticOnload() unless the "manualStartup" option was specified */
if (typeof tabberOptions == 'undefined') {
tabberAutomaticOnLoad();
} else {
if (!tabberOptions['manualStartup']) {
tabberAutomaticOnLoad(tabberOptions);
}
}

View file

@ -0,0 +1,173 @@
<?php
global $lang, $tenses, $pronouns, $forme_prono, $forme_prono_vowel, $forme_prono_imperative, $NB_VERBS;
$lang = array (
"Unknown verb" => "Verbe inconnu ",
"Unknown verb or wrong conjugation" => "Verbe inconnu ou mauvaise conjugaison ",
"The verb" => "Le verbe",
"infinitive" => "Infinitif",
"indicative" => "Indicatif",
"conditional" => "Conditionnel",
"subjunctive" => "Subjonctif",
"imperative" => "Impératif",
"participle" => "Participe",
"present" => "Présent",
"imperfect" => "Imparfait",
"future" => "Futur",
"simplepast" => "Passé simple",
"past" => "Passé",
"Close" => "Fermer",
"Add sensmotdire to your browser" => "Ajouter sensmotdire à votre navigateur",
"Add to your browser" => "Ajouter au navigateur",
"F.A.Q. of sensmotdire" => "La F.A.Q. de sensmotdire",
"Verb to be combined" => "Verbe à conjuguer",
"Combine" => "Conjuguer",
"I write without accent" => "j'écris sans accent",
"About" => "A propos",
"Only alphabetical characters, accentuated characters, apostrophe and space are accepted." => "Seuls les caractères alphabétiques, les caractères accentués, l'apostrophe et l'espace sont acceptés.",
"News" => "Nouvelles",
"Accessibility" => "Accessibilité",
"Accessibility policy" => "Politiques d'accessibilité",
"Conjugation to" => "Conjugaison de",
"The conjugated verbs result from a base of knowledge free and open." => "Les verbes conjugués sont issus d'une base de connaissance libres et ouvertes.",
"Thank you to announce the errors or the omissions" => "Merci de signaler les erreurs ou les omissions",
"Mail address (optinal)" => "Adresse courriel (optionnel) ",
"Search verb" => "Verbe recherché",
"Binary code" => "Code binaire ",
"Submit" => "Envoyer",
"Interface in line of French conjugation sensmotdire" => "Interface en ligne de conjugaison francaise sensmotdire",
"the free French conjugation on line" => "la conjugaison francaise libre en ligne",
"User agent" => "Navigateur",
"Your demand is too long" => "Votre demande est trop longue ",
"Wrong verb" => "Mauvais verbe"
);
$acronym = array (
"F.A.Q." => "Foire Aux Questions",
);
// Arrays with existing pronouns
$pronouns = array(
"1"=>"je",
"2"=>"tu",
"3"=>"il",
"4"=>"nous",
"5"=>"vous",
"6"=>"ils"
);
$forme_prono = array(
"1"=>"me",
"2"=>"te",
"3"=>"se",
"4"=>"nous",
"5"=>"vous",
"6"=>"se"
);
$forme_prono_vowel = array(
"1"=>"m'",
"2"=>"t'",
"3"=>"s'",
"4"=>"nous ",
"5"=>"vous ",
"6"=>"s'"
);
$forme_prono_imperative=array(
1=>'toi',
2=>'nous',
3=>'vous'
);
$pronouns_3 = array(
"1"=>"",
"2"=>"",
"3"=>""
);
$pronouns_1 = array(
"1"=>""
);
$pronouns_subj = array(
"1"=>"que je",
"2"=>"que tu",
"3"=>"qu'il",
"4"=>"que nous",
"5"=>"que vous",
"6"=>"qu'ils"
);
// all tenses with pronouns
$tenses = array (
"indicative" => array (
'present' => $pronouns,
'imperfect' => $pronouns,
'future' => $pronouns,
'simplepast' => $pronouns
),
"conditional" => array ('present' => $pronouns),
"subjunctive" => array (
'present' => $pronouns_subj,
'imperfect' => $pronouns_subj
),
"imperative" => array ('present' => $pronouns_3),
"participle" => array (
'present' => $pronouns_1,
'past' => $pronouns_3
),
"infinitive" => array ('present' => $pronouns_1)
);
function display_add_browser ()
{
return "\n\t\t<h2>Mozilla firefox</h2>
\t\t<p>Cliquer sur le lien ci-dessous et installer le moteur de recherche.</p>
\t\t<h2>Mozilla plus ancien</h2>
\t\t<p>Ces navigateurs n'ont pas de système de moteur de recherche intégré. Ajouter un panneau ou un signet en cliquant sur le lien ci-dessous.</p>
\t\t<h2>Epiphany et Galeon</h2>
\t\t<p>Pour ajouter sensmotdire en tant que moteur de recherche, il suffit de cliquer droit sur le lien ci-dessous et choisir «Créer un signet sur ce lien». Vous pourez alors choisir le moteur «sensmotdire» dans la barre d'URL.</p>
\t\t<h2>Konqueror et Opera</h2>
\t\t<p>Il n'y a pas, à ma connaissance, de moyen simple pour ajouter un moteur de recherche dans ces navigateurs.</p>
\t\t<h2>Internet Explorer 7</h2>
\t\t<p>Cliquer sur le lien ci-dessous et installer le moteur de recherche.</p>
\t\t<h2>Internet Explorer plus ancien</h2>
\t\t<p>Ces navigateurs n'ont pas de système de moteur de recherche intégré. Ajouter un favoris en cliquant sur le lien ci-dessous.</p>";
}
function display_faq()
{
global $NB_VERBS;
return "\n\t\t<h2>Général</h2>
\t\t<h3>Vous avez oublié les temps composés !</h3>
\t\t<p>Non ! C'est une volonté du développeur de verbiste :</p>
\t\t<blockquote><p>Je n'ai pas l'intention de le faire, parce que la détermination de l'auxiliaire qui convient à chaque verbe dépend parfois du contexte. Par exemple, pour le verbe «retourner», on peut dire «je suis retourné» aussi bien que «j'ai retourné la lettre». Je préfère que Verbiste ne réponde qu'à des questions dont la réponse est simple et toujours vraie.</p></blockquote>
\t\t<h3>Que faites-vous des adresses courriels lorsque j'envoie une suggestion ?</h3>
\t\t<p>Rien. Un développeur pourra vous répondre ou vous ternir au courant. Aucune collecte de donnée personnelle quelconque n'est faite.</p>
\t\t<h3>J'ai proposé une correction et je ne vois toujours pas de modification sur le site !</h3>
\t\t<p>La base de donnée de sensmotdire est synchronisé avec celle de verbiste. Si votre remarque a été jugé pertinante, elle sera intégré d'abord dans verbiste puis sur sensmotdire.</p>
\t\t<h2>Fonctionnement du site</h2>
\t\t<h3>Lorsque je mets des accents dans un verbe, ca ne marche pas. Que dois-je faire ?</h3>
\t\t<p>Il suffit de taper le mot sans les accents et de cocher la case «j'écris sans accent». Pour aider à améliorer le site, je vous encourage à envoyer une suggestion en bas d'une page posant problème. Des informations cachés seront transmises aux développeurs.</p>
\t\t<h3>Puis-je avoir le résultat de plusieurs verbes en même temps ?</h3>
\t\t<p>Oui. Vous pouvez conjuguer jusqu'à $NB_VERBS verbes. Il suffit de mettre vos verbes séparer par un espace dans la zone de recherche (par exemple «manger dormir»).</p>";
}
function display_access()
{
return "\n\t\t<ul>
<li><kbd>0</kbd> = Politique d'accessibilité</li>
<li><kbd>1</kbd> = Aller à l'Accueil du site</li>
<li><kbd>4</kbd> = Aller au formulaire de recherche</li>
<li><kbd>5</kbd> = Activé/désactivé la recherche avec accent</li>
<li><kbd>7</kbd> = Contacter le webmaster</li>
</ul>";
}
function display_about()
{
return ' <p><strong>Un site de conjugaison française ouvert et libre</strong></p>
<p>Copyright (C) 2007 GnunuX <a href="http://gnunux.info">http://gnunux.info/</a><br />Distribué sous la <a href="http://www.gnu.org/licenses/gpl.html">Licence Publique Générale GNU (GPL)</a>.</p>
<p><a href="http://sensmotdire.gnunux.info/dist/">Télécharger les sources</a></p>
<p>Utilise la base de connaissance de <a href="http://sarrazip.com/dev/verbiste.html">Verbiste</a> sous licence GNU/GPL, <a href="http://www.barelyfitz.com/projects/tabber/">Tabber</a> sous licence MIT, <a href="http://www.brandspankingnew.net/archive/2007/02/ajax_auto_suggest_v2.html">autossuggest</a> sous licence CC BY-SA et <a href="http://phpmailer.sourceforge.net/">PHPMailer</a> sous licence GNU/LGPL</p>';
}
function display_copyright()
{
return ' <p>La base de connaissance de conjugaison est issue du projet verbiste et est sous licence GNU/GPL</p>
<p>La base de connaissance des informations est issue du projet wiktionnaire et est sous licence GNU/FDL</p>';
}
?>

View file

@ -0,0 +1,551 @@
<?php
/*
Copyright (C) sensmotdire GnunuX http://sensmotdire.gnunux.info/dist/
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
//use pear DB
require_once 'DB.php';
require "lang-fr.php";
require "config.php";
// display error
function displayError($message)
{
die ("<strong>$message</strong>");
}
// translate sentense with global $lang var
function translate($sentence)
{
global $lang;
if (isset($lang[$sentence]))
return $lang[$sentence];
else
return $sentence;
}
// class to use database
class dataBase
{
var $db;
var $res;
function __construct($config_dsn)
{
require "config.php";
$db = new DB();
$this->db = $db->connect($config_dsn);
if ((new PEAR)->isError($this->db)) {
displayError('Erreur a la connexion a la base : '
. $this->db->getMessage());
}
}
function execRequest($request)
{
$this->res = $this->db->query("$request");
if ((new PEAR)->isError($this->res)) {
displayError('Erreur a l\'execution de la requete : '
. $this->res->getMessage());
}
return $this->res;
}
function execSearchCondAccent($what, $where, $cond, $value, $order="")
{
$input=mb_eregi_replace("e", "(e|é|è|ê)", $value);
$input=mb_eregi_replace("a", "(a|â|à)", $input);
$input=mb_eregi_replace("u", "(u|ù|û)", $input);
$input=mb_eregi_replace("i", "(i|ï|î)", $input);
$input=mb_eregi_replace("o", "(o|ô)", $input);
$input=mb_eregi_replace("c", "(c|ç)", $input);
$request = "SELECT $what FROM $where WHERE $cond REGEXP \"^$input$\"";
if ( $order != "" ) { $request .= " ORDER BY `$order` ASC"; };
return $this->execRequest($request);
}
function execSearchCond($what, $where, $cond, $value, $order="")
{
$request = "SELECT $what FROM $where WHERE $cond = \"$value\"";
if ( $order != "" ) { $request .= " ORDER BY `$order` ASC"; };
return $this->execRequest($request);
}
#use by complete_database.php
function execSearchAll($what, $where, $order="")
{
$request = "SELECT $what FROM $where";
if ( $order != "" ) { $request .= " ORDER BY `$order` ASC"; };
return $this->execRequest($request);
}
function nextResult()
{
$this->res->fetchInto($row, DB_FETCHMODE_ASSOC);
return $row;
}
function close()
{
$this->res->free();
}
}
function removeextraspace($word)
{
return implode(" ",array_filter(explode(" ",$word)));
}
// remove french accent
function removeaccent($word)
{
$word=utf8_encode(utf8_decode($word));
$word = str_ireplace("é", "e", $word);
$word = str_ireplace("è", "e", $word);
$word = str_ireplace("ê", "e", $word);
$word = str_ireplace("à", "a", $word);
$word = str_ireplace("â", "a", $word);
$word = str_ireplace("ï", "i", $word);
$word = str_ireplace("î", "i", $word);
$word = str_ireplace("ô", "o", $word);
$word = str_ireplace("ù", "u", $word);
$word = str_ireplace("û", "u", $word);
$word = str_ireplace("ç", "c", $word);
$word = str_ireplace("œ", "e", $word);
return $word;
}
function stripword($word)
{
$word=strtolower(stripcslashes($word));
if (!checkword($word))
{
$word=mb_convert_encoding($word,"UTF-8","ISO-8859-1");
if (!checkword($word))
$word="";
}
return $word;
}
// verify if $word content other char than [a-z] accent or '
function checkword($word)
{
$word = removeaccent($word);
$word = mb_eregi_replace("'", "", $word);
$word = mb_eregi_replace("-", "", $word);
$word = mb_eregi_replace(" ", "", $word);
$word = mb_eregi_replace(":", "", $word);
$word = mb_eregi_replace("\*", "", $word);
$word = mb_eregi_replace("\?", "", $word);
if (ctype_alpha($word)) {
return true;
} else {
return false;
}
}
function display_suggest($verb)
{
$return = "\n\t\t\t\t<div class=\"suggest\">";
// $return .= "\n\t\t\t\t\t<form method=\"post\" action=\"send.php\">";
// $return .= "\n\t\t\t\t\t\t<p class=\"report\">" . translate("The conjugated verbs result from a base of knowledge free and open.") . " <a href=\"#a" . $verb . "\" id=\"c" . $verb . "d\" class=\"hidden\" accesskey=\"7\">" . translate("Thank you to announce the errors or the omissions") . "</a>.</p>";
// $return .= "\n\t\t\t\t\t\t<fieldset class=\"areasuggest\" id=\"c" . $verb . "div\">";
// $return .= "\n\t\t\t\t\t\t\t<legend>";
// $return .= "\n\t\t\t\t\t\t\t\t<a id=\"a" . "$verb\">" . translate("Suggestions") . "</a>";
// $return .= "\n\t\t\t\t\t\t\t</legend>";
// $return .= "\n\t\t\t\t\t\t\t<label>" . translate ("Mail address (optinal)") . ": <input type=\"text\" name=\"mail\" /></label><br />";
// $return .= "\n\t\t\t\t\t\t\t<textarea cols=\"90\" rows=\"5\" name=\"texte\" id=\"c" . $verb . "divt\"></textarea>";
// $return .= "\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"verb\" value=\"" . $verb . "\" />";
// $return .= "\n\t\t\t\t\t\t\t<p>" . translate("Search verb") . ": $verb</p>";
// $return .= "\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"verb64\" value=\"" . bin2hex($verb) . "\" />";
// $return .= "\n\t\t\t\t\t\t\t<p>" . translate("Binary code") . ": " . bin2hex($verb) . "</p>";
// $return .= "\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"uagent\" value=\"" . $_SERVER['HTTP_USER_AGENT'] . "\" />";
// $return .= "\n\t\t\t\t\t\t\t<p>" . translate("User agent") . ": " . $_SERVER['HTTP_USER_AGENT'] . "</p>";
// $return .= "\n\t\t\t\t\t\t\t<br /><input type=\"submit\" value=\"" . translate("Submit") . "\" />";
// $return .= "\n\t\t\t\t\t\t</fieldset>";
// $return .= "\n\t\t\t\t\t</form>";
$return .= "\n\t\t\t\t</div>";
return $return;
}
function display_close_button ()
{
$return = '<p id="pclose"><a href="';
if (array_key_exists('HTTP_REFERER', $_SERVER))
$return .= $_SERVER['HTTP_REFERER'];
else
$return .= "index.html";
$return .= '" id="close" accesskey="1">' . translate("Close") . '</a></p>';
return $return;
}
// check if word begin by a vowel
function beginvowel($word, $asp="no")
{
$word = removeaccent($word);
$letter=$word[0];
if ($letter == "h" and "$asp" == "")
$letter="a";
if ( $letter == "a" or $letter == "e" or $letter == "i" or $letter == "o" or $letter == "u" or $letter == "y")
return true;
else
return false;
}
// main class
class display
{
var $return;
var $begin;
var $aspirateh;
var $conjugation;
var $searchword;
var $word;
function __construct($word, $searchword)
{
global $config_dsn;
// search information about $word
$allData = new dataBase ($config_dsn);
$allData->execSearchCond('*', 'verbsfr', 'infinitif', "$word");
$row = $allData->nextResult();
$this->aspirateh=$row['aspirateh'];
$template=$row['template'];
$this->begin = $row['base'];
# search the conjugation
$allData->execSearchCond('*', 'conjugationfr', 'template', "$template");
$this->conjugation = $allData->nextResult();
$allData->close();
$this->return = "\n\t\t\t" . '<div class="tabbertab" id="' . $word . '">' . "\n\t\t\t\t<h2>" . translate("The verb") . " " . $row['infinitif'] . "</h2>\n\t\t\t\t\t<div class=\"verbiste\"><a href=\"#$word" . "iv\" class=\"hidden\" id=\"d$word\"><img alt=\">\" class=\"twisty\" src=\"images/twisty-down.gif\" /> Conjugaison</a><div id=\"d$word" . "iv\" class=\"conj\">";
$allData->close();
$this->searchword=$searchword;
$this->word=$word;
}
function display_tenses($tense, $add_accent, $info)
{
foreach ($tense as $mod => $tensepron)
{
//fixme: ca ne sert plus a rien le pronom
foreach ($tensepron as $tense => $pronouns) {
foreach ($pronouns as $num => $pronoun) {
$search=$mod."_".$tense."_".$num;
if($this->conjugation != null) {
$term_array=explode("-",$this->conjugation[$search]);
foreach ( $term_array as $term )
if ($term != "") {
if ( ! isset($return2))
$return2 = '';
$return2 .= "\n\t\t\t\t\t\t<li>" . conjugate_verb($this->begin,$term,$this->aspirateh,$num,$tense,$mod,removeextraspace($info[1]), "", $info[0]) . "</li>";
}
};
}
if ( isset($return2)) {
if ( ! isset($return))
$return = '';
$return .= "\n\t\t\t\t\t<h4>" . translate("$tense") . "</h4>\n\t\t\t\t\t<ul>$return2\n\t\t\t\t\t</ul>";
}
unset($return2);
}
if ( isset($return))
$this->return .= "\n\t\t\t\t" . '<div class="mod">' . "\n\t\t\t\t\t<h3>" . translate("$mod") . "</h3>$return\n\t\t\t\t</div>";
unset($return);
}
}
function close ()
{
global $config_dsn;
$verb=$this->word;
$this->return .= display_suggest($verb);
$allData = new dataBase ($config_dsn);
$this->return .= "\n\t\t\t\t\t</div></div>";
$allData->execSearchCond('*', 'wiktionaryfr', 'infinitive', $verb);
$wiktionary = $allData->nextResult();
$this->return .= display_wiktionary ($wiktionary['Definitions'], "Définitions", "def", $verb);
$this->return .= display_wiktionary ($wiktionary['Etymologie'], 'Étymologie', 'etym', $verb);
$this->return .= display_wiktionary ($wiktionary['Note'], 'Note', 'note', $verb);
$this->return .= display_wiktionary ($wiktionary['Synonymes'], 'Synonymes', 'syn', $verb);
$this->return .= display_wiktionary ($wiktionary['Antonymes'], 'Antonymes', 'ant', $verb);
$this->return .= display_wiktionary ($wiktionary['Apparentes'], 'Apparentés', 'apr', $verb);
$this->return .= display_wiktionary ($wiktionary['Derives'], 'Dérivés', 'der', $verb);
$this->return .= display_wiktionary ($wiktionary['Expressions'], 'Expressions', 'exp', $verb);
$this->return .= display_wiktionary ($wiktionary['Troponymes'], 'Troponymes', 'tropo', $verb);
$this->return .= display_wiktionary ($wiktionary['Homophones'], 'Homophones', 'homo', $verb);
$this->return .= display_wiktionary ($wiktionary['Prononciation'], 'Prononciation', 'pron', $verb);
$this->return .= display_wiktionary ($wiktionary['Vocabulaire'], 'Vocabulaire', 'voc', $verb);
$this->return .= display_wiktionary ($wiktionary['Hyponymes'], 'Hyponymes', 'hypo', $verb);
$this->return .= display_wiktionary ($wiktionary['Paronymes'], 'Paronymes', 'paro', $verb);
$this->return .= display_wiktionary ($wiktionary['Hyperonymes'], 'Hyperonymes', 'hyper', $verb);
$allData->close();
//end of the class tabbertab
$this->return .= "\n\t\t\t\t<p class=\"report\">La conjugaison est issu de verbiste sous GNU Publique Générale GNU, le contenu issu de Wiktionnaire disponible sous GNU Free Documentation License.</p>";
$this->return .= "\n\t\t\t</div>";
unset ($this->begin);
return $this->return;
}
}
function display_wiktionary ($search, $name, $id, $verb)
{
if ( $search != "" )
return "\n\t\t\t" . '<div class="wiktionary"><a href="#ab' . $verb . $id . '" class="hidden" id="' . $verb . $id . '"><img alt=">"class="twisty" src="images/twisty-down.gif" /> ' . $name . '</a><div id="' . $verb . $id . 'iv" class="' . $id . '"><a id="ab' . $verb . $id . '"></a>' . $search . '<p class="report">Ces informations sont librement accessibles et modifiables sur le site wiktionnaire. <a href="http://fr.wiktionary.org/wiki/' . $verb . '">Retrouver ' . $verb . ' sur wiktionnaire</a>.</p></div></div>';
}
class display_html
{
var $title;
var $return;
function __construct($title)
{
$this->title=$title;
$this->return = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/2001/REC-xhtml11-20010531/DTD/xhtml11-flat.dtd">';
$this->return .= '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">';
}
function head()
{
global $URL;
$this->return .= "\n<head>";
$this->return .= "\n\t<title>" . $this->title . "</title>";
$this->return .= "\n\t" . '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
$this->return .= "\n\t" . '<meta name="robots" content="index,follow" />';
$this->return .= "\n\t" . '<meta name="description" content="' . translate("Interface in line of French conjugation sensmotdire") . '" />';
$this->return .= "\n\t" . '<meta name="keyword" content="sensmotdire - ' . translate("the free French conjugation on line") . '" />';
$this->return .= "\n\t" . '<meta name="author" content="GnunuX" />';
$this->return .= "\n\t" . '<link rel="icon" type="image/png" href="images/sensmotdire.png" />';
$this->return .= "\n\t" . '<link href="css/sensmotdire.css" rel="stylesheet" type="text/css" />';
$this->return .= "\n\t" . '<script type="text/javascript" src="js/sensmotdire.js.php"></script>';
# pour ie $this->return .= "\n\t" . '<script src="js/scriptaculous.js?load=effects" type="text/javascript"></script>';
$this->return .= "\n\t" . '<link rel ="search" title="sensmotdire" type="application/opensearchdescription+xml" href="' . $URL . 'sensmotdire.xml" />';
$this->return .= "\n\t" . '<link rel="alternate" title="rss" type="application/rss+xml" href="' . $URL . 'rss20.xml" />';
$this->return .= "\n</head>";
}
function body($content,$id="")
{
if ($id == "")
$this->return .= "\n<body>";
else
$this->return .= "\n<body id=\"$id\">";
$this->return .= "<!--
Copyright (C) sensmotdire GnunuX http://sensmotdire.gnunux.info/dist/
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-->";
$this->return .= "$content";
$this->return .= "\n</body>";
}
function close()
{
global $acronym;
$this->return .= "\n</html>";
$tmp=$this->return;
foreach ($acronym as $word => $acro)
$tmp=mb_eregi_replace($word, "<acronym title=\"$acro\">$word</acronym>", $tmp);
unset($this->return);
return $tmp;
}
}
function conjugate_verb($begin,$term,$hasp,$num,$tense,$mod,$compare,$accent="",$prono="no",$html="yes")
{
global $tenses, $forme_prono_vowel, $forme_prono, $forme_prono_imperative;
if (beginvowel($begin . $term, $hasp))
$begin_by_vowel="yes";
else
$begin_by_vowel="no";
$pronoun=$tenses[$mod][$tense][$num];
$return='';
if ($pronoun != "")
$return="$pronoun ";
if ($begin_by_vowel=="yes")
{
$tmp_forme_prono=$forme_prono_vowel[$num];
$tmp_forme_prono_inf="s'";
} else {
$tmp_forme_prono=$forme_prono[$num] . " ";
$tmp_forme_prono_inf="se ";
}
if ( "$prono" == "yes" and !( $mod == "imperative" or ( $mod == "participle" and $tense == "past")))
{
if ($mod == "infinitive" or $mod == "participle")
$return.=$tmp_forme_prono_inf;
else
$return.=$tmp_forme_prono;
} else {
if ( "$return" == "je " )
if ($begin_by_vowel=="yes")
$return = "j'";
if ( "$return" == "que je " )
if ($begin_by_vowel=="yes")
$return = "que j'";
}
if ($html == "yes")
$term2='<span class="combined">' . $term . '</span>';
else
$term2=$term;
$verb=$begin . $term2;
if ($accent == "")
$verb2=$begin . $term;
else
$verb2=removeaccent($verb) . removeaccent($term);
if ($html == "yes" and $compare == $verb2)
$verb="<strong>" . $verb . "</strong>";
$verb2=$return . $verb2;
$return .= $verb;
if ( "$prono" == "yes" and $mod == "imperative" )
{
$return .= "-" . $forme_prono_imperative[$num];
$verb2 .= "-" . $forme_prono_imperative[$num];
}
if ($html == "yes" and $compare == $verb2)
$return="<strong>" . $return . "</strong>";
return $return;
}
function is_an_infinitive_verb($word, $add_accent="no")
{
// search informations into database 'verbsfr' the 'template' refered
// to $word
if ($add_accent == "yes")
return false;
global $config_dsn;
$allData = new dataBase ($config_dsn);
$allData->execSearchCond('infinitif', 'verbsfr', 'infinitif', "$word");
$row = $allData->nextResult();
$allData->close();
if ($row && $row['infinitif'] != "")
return $row['infinitif'];
else
return false;
}
function is_a_conjugated_verb($word, $add_accent="no")
{
global $pronouns, $forme_prono, $forme_prono_vowel, $forme_prono_imperative, $config_dsn;
$add_forme_prono="no";
//remove empty array
$word=removeextraspace($word);
$orig_word=$word;
$word_array=explode(" ",$word);
$add_pronouns="";
if ( $word_array[0] == "que" )
array_shift($word_array);
if ( preg_match("/^qu'/", $word_array[0] ) )
$word_array[0]=mb_substr($word_array[0], 3);
if ( in_array($word_array[0], $pronouns) )
{
array_shift($word_array);
$add_pronouns="yes";
} elseif ( preg_match("/^j'/", $word_array[0] ) ) {
$add_pronouns="yes";
$word_array[0]=mb_substr($word_array[0], 2);
}
if ( in_array($word_array[0], $forme_prono ) )
{
array_shift($word_array);
$add_pronouns="yes";
$add_forme_prono="yes";
} elseif ( in_array(mb_substr($word_array[0], 0, 2), $forme_prono_vowel ) ) {
$word_array[0]=mb_substr($word_array[0], 2);
$add_forme_prono="yes";
$add_pronouns="yes";
} else {
$tmp=explode("-", $word_array[0]);
if (count($tmp) != "1")
{
if ( in_array($tmp[count($tmp)-1], $forme_prono_imperative ) )
{
unset ($tmp[count($tmp)-1]);
$word_array[0]=implode("-", $tmp);
$add_forme_prono="yes";
$add_pronouns="yes";
}
}
}
if (!(isset($word_array[1]) and $add_pronouns == "yes"))
{
foreach ( $word_array as $word )
{
if (!$verb = is_an_infinitive_verb($word, $add_accent) or $add_pronouns == "yes")
{
$allData = new dataBase ($config_dsn);
$allData2 = new dataBase ($config_dsn);
for ($i = 0; $i < mb_strlen($word);$i++)
{
$begin = mb_substr($word, 0, $i);
if ( $add_accent == "yes" )
{
$end = removeaccent(mb_substr($word, $i));
$allData->execSearchCondAccent('*', 'verbsfr', 'base', "$begin");
} else {
$end = mb_substr($word, $i);
$allData->execSearchCond('*', 'verbsfr', 'base', "$begin");
}
while ($row = $allData->nextResult())
{
$allData2->execSearchCond('*', 'conjugationfr', 'template', $row['template']);
while ($tab = $allData2->nextResult())
{
if ( $add_accent == "yes" )
$tab = array_map("removeaccent", $tab);
if ( $result=preg_grep("*(-$end-)*", $tab))
if ( $add_pronouns != "" )
{
foreach ($result as $mod => $num)
{
$mod=explode("_",$mod);
if ($orig_word == conjugate_verb($begin, $end, $row['aspirateh'], $mod[2], $mod[1], $mod[0], "", $add_accent, $add_forme_prono, "no"))
{
$verbs[$row['infinitif']]=array($add_forme_prono, $orig_word);
break;
}
}
} else
$verbs[$row['infinitif']]=array($add_forme_prono, $word);
}
}
}
$allData->close();
$allData2->close();
} else
$verbs[$verb]=array($add_forme_prono, $verb);
}
}
if (isset($verbs))
return $verbs;
}
?>

View file

@ -0,0 +1,42 @@
<?php require "config.php";
$nav=$_GET['nav'];
header("Content-Disposition: attachment; filename=\"sensmotdire.$nav\";");
header("Content-Type: text/xml");
if ($nav == "src")
{
echo '<search
version="7.1"
name="sensmotdire"
description="Conjuguer un verbe"
action="' . $URL . 'redirect/"
searchform="' . $URL . 'redirect/"
method="GET"
queryCharset="utf-8"
>
<input name="sourceid" value="Mozilla-search">
<input name="word" user>
</search>
<browser
update="' . $URL . 'plugin_firefox.src"
updateIcon="' . $URL . 'images/sensmotdire.png"
updateCheckDays="7"
>
';
};
if ($nav == "xml")
{
echo '<?xml version="1.0" encoding="UTF-8" ?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>sensmotdire</ShortName>
<Description>Conjuguer un verbe</Description>
<InputEncoding>utf-8</InputEncoding>
<Image width="16" height="16">data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1wIEEjsAFV3aJgAAAB10RVh0Q29tbWVudABDcmVhdGVkIHdpdGggVGhlIEdJTVDvZCVuAAACO0lEQVQ4y6WTXUiTYRTHf++7dx8tK1wWVDNtYg0r+tAivdBKMsmLIkrwops+EGIQRF2IFRTYRQURBFFQF8JIKKG6iFRCiy40FYeEoib5haBzzlHqnG6ni70bvayueh7Ozf+c8zvn4TwH/vMoqZKosFgII6UQXQeOftj8HpgC9gLfQQklojWAu3BAhaxuTuUP8sQTY0MagKAQxo6faQlh+QF5LmhtAKoMNT9oDAvIvywG0o8ql6x5omQ++omQq5sTgOKrzNa7jUlvLCw3wMdPMBSEWG55TmzrKGKOIMnrwx9v4VBmjeNehgHgukg40eEv2EQfi3+kCo8JUoZHD6ktSyu/ZgBk30SoeHYbxEUTxUoMYTaeXNKGWLYwDpjUOOD1N1hKHci+llvAML6SlvUBoMkaBMgegaIA6cB+HTAwifY1mAKobAZF4GyHZWbMBF2H0xOu7YIKuNWEYNvZ8SoFsDsE5x/AtjB4CwBT0qUJCqAlAYzlB6bNSArkYQ1Ewek9Z5DHVE0DRnVA+52Zl101FcuNb5cgCpCcwZootClyeqoNQgsALFnhi80qQLvez4kruPsEouLl+HMByT5JODGywgt0joOfuqwYgtjnES475xD9TXkv6D1YZxLMEYHISj1nGp9uZKCqGrl/BPmsEDj6TvEb/oEgzNClAHhtLOwJs2rX6maYPwbADnonbuCZy7H0OFsjRUO1pd0F2APG5YvgA6AOqj1kdGoMCkwIhP6yEkGBSYHrK6BVAg5g7W8n2Ay7yS5tsAAAAABJRU5ErkJggg==</Image>
<UpdateInterval>7</UpdateInterval>
<UpdateUrl>' . $URL . 'sensmotdire.xml</UpdateUrl>
<IconUpdateUrl>'. $URL . 'images/sensmotdire.png</IconUpdateUrl>
<Url type="text/html" template="' . $URL . '{searchTerms}.html" />
<Url type="application/x-suggestions+json" method="GET" template="' . $URL . 'autosuggest.php?input={searchTerms}&amp;firefox=yes" />
</OpenSearchDescription>';
};
?>

View file

@ -0,0 +1,67 @@
<?xml version="1.0"?>
<?xml-stylesheet href="css/news.css" type="text/css"?>
<rss version="2.0">
<channel>
<title>Nouveautés sensmodire</title>
<link>http://sensmotdire.gnunux.info/</link>
<language>fr</language>
<description>Nouveauté sur sensmotdire - http://sensmotdire.gnunux.info/</description>
<item>
<title>Amélioration</title>
<link>http://sensmotdire.gnunux.info/</link>
<pubDate>Tue, 20 Feb 2007 08:16:53 +0000</pubDate>
<description>Changelogs :
- remise des urls en UTF-8 ;
- meilleurs accessibilités ;
- divers corrections dans la page xhtml ;
- amélioration du rendu css ;
- distinction des terminaisons de conjugation ;
- mise en place de la faq ;
- mise en place du flux rss ;
- meilleur gestion des "sans accent" ;
- autosuggestion de caractères indéfinis multiple (*) ou unique (?) ;
- meilleur gestion des verbes inconnus et des caractères interdits ;
- unification des scripts javascripts et css ;
- correction d'une erreur javascript + autofocus sur la zone de saisi ;
- correction d'un problème de caractère dans l'autosuggestion dans konqueror ;
- corrections et améliorations diverses.
</description>
</item>
<item>
<title>Version 0.2 rc1</title>
<link>http://sensmotdire.gnunux.info/</link>
<pubDate>Sun, 11 Mar 2007 10:05:53 +0000</pubDate>
<description>Changelogs :
- correction probleme de css sous konqueror ;
- erreur 404 pour les verbes non reconnus dans la base (s'il n'y a aucun verbe reconnu) ;
- donnée issue de wiktionaire intégré ;
- apparition d'un cookie pour conserver l'affichage (par javascript) ;
- meilleur accessibilité (même si ce n'est pas parfait) ;
- recherche avec le pronom (ex. je mange) ;
- ajout de la forme pronominale réfléchie ;
- support des conjugaisons multiples pour un verbe (comme asseoir) ;
- support amélioré pour ie5 ;
- correction de divers bugs.
</description>
</item>
<item>
<title>Version 0.2 rc2</title>
<link>http://sensmotdire.gnunux.info/</link>
<pubDate>Sun, 11 Mar 2007 23:05:53 +0000</pubDate>
<description>Nouveauté sur sensmotdire - http://sensmotdire.gnunux.info/
- la conjugaison est déployé par défaut ;
- 25 caractères et/ou 4 verbes maximums ;
- correction de bugs divers.
</description>
</item>
<item>
<title>Integration de la base de connaissance de verbiste 0.1.20</title>
<link>http://sensmotdire.gnunux.info/</link>
<pubDate>Mon, 12 Mar 2007 14:30:00 +0000</pubDate>
<description>La base de connaissance des conjugaisons a été mis à jour suite à la sortie de verbiste 0.1.20.
Plus d'information sur les nouveautés : http://sarrazip.com/dev/verbiste.html</description>
</channel>
</rss>

View file

@ -0,0 +1,317 @@
/*
FILE ARCHIVED ON 22:18:05 Feb 9, 2007 AND RETRIEVED FROM THE
INTERNET ARCHIVE ON 12:25:55 Jan 31, 2015.
JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
SECTION 108(a)(3)).
*/
body {
font-family: 'Lucida Grande', Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
font-size: 12px;
position: relative;
background: white url(/web/20070209221805/http://sensmotdire.gnunux.info/images/sensmotdire.png) no-repeat right top;
}
strong {
color: red;
}
#bottom {
clear: both;
text-align: center;
margin-top: 6em;
}
div.tabbertab {
clear: both;
}
div.mod {
margin:1px;
float:left;
display:block;
border:1px solid #B3B3B3;
background-color:white;
}
p {
margin:0px;
padding:0px;
border:0px;
padding-top:2px;
}
div.mod h3 {
margin:0px;
padding:0px;
border:0px;
background-color:#B3B3B3;
text-align: center;
}
div.mod h4 {
margin:0px;
padding:0px;
border:0px;
background-color:#E3E3E3;
text-align: center;
}
ul {
list-style: none;
padding: 5px;
border: 0px;
margin: 0px;
}
li {
min-width: 10em;
}
/*tabber*/
/*--------------------------------------------------
REQUIRED to hide the non-active tab content.
But do not hide them in the print stylesheet!
--------------------------------------------------*/
.tabberlive .tabbertabhide {
display:none;
}
/*--------------------------------------------------
.tabber = before the tabber interface is set up
.tabberlive = after the tabber interface is set up
--------------------------------------------------*/
.tabberlive {
margin-top:1em;
}
/*--------------------------------------------------
ul.tabbernav = the tab navigation list
li.tabberactive = the active tab
--------------------------------------------------*/
ul.tabbernav
{
margin:0;
padding: 3px 0;
border-bottom: 1px solid #778;
font-weight: bold ;
}
ul.tabbernav li
{
list-style: none;
margin: 0;
display: inline;
}
ul.tabbernav li a
{
padding: 3px 0.5em;
margin-left: 3px;
border: 1px solid #778;
border-bottom: none;
background: #DDE;
text-decoration: none;
}
ul.tabbernav li a:link { color: #448; }
ul.tabbernav li a:visited { color: #667; }
ul.tabbernav li a:hover
{
color: #000;
background: #AAE;
border-color: #227;
}
ul.tabbernav li.tabberactive a
{
background-color: #fff;
border-bottom: 1px solid #fff;
}
ul.tabbernav li.tabberactive a:hover
{
color: #000;
background: white;
border-bottom: 1px solid white;
}
/*--------------------------------------------------
.tabbertab = the tab content
Add style only after the tabber interface is set up (.tabberlive)
--------------------------------------------------*/
.tabberlive .tabbertab {
padding:5px;
border-top:0;
}
.tabberlive .tabbertab h2 {
display:none;
}
/*
================================================
autosuggest, inquisitor style
================================================
*/
div.autosuggest
{
position: absolute;
background-image: url(/web/20070209221805/http://sensmotdire.gnunux.info/images/as_pointer.gif);
background-position: top;
background-repeat: no-repeat;
padding: 10px 0 0 0;
}
div.autosuggest div.as_header,
div.autosuggest div.as_footer
{
position: relative;
height: 6px;
padding: 0 6px;
background-image: url(/web/20070209221805/http://sensmotdire.gnunux.info/images/ul_corner_tr.gif);
background-position: top right;
background-repeat: no-repeat;
overflow: hidden;
}
div.autosuggest div.as_footer
{
background-image: url(/web/20070209221805/http://sensmotdire.gnunux.info/images/ul_corner_br.gif);
}
div.autosuggest div.as_header div.as_corner,
div.autosuggest div.as_footer div.as_corner
{
position: absolute;
top: 0;
left: 0;
height: 6px;
width: 6px;
background-image: url(/web/20070209221805/http://sensmotdire.gnunux.info/images/ul_corner_tl.gif);
background-position: top left;
background-repeat: no-repeat;
}
div.autosuggest div.as_footer div.as_corner
{
background-image: url(/web/20070209221805/http://sensmotdire.gnunux.info/images/ul_corner_bl.gif);
}
div.autosuggest div.as_header div.as_bar,
div.autosuggest div.as_footer div.as_bar
{
height: 6px;
overflow: hidden;
background-color: #333;
}
div.autosuggest ul
{
list-style: none;
margin: 0 0 -4px 0;
padding: 0;
overflow: hidden;
background-color: #333;
}
div.autosuggest ul li
{
color: #ccc;
padding: 0;
margin: 0 4px 4px;
text-align: left;
}
div.autosuggest ul li a
{
color: #ccc;
display: block;
text-decoration: none;
background-color: transparent;
position: relative;
padding: 0;
width: 100%;
}
div.autosuggest ul li a:hover
{
background-color: #444;
}
div.autosuggest ul li.as_highlight a:hover
{
background-color: #1B5CCD;
}
div.autosuggest ul li a span
{
display: block;
padding: 3px 6px;
font-weight: bold;
}
div.autosuggest ul li a span small
{
font-weight: normal;
color: #999;
}
div.autosuggest ul li.as_highlight a span small
{
color: #ccc;
}
div.autosuggest ul li.as_highlight a
{
color: #fff;
background-color: #1B5CCD;
background-image: url(/web/20070209221805/http://sensmotdire.gnunux.info/images/hl_corner_br.gif);
background-position: bottom right;
background-repeat: no-repeat;
}
div.autosuggest ul li.as_highlight a span
{
background-image: url(/web/20070209221805/http://sensmotdire.gnunux.info/images/hl_corner_bl.gif);
background-position: bottom left;
background-repeat: no-repeat;
}
div.autosuggest ul li a .tl,
div.autosuggest ul li a .tr
{
width: 6px;
height: 6px;
position: absolute;
top: 0;
padding: 0;
margin: 0;
}
div.autosuggest ul li a .tr
{
right: 0;
}
div.autosuggest ul li.as_highlight a .tl
{
left: 0;
background-image: url(/web/20070209221805/http://sensmotdire.gnunux.info/images/hl_corner_tl.gif);
background-position: bottom left;
}
div.autosuggest ul li.as_highlight a .tr
{
right: 0;
background-image: url(/web/20070209221805/http://sensmotdire.gnunux.info/images/hl_corner_tr.gif);
background-position: bottom right;
}
div.autosuggest ul li.as_warning
{
font-weight: bold;
text-align: center;
}
div.autosuggest ul em
{
font-style: normal;
color: #6EADE7;
}

View file

@ -0,0 +1,30 @@
<?php include("config.php"); ?>
<h1>Base</h1>
<p><a href="<?php echo $URL; ?>avoir.html">Conjugaison du verbe infinitif "avoir"</a></p>
<p><a href="<?php echo $URL; ?>marche.html">Conjugaison du verbe conjugue "marche"</a></p>
<p><a href="<?php echo $URL; ?>sue.html">Conjugaison du verbe conjugue a choix multiple "sue"</a></p>
<p><a href="<?php echo $URL; ?>éliminer.html">Conjugaison d'un verbe accentue "éliminer"</a></p>
<p><a href="<?php echo $URL; ?>:elimer.html">Conjugaison d'un verbe normalement accentue "elimier"</a></p>
<p><a href="<?php echo $URL; ?>entre-heurter.html">Conjugaison d'un verbe avec "-" "entre-heurter"</a></p>
<p><a href="<?php echo $URL; ?>entr'aimer.html">Conjugaison d'un verbe avec "'" "entr'aimer"</a></p>
<p><a href="<?php echo $URL; ?>%20suis%20.html">Conjugaison d'un verbe avec des espaces mal places " suis "</a></p>
<p><a href="<?php echo $URL; ?>asseoir.html">Conjugaison multiple de "asseoir"</a></p>
<p><a href="<?php echo $URL; ?>a%20vu%20va%20vie%20sue%20pu%20tu%20ru.html">4 verbes maximum</a></p>
<p><a href="<?php echo $URL; ?>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.html">25 caractères maximum</a></p>
<h1>Pronom</h1>
<p><a href="<?php echo $URL; ?>je%20mange.html">Conjugaison d'un verbe avec pronom "je mange"</a></p>
<p><a href="<?php echo $URL; ?>j'aime.html">Conjugaison d'un verbe avec le pronom j' "j'aime"</a></p>
<p><a href="<?php echo $URL; ?>j'mange.html">Erreur : Conjugaison d'un verbe avec le pronom j' alors que ce n'est pas possible "j'mange"</a></p>
<p><a href="<?php echo $URL; ?>je%20aime.html">Erreur : Conjugaison d'un verbe avec le pronom je alors que ce n'est pas possible "je aime"</a></p>
<p><a href="<?php echo $URL; ?>je%20parais.html">Conjugaison d'un verbe avec pronom a choix multiple "je parais"</a></p>
<p><a href="<?php echo $URL; ?>nous%20mouchassions.html">Erreur : Conjugaison d'un verbe avec pronom mais subjectif "nous mouchassions"</a></p>
<p><a href="<?php echo $URL; ?>je%20manger.html">Conjugaison d'un verbe avec pronom + infinitif "je manger"</a></p>
<p><a href="<?php echo $URL; ?>je%20suis%20.html">Bug : Conjugaison d'un verbe avec des espaces mal places "je suis "</a></p>
<h1>Subjonctif</h1>
<p><a href="<?php echo $URL; ?>que%20je%20mangeasse.html">Conjugaison d'un verbe avec subjonctif "que je mangeasse"</a></p>
<p><a href="<?php echo $URL; ?>qu'il%20finisse.html">Conjugaison d'un verbe avec subjonctif en qu' "qu'il finisse"</a></p>
<h1>Pronominaux</h1>
<p><a href="<?php echo $URL; ?>je%20me%20lave.html">Conjugaison d'un verbe avec la forme pronominale "je me lave"</a></p>
<p><a href="<?php echo $URL; ?>ils%20s'aiment.html">Conjugaison d'un verbe avec la forme pronominale avec ' "ils s'aiment"</a></p>
<p><a href="<?php echo $URL; ?>ils%20se%20hissent.html">Conjugaison d'un verbe avec la forme pronominale avec "h" "ils se hissent"</a></p>
<p><a href="<?php echo $URL; ?>ils%20s'habituent.html">Conjugaison d'un verbe avec la forme pronominale avec "h aspire" "ils s'habituent"</a></p>

View file

@ -0,0 +1,53 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/2001/REC-xhtml11-20010531/DTD/xhtml11-flat.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<title>sensmotdire - conjugaison francaise libre</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="robots" content="index,follow" />
<meta name="description" content="Interface en ligne de conjugaison francaise sensmotdire" />
<meta name="keyword" content="sensmotdire - la conjugaison francaise libre en ligne" />
<meta name="author" content="GnunuX" />
<link href="css/sensmotdire.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/bsn.AutoSuggest_c_2.0.js"></script>
<link rel="icon" type="image/png" href="images/sensmotdire.png" />
<link rel ="search" title="sensmotdire" type="application/opensearchdescription+xml" href="sensmotdire.xml" />
<link rel="alternate" title="rss" type="application/rss+xml" href="rss20.xml" />
</head>
<body id="indexwidget"><!--
Copyright (C) sensmotdire GnunuX http://sensmotdire.gnunux.info/dist/
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-->
<form id="formwidget" method="get" action="redirect/">
<fieldset id="fieldwidget">
<?php $title="yes"; if ( isset ( $_GET['title'] ) AND $_GET['title'] == "no" ) { $title="no"; }; if ( $title == "yes" ) { echo "<legend>Verbe à conjuguer</legend>"; }; ?>
<input type="text" id="textwidget" name="word" accesskey="4" <?php if ( isset ($_GET['size']) ) { echo 'size="' . $_GET['size'] . '"'; } ?> /><br />
<label><input type="checkbox" name="accent" id="checkword" accesskey="5" />j'écris sans accent</label><br /><br />
<input type="submit" value="Conjuguer" id="conjuguer" onClick="window.open('http://sensmotdire.gnunux.info/'+document.getElementById('textwidget').value + '.html', 'sensmotdire');return(false)"/>
</fieldset>
</form>
<script>
var options1 = {
script:"autosuggest.php?limit=<?php if ( isset ($_GET['limit']) ) { echo $_GET['limit']; } else { echo '3'; } ?>&",
varname:"input",
json: true,
minchars:1,
noresults:"Pas de résultat",
cache:false
};
var as1 = new AutoSuggest('textwidget', options1);
</script>
</body>
</html>

View file

@ -0,0 +1 @@
PKG="$PKG php-mysqlnd php-mbstring php-pear-DB"

View file

@ -0,0 +1,12 @@
<?php
global $config_dsn, $URL, $NB_VERBS;
$config_dsn = array(
'phptype' => 'mysqli',
'username' => '%%mariadb_client_username',
'password' => '%%mariadb_client_password',
'hostspec' => '%%mariadb_client_server_domainname',
'database' => '%%mariadb_client_database',
);
$URL="http://%%{revprox_client_external_domainnames[0]}%%{revprox_client_external_domainnames[0]}.location";
$NB_VERBS=3;
?>

View file

@ -0,0 +1,34 @@
# To allow POST on static pages
error_page 405 =200 $uri;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains;';
add_header Referrer-Policy no-referrer always;
%set %%locations = []
%for %%revprox in %%revprox_client_external_domainnames
%set %%location = %%revprox.revprox_client_location
%if %%location in %%locations
%continue
%end if
%%locations.append(%%location)
location %%location {
%if %%location == '/'
root %slurp
%else
alias %slurp
%end if
/usr/local/share/sensmotdire/;
index index.php;
location ~ ^(?<script_name>.+?\.php)(?<path_info>/.*)?$ {
fastcgi_pass php-fpm;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include fastcgi_params;
}
}
%end for