Conn2Flow
Docs navigation

Reference / Libraries

configuracao.php library

The text-variable editor of a module (screen and saving) used by the variables and modulos modules, and the per-host variables legacy.

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-variables to 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

5 of 5

configuracao_hosts_salvar

view source · line 549 ↗
configuracao_hosts_salvar(array|false $params = false): array

Salva as configurações de hosts para variáveis de um módulo.

Parameters

$paramsarray|false
Parâmetros da função.

Returns

array
Array de retorno com informações do processamento.

configuracao_hosts_variaveis

view source · line 829 ↗
configuracao_hosts_variaveis(array|false $params = false): array

Retorna as variáveis de configuração de um módulo para um host específico.

Parameters

$paramsarray|false
Parâmetros da função.

Returns

array
Array de variáveis de configuração com valores mesclados do host.

The Future is Hybrid: Human + AI.

Conn2Flow is the tool. If you need the Architect to design your company's strategy using this technology...

Hire Specialized Consulting