File: D:/HostingSpaces/PvdBoogaard/indoorski.nl/backup/oude-site/cms/js.php
<?php
// if the site is down for maintenacne we still want to show js as the admin will still use it
// so ignore the down for maintenanace message for this page load
define('IGNORE_MAINTENANCE', true);
define('IGNORE_INSTALL', true);
define('IN_CONTROL_PANEL', true);
require_once(dirname(__FILE__) . '/api/iwp.php');
header('Content-Type: application/x-javascript');
// A white list of available sections/classes to load language variables for
$whitelist_section = array(
'content',
'lists',
'categories',
'contenttypes',
'user',
'groups',
'modules',
);
if(isset($_GET['a'])){
$a = $_GET['a'];
}else{
$a = 0;
}
// set the language file
if($a == 1){
if (isset($_GET['section']) && in_array($_GET['section'], $whitelist_section, true)) {
IWP::Set('LangFile', 'admin.common,'.'admin.'.$_GET['section']);
}else{
IWP::Set('LangFile', 'admin.common');
}
}
IWP::Init('basic,outputbuffer,language,whitelabel,functions');
function SendCacheHeaders($LastModifiedDate) {
if ($LastModifiedDate) {
$date = gmdate("D, d M Y H:i:s \G\M\T", $LastModifiedDate);
if ((isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) >= $LastModifiedDate)) {
if (php_sapi_name() == 'CGI') {
header("Status: 304 Not Modified");
} else {
header("HTTP/1.0 304 Not Modified");
}
header('Last-Modified: '.$date);
header('Cache-Control: max-age=604800, must-revalidate');
header("Pragma: public");
header('Expires: '.gmdate("D, d M Y H:i:s \G\M\T",time()+604800));
die();
} else {
header('Last-Modified: '.$date);
header('Cache-Control: max-age=604800, must-revalidate');
header("Pragma: public");
header('Expires: '.gmdate("D, d M Y H:i:s \G\M\T",time()+604800));
}
}
}
/* Lets set up some globals */
$template = iwp_template::getInstance();
$template->Assign('RequireEmail', iwp_config::Get('CommentRequireEmail'));
$template->Assign('RequireName', iwp_config::Get('CommentRequireName'));
if(isset($_GET['tpl'])){
$tpl = $_GET['tpl'];
}else{
$tpl = 0;
}
$template->SetTemplatePath(IWP_BASE_PATH . "/javascript/");
$template->SetIncludePath(IWP_BASE_PATH);
$template->SetCachePath(IWP_CACHE_TEMPLATE_PATH);
$filename = preg_replace('/[^a-zA-Z0-9\-_ \.,]/','',$_GET['f']);
if(strlen($filename) > 0){
if (file_exists(IWP_BASE_PATH . "/javascript/". $filename.".js")) {
SendCacheHeaders(filemtime(IWP_BASE_PATH . "/javascript/". $filename.".js"));
$template->SetTemplatePath(IWP_BASE_PATH . "/javascript/",'js');
$template->ParseTemplate($filename);
}
}