Correzioni minori su namespace

This commit is contained in:
Dasc3er 2020-09-22 14:54:14 +02:00
parent 8bd9643f5d
commit 19e6a8ac23
5 changed files with 22 additions and 16 deletions

View File

@ -19,6 +19,8 @@
namespace HTMLBuilder\Manager; namespace HTMLBuilder\Manager;
use Util\Query;
/** /**
* @since 2.4 * @since 2.4
*/ */
@ -96,7 +98,7 @@ class WidgetManager implements ManagerInterface
$query = str_replace('1=1', '1=1 '.$additionals, $query); $query = str_replace('1=1', '1=1 '.$additionals, $query);
} }
$query = \Util\Query::replacePlaceholder($query); $query = Query::replacePlaceholder($query);
// Individuazione del risultato della query // Individuazione del risultato della query
$database = database(); $database = database();
@ -163,7 +165,7 @@ class WidgetManager implements ManagerInterface
elseif ($widget['more_link_type'] == 'javascript') { elseif ($widget['more_link_type'] == 'javascript') {
$link = $widget['more_link']; $link = $widget['more_link'];
$link = \Util\Query::replacePlaceholder($link); $link = Query::replacePlaceholder($link);
$result .= 'onclick="'.$link.'"'; $result .= 'onclick="'.$link.'"';
} }

View File

@ -20,6 +20,7 @@
namespace Models; namespace Models;
use Common\Model; use Common\Model;
use Util\Query;
class Clause extends Model class Clause extends Model
{ {
@ -39,6 +40,6 @@ class Clause extends Model
public function getClauseAttribute($value) public function getClauseAttribute($value)
{ {
return Util\Query::replacePlaceholder($value); return Query::replacePlaceholder($value);
} }
} }

View File

@ -20,6 +20,7 @@
namespace Models; namespace Models;
use Common\Model; use Common\Model;
use Util\Query;
class View extends Model class View extends Model
{ {
@ -27,7 +28,7 @@ class View extends Model
public function getQueryAttribute($value) public function getQueryAttribute($value)
{ {
return Util\Query::replacePlaceholder($value); return Query::replacePlaceholder($value);
} }
/* Relazioni Eloquent */ /* Relazioni Eloquent */

View File

@ -18,6 +18,7 @@
*/ */
use Models\Module; use Models\Module;
use Util\Query;
/** /**
* Classe per la gestione delle informazioni relative ai moduli installati. * Classe per la gestione delle informazioni relative ai moduli installati.
@ -137,7 +138,7 @@ class Modules
$results = $database->fetchArray('SELECT * FROM `zz_group_module` WHERE `idgruppo` = (SELECT `idgruppo` FROM `zz_users` WHERE `id` = '.prepare($user['id']).') AND `enabled` = 1 AND `idmodule` = '.prepare($module['id'])); $results = $database->fetchArray('SELECT * FROM `zz_group_module` WHERE `idgruppo` = (SELECT `idgruppo` FROM `zz_users` WHERE `id` = '.prepare($user['id']).') AND `enabled` = 1 AND `idmodule` = '.prepare($module['id']));
foreach ($results as $result) { foreach ($results as $result) {
if (!empty($result['clause'])) { if (!empty($result['clause'])) {
$result['clause'] = Util\Query::replacePlaceholder($result['clause']); $result['clause'] = Query::replacePlaceholder($result['clause']);
$additionals[$result['position']][] = $result['clause']; $additionals[$result['position']][] = $result['clause'];
} }
@ -149,7 +150,7 @@ class Modules
$id_segment = $_SESSION['module_'.$module['id']]['id_segment']; $id_segment = $_SESSION['module_'.$module['id']]['id_segment'];
foreach ($segments as $result) { foreach ($segments as $result) {
if (!empty($result['clause']) && $result['id'] == $id_segment) { if (!empty($result['clause']) && $result['id'] == $id_segment) {
$result['clause'] = Util\Query::replacePlaceholder($result['clause']); $result['clause'] = Query::replacePlaceholder($result['clause']);
$additionals[$result['position']][] = $result['clause']; $additionals[$result['position']][] = $result['clause'];
} }
@ -263,13 +264,13 @@ class Modules
/** /**
* Costruisce un link HTML per il modulo e il record indicati. * Costruisce un link HTML per il modulo e il record indicati.
* *
* @param string|int $modulo * @param string|int $modulo
* @param int $id_record * @param int $id_record
* @param string $testo * @param string $testo
* @param string $alternativo * @param bool|string $alternativo
* @param string $extra * @param string $extra
* @param bool $blank * @param bool $blank
* @param string $anchor * @param string $anchor
* *
* @return string * @return string
*/ */

View File

@ -18,6 +18,7 @@
*/ */
use Mpdf\Mpdf; use Mpdf\Mpdf;
use Util\Query;
/** /**
* Classe per la gestione delle informazioni relative alle stampe installate. * Classe per la gestione delle informazioni relative alle stampe installate.
@ -152,11 +153,11 @@ class Prints
if (!empty($infos['is_record'])) { if (!empty($infos['is_record'])) {
$module = Modules::get($infos['id_module']); $module = Modules::get($infos['id_module']);
Util\Query::setSegments(false); Query::setSegments(false);
$query = Util\Query::getQuery($module, [ $query = Query::getQuery($module, [
'id' => $id_record, 'id' => $id_record,
]); ]);
Util\Query::setSegments(true); Query::setSegments(true);
$has_access = !empty($query) ? $dbo->fetchNum($query) !== 0 : true; $has_access = !empty($query) ? $dbo->fetchNum($query) !== 0 : true;
} }