Merge remote-tracking branch 'origin/switch-to-adodb' into switch-to-adodb

Dieser Commit ist enthalten in:
Ortwin Pinke 2025-07-02 20:45:28 +02:00
Commit b351c063d6
10 geänderte Dateien mit 169 neuen und 111 gelöschten Zeilen

55
.gitignore gevendort
Datei anzeigen

@ -1,12 +1,52 @@
/nbproject/private/ # Ignore all files in the .idea folder
/.idea/workspace.xml .idea/*
/data/config/production/config.php
# Except for the following:
!.idea/codeStyles
!.idea/fileTemplates
!.idea/inspectionProfiles
!.idea/keymaps
!.idea/libraries
!.idea/modules.xml
!.idea/vcs.xml
!.idea/workspace.xml
!.idea/tasks.xml
# Ignore workspace-related files
.idea/workspace.xml
.idea/tasks.xml
.idea/usage.statistics.xml
.idea/dictionaries
.idea/shelf
# Ignore OS-specific files
.idea/**/Desktop.xml
.idea/**/Find.xml
.idea/**/Usage Statistics.xml
.idea/**/Deployment.xml
.idea/**/dataSources
.idea/**/dataSources.local.xml
.idea/**/databaseDrivers
.idea/**/databaseServers.xml
.idea/**/sqlDataSources.xml
.idea/**/sqlDialects.xml
.idea/**/webServers.xml
.idea/**/jsLibraryMappings.xml
# Ignore .iml files (module files) if you use Maven or Gradle
*.iml
modules.xml
.idea/modules.xml
# conlite config
/data/config/*/config.php
*.local.php
/_dev/ /_dev/
/conlite/plugins/pluginmanager/_src /conlite/plugins/pluginmanager/_src
/.project /.project
/_api/ /_api/
/cl-releasetool /cl-releasetool
/data/config/production/config.local.php
/cms/data/modules/up-download/ /cms/data/modules/up-download/
/cms/captcha/ /cms/captcha/
!/cms/data/modules/ !/cms/data/modules/
@ -14,17 +54,12 @@
!/cms/data/layouts/ !/cms/data/layouts/
/cms/data/layouts/* /cms/data/layouts/*
/conlite/includes/include.style_edit_form_1.php /conlite/includes/include.style_edit_form_1.php
/cms/config.local.php
/cms/dflip/ /cms/dflip/
/cms/js/firstlevel/ /cms/js/firstlevel/
/conlite/external/**/.git /conlite/external/**/.git
/conlite/logs/debug.log /conlite/logs/debug.log
/cms/data/config/production/config.mod_rewrite.php /cms/data/config/production/config.mod_rewrite.php
/cms/data/config/production/config.local.php
/cms/cache/* /cms/cache/*
composer.phar composer.phar
/conlite/vendor/ /conlite/vendor/
*.old.php *.old.php
/conlite/plugins/smarty/.idea/modules.xml
/conlite/plugins/smarty/.idea/smarty.iml
/conlite/plugins/smarty/.idea/workspace.xml

Datei anzeigen

@ -12,7 +12,10 @@
"php": "^8.0", "php": "^8.0",
"phpmailer/phpmailer": "v6.9.1", "phpmailer/phpmailer": "v6.9.1",
"adodb/adodb-php": "^5.22", "adodb/adodb-php": "^5.22",
"ext-zlib": "*" "ext-zlib": "*",
"ext-mysqli": "*",
"ext-dom": "*",
"ext-simplexml": "*"
}, },
"require-dev": { "require-dev": {
"phpstan/phpstan": "^1.10", "phpstan/phpstan": "^1.10",

Datei anzeigen

@ -97,6 +97,7 @@ abstract class ItemCollection extends ItemBaseAbstract
*/ */
protected $_bAllMode = false; protected $_bAllMode = false;
protected $_order; protected $_order;
protected string $lastSQL;
/** /**
* Constructor Function * Constructor Function
@ -124,6 +125,16 @@ abstract class ItemCollection extends ItemBaseAbstract
); );
} }
public function getLastSQL(): string
{
return $this->lastSQL;
}
public function setLastSQL(string $lastSQL): void
{
$this->lastSQL = $lastSQL;
}
/** /**
* Defines the reverse links for this table. * Defines the reverse links for this table.
* *
@ -656,7 +667,7 @@ abstract class ItemCollection extends ItemBaseAbstract
$sql = implode(' ', $aStatement); $sql = implode(' ', $aStatement);
$result = $this->db->query($sql); $result = $this->db->query($sql);
$this->_lastSQL = $sql; $this->lastSQL = $sql;
// @todo disable all mode in this method for the moment. It has to be verified, // @todo disable all mode in this method for the moment. It has to be verified,
// if enabling will result in negative side effects. // if enabling will result in negative side effects.
$this->_bAllMode = false; $this->_bAllMode = false;
@ -796,7 +807,7 @@ abstract class ItemCollection extends ItemBaseAbstract
$sql = 'SELECT ' . $sFields . ' FROM `' . $this->table . '`' . $sWhere $sql = 'SELECT ' . $sFields . ' FROM `' . $this->table . '`' . $sWhere
. $sGroupBy . $sOrderBy . $sLimit; . $sGroupBy . $sOrderBy . $sLimit;
$this->db->query($sql); $this->db->query($sql);
$this->_lastSQL = $sql; $this->lastSQL = $sql;
$this->_bAllMode = $this->_settings['select_all_mode']; $this->_bAllMode = $this->_settings['select_all_mode'];
if ($this->db->num_rows() == 0) { if ($this->db->num_rows() == 0) {
@ -852,7 +863,7 @@ abstract class ItemCollection extends ItemBaseAbstract
. $sFrom . $sWhere . $sGroupBy . $sOrderBy . $sLimit; . $sFrom . $sWhere . $sGroupBy . $sOrderBy . $sLimit;
$this->db->query($sql); $this->db->query($sql);
$this->_lastSQL = $sql; $this->lastSQL = $sql;
// @todo disable all mode in this method // @todo disable all mode in this method
$this->_bAllMode = false; $this->_bAllMode = false;

Datei anzeigen

@ -12,31 +12,30 @@ if (!defined('CON_FRAMEWORK')) {
class pimPluginHandler { class pimPluginHandler {
protected $_iPluginId = 0; protected int $_iPluginId = 0;
protected $_oPlugin = NULL; protected ?pimPlugin $_oPlugin = NULL;
protected $_bIsLoaded = FALSE; protected $_bIsLoaded = FALSE;
protected $_sPluginPath; protected string $_sPluginPath;
/** /**
* holds the xml of plugin.xml * holds the xml of plugin.xml
* @var SimpleXMLElement
*/ */
protected $_oPiXml = NULL; protected ?SimpleXMLElement $_oPiXml = NULL;
/** /**
* *
* @var DomDocument * @var DomDocument
*/ */
protected $_oDomDocument; protected DOMDocument $_oDomDocument;
protected $_xsd = 'plugins/pluginmanager/xml/plugin_info.xsd'; protected string $_xsd = 'plugins/pluginmanager/xml/plugin_info.xsd';
protected $_bValid = FALSE; protected bool $_bValid = false;
/** /**
* Constructor * Constructor
*/ */
public function __construct() { public function __construct() {
$this->_oDomDocument = new DOMDocument(); $this->_oDomDocument = new DOMDocument();
$this->_oDomDocument->preserveWhiteSpace = FALSE; $this->_oDomDocument->preserveWhiteSpace = false;
} }
/** /**
@ -44,7 +43,8 @@ class pimPluginHandler {
* @param int $iPluginId * @param int $iPluginId
* @return boolean * @return boolean
*/ */
public function loadPluginFromDb($iPluginId) { public function loadPluginFromDb($iPluginId): bool
{
$this->_oPlugin = new pimPlugin($iPluginId); $this->_oPlugin = new pimPlugin($iPluginId);
if ($this->_oPlugin->isLoaded()) { if ($this->_oPlugin->isLoaded()) {
$this->_iPluginId = $this->_oPlugin->get('idplugin'); $this->_iPluginId = $this->_oPlugin->get('idplugin');
@ -63,8 +63,8 @@ class pimPluginHandler {
* @param string $sPluginFolderName * @param string $sPluginFolderName
* @return boolean * @return boolean
*/ */
public function installPlugin($sPluginFolderName) { public function installPlugin(string $sPluginFolderName): bool
$iNewPluginId = 0; {
if (empty($sPluginFolderName)) { if (empty($sPluginFolderName)) {
return FALSE; return FALSE;
} }
@ -98,7 +98,8 @@ class pimPluginHandler {
* @param string $sHandleSql * @param string $sHandleSql
* @return boolean * @return boolean
*/ */
public function uninstallPlugin($sHandleSql) { public function uninstallPlugin($sHandleSql): bool
{
$oPluginUninstall = new pimSetupPluginUninstall(); $oPluginUninstall = new pimSetupPluginUninstall();
$oPluginUninstall->setPluginPath($this->_sPluginPath); $oPluginUninstall->setPluginPath($this->_sPluginPath);
return $oPluginUninstall->uninstallPlugin($this->_iPluginId, $sHandleSql); return $oPluginUninstall->uninstallPlugin($this->_iPluginId, $sHandleSql);
@ -108,40 +109,38 @@ class pimPluginHandler {
* *
* @return int * @return int
*/ */
public function getPluginId() { public function getPluginId(): int
{
return $this->_iPluginId; return $this->_iPluginId;
} }
/** /**
* *
* @param string $sFile * @param string $sFile
* @return boolean * @return boolean
* @throws pimXmlStructureException
*/ */
public function loadXmlFile($sFile) { public function loadXmlFile(string $sFile): bool
{
$this->_oDomDocument->load($sFile); $this->_oDomDocument->load($sFile);
if ($this->_validateXml()) { if ($this->_validateXml()) {
$this->_oPiXml = simplexml_load_string($this->_oDomDocument->C14N()); $this->_oPiXml = simplexml_load_string($this->_oDomDocument->C14N());
} }
return (is_a($this->_oPiXml, "SimpleXMLElement")) ? TRUE : FALSE; return is_a($this->_oPiXml, "SimpleXMLElement");
} }
/**
* public function getCfgXmlObject(): ?SimpleXMLElement
* @return object|null {
*/
public function getCfgXmlObject() {
if (is_object($this->_oPiXml)) { if (is_object($this->_oPiXml)) {
return $this->_oPiXml; return $this->_oPiXml;
} }
return NULL; return NULL;
} }
/** public function getPiGeneralArray(): array
* {
* @return array $aGeneral = [];
*/
public function getPiGeneralArray() {
$aGeneral = array();
if (is_object($this->_oPiXml)) { if (is_object($this->_oPiXml)) {
$aGeneral = $this->_xml2Array($this->_oPiXml->general); $aGeneral = $this->_xml2Array($this->_oPiXml->general);
$aDependencies = $this->_xml2Array($this->_oPiXml->dependencies); $aDependencies = $this->_xml2Array($this->_oPiXml->dependencies);
@ -157,7 +156,8 @@ class pimPluginHandler {
* @param int $iPluginId * @param int $iPluginId
* @return string * @return string
*/ */
public function getInfoInstalled($iPluginId) { public function getInfoInstalled($iPluginId): string
{
$oPlugin = new pimPlugin($iPluginId); $oPlugin = new pimPlugin($iPluginId);
if ($oPlugin->isLoaded()) { if ($oPlugin->isLoaded()) {
$oView = new pimView(); $oView = new pimView();
@ -221,7 +221,8 @@ class pimPluginHandler {
return ''; return '';
} }
protected function _getDepencyArray() { protected function _getDepencyArray(): bool|array
{
$aDependencies = array(); $aDependencies = array();
$aAttributes = array(); $aAttributes = array();
$iCountDependencies = count($this->_oPiXml->dependencies); $iCountDependencies = count($this->_oPiXml->dependencies);
@ -237,7 +238,7 @@ class pimPluginHandler {
return $aDependencies; return $aDependencies;
} }
return FALSE; return false;
} }
/** /**
@ -245,24 +246,28 @@ class pimPluginHandler {
* @return boolean * @return boolean
* @throws pimXmlStructureException * @throws pimXmlStructureException
*/ */
private function _validateXml() { private function _validateXml(): bool
{
if ($this->_oDomDocument->schemaValidate($this->_xsd)) { if ($this->_oDomDocument->schemaValidate($this->_xsd)) {
$this->_bValid = true; $this->_bValid = true;
return true; return true;
} else { } else {
return FALSE; return false;
} }
} }
/** /**
* *
* @param xml $xml * @param ?SimpleXMLElement $xml
* @return array * @return array
*/ */
private function _xml2Array($xml) { private function _xml2Array(?SimpleXMLElement $xml): array
{
if(empty($xml)) {
return [];
}
$string = json_encode($xml); $string = json_encode($xml);
$array = json_decode($string, true); return json_decode($string, true);
return $array;
} }
} }

Datei anzeigen

@ -15,6 +15,7 @@ class pimPluginCollection extends ItemCollection {
public function __construct() { public function __construct() {
global $cfg; global $cfg;
//print_r($cfg['sql']);
parent::__construct($cfg['tab']['plugins'], 'idplugin'); parent::__construct($cfg['tab']['plugins'], 'idplugin');
$this->_setItemClass("pimPlugin"); $this->_setItemClass("pimPlugin");
} }

Datei anzeigen

@ -15,10 +15,9 @@ class PluginmanagerAjax extends pimAjax {
* @param string $Request * @param string $Request
* @return string * @return string
*/ */
public function handle($Request) { public function handle($Request): string
$sString = ''; {
switch ($Request) { switch ($Request) {
// toggle active/inactive of plugins // toggle active/inactive of plugins
case 'toggle_active': case 'toggle_active':
if(!isset($_POST['plugin_id']) || empty($_POST['plugin_id'])) { if(!isset($_POST['plugin_id']) || empty($_POST['plugin_id'])) {
@ -59,9 +58,7 @@ class PluginmanagerAjax extends pimAjax {
break; break;
// install plugin with existing source in plugin dir // install plugin with existing source in plugin dir
case 'pim_install': case 'pim_install':
//sleep(3);
$iNewPluginId = 0;
$sPluginPath = cRegistry::getBackendPath() $sPluginPath = cRegistry::getBackendPath()
.cRegistry::getConfigValue('path', 'plugins') .cRegistry::getConfigValue('path', 'plugins')
.Contenido_Security::escapeDB($_POST['plugin_folder']).DIRECTORY_SEPARATOR; .Contenido_Security::escapeDB($_POST['plugin_folder']).DIRECTORY_SEPARATOR;
@ -100,5 +97,4 @@ class PluginmanagerAjax extends pimAjax {
} }
return $sString; return $sString;
} }
}
}

Datei anzeigen

@ -67,13 +67,13 @@ class pimSetupBase {
* nav sub entries * nav sub entries
* @var SimpleXMLElement * @var SimpleXMLElement
*/ */
public static $XmlNavSub; public static SimpleXMLElement $XmlNavSub;
/** /**
* content type(s) for plugin * content type(s) for plugin
* @var SimpleXMLElement * @var SimpleXMLElement
*/ */
public static $XmlContentType; public static SimpleXMLElement $XmlContentType;
/** /**
* whole xml object from info xml * whole xml object from info xml
@ -135,11 +135,10 @@ class pimSetupBase {
$this->_PimPluginCollection = new pimPluginCollection(); $this->_PimPluginCollection = new pimPluginCollection();
$this->_PimPluginRelationCollection = new pimPluginRelationCollection(); $this->_PimPluginRelationCollection = new pimPluginRelationCollection();
//print_r($this->_getAttrForTag("area"));
} }
public function setPluginPath($sPath) { public function setPluginPath($sPath): void
{
$this->_sPluginPath = $sPath; $this->_sPluginPath = $sPath;
} }
@ -151,7 +150,8 @@ class pimSetupBase {
* *
* @return boolean * @return boolean
*/ */
public function doQueries() { public function doQueries(): bool
{
if (!is_array($this->_aSql) || count($this->_aSql) <= 0) { if (!is_array($this->_aSql) || count($this->_aSql) <= 0) {
return TRUE; return TRUE;
} }
@ -177,7 +177,8 @@ class pimSetupBase {
} }
public function setXmlObject($oXml, $bSplit = TRUE) { public function setXmlObject($oXml, $bSplit = TRUE): void
{
if (is_object($oXml)) { if (is_object($oXml)) {
$this->_oXml = & $oXml; $this->_oXml = & $oXml;
} }
@ -187,7 +188,8 @@ class pimSetupBase {
} }
} }
public function setXsdFile($sFile) { public function setXsdFile($sFile): void
{
$this->_sXsdPath = $sFile; $this->_sXsdPath = $sFile;
} }
@ -197,7 +199,8 @@ class pimSetupBase {
* @param string $sTable * @param string $sTable
* @return int the next usable table id * @return int the next usable table id
*/ */
protected function _getNextId($sTable) { protected function _getNextId($sTable): int
{
cInclude("includes", "functions.database.php"); cInclude("includes", "functions.database.php");
dbUpdateSequence(cRegistry::getConfigValue("tab", "sequence"), cRegistry::getConfigValue('tab', $sTable), cRegistry::getDb()); dbUpdateSequence(cRegistry::getConfigValue("tab", "sequence"), cRegistry::getConfigValue('tab', $sTable), cRegistry::getDb());
@ -219,7 +222,8 @@ class pimSetupBase {
return Contenido_Security::toInteger($iNextId . 0); // last number is always a zero return Contenido_Security::toInteger($iNextId . 0); // last number is always a zero
} }
protected function _getAttrForTag($sTag) { protected function _getAttrForTag($sTag): bool|array
{
foreach ($this->_aXmlDefaultValues as $Key => $aValue) { foreach ($this->_aXmlDefaultValues as $Key => $aValue) {
if ($aValue['tag'] === strtoupper($sTag) && $aValue['type'] === "complete") { if ($aValue['tag'] === strtoupper($sTag) && $aValue['type'] === "complete") {
if (isset($aValue['attributes']) && is_array($aValue['attributes'])) { if (isset($aValue['attributes']) && is_array($aValue['attributes'])) {
@ -292,7 +296,7 @@ class pimSetupBase {
$oPluginColl->setWhere("executionorder", (int) $_REQUEST['new_position'], ">="); $oPluginColl->setWhere("executionorder", (int) $_REQUEST['new_position'], ">=");
$oPluginColl->query(); $oPluginColl->query();
if($oPluginColl->count() > 0) { if($oPluginColl->count() > 0) {
/* @var $oPlugin cApiPlugin */ /* @var $oPlugin pimPlugin */
while ($oPlugin = $oPluginColl->next()) { while ($oPlugin = $oPluginColl->next()) {
$iOrder = $oPlugin->get("executionorder"); $iOrder = $oPlugin->get("executionorder");
$oPlugin->set("executionorder", $iOrder++); $oPlugin->set("executionorder", $iOrder++);

Datei anzeigen

@ -8,16 +8,11 @@ class pimSetupPluginInstall extends pimSetupBase {
const SQL_FILE = "plugin_install.sql"; const SQL_FILE = "plugin_install.sql";
/**
*
* @var pimPlugin
*/
private $_oPlugin;
//helper arrays //helper arrays
private $_aAreas = array(); private array $_aAreas = [];
private $_aInstalledAreas; private array $_aInstalledAreas;
private $_aInstalledNavMain; private array $_aInstalledNavMain;
private $_aInstalledNavSub; private array $_aInstalledNavSub;
public function __construct() { public function __construct() {
parent::__construct(); parent::__construct();
@ -31,31 +26,30 @@ class pimSetupPluginInstall extends pimSetupBase {
} }
$this->_installCheckUuid(); $this->_installCheckUuid();
$this->_installCheckRequirements(); $this->_installCheckRequirements();
$oPiColl = new pimPluginCollection();
$this->_oPlugin = $oPiColl->createNewItem();
if ($this->_oPlugin->isLoaded()) { $oPiColl = new pimPluginCollection();
$this->_iPiId = $this->_oPlugin->get('idplugin'); $_oPlugin = $oPiColl->createNewItem();
if ($_oPlugin->isLoaded()) {
$this->_iPiId = $_oPlugin->get('idplugin');
$this->_insertDbEntries(); $this->_insertDbEntries();
$this->_getPluginSql(); $this->_getPluginSql();
if ($this->doQueries()) { if ($this->doQueries()) {
$this->_oPlugin->set('idclient', $this->_iClient, FALSE); $_oPlugin->set('idclient', $this->_iClient, FALSE);
$this->_oPlugin->set('name', Contenido_Security::escapeDB(self::$XmlGeneral->plugin_name)); $_oPlugin->set('name', Contenido_Security::escapeDB(self::$XmlGeneral->plugin_name));
$this->_oPlugin->set('description', Contenido_Security::escapeDB(self::$XmlGeneral->description)); $_oPlugin->set('description', Contenido_Security::escapeDB(self::$XmlGeneral->description));
$this->_oPlugin->set('author', Contenido_Security::escapeDB(self::$XmlGeneral->author)); $_oPlugin->set('author', Contenido_Security::escapeDB(self::$XmlGeneral->author));
$this->_oPlugin->set('copyright', Contenido_Security::escapeDB(self::$XmlGeneral->copyright)); $_oPlugin->set('copyright', Contenido_Security::escapeDB(self::$XmlGeneral->copyright));
$this->_oPlugin->set('mail', Contenido_Security::escapeDB(self::$XmlGeneral->mail)); $_oPlugin->set('mail', Contenido_Security::escapeDB(self::$XmlGeneral->mail));
$this->_oPlugin->set('website', Contenido_Security::escapeDB(self::$XmlGeneral->website)); $_oPlugin->set('website', Contenido_Security::escapeDB(self::$XmlGeneral->website));
$this->_oPlugin->set('version', Contenido_Security::escapeDB(self::$XmlGeneral->version)); $_oPlugin->set('version', Contenido_Security::escapeDB(self::$XmlGeneral->version));
$this->_oPlugin->set('folder', Contenido_Security::escapeDB(self::$XmlGeneral->plugin_foldername)); $_oPlugin->set('folder', Contenido_Security::escapeDB(self::$XmlGeneral->plugin_foldername));
$this->_oPlugin->set('uuid', Contenido_Security::escapeDB(self::$XmlGeneral->uuid)); $_oPlugin->set('uuid', Contenido_Security::escapeDB(self::$XmlGeneral->uuid));
$this->_oPlugin->set('executionorder', $this->_updateSortOrder(), FALSE); $_oPlugin->set('executionorder', $this->_updateSortOrder(), FALSE);
$this->_oPlugin->set('installed', date('Y-m-d H:i:s'), FALSE); $_oPlugin->set('installed', date('Y-m-d H:i:s'), FALSE);
$this->_oPlugin->set('active', (int) self::$XmlGeneral['active'], FALSE); $_oPlugin->set('active', (int) self::$XmlGeneral['active'], FALSE);
if ($this->_oPlugin->store()) { if ($_oPlugin->store()) {
//echo "stored: ".$this->_iPiId;
return $this->_iPiId; return $this->_iPiId;
} }
} else { } else {
@ -245,7 +239,10 @@ class pimSetupPluginInstall extends pimSetupBase {
} }
private function _addNavSub() { private function _addNavSub() {
$aAttributes = array(); $aDefaultAttr = array(
'online' => 1
);
$this->_initInstalledNavMainArray(); $this->_initInstalledNavMainArray();
$iCountNavSub = (is_countable(self::$XmlNavSub->nav))?count(self::$XmlNavSub->nav):0; $iCountNavSub = (is_countable(self::$XmlNavSub->nav))?count(self::$XmlNavSub->nav):0;
@ -253,16 +250,21 @@ class pimSetupPluginInstall extends pimSetupBase {
$oNavSubColl = new cApiNavSubCollection(); $oNavSubColl = new cApiNavSubCollection();
for ($i = 0; $i < $iCountNavSub; $i++) { for ($i = 0; $i < $iCountNavSub; $i++) {
$aAttributes = [];
$sLocation = cSecurity::escapeString(self::$XmlNavSub->nav[$i]); $sLocation = cSecurity::escapeString(self::$XmlNavSub->nav[$i]);
if (empty($sLocation)) { if (empty($sLocation)) {
parent::error(i18n('There seem to be an empty sub navigation entry in plugin.xml. Please contact your plugin author.', 'pluginmanager'), $this->_iPiId); parent::error(i18n('There seem to be an empty sub navigation entry in plugin.xml. Please contact your plugin author.', 'pluginmanager'), $this->_iPiId);
} }
// Build attributes with security checks // Build attributes with security checks
foreach (self::$XmlNavSub->nav[$i]->attributes() as $sKey => $sValue) { foreach (self::$XmlNavSub->nav[$i]->attributes() as $sKey => $sValue) {
$aAttributes[$sKey] = cSecurity::escapeString($sValue); $aAttributes[$sKey] = cSecurity::escapeString($sValue);
} }
$aAttributes = array_merge($aDefaultAttr, array_filter($aAttributes, function($x) { return !(is_null($x) || $x === false); }));
/* @var $oNavSub cApiNavSub */ /* @var $oNavSub cApiNavSub */
$oNavSub = $oNavSubColl->createNewItem($this->_getNextId("nav_sub")); $oNavSub = $oNavSubColl->createNewItem($this->_getNextId("nav_sub"));
if ($oNavSub->isLoaded()) { if ($oNavSub->isLoaded()) {
@ -272,7 +274,7 @@ class pimSetupPluginInstall extends pimSetupBase {
$oNavSub->set("idarea", $this->_getIdForArea($aAttributes['area'])); $oNavSub->set("idarea", $this->_getIdForArea($aAttributes['area']));
$oNavSub->set("level", (int) $aAttributes['level']); $oNavSub->set("level", (int) $aAttributes['level']);
$oNavSub->set("location", $sLocation, FALSE); $oNavSub->set("location", $sLocation, FALSE);
$oNavSub->set("online", 1, FALSE); $oNavSub->set("online", (int) $aAttributes['online'], FALSE);
$oNavSub->store(); $oNavSub->store();
} }
@ -361,7 +363,8 @@ class pimSetupPluginInstall extends pimSetupBase {
*/ */
} }
private function _initInstalledAreasArray() { private function _initInstalledAreasArray(): void
{
$this->_aInstalledAreas = array(); $this->_aInstalledAreas = array();
$oAreaColl = new cApiAreaCollection(); $oAreaColl = new cApiAreaCollection();
$oAreaColl->select(); $oAreaColl->select();
@ -370,26 +373,25 @@ class pimSetupPluginInstall extends pimSetupBase {
while ($oArea = $oAreaColl->next()) { while ($oArea = $oAreaColl->next()) {
$this->_aInstalledAreas[] = $oArea->get('name'); $this->_aInstalledAreas[] = $oArea->get('name');
} }
//print_r($this->_aInstalledAreas);
} }
private function _initInstalledNavMainArray() { private function _initInstalledNavMainArray(): void
{
$this->_aInstalledNavMain = array(); $this->_aInstalledNavMain = array();
$oNavMainColl = new cApiNavMainCollection(); $oNavMainColl = new cApiNavMainCollection();
$oNavMainColl->select(); $oNavMainColl->select();
//$oNavMainColl->query(); /* @var $oNavMain cApiNavMain */
/* @var $oArea cApiArea */
while ($oNavMain = $oNavMainColl->next()) { while ($oNavMain = $oNavMainColl->next()) {
$this->_aInstalledNavMain[$oNavMain->get('name')] = $oNavMain->get('idnavm'); $this->_aInstalledNavMain[$oNavMain->get('name')] = $oNavMain->get('idnavm');
} }
} }
private function _initInstalledNavSubArray() { private function _initInstalledNavSubArray(): void
{
$this->_aInstalledNavSub = array(); $this->_aInstalledNavSub = array();
$oNavSubColl = new cApiNavSubCollection(); $oNavSubColl = new cApiNavSubCollection();
$oNavSubColl->select(); $oNavSubColl->select();
//$oNavSubColl->query(); /* @var $oNavSub cApiNavSub */
/* @var $oArea cApiArea */
while ($oNavSub = $oNavSubColl->next()) { while ($oNavSub = $oNavSubColl->next()) {
$this->_aInstalledNavMain[$oNavSub->get('idnavsub')] = $oNavSub->get('name'); $this->_aInstalledNavMain[$oNavSub->get('idnavsub')] = $oNavSub->get('name');
} }
@ -424,5 +426,4 @@ class pimSetupPluginInstall extends pimSetupBase {
//echo "<pre>"; //echo "<pre>";
//print_r($this->_aAreas); //print_r($this->_aAreas);
} }
} }

Datei anzeigen

@ -23,6 +23,7 @@ $aMessages = [];
$oPage = new cPage(); $oPage = new cPage();
$oPage->sendNoCacheHeaders(); $oPage->sendNoCacheHeaders();
$oPage->setEncoding('UTF-8');
$oPage->setHtml5(); $oPage->setHtml5();
$oPage->addCssFile("plugins/pluginmanager/css/pluginmanager.css"); $oPage->addCssFile("plugins/pluginmanager/css/pluginmanager.css");
$oPage->addJsFile("plugins/pluginmanager/scripts/jquery.plainoverlay.js"); $oPage->addJsFile("plugins/pluginmanager/scripts/jquery.plainoverlay.js");
@ -38,7 +39,7 @@ if (!$perm->isSysadmin()) {
} }
// check disable plugin var // check disable plugin var
if ($cfg['debug']['disable_plugins'] === true) { if (cRegistry::getConfigValue('debug', 'disable_plugins') === true) {
$oPage->setContent($Notification->returnNotification(Contenido_Notification::LEVEL_WARNING, i18n('Currently the plugin system is disabled via configuration', "pluginmanager"))); $oPage->setContent($Notification->returnNotification(Contenido_Notification::LEVEL_WARNING, i18n('Currently the plugin system is disabled via configuration', "pluginmanager")));
$oPage->render(); $oPage->render();
die(); die();

Datei anzeigen

@ -162,6 +162,7 @@
<xsd:extension base="xsd:string"> <xsd:extension base="xsd:string">
<xsd:attribute name="area" type="xsd:string" use="required" /> <xsd:attribute name="area" type="xsd:string" use="required" />
<xsd:attribute name="level" type="xsd:integer" use="required" /> <xsd:attribute name="level" type="xsd:integer" use="required" />
<xsd:attribute name="online" type="xsd:integer" default="1" />
<xsd:attribute name="navm" /> <xsd:attribute name="navm" />
</xsd:extension> </xsd:extension>
</xsd:simpleContent> </xsd:simpleContent>