<?php
 namespace Modules\Utils\AiConfig; class View_Utils_FormAdmin extends \App\Mvc\View_Utils_FormAbstract { public function getForm() { $form = \Engine\Form\General::create(); $fieldset = \Engine\Form\Container\Fieldset::create($this->lang['index']['form']['apiSettings']); $apiKey = new \Engine\Form\Input\Password($this->lang['index']['formFields']['apiKeyOpenAi'], 'apiKeyOpenAi', $this->values['apiKeyOpenAi']); $apiKey->setStyle('showPassword', true); $fieldset->addElement($apiKey); $apiKey = new \Engine\Form\Input\Password($this->lang['index']['formFields']['apiKeyAnthropic'], 'apiKeyAnthropic', $this->values['apiKeyAnthropic']); $apiKey->setStyle('showPassword', true); $fieldset->addElement($apiKey); $apiKey = new \Engine\Form\Input\Password($this->lang['index']['formFields']['apiKeyGemini'], 'apiKeyGemini', $this->values['apiKeyGemini']); $apiKey->setStyle('showPassword', true); $fieldset->addElement($apiKey); $form->addContainer($fieldset); $fieldset = \Engine\Form\Container\Fieldset::create($this->lang['index']['form']['aiAssistant']); $platform = new \Engine\Form\Input\Select($this->lang['index']['formFields']['aiAssistantPlatform'], 'aiAssistantPlatform', $this->values['aiAssistantPlatform']); $platform->setPossibleValues([ 'openAi' => 'OpenAI', 'anthropic' => 'Anthropic', 'gemini' => 'Gemini', ]); $platform->showDefaultOption(); $fieldset->addElement($platform); $modelOpenAi = new \Engine\Form\Input\Select($this->lang['index']['formFields']['aiAssistantModel'], 'aiAssistantModelOpenAi', $this->values['aiAssistantModelOpenAi']); $modelOpenAi->setPossibleValues([ 'gpt-5.1' => 'gpt-5.1', 'gpt-5.4' => 'gpt-5.4', 'gpt-5.5' => 'gpt-5.5', ]); $modelOpenAi->showDefaultOption(); $fieldset->addElement($modelOpenAi); $modelAnthropic = new \Engine\Form\Input\Select($this->lang['index']['formFields']['aiAssistantModel'], 'aiAssistantModelAnthropic', $this->values['aiAssistantModelAnthropic']); $modelAnthropic->setPossibleValues([ 'claude-haiku-4-5-20251001' => 'claude-haiku-4.5', 'claude-opus-4-6' => 'claude-opus-4.6', 'claude-opus-4-8' => 'claude-opus-4.8', 'claude-fable-5' => 'claude-fable-5', ]); $modelAnthropic->showDefaultOption(); $fieldset->addElement($modelAnthropic); $modelGemini = new \Engine\Form\Input\Select($this->lang['index']['formFields']['aiAssistantModel'], 'aiAssistantModelGemini', $this->values['aiAssistantModelGemini']); $modelGemini->setPossibleValues([ 'gemini-3.5-flash' => 'gemini-3.5-flash', 'gemini-3.1-pro-preview' => 'gemini-3.1-pro', ]); $modelGemini->showDefaultOption(); $fieldset->addElement($modelGemini); $platform->setControlledElements([ 'openAi' => [$modelOpenAi], 'anthropic' => [$modelAnthropic], 'gemini' => [$modelGemini], ]); $form->addContainer($fieldset); $form->addElement(new \Engine\Form\Input\Hidden('', $this->submitButtonName, 1)); return $form; } }