<?php
/**
 * $Source: /home/cvs/nukescripts/kernel/templates/themes_maximus.php,v $
 * $Revision: 1.1.0a-2 $
 * $Author: cyril $
 * $Date: 2006/06/20 12:40:01 $
 * Fix frenatus - killermanlille
 * Bug 94 et 109
 * Lignes corrigées : 74 - 75
 */
/************************************************************************/
/* Maximus CMS: Web Portal System                                       */
/* ==============================                                       */
/*                                                                      */
/* Copyright (c) 2002 - 2006                                            */
/* http://www.php-maximus.fr                                            */
/* dev@php-maximus.org                                                  */
/*                                                                      */
/* 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.       */
/************************************************************************/
/* Based on PHP-NUKE: Web Portal System                                 */
/************************************************************************/
defined('MAXIMUS') or die ('Access denied themes maximus MAXIMUS directly...');


function Max_OpenTable() {
	echo "<div class='opentable'>";
}

function Max_CloseTable() {
	echo "</div>";
}

function Max_OpenTable2() {
	echo "<div class='opentable2'>";
}

function Max_CloseTable2() {
	echo "</div>";
}

function OpenTable() {
	echo "<div class='opentable'>";
}

function CloseTable() {
	echo "</div>";
}

function OpenTable2() {
	echo "<div class='opentable2'>";
}

function CloseTable2() {
	echo "</div>";
}

if (!function_exists('title')) {
	function title($text) {
		Max_OpenTable();
		br('1');
		echo "<center><font class='title'>".stripslashes($text)."</font></center>";
		br('1');
		Max_CloseTable();
		br('1');
	}
}

function Max_Template_Block($file=false, $title=false, $content=false){
    global $ThemeSel, $name;
// fix frenatus 18 / 06/ 2006 bug 94
// fix killermanlille 20 / 06/ 2006 bug 109
$title2 = str_replace(' ', '_', $title);
if ($_COOKIE['blo'][$title2] == "1"){
// fin fix
$control_blocks = "<a href='index.php?g&amp;bloc=$title&amp;actif='><img src='images/blocks/bas.png' border='0' alt='"._OPENBLOCK."' title='"._OPENBLOCK."' /></a>";
	if (file_exists("themes/".$ThemeSel."/".$file."_".$name."_mini.html")) {
		$tmpl_file = "themes/".$ThemeSel."/".$file."_".$name."_mini.html";
	} else {
 		$tmpl_file = "themes/".$ThemeSel."/".$file."_mini.html";
	}
} else {
$control_blocks ="<a href='index.php?g&amp;bloc=$title&amp;actif=1'><img src='images/blocks/droite.png' border='0' alt='"._CLOSEBLOCK."' title='"._CLOSEBLOCK."' /></a>";
if (file_exists("themes/".$ThemeSel."/".$file."_".$name.".html")) {
		$tmpl_file = "themes/".$ThemeSel."/".$file."_".$name.".html";
	} else {
	$tmpl_file = "themes/".$ThemeSel."/".$file.".html";
	}
}

    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval("$thefile");
    print $r_file;
}

function themesidebox($title, $content) {
	Max_Template_Block('blocks', $title, $content);
}

function themerightbox($title, $content) {
	Max_Template_Block('blocks_right', $title, $content);
}

function themeleftbox($title, $content) {
	Max_Template_Block('blocks_left', $title, $content);
}

function thememessagebox($title, $content) {
	Max_template_block('message', $title, $content);
}

function themecenterbox($title, $content) {
	Max_template_block('blocks_hight', $title, $content);
}

function themecenterbox_low($title, $content) {
	Max_template_block('blocks_low', $title, $content);
}