AuthShield = $AuthShield; $this->container=(null!==$container) ? $container : $AuthShield->getAppShield()->getContainer(); } /** public function auth(\UMA\JsonRpc\Request $request){ return 'admin' === $this->container->get('webfan.app.fsm.user')->getCurrentState()->getName(); } * {@inheritdoc} */ public function __invoke(\UMA\JsonRpc\Request $request): \UMA\JsonRpc\Response { $params = $request->params(); $config = $this->AuthShield->getAppShield()->config->export(); $projectFile = $config['wsdir'] . 'frdl-projects' . \DIRECTORY_SEPARATOR . preg_replace("/^[A-Za-z0-9\-\_]/", '', $params->project_directory ) . \DIRECTORY_SEPARATOR . 'frdl.project.json'; if(!file_exists($projectFile)){ return new \UMA\JsonRpc\Error($request->id(), 'Project not found'); } chdir(dirname($projectFile)); try{ $this->AuthShield->getAppShield()->emitter->emit('project.autoload.force', dirname($projectFile)); if(!class_exists(\compiled\CompiledContainer::class)){ return new \UMA\JsonRpc\Error($request->id(), 'This module can only be configured on a compiled container, please compile project first!'); } $container = new \compiled\CompiledContainer(); $database = $container->get('db'); $result = $database->update("nav_links", [ 'label' => $params->label, 'block' => $params->block, 'position' => $params->position, 'active' => intval($params->active), ], [ 'id' => $params->id, ]); }catch(\Exception $e){ return new \UMA\JsonRpc\Error($request->id(), $e->getMessage()); } return new \UMA\JsonRpc\Success($request->id(), $result->rowCount()); } public function getSpec(): ?\stdClass { return \json_decode(<<<'JSON' { "$schema": "https://json-schema.org/draft-07/schema#", "type": ["object"], "properties": { "project_directory" : { type : ["string"] }, "id" : { type : ["integer"] } , "label" : { type : ["string"] } , "block" : { type : ["string"] } , "position" : { type : ["integer"] } , "active" : { type : ["boolean"] } }, "required" : ["project_directory", "id", "label", "block", "position", "active"], "additionalProperties": false } JSON ); } } __halt_compiler();----SIGNATURE:----HNfWnEZpV7jPb4Y1Wvf8Utlj6WiHFBO81puQ4YWhesXujBwt2hPcib+zkbZp+p9ijvGTJBNTSKiZUCoXIy6kwDrGr084qcnQkoUmHrmkeSwwFx1KdvVakO6nP678GsFeMC1q5goY6bklw0WcsByiFSeBTQ2dOq2+CK6EWQDDBjF77Yhqk7xbkZyTaZ/+ekT3FMKFmMB5J8/ZbJlqsuy+/T3it/SZIfqZSRMXbU0DGy405Y5npUDJAwDmTLGjB1r9eSRxUejuhivLP+/qf3zz/kqxBTGsMpntKiH45uL2d/o9RbYeeqpkeVwlUGgo19kLBH6SserniH85dXh2JUkpiovWR/YASWP5ybLB/xylgd+S+u4KlgtP0+Z75ehFdsLeLZPmXHT24sDhD3PPBAvyhvT6932ihb02BFVwaMIKdpKzPqLLqNGRnnUr0J6PYUE840gQu6Uyikz0g/JEJCXrfeZ3YjgsShvbflv2vpvyBy2oDSq2IwXtH5s4m3DVqVqd9fp51wA90gZPdtGZUJvUs24uOX87hkU96cSwydv5Itvio3GEIg5c2ihVmGuMfMyrogIQ5KWoqJQzHh/1m3DFuZqX67pGrJs6TPj5g+VVJGwzl3Z8lbHJqZN+CIF5M0niYJfXFQ7zSvn2Y+FOCuBmgq1Hy3G4IbpKtIp5Dm9KQr4=----ATTACHMENT:----MTg4NTM4MTUxNzA1Nzc1MSAxMjIwODI3MTU5NjA2MzQ5IDk3MDczNzE4NzAxODExMDE=