[Gelöst] 2x gleicher Modulinput in 1 Vorlage: Interaktiv...

Fragen zur Installation von CONTENIDO 4.9? Probleme bei der Konfiguration? Hinweise oder Fragen zur Entwicklung des Systemes oder zur Sicherheit?
Antworten
homtata
Beiträge: 1142
Registriert: Mi 14. Jan 2004, 14:41
Kontaktdaten:

[Gelöst] 2x gleicher Modulinput in 1 Vorlage: Interaktiv...

Beitrag von homtata » So 8. Sep 2013, 23:11

Hallo,

ich habe mein umgeschriebenes Lightboxgalerie-Modul auf einer Seite 2x eingehängt. Wenn ich nun einen Artikel über die Vorlage konfigurieren will, dann spinnt die Anzeige des Inputbereichs im 2. Container. Lösche ich den Input des 1. Containers, stimmt der Zweite... Wie kann das jetzt wieder sein? Ich dachte, diese Bereiche laufen komplett getrennt pro Modul??

Hier mein Input:

Code: Alles auswählen

?><?php

/**
 *
 * @package Module
 * @subpackage OutputSetsOfImages
 * @version SVN Revision $Rev:$
 *
 * @author info@tone2tone.com
 * @copyright TONE2TONE e.K., Viktor Lehmann
 * @link http://www.tone2tone.com
 * Thanks to creators of former similar modules for code snippets and ideas
 */

$db = cRegistry::getDb();
$cfg = cRegistry::getConfig();
$client = cRegistry::getClientId();
$cfgClient = cRegistry::getClientConfig();


// prepare pre-configured values
$selected_dir = "CMS_VALUE[4]";
$selectDir    = "CMS_VAR[4]";
$selected_tpl = "CMS_VALUE[12]";
$selectTpl    = "CMS_VAR[12]";
if ( "CMS_VALUE[5]" != "DESC" ) $sort_checked_asc = "checked"; else $sort_checked_descc = "checked"; 
if ( "CMS_VALUE[9]" != "yes" ) $random_checked_nein = "checked"; else $random_checked_ja = "checked"; 

// find Smarty-Templates which belong to THIS module by scanning the appropriate subdir
$mod = new cApiModule($cCurrentModule);
$tplpath = $cfgClient[$client]["path"]["frontend"]."data/modules/".$mod->get("alias")."/template/";
$tplFiles = scanDirectory($tplpath, $bRecursive);
array_multisort($tplFiles, "SORT_ASC", SORT_STRING);

	
$oUploadColl = new cApiUploadCollection();
$oUploadColl->flexSelect('dirname', '', 'idclient=' . $client, 'dirname');

// construct the HTML
$table = new cHTMLTable();
//first row
$tr = new cHTMLTableRow();
$td = new cHTMLTableData();
$td->setContent(mi18n("choose_tree"));
$fillrow[] = $td;
$td = new cHTMLTableData();
$select = new cHTMLSelectElement($selectDir);

$option = new cHTMLOptionElement(mi18n("please_choose"), "");
$select->appendOptionElement($option);
while ($oUploadItem = $oUploadColl->next()) {
	$dirname = $oUploadItem->get('dirname');
	
    $option = new cHTMLOptionElement($dirname, $dirname);
    if ($selected_dir == $dirname) {
        $option->setSelected(true);
    }
    $select->appendOptionElement($option);
}
$td->setContent($select);
$fillrow[] = $td;
$tr->setContent($fillrow);
$filltable[] = $tr;

//start next row with columns/rows input
$fillrow = array();
$tr = new cHTMLTableRow();
$td = new cHTMLTableData();
$td->setContent(mi18n("label_colums_rows_max"));
$fillrow[] = $td;
$td = new cHTMLTableData();
$input = new cHTMLTextbox("CMS_VAR[2]", "CMS_VALUE[2]",'4','3','columns',false,null,'');
$td->setContent($input);
$input2 = new cHTMLTextbox("CMS_VAR[3]", "CMS_VALUE[3]",'4','3','rows',false,null,'');
$td->setContent($input." x ".$input2);
$fillrow[] = $td;
$tr->setContent($fillrow);
$filltable[] = $tr;

//start next row with scaling info
$fillrow = array();
$tr = new cHTMLTableRow();
$td = new cHTMLTableData();
$td->setContent(mi18n("label_scale"));
$fillrow[] = $td;
$td = new cHTMLTableData();
$input = new cHTMLTextbox("CMS_VAR[0]", "CMS_VALUE[0]",'4','3','max_width_scale',false,null,'');
$td->setContent($input);
$input2 = new cHTMLTextbox("CMS_VAR[1]", "CMS_VALUE[1]",'4','3','max_height_scale',false,null,'');
$td->setContent($input." x ".$input2);
$fillrow[] = $td;
$tr->setContent($fillrow);
$filltable[] = $tr;

//start next row with cropping info
$fillrow = array();
$tr = new cHTMLTableRow();
$td = new cHTMLTableData();
$td->setContent(mi18n("label_crop"));
$fillrow[] = $td;
$td = new cHTMLTableData();
$input = new cHTMLTextbox("CMS_VAR[7]", "CMS_VALUE[7]",'4','3','max_width_crop',false,null,'');
$td->setContent($input);
$input2 = new cHTMLTextbox("CMS_VAR[8]", "CMS_VALUE[8]",'4','3','max_height_crop',false,null,'');
$td->setContent($input." x ".$input2);
$fillrow[] = $td;
$tr->setContent($fillrow);
$filltable[] = $tr;

//start next row with popup image info
$fillrow = array();
$tr = new cHTMLTableRow();
$td = new cHTMLTableData();
$td->setContent(mi18n("label_popup"));
$fillrow[] = $td;
$td = new cHTMLTableData();
$input = new cHTMLTextbox("CMS_VAR[10]", "CMS_VALUE[10]",'4','3','max_width_popup',false,null,'');
$td->setContent($input);
$input2 = new cHTMLTextbox("CMS_VAR[11]", "CMS_VALUE[11]",'4','3','max_height_popup',false,null,'');
$td->setContent($input." x ".$input2);
$fillrow[] = $td;
$tr->setContent($fillrow);
$filltable[] = $tr;

//start next row with sorting info
$fillrow = array();
$tr = new cHTMLTableRow();
$td = new cHTMLTableData();
$td->setContent(mi18n("label_sort"));
$fillrow[] = $td;
$td = new cHTMLTableData();
$input = new cHTMLRadiobutton("CMS_VAR[5]", 'ASC', '', $sort_checked_asc);
$input->setLabelText(mi18n("value_ascending"));
$td->setContent($input);
$input2 = new cHTMLRadiobutton("CMS_VAR[5]", 'DESC', '', $sort_checked_desc);
$input2->setLabelText(mi18n("value_descending"));
$td->setContent($input."  ".$input2);
$fillrow[] = $td;
$tr->setContent($fillrow);
$filltable[] = $tr;

//start next row with randomizer info
$fillrow = array();
$tr = new cHTMLTableRow();
$td = new cHTMLTableData();
$td->setContent(mi18n("label_randomizer"));
$fillrow[] = $td;
$td = new cHTMLTableData();
$input = new cHTMLRadiobutton("CMS_VAR[9]", 'no', '', $random_checked_nein);
$input->setLabelText(mi18n("value_no"));
$td->setContent($input);
$input2 = new cHTMLRadiobutton("CMS_VAR[9]", 'yes', '', $random_checked_ja);
$input2->setLabelText(mi18n("value_yes"));
$td->setContent($input."  ".$input2);
$fillrow[] = $td;
$tr->setContent($fillrow);
$filltable[] = $tr;

//start next row with Template info
$fillrow = array();
$tr = new cHTMLTableRow();
$td = new cHTMLTableData();
$td->setContent(mi18n("label_template"));
$fillrow[] = $td;
$td = new cHTMLTableData();
$select = new cHTMLSelectElement($selectTpl);

$option = new cHTMLOptionElement(mi18n("please_choose"), "");
$select->appendOptionElement($option);
foreach ($tplFiles AS $key=>$value) {
	$value = str_replace($tplpath, "", $value);

	$option = new cHTMLOptionElement($value, $value);
    if ($selected_tpl == $value) {
        $option->setSelected(true);
    }
    $select->appendOptionElement($option);
}

$td->setContent($select);
$fillrow[] = $td;
$tr->setContent($fillrow);
$filltable[] = $tr;

// put all rows in the table
$table->setContent($filltable);

// echo the whole HTML
echo $table->render();

?><?php
Ich habe auch schon alle möglichen Variablen nochmal neu instanziert: $table, $fillrow, $filltable.. nutzt alles nix. Ich sehe den Inputbereich quasi doppelt, manche Elemente sogar dreifach!

Hat jemand Ideen?


***** Gelöst:
Es war doch mein eigener Modulcode: einige Arrays müssen sauber neu instanziert werden und sind sonst nicht leer - Inhalte werden ins neue Modul geschleppt.
Unter der Zeile

Code: Alles auswählen

//construct the HTML
muss noch ergänzt werden:

Code: Alles auswählen

$filltable = array();
$fillrow   = array();
Das fehlt in allen meinen kürzlich online gestellten Modulen, muss ich noch anpassen.

Antworten