$GLOBALS['links']['prefs-utilisateur']['linkvalue']);
$content = '
' . END_LINE;
$content .= '
' . END_LINE;
$link_create = array('rub' => $GLOBALS['links']['inscription-utilisateur']['linkvalue']);
$link_logout = array('rub' => $GLOBALS['links']['deconnexion']['linkvalue']);
$content .= '
' . END_LINE;
$content .= '
' . END_LINE;
echo $content;
}
/**
* AuthForm()
* Formulaire d'authentification pour login ou inscription
*
* @param string $todo
* @return void (echo string)
*/
function AuthForm($todo = 'LOGON')
{
$action = $_SERVER['PHP_SELF'];
if ($todo == 'LOGON') {
$input_hidden = $GLOBALS['links']['prefs-utilisateur']['linkvalue'];
$div_id = 'logon';
} else {
$input_hidden = $GLOBALS['links']['inscription-utilisateur']['linkvalue'];
$div_id = 'subscribe';
}
$form = '' . END_LINE;
echo $form;
}
/**
* DisplayHTMLTitle()
* Affichage du titre de la page courante
*
* @return void ( echo string )
*/
function DisplayHTMLTitle()
{
echo SITE_CITY_NAME . ' - ' . $GLOBALS['links'][$GLOBALS['activeitem']]['title'];
}
/**
* DisplayMenu()
* Affichage du menu
*
* @return void ( echo string )
*/
function DisplayMenu()
{
$content = '";
echo $content;
}
/**
* HrefMaker()
* Fabrique un lien en suivant au besoin les règles de l'url_rewriting
*
* @param array $var_table
* @return string $url_maked
**/
function HrefMaker($var_table)
{
$url_maked = '';
if (defined("MOD_REWRITE") && MOD_REWRITE === true) {
if (array_key_exists('rub', $var_table)) {
$url_maked .= $var_table['rub'];
}
if (array_key_exists('filter', $var_table)) {
$url_maked .= URI_SEPARATOR . $var_table['filter'];
}
if (array_key_exists('id', $var_table)) {
$url_maked .= URI_SEPARATOR . $var_table['id'];
}
if (array_key_exists('parentid', $var_table)) {
$url_maked .= URI_SEPARATOR . $var_table['parentid'];
}
if (array_key_exists('parentparentid', $var_table)) {
$url_maked .= URI_SEPARATOR . $var_table['parentparentid'];
}
if (array_key_exists('debut', $var_table)) {
$url_maked .= URI_SEPARATOR . $var_table['debut'];
}
$url_maked .= '.html';
} else {
if (function_exists('http_build_query')) $url_string = http_build_query($var_table);
else {
$url_string = '';
$sep = '';
while (list($key, $value) = each ($var_table)) {
if (!empty($value)) {
$url_string .= $sep . $key . '=' . $value;
$sep = OUTPUT_SEP;
}
}
}
$url_maked = 'index.php?' . $url_string;
}
return $url_maked;
}
/**
* DisplayTemplate()
* Fait l'include du template désiré
*
* @return void --> include
**/
function DisplayTemplate()
{
foreach ($GLOBALS['links'] as $key => $value) {
if ($GLOBALS['links'][$key]['linkvalue'] == $GLOBALS['activeitem']) {
$current_template = $GLOBALS['links'][$key]['template'];
}
}
include_once('tpl_' . $current_template . '.php');
}
/**
* AliasActiveItems()
* Retourne l'item actif
*
* @param string $item
* @return string item actif ou boolean false
**/
function AliasActiveItems($item)
{
foreach ($GLOBALS['links'] as $key => $value) {
if ($GLOBALS['links'][$key]['linkvalue'] == $item) {
if ($GLOBALS['links'][$key]['alias'] === false) return $GLOBALS['links'][$key]['linkvalue'];
else return $GLOBALS['links'][$key]['alias'];
}
}
}
/**
* Display_linkin_page()
*
* @param array $table_link
* @param integer $total
* @param integer $debut
* @param integer $pas
* @return void (echo)
**/
function Display_linkin_page($table_link, $total, $debut, $pas = SELECT_LIMIT)
{
$result = ceil($total / $pas);
if ($result <= 1) return ' ';
else {
$link = ''.END_LINE;
$link .= '< < ';
$sep='';
for($i = 0; $i < $result; $i++) {
$current_pos = ($pas * $i);
if ($debut == $current_pos) $link .= $sep."
" . ($i + 1) . " \n";
else {
$array_pos = array ('debut' => $current_pos);
$new_table_link = array_merge ($table_link, $array_pos);
$link .= $sep.'
' . ($i + 1) . ''.END_LINE;
}
$sep=' | ';
}
$link .= ' > >';
$link .= '
'.END_LINE;
echo $link;
}
}
?>