Файл: app/admin/settings/main.php
Строк: 69
<?php
Core::only('level', 3);
$smarty->header('Параметры системы');
$data = parse_ini_file(ROOT . 'system/ini/default.ini');
if (filter_has_var(INPUT_POST, 'submit'))
{
$filter = [
'title' => filter_input(INPUT_POST, 'title', FILTER_UNSAFE_RAW),
'language' => filter_input(INPUT_POST, 'language', FILTER_UNSAFE_RAW),
'keywords' => filter_input(INPUT_POST, 'keywords', FILTER_UNSAFE_RAW),
'description' => filter_input(INPUT_POST, 'description', FILTER_UNSAFE_RAW),
'pages' => filter_input(INPUT_POST, 'pages', FILTER_SANITIZE_NUMBER_INT)
];
$data['title'] = $filter['title'];
$data['language'] = $filter['language'];
$data['keywords'] = $filter['keywords'];
$data['description'] = $filter['description'];
$data['pages'] = $filter['pages'];
$db->query("ALTER TABLE `users` CHANGE `pages` `pages` INT(99) DEFAULT '" . $filter['pages'] . "' ");
Core::config($data);
}
Core::show('error');
$elements[] = [
'type' => 'input',
'title' => Lang::word('Заголовок'),
'br' => 1,
'info' => [
'name' => 'title',
'value' => $data['title'],
]
];
$elements[] = [
'type' => 'input',
'title' => Lang::word('Пунктов на страницу'),
'br' => 1,
'info' => [
'name' => 'pages',
'value' => $data['pages'],
]
];
foreach (glob('system/language/*') AS $lang)
{
$name = str_replace('system/language/', '', $lang);
$options[] = [
$name,
file_get_contents(ROOT . 'system/language/' . $name . '/lang.name'),
$data['language'] == $name
];
}
$elements[]= [
'type' => 'select',
'title' => Lang::word('Язык'),
'br' => 1,
'info' => [
'name' => 'language',
'options' => $options
]
];
$elements[] = [
'type' => 'textarea',
'title' => Lang::word('Ключевые слова') . ' (meta-keywords)',
'br' => 1,
'info' => [
'name' => 'keywords',
'value' => $data['keywords'],
]
];
$elements[] = [
'type' => 'textarea',
'title' => Lang::word('Описание') . ' (meta-description)',
'br' => 1,
'info' => [
'name' => 'description',
'value' => $data['description'],
]
];
$elements[] = [
'type' => 'submit',
'info' => [
'name' => 'submit',
'value' => Lang::word('Сохранить')
]
];
$smarty->assign([
'method' => 'POST',
'action' => '?',
'el' => $elements
]);
$smarty->display('form.tpl');
$smarty->footer();