public
Description: Git mirror of the CMS Made Simple 2.0 rewrite
Homepage: http://cmsmadesimple.org
Clone URL: git://github.com/tedkulp/cmsmadesimple-2-0.git
calguy1000 (author)
Thu Apr 10 18:01:16 -0700 2008
commit  b9e58c898cdf7ec54df8b9a91b889343ee8797a2
tree    86db96be1071579447874c71251a0d95305bab91
parent  4889dbf51e0362e355f0346d573ae1452136eac5
cmsmadesimple-2-0 / include.php
100644 94 lines (77 sloc) 2.928 kb
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?php
#CMS - CMS Made Simple
#(c)2004-2006 by Ted Kulp (ted@cmsmadesimple.org)
#This project's homepage is: http://cmsmadesimple.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, 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#$Id$
 
//Load necessary global functions
require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'cmsms.api.php');
 
//Where are we?
$dirname = ROOT_DIR;
 
//Load stuff that hasn't been moved to static methods yet
require_once(cms_join_path($dirname,'lib','misc.functions.php'));
require_once(cms_join_path($dirname,'lib','page.functions.php'));
require_once(cms_join_path($dirname,'lib','translation.functions.php'));
 
//Setup the session
CmsSession::setup();
 
//Do any necessary stuff to the actual request
CmsRequest::setup();
 
//Setup a global $gCms... this needs to die, though
$gCms = cmsms();
 
#define timezone
if (function_exists('date_default_timezone_set') && CmsConfig::exists('timezone') && CmsConfig::get('timezone') != '')
{
    date_default_timezone_set(CmsConfig::get('timezone'));
}
 
#Preload content types (TODO: Cache me!)
CmsContentOperations::find_content_types();
 
#And block types (TODO: Cache me!)
CmsContentOperations::find_block_types();
 
#Set a umask
$global_umask = get_site_preference('global_umask','');
if( $global_umask != '' )
{
  @umask( octdec($global_umask) );
}
 
#Set the locale if it's set
#either in the config, or as a site preference.
$frontendlang = get_site_preference('frontendlang','');
if (CmsConfig::exists('locale') && CmsConfig::get('locale') != '')
{
    $frontendlang = CmsConfig::get('locale');
}
if ($frontendlang != '')
{
    @setlocale(LC_ALL, $frontendlang);
}
 
cms_smarty()->assign('lang', $frontendlang);
cms_smarty()->assign('encoding', get_encoding());
 
/*
if (isset($CMS_ADMIN_PAGE))
{
include_once(cms_join_path($dirname, CmsConfig::get('admin_dir'), 'lang.php'));
 
  #This will only matter on upgrades now. All new stuff (0.13 on) will be UTF-8.
  if (is_file(cms_join_path($dirname,'lib','convert','ConvertCharset.class.php')))
  {
    include(cms_join_path($dirname,'lib','convert','ConvertCharset.class.php'));
    $gCms->variables['convertclass'] = new ConvertCharset();
  }
}
*/
 
#Load all installed module code
CmsModuleLoader::load_modules(isset($LOAD_ALL_MODULES), !isset($CMS_ADMIN_PAGE));
 
# vim:ts=4 sw=4 noet
?>