This commit is contained in:
2026-04-24 23:37:57 +02:00
parent ff05330778
commit ed2f89567c
15 changed files with 1263 additions and 41 deletions

View File

@@ -108,6 +108,7 @@ class DictionaryController extends MainController implements ControllerInterface
//'User' => array('User' => 'Index'),
'Słowniki' => array('Dictionary' => 'Index'),
'Zmienne serwisu' => array('Setup' => 'Index'),
'Ustawienia formularza' => array('FormSettings' => 'Index'),
// 'Kategorie produktów' => array('ProductCategory' => 'Index'),
// 'Serie produktów' => array('ProductSeries' => 'Index'),
// 'Materiał produktów' => array('ProductSpec' => 'Index', 'type' => 2),
@@ -150,4 +151,4 @@ class DictionaryController extends MainController implements ControllerInterface
?>
?>

View File

@@ -0,0 +1,61 @@
<?php
class FormSettingsController extends MainController implements ControllerInterface {
public function IndexAction($param) {
$errors = array();
if (Request::GetPost('doFormSettingsEdit')) {
$post = Request::GetAllPost();
$errors = RegistrationFormSettings::Validate($post);
if (empty($errors)) {
RegistrationFormSettings::SaveSettings($post);
$this->smarty->assign('info', 'Zapisano ustawienia formularza.');
$this->smarty->assign('type', 'ok');
} else {
$this->smarty->assign('info', 'Popraw pola formularza.');
$this->smarty->assign('type', 'error');
}
}
$settings = RegistrationFormSettings::GetSettings();
$this->smarty->assign('settings', $settings);
$this->smarty->assign('errors', $errors);
}
public function preDispatch($param) {
$this->RunShared('Auth', $param);
$this->Run($param);
$admin = AuthDAL::GetAdmin();
$this->user = $admin;
$this->smarty->assign('titleAdmin', 'Administracja');
$struct = array(
'Słowniki' => array('Dictionary' => 'Index'),
'Zmienne serwisu' => array('Setup' => 'Index'),
'Ustawienia formularza' => array('FormSettings' => 'Index'),
);
$this->smarty->assign('structure', $this->renderStruct($struct));
}
private function renderStruct($struct) {
$return = '';
foreach ($struct as $k => $row) {
$return .= '<li><a href="' . Router::GenerateUrl('dictpig', $row) . '">' . $k . '</a></li>';
}
$html = '<ul>';
$html .= $return;
$html .= '</ul>';
return $html;
}
public function postDispatch($param) {
}
}
?>

View File

@@ -144,6 +144,7 @@ class SetupController extends MainController implements ControllerInterface {
//'User' => array('User' => 'Index'),
'Słowniki' => array('Dictionary' => 'Index'),
'Zmienne serwisu' => array('Setup' => 'Index'),
'Ustawienia formularza' => array('FormSettings' => 'Index'),
// 'Kategorie produktów' => array('ProductCategory' => 'Index'),
// 'Serie produktów' => array('ProductSeries' => 'Index'),
// 'Materiał produktów' => array('ProductSpec' => 'Index', 'type' => 2),
@@ -179,4 +180,4 @@ class SetupController extends MainController implements ControllerInterface {
}
}
?>
?>