modify mod modFileEdit

Dieser Commit ist enthalten in:
Ortwin Pinke 2022-10-25 20:28:00 +02:00
Ursprung 1ad477e427
Commit 10725d7234
4 geänderte Dateien mit 22 neuen und 32 gelöschten Zeilen

Datei anzeigen

@ -119,7 +119,8 @@ class cApiModule extends Item {
* @param mixed $mId Specifies the ID of item to load
*/
public function __construct($mId = false) {
global $cfg, $cfgClient, $client;
$cfg = cRegistry::getConfig();
$cfgClient = cRegistry::getClientConfig(cRegistry::getClientId());
parent::__construct($cfg["tab"]["mod"], "idmod");
@ -129,15 +130,17 @@ class cApiModule extends Item {
// (data not from a form field)
$this->setFilters(array(), array());
$this->_packageStructure = array("jsfiles" => $cfgClient[$client]["js"]["path"],
"tplfiles" => $cfgClient[$client]["tpl"]["path"],
"cssfiles" => $cfgClient[$client]["css"]["path"]);
$this->_packageStructure = array(
"jsfiles" => $cfgClient["js"]["path"],
"tplfiles" => $cfgClient["tpl"]["path"],
"cssfiles" => $cfgClient["css"]["path"]
);
if (isset($cfg['dceModEdit']) && is_array($cfg['dceModEdit'])) {
$this->_aModFileEditConf['clientPath'] = $cfgClient[$client]["path"]["frontend"];
$this->_aModFileEditConf['clientPath'] = $cfgClient["path"]["frontend"];
$this->_aModFileEditConf = array_merge($this->_aModFileEditConf, $cfg['dceModEdit']);
if (!isset($cfg['dceModEdit']['modPath']) || empty($cfg['dceModEdit']['modPath'])) {
$this->_aModFileEditConf['modPath'] = $cfgClient[$client]["path"]["frontend"]
$this->_aModFileEditConf['modPath'] = $cfgClient["path"]["frontend"]
. $this->_aModFileEditConf['modFolderName'] . "/";
}
}
@ -376,6 +379,8 @@ class cApiModule extends Item {
/**
* Checks if the module is a pre-4.3 module
* @return boolean true if this module is an old one
*
* @deprecated since version 2.0
*/
public function isOldModule() {
// Keywords to scan

Datei anzeigen

@ -237,32 +237,17 @@ function conGenerateCode($idcat, $idart, $lang, $client, $layout = false) {
$a_container = explode("&", $tmp_returnstring);
foreach ($a_container as $key => $value) {
$sql = "SELECT output, template, name FROM " . $cfg["tab"]["mod"] . " WHERE idmod='" . $a_d[$value] . "'";
$db->query($sql);
$db->next_record();
if (is_numeric($a_d[$value])) {
$thisModule = '<?php $cCurrentModule = ' . ((int) $a_d[$value]) . '; ?>';
$thisContainer = '<?php $cCurrentContainer = ' . ((int) $value) . '; ?>';
}
/* dceModFileEdit (c)2009 www.dceonline.de */
if ($cfg['dceModEdit']['use']
&& ($cfg['dceModEdit']['allModsFromFile'] == true
|| in_array((int) $a_d[$value], $cfg['dceModEdit']['modsFromFile']))) {
cInclude('classes', 'contenido/class.module.php');
$tmpModule = new cApiModule;
$tmpModule->loadByPrimaryKey($a_d[$value]);
$output = $thisModule . $thisContainer . $tmpModule->get("output");
unset($tmpModule);
} else {
$output = $thisModule . $thisContainer . $db->f("output");
}
/* dceModFileEdit (c)2009 www.dceonline.de */
$output = AddSlashes($output) . "\n";
$template = $db->f("template");
$oModule = new cApiModule($a_d[$value]);
$output = $thisModule . $thisContainer . $oModule->get("output");
$template = $oModule->get("template");
$output = AddSlashes($output) . "\n";
$varstring = array();
if (!empty($a_c[$value])) {
@ -297,7 +282,7 @@ function conGenerateCode($idcat, $idart, $lang, $client, $layout = false) {
$fedebug .= "Container: CMS_CONTAINER[$value]" . '\\\\n';
}
if ($frontend_debug["module_display"] == true) {
$fedebug .= "Modul: " . $db->f("name") . '\\\\n';
$fedebug .= "Modul: " . $oModule->get("name") . '\\\\n';
}
if ($frontend_debug["module_timing_summary"] == true || $frontend_debug["module_timing"] == true) {
$fedebug .= 'Eval-Time: $modtime' . $value . '\\\\n';
@ -311,7 +296,7 @@ function conGenerateCode($idcat, $idart, $lang, $client, $layout = false) {
if ($frontend_debug["module_timing_summary"] == true) {
$output .= addslashes(' <?php $cModuleTimes["' . $value . '"] = $modtime' . $value . '; ?>');
$output .= addslashes(' <?php $cModuleNames["' . $value . '"] = "' . addslashes($db->f("name")) . '"; ?>');
$output .= addslashes(' <?php $cModuleNames["' . $value . '"] = "' . addslashes($oModule->get("name")) . '"; ?>');
}
/* Replace new containers */
$code = preg_replace("/<container( +)id=\\\\\"$value\\\\\"(.*)>(.*)<\/container>/Uis", "CMS_CONTAINER[$value]", $code);

Datei anzeigen

@ -357,7 +357,7 @@ function insertTab(event, obj) {
$page->setReload();
}
}
/* dceModFileEdit (c)2009-2011 www.dceonline.de */
if ($cfg['dceModEdit']['use']) {
// button for mod folder creation
if (!$module->hasModuleFolder() && $action != "mod_new") {
@ -380,7 +380,7 @@ function insertTab(event, obj) {
} else {
$form->add(i18n("Name"), $name->render());
}
/* End dceModFileEdit (c)2009-2011 www.dceonline.de */
$form->add(i18n("Type"), $typeselect->render() . $custom->render());
$form->add(i18n("Description"), $descr->render());

@ -1 +1 @@
Subproject commit 06cc337092ed649df1ec738816ba6a3e59a8af0b
Subproject commit 3217b73d08e1b76193f02d2d912134320ef40bfe