Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

siteconfig.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: siteconfig.php 9330 2002-03-04 12:56:24Z ce $
5 //
6 // Created on: <12-Jul-2001 10:45:55 bf>
7 //
8 // This source file is part of Exponential Basic, publishing software.
9 //
10 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
11 //
12 // This program is free software; you can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
25 //
26
27 // include_once( "classes/INIFile.php" );
28 // include_once( "classes/eztemplate.php" );
29 // include_once( "classes/ezhttptool.php" );
30 // include_once( "classes/ezfile.php" );
31
32 $ini =& eZINI::instance( 'site.ini' );
33 $Language = $ini->variable( "eZSiteManagerMain", "Language" );
34 $SitePath = $ini->variable( "site", "SitePath" );
35
36 /* Nice Idea, Not Needed because of classes/ezfile's predicate path
37 Specificly the sitedir.ini does this work for us (dependancy)
38 */
39
40 /*
41 $ini_file = "$SitePath/override/site.ini";
42 $ini_php_file = "$SitePath/override/site.ini.php" ;
43 */
44
45 $ini_file = "/override/site.ini";
46 $ini_php_file = "/override/site.ini.php" ;
47
48 if ( isset( $Store ) )
49 {
50 if ( file_exists( "settings/override/site.ini.php" ) )
51 $fp = eZPBFile::fopen( "settings/override/site.ini.php", "w+");
52 elseif ( file_exists( "settings/override/site.ini" ) )
53 $fp = eZPBFile::fopen( "settings/site.ini", "w+");
54 elseif ( file_exists( "settings/site.ini.php" ) )
55 $fp = eZPBFile::fopen( "settings/site.ini.php", "w+");
56 elseif ( file_exists( "settings/site.ini" ) )
57 $fp = eZPBFile::fopen( "settings/site.ini", "w+");
58
59 $Contents =& str_replace ("\r", "", $Contents );
60 fwrite ( $fp, $Contents );
61 fclose( $fp );
62 }
63
64
65 $ini =& eZINI::instance( 'site.ini' );
66 $Language = $ini->variable( "eZSiteManagerMain", "Language" );
67
68 $t = new eZTemplate( "kernel/ezsitemanager/admin/" . $ini->variable( "eZSiteManagerMain", "AdminTemplateDir" ),
69 "kernel/ezsitemanager/admin/" . "/intl", $Language, "siteconfig.php" );
70 $t->setAllStrings();
71
72 $t->set_file( "site_config_tpl", "siteconfig.tpl" );
73
74 if ( file_exists( "settings/override/site.ini.php" ) )
75 {
76 $lines = eZPBFile::file( "settings/override/site.ini.php" );
77 }
78 elseif ( file_exists( "settings/override/site.ini" ) )
79 {
80 $lines = eZPBFile::file( "settings/override/site.ini" );
81 }
82 elseif ( file_exists( "settings/site.ini.php" ) )
83 {
84 $lines = eZPBFile::file( "settings/site.ini.php" );
85 }
86 elseif ( file_exists( "settings/site.ini" ) )
87 {
88 $lines = eZPBFile::file( "settings/site.ini" );
89 }
90 else
91 {
92 print("<span style='color: red;'>Warning</span>: The Exponential Basic site.ini file could not be found : <span style='color: red;'>$ini_file</span>");
93
94 // print("<br />");
95 }
96
97 // print("<br />This is the End ...");
98 $contents = "";
99 foreach ( $lines as $line )
100 {
101 $contents .= stripslashes($line);
102 }
103 $t->set_var( "file_contents", htmlspecialchars( $contents ) );
104 $t->set_var( "file_name", isset( $fileName ) ? $fileName : false );
105
106 $t->pparse( "output", "site_config_tpl" );
107
108 ?>
eZPBFile\fopen
static fopen( $filename, $options)
Definition: ezpbfile.php:326
eZPBFile\file
static file( $filename)
Definition: ezpbfile.php:428
eZTemplate
Definition: eztemplate.php:107
$lines
else $lines
Definition: csseditor.php:58
file_exists
static file_exists( $inifilename)
Definition: eZPBINIFile.php:195
$fp
$fp
Definition: export.php:97
$fileName
if(eZObjectPermission::hasPermission( $file->id(), "filemanager_file", "r", $user)==false) $fileName
Definition: ezfilemanager/user/filedownload.php:43
$SitePath
$SitePath
Definition: siteconfig.php:34
$t
$t
Definition: siteconfig.php:68
$ini_file
$ini_file
Definition: siteconfig.php:45
$contents
$contents
Definition: siteconfig.php:98
$Language
$Language
Definition: siteconfig.php:33
$ini_php_file
$ini_php_file
Definition: siteconfig.php:46
$ini
$ini
Definition: siteconfig.php:32
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.