Path in the Gestor bibliotecas/configuracao.php
Builds and saves the editor of a module's text variables (the variaveis table, read by gestor_variaveis()): the screen where each variable shows up with a field matching its type, and the saving of the changes. It is what the variables and modulos modules show when editing a record.
Screen: configuracao_administracao()
gestor_incluir_biblioteca('configuracao');
configuracao_administracao([
'modulo' => $id, // module whose variables will be edited
'linguagemCodigo' => $_GESTOR['linguagem-codigo'],
'marcador' => '<!-- configuracao-administracao -->',
]);It reads the variables of the module and language, builds the configuracao-widget and configuracao-campos components and replaces the marcador in $_GESTOR['pagina'] with the editor. Field types live in $_GESTOR['biblioteca-configuracao']['camposTipos']: string, text, bool, number, quantidade, dinheiro, css, js, html, editor-texto, datas-multiplas, data and data-hora. The old tinymce type is read as editor-texto (configuracao_campo_tipo()).
Saving: configuracao_administracao_salvar()
configuracao_administracao_salvar([
'modulo' => $id,
'linguagemCodigo' => $_GESTOR['linguagem-codigo'],
'tabela' => $modulo['tabela'], // to bump the record version and write the history
]);It compares the form (variaveis-total, and for each index ref-N, id-N, grupo-N, descricao-N, tipo-N and valor-N) with the database:
-
an existing variable that changed: updated, and marked
user_modified=1(deploys then preserve the value, see resources); -
a new variable (with
id): inserted; -
a variable that existed and did not come in the form: deleted from the database;
-
if anything changed, it increments the module record version and writes
module-variablesto the history.
modulo and linguagemCodigo go into the SQL unescaped: core callers pass already-escaped values (modulo-registro-id).
Hosts legacy
configuracao_hosts_variaveis() (overlays the module variables with values from hosts_variaveis) and configuracao_hosts_salvar() belong to the multi-host mode. The hosts_variaveis table does not exist on current installations and $_GESTOR['host-id'] is never set (host.php); configuracao_hosts_salvar() has no callers and configuracao_hosts_variaveis() is only called by comunicacao.php in a branch that also depends on a host.
The screen hides parts with html.php (html_adicionar_classe(... 'escondido')).
Functions
Generated from gestor/bibliotecas/configuracao.php · 5 functions
configuracao_campo_tipo
view source · line 52 ↗configuracao_campo_tipo(string $tipo): stringNormaliza o tipo de um campo de configuração (req-144 / BATCH-147).
Parameters
$tipostring- Tipo gravado no banco.
Returns
configuracao_administracao_salvar
view source · line 75 ↗configuracao_administracao_salvar(array|false $params = false): voidSalva as configurações de administração de um módulo.
Parameters
$paramsarray|false- Parâmetros da função.
Returns
configuracao_administracao
view source · line 262 ↗configuracao_administracao(array|false $params = false): voidExibe o widget de administração de configurações de um módulo.
Parameters
$paramsarray|false- Parâmetros da função.
Returns
configuracao_hosts_salvar
view source · line 549 ↗configuracao_hosts_salvar(array|false $params = false): arraySalva as configurações de hosts para variáveis de um módulo.
Parameters
$paramsarray|false- Parâmetros da função.
Returns
configuracao_hosts_variaveis
view source · line 829 ↗configuracao_hosts_variaveis(array|false $params = false): arrayRetorna as variáveis de configuração de um módulo para um host específico.
Parameters
$paramsarray|false- Parâmetros da função.
Returns