Exemple #1
0
    debug_buffer('loading translation functions');
    require_once cms_join_path($dirname, 'lib', 'translation.functions.php');
}
debug_buffer('loading events functions');
require_once cms_join_path($dirname, 'lib', 'classes', 'class.events.inc.php');
debug_buffer('loading php4 entity decode functions');
require_once $dirname . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'html_entity_decode_php4.php';
require_once $dirname . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'autoloader.php';
debug_buffer('done loading files');
#Load them into the usual variables.  This'll go away a little later on.
global $DONT_LOAD_DB;
if (!isset($DONT_LOAD_DB)) {
    $cmsdb =& $gCms->GetDB();
    //    $cmsdb->Execute('set names utf8'); // database connection with utf-8
}
$smarty =& $gCms->GetSmarty();
$contenttypes =& $gCms->contenttypes;
#Load content types
$dir = cms_join_path($dirname, 'lib', 'classes', 'contenttypes');
$handle = opendir($dir);
while ($file = readdir($handle)) {
    $path_parts = pathinfo($file);
    if (isset($path_parts['extension']) && $path_parts['extension'] == 'php') {
        $obj = new CmsContentTypePlaceholder();
        $obj->type = strtolower(basename($file, '.inc.php'));
        $obj->filename = cms_join_path($dir, $file);
        $obj->loaded = false;
        $obj->friendlyname = basename($file, '.inc.php');
        $contenttypes[strtolower(basename($file, '.inc.php'))] = $obj;
    }
}