-
Notifications
You must be signed in to change notification settings - Fork 5
/
conditions.php
59 lines (50 loc) · 1.78 KB
/
conditions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
# ***** BEGIN LICENSE BLOCK *****
# This file is part of Nevertable .
# Copyright (c) 2004 Francois Guillet and contributors. All rights
# reserved.
#
# Nevertable 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.
#
# Nevertable 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 Nevertable; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# ***** END LICENSE BLOCK *****
define('ROOT_PATH', "./");
define('NVRTBL', 1);
include_once ROOT_PATH ."config.inc.php";
include_once ROOT_PATH ."includes/common.php";
include_once ROOT_PATH ."includes/classes.php";
$table = new Nvrtbl();
try {
/* Cache for texts */
$cache = new Cache("text");
$langpath = ROOT_PATH . $config['lang_dir'] . $config['opt_user_lang'] . "/";
$conditions = $langpath . "conditions.txt";
if ($cache->Hit('conditions_txt_'.$config['opt_user_lang']))
$content = $cache->Read();
else
{
$f = new FileManager($conditions);
if ($f->Exists())
{
$content = $table->template->RenderText($f->ReadString());
$cache->Create('conditions_txt_'.$config['opt_user_lang'], $content);
}
}
$tpl_params['content'] = $content . '<br/>'. gui_button_back();
$table->template->Show("generic", $tpl_params);
} catch (Exception $ex)
{
$table->template->Show('error', array("exception" => $ex));
}
$table->Close();