Файл: install/system/classes/Core.php
Строк: 37
<?php
class Core
{
static function go($var)
{
exit (header ('location: ' . $var));
}
static function config($var, $cfg = 'settings', $comment = null)
{
if (isset($comment))
{
$array = ['[' . $comment . ']'];
}
if ($fopen = fopen(ROOT . 'system/ini/' . $cfg . '.ini', 'w'))
{
foreach ($var as $key => $value)
{
$array[] = $key . ' = '' . htmlentities($value, ENT_QUOTES, 'UTF-8') . ''';
}
fputs($fopen, implode("rn", $array));
fclose($fopen);
return true;
}
else
return false;
}
static function show($type = NULL, $var = NULL)
{
global $smarty;
switch ($type)
{
case 'success':
$listing[] = [
'title' => $var,
'div' => 'success',
];
break;
case 'warning':
$listing[] = [
'title' => $var,
'div' => 'warning',
];
break;
case 'error':
if (empty($var))
{
global $error;
$var = $error;
$listing = null;
}
if (isset($var))
{
$listing[] = [
'title' => $var,
'div' => 'error'
];
}
break;
}
$smarty->assign('listing', $listing);
$smarty->display('listing.tpl');
}
}