meraproject/module/common/page/block/controller.php
keboss-m 5c21d25d45 Initial commit: Merakomis portal, Docker stack and user-reader API.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 11:04:05 +03:00

42 lines
1.0 KiB
PHP

<?
namespace controller\common\page\block;
use common\page\Block;
use ms\ms\structure\msControllerTable;
class Api extends msControllerTable {
static $class = 'common\page\Block';
public function updatePosForID($id=null,$pos=null,$where = null){
if(IF_AUTH) {
$C = Block::getByID($_POST['id']);
$where = \Where::_and([
\Where::_operator(Block::$TO, '=', $C[Block::$TO]),
\Where::_operator(Block::$OID, '=', $C[Block::$OID]),
]);
parent::updatePosForID($_POST['id'], $_POST['pos'], $where);
}
}
static function getSettingsForm(){
$res = [];
if(IF_AUTH) {
if($BLOCK = Block::isMy($_POST['id'])) {
$form = Block::getTemplateForm($BLOCK);
$res = [];
$res['form'] = $form;
$res['title'] = 'Шаблон';
$res['values'] = json_decode($BLOCK[Block::$DATA], true);
}
}
echo je($res);
}
}