ich habe eben beim Aufräumen ein Modul gefunden. Es wurde vor ca. 2 Jahren für einen Kunden benötigt.
Beispiel: http://conmods.ralf-fleischer.de/cms/fr ... =54&lang=1
Funktion:
Im Inputbereich kann man eine unbegrenzte Anzahl von Arccordionbereichen einstellen.
Im Editor hat man dann dementsprechend pro Bereich einmal eine Headline (CMS_HEAD) und einen Textbereich(CMS_HTML).
Diese kann man dann einfach per Editor mit Text oder Bildern füllen.
Im Frontend erfolgt die Ausgabe der Bereiche dann als Accordion.
Die Grundlage ist jQuery Accordion siehe:
http://docs.jquery.com/UI/Accordion
Wobei nicht alle Funktionen eingearbeitet wurden.
Hinterlegt ist momentan Autoheight, Animation und Mouseover zum öffnen.
Im Output sind die benötigten jQuery Dateien als externe verlinkt:
Code: Alles auswählen
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
Input:
Code: Alles auswählen
?><?php
/***********************************************
* Dynamisches CMS_HTML und CMS_HTMLHEAD jQuery Accordion
*
* Inputbereich
*
* Author : Ralf Fleischer
* Copyright : Werbung R. Fleischer.de
* Mail : werbung@ralf-fleischer.de
* Created : 01-06-2010
* Version : 0.0.1
************************************************/
$sSubmitLink = '<a href="javascript:if (document.tplcfgform.send) {document.tplcfgform.send.value = 0}; document.tplcfgform.submit();"><img src="images/submit.gif" /></a>';
$sSubmitOnchange='javascript:if (document.tplcfgform.send) {document.tplcfgform.send.value = 0}; document.tplcfgform.submit();';
?>
<table style="border:1px solid #e2e2e2" cellpadding="0" cellspacing="0" border="0">
<tr>
<td> <?php echo mi18n("Anzahl der Bereiche:");?> </td>
<td style="border-left:1px solid #e2e2e2;" colspan="3"> <input type="text" name="CMS_VAR[10]" value="CMS_VALUE[10]" size="3" /> </td>
</tr>
<tr>
<td> <?php echo mi18n("StartId (Bsp: 5 für CMS_HTML[5]):");?> </td>
<td style="border-left:1px solid #e2e2e2;" colspan="3"> <input type="text" name="CMS_VAR[11]" value="CMS_VALUE[11]" size="3" /> </td>
</tr>
<tr>
<td> <?php echo mi18n("Startfenster (Bsp: 1 für zweites geöffnet):");?> </td>
<td style="border-left:1px solid #e2e2e2;" colspan="3"> <input type="text" name="CMS_VAR[12]" value="CMS_VALUE[12]" size="3" /> <?php echo mi18n("(Zahlen oder false um alle beim laden zu schließen)");?> </td>
</tr>
<tr>
<td> <?php echo mi18n("Animation:");?> </td>
<td style="border-left:1px solid #e2e2e2;" colspan="3"> <input <?php if("CMS_VALUE[13]"==true){echo "checked=\"checked\"";}?> type="checkbox" name="CMS_VAR[13]" value="true" /> </td>
</tr>
<tr>
<td> <?php echo mi18n("Automatische Höhe:");?> </td>
<td style="border-left:1px solid #e2e2e2;" colspan="3"> <input <?php if("CMS_VALUE[14]"==true){echo "checked=\"checked\"";}?> type="checkbox" name="CMS_VAR[14]" value="true" /> </td>
</tr>
<tr>
<td> <?php echo mi18n("Event Mouseover:");?> </td>
<td style="border-left:1px solid #e2e2e2;" colspan="3"> <input <?php if("CMS_VALUE[15]"==true){echo "checked=\"checked\"";}?> type="checkbox" name="CMS_VAR[15]" value="true" /> </td>
</tr>
<tr>
<td align="right" style="background:#f1f1f1;border-top:1px solid #e2e2e2;border-bottom:1px solid #e2e2e2;"> Speichern </td>
<td colspan="3" style="background:#f1f1f1;border-left:1px solid #e2e2e2;border-top:1px solid #e2e2e2;border-bottom:1px solid #e2e2e2;"> <?php echo $sSubmitLink;?> </td>
</tr>
</table>
<?php
Code: Alles auswählen
<?php
/***********************************************
* Dynamisches CMS_HTML und CMS_HTMLHEAD jQuery Accordion
*
* Outputbereich
*
* Author : Ralf Fleischer
* Copyright : Werbung R. Fleischer.de
* Mail : werbung@ralf-fleischer.de
* Created : 01-06-2010
* Version : 0.0.1
************************************************/
########################################################
################## Benötigte Variablen #################
########################################################
$fValueOut="CMS_VALUE[10]";
$fValueStartId="CMS_VALUE[11]";
$fActive="CMS_VALUE[12]";
$fBounceslide="CMS_VALUE[13]";
$fAutoHeight="CMS_VALUE[14]";
$fEvent="CMS_VALUE[15]";
if($fValueOut==""){$fValueOut=1;}
if($fValueStartId==""){$fValueStartId=2;}
if($fActive==""){$fActive=1;}
if($fBounceslide==true){$fBounceslide="bounceslide";}else{$fBounceslide="slide";}
if($fAutoHeight==true){$fAutoHeight="true";}else{$fAutoHeight="false";}
if($fEvent==true){$fEvent="mouseover";}else{$fEvent="click";}
########################################################
################## Contenido Includes ##################
########################################################
cInclude("includes", "functions.general.php");
cInclude("includes", "functions.lang.php");
cInclude("classes", "class.htmlelements.php");
################################################
################## Funktionen ##################
################################################
// Container erstellen
if (!function_exists('make_cms_type')) {
function make_cms_type( $container_type, $container_id ) {
global $a_content, $idartlang, $idart, $idcat, $lang, $db, $edit, $sess, $client, $cfg, $cfgClient;
$sql = "SELECT * FROM ".$cfg["tab"]["type"]." WHERE type = '$container_type'";
$db->query($sql);
$db->next_record();
$cms_code = $db->f("code");
$cms_idtype = $db->f("idtype");
if( !$edit ) {
$db2 = new DB_Contenido;
$sql = "SELECT * FROM ".$cfg["tab"]["content"]." AS A, ".$cfg["tab"]["art_lang"]." AS B, ".$cfg["tab"]["type"]." AS C
WHERE A.idtype = C.idtype AND A.idartlang = B.idartlang AND B.idart = '".Contenido_Security::toInteger($idart)."' AND B.idlang = '".Contenido_Security::escapeDB($lang, $db)."' AND
A.idtype = '".$cms_idtype."' AND A.typeid = '".$container_id."'";
$db2->query($sql);
$db2->next_record();
$a_content[$db2->f("type")][$db2->f("typeid")] = $db2->f("value");
}
$val = $container_id;
eval($cms_code);
$tmp_output = str_replace('\\\"','"',$tmp);
$tmp_output = stripslashes($tmp_output);
return $tmp_output;
}
}
################################################
################## Javascript ##################
################################################
if(!$contenido){
?>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<script>
$(document).ready(function() {
$("#accordion").accordion({
active: <?php echo $fActive; ?>,
animated: '<?php echo $fBounceslide; ?>',
autoHeight: <?php echo $fAutoHeight; ?>,
event: '<?php echo $fEvent; ?>'
});
});
</script>
<?php
$LinkStart="<a href=\"#\">";
$LinkEnde="</a>";
}
####################################################
################## Ausgabe Felder ##################
####################################################
?>
<div id="accordion">
<?php
for($i=1;$i<=$fValueOut;$i++){ ?>
<h3><?php echo $LinkStart.make_cms_type("CMS_HTMLHEAD",$fValueStartId+$i).$LinkEnde; ?></h3>
<div><?php echo make_cms_type("CMS_HTML",$fValueStartId+$i); ?></div>
<?php
}
?>
</div>
Ralf