77 lines
2.5 KiB
PHP
77 lines
2.5 KiB
PHP
|
|
<?
|
||
|
|
|
||
|
|
namespace controller\ms\portal\section;
|
||
|
|
|
||
|
|
use core\site\Theme;
|
||
|
|
use ms\MS;
|
||
|
|
use ms\ms\structure\msControllerTable;
|
||
|
|
use ms\ms\structure\msLang;
|
||
|
|
use ms\portal\Section;
|
||
|
|
use ui\Form;
|
||
|
|
use ui\form\structure\eInputType;
|
||
|
|
use ui\input\Input;
|
||
|
|
use core\lang\structure\LangVariable as V;
|
||
|
|
|
||
|
|
class Api extends msControllerTable {
|
||
|
|
|
||
|
|
static $class = 'ms\Portal\Section';
|
||
|
|
|
||
|
|
static function getSettingsForm(){
|
||
|
|
|
||
|
|
$res = [];
|
||
|
|
if(IF_AUTH) {
|
||
|
|
if($SECTION = Section::isMy($_POST['id'])) {
|
||
|
|
$section_id = $SECTION[Section::$ID];
|
||
|
|
$data = json_decode( $SECTION[Section::$DATA] , true );
|
||
|
|
$theme_id = intval($SECTION[Section::$THEME]);
|
||
|
|
$x = Theme::init($theme_id , $data);
|
||
|
|
$form = $x::getForm();
|
||
|
|
|
||
|
|
|
||
|
|
$form[] =
|
||
|
|
[
|
||
|
|
Form::VIEW => Form::INPUT,
|
||
|
|
Form::TYPE => eInputType::HIDDEN,
|
||
|
|
Form::KEY_VALUE => Section::$THEME,
|
||
|
|
Form::INPUT_OPT => [
|
||
|
|
Input::VALUE => $SECTION[Section::$THEME],
|
||
|
|
]
|
||
|
|
];
|
||
|
|
$form[] =
|
||
|
|
[
|
||
|
|
Form::VIEW => Form::INPUT,
|
||
|
|
Form::TYPE => eInputType::HIDDEN,
|
||
|
|
Form::KEY_VALUE => 'controller',
|
||
|
|
Form::INPUT_OPT => [ Input::VALUE=> Section::$controller, ]
|
||
|
|
];
|
||
|
|
$form[] =
|
||
|
|
[
|
||
|
|
Form::VIEW => Form::INPUT,
|
||
|
|
Form::TYPE => eInputType::HIDDEN,
|
||
|
|
Form::KEY_VALUE => Section::$ID,
|
||
|
|
Form::INPUT_OPT=>[ Input::VALUE => $section_id]
|
||
|
|
];
|
||
|
|
$form[] =
|
||
|
|
[
|
||
|
|
Form::VIEW =>Form::INPUT,
|
||
|
|
Form::COL_CLASSES =>'',
|
||
|
|
Form::TYPE =>eInputType::SUBMIT,
|
||
|
|
Form::INPUT_OPT => [
|
||
|
|
Input::CSS_CLASS => MS::CSS_BTN_SAVE,
|
||
|
|
Input::LABEL => $c = V::get(msLang::$BUTTON_SUBMIT),
|
||
|
|
],
|
||
|
|
];
|
||
|
|
|
||
|
|
|
||
|
|
$res = [];
|
||
|
|
$res['form'] = $form;
|
||
|
|
$res['title'] = 'Настройки';
|
||
|
|
$res['values'] = json_decode($SECTION[Section::$DATA], true);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
echo je($res);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|