(add): Adição de gestçao do Museu
This commit is contained in:
1 parent
2b8862c5cd
commit
d2f9414e7d
5 files changed
+375
-8
No files matched your search
+14
-6
@@ -47,7 +47,7 @@ function init() {
|
||||
|
||||
$ark = "";
|
||||
|
||||
return ['ok'=>false,'destino'=>'','msg'=>'Nenhum ARK foi passado...','qrark'=> false,'ark_full'=>'', 'tem_interrogacao'=>false];
|
||||
return ['ok'=>false,'destino'=>'','msg'=>'Nenhum ARK foi passado...','qrark'=> false,'ark_full'=>'', 'tem_interrogacao'=>false, 'consulta_original_encontrada' => false];
|
||||
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ function init() {
|
||||
|
||||
|
||||
if ($ark === '') {
|
||||
return ['ok'=>false,'destino'=>'','msg'=>'ARK vazio.','qrark'=>$qrark,'ark_full'=>'', 'tem_interrogacao'=>false];
|
||||
return ['ok'=>false,'destino'=>'','msg'=>'ARK vazio.','qrark'=>$qrark,'ark_full'=>'', 'tem_interrogacao'=>false, 'consulta_original_encontrada' => false];
|
||||
}
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ function init() {
|
||||
//-------------------------- FIM PREFIXOS ARK --------------------------
|
||||
|
||||
if (!is_callable($buscar_ark)) {
|
||||
return ['ok'=>false,'destino'=>'','msg'=>'Prefixo ARK desconhecido.','qrark'=>$qrark,'ark_full'=>$ark_full, 'tem_interrogacao'=>$tem_interrogacao];
|
||||
return ['ok'=>false,'destino'=>'','msg'=>'Prefixo ARK desconhecido.','qrark'=>$qrark,'ark_full'=>$ark_full, 'tem_interrogacao'=>$tem_interrogacao, 'consulta_original_encontrada' => false];
|
||||
}
|
||||
|
||||
|
||||
@@ -134,8 +134,9 @@ function init() {
|
||||
|
||||
$identificador_ark = false;
|
||||
|
||||
$resultado = ['ok'=>false,'destino'=>'','msg'=>'ARK não encontrado.Erro não identificado.','qrark'=>$qrark,'ark'=>$ark_full, 'tem_interrogacao'=>$tem_interrogacao];
|
||||
$resultado = ['ok'=>false,'destino'=>'','msg'=>'ARK não encontrado.Erro não identificado.','qrark'=>$qrark,'ark'=>$ark_full, 'tem_interrogacao'=>$tem_interrogacao, 'consulta_original_encontrada' => false];
|
||||
|
||||
$consulta_original_encontrada = false;
|
||||
|
||||
|
||||
do {
|
||||
@@ -169,6 +170,8 @@ function init() {
|
||||
|
||||
$identificador_ark = $resultado["ok"];
|
||||
|
||||
$consulta_original_encontrada = ($index === 0);
|
||||
|
||||
$index++;
|
||||
|
||||
} while ($tamanho > 1 && !$identificador_ark);
|
||||
@@ -176,8 +179,9 @@ function init() {
|
||||
|
||||
|
||||
$resultado['qrark'] = $qrark;
|
||||
$resultado['ark_full'] = $ark_full; // <-- use este no JS/analytics
|
||||
$resultado['tem_interrogacao'] = $tem_interrogacao;
|
||||
$resultado['ark_full'] = $ark_full; // <-- use este no JS/analytics
|
||||
$resultado['tem_interrogacao'] = $tem_interrogacao;
|
||||
$resultado['consulta_original_encontrada'] = $consulta_original_encontrada;
|
||||
|
||||
|
||||
return $resultado;
|
||||
@@ -198,6 +202,8 @@ $qrark = $conteudo["qrark"];
|
||||
|
||||
$tem_interrogacao = $conteudo['tem_interrogacao'];
|
||||
|
||||
$consulta_original_encontrada = $conteudo['consulta_original_encontrada'];
|
||||
|
||||
function slug_titulo($s) {
|
||||
$s = trim((string)$s);
|
||||
if ($s === '') return '';
|
||||
@@ -263,6 +269,7 @@ background: linear-gradient(to right, #FFC371, #FF5F6D); /* W3C, IE 10+/ Edge, F
|
||||
const arkFull = <?= json_encode($arkFull) ?>; // "68745/eM8Rf/gJ.ht"
|
||||
const qrark = <?= json_encode($qrark) ?>; // boolean
|
||||
const consultaMetadados = <?= json_encode($tem_interrogacao) ?>; // boolean
|
||||
const consulta_original_encontrada = <?= json_encode($consulta_original_encontrada) ?>;
|
||||
const tituloSlug = <?= json_encode($tituloSlug) ?>; // "o-titulo-do-livro"
|
||||
|
||||
const spinner = document.getElementById('spinner');
|
||||
@@ -282,6 +289,7 @@ background: linear-gradient(to right, #FFC371, #FF5F6D); /* W3C, IE 10+/ Edge, F
|
||||
|
||||
if (ok) {
|
||||
const parts = [];
|
||||
if (!consulta_original_encontrada) parts.push('404');
|
||||
if (qrark) parts.push('qrcodeLivro');
|
||||
if (consultaMetadados) parts.push('meta');
|
||||
if (tituloSlug) parts.push(tituloSlug);
|
||||
|
||||
Reference in new issue
Block a user