hier ein neues Modul "Accordion" das yodatortenboxer entwickelt hat und wir können dies im Forum veröffentlichen.
Das Modul ist aufgebaut auf der Grundlage vom Modul "xtcDynCmsContainer".
http://www.werbeagentur-usedom.de/xtend ... ainer.html
Die Installaltion ist sehr einfach. Das Modul importieren, ins Template zuordnen und die js- und css-Dateien in die entsprechenden Verzeichnisse kopieren.
Zu sehen unter http://neu.frauenarzt-kl.de/ bei den Sprechzeiten.
Hier der Input:
Code: Alles auswählen
?><?php
/***********************************************
* Dynamisches CMS_HTML und CMS_HTMLHEAD jQuery Accordeon
*
* Inputbereich
*
* Author : Ralf Fleischer
* Copyright : xtended cooperation
* Mail : info@xtended-coperation.de
* Created : 01-12-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" /> </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 Accordeon
*
* Outputbereich
*
* Author : Ralf Fleischer
* Copyright : xtended cooperation
* Mail : info@xtended-coperation.de
* Created : 01-12-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 ##################
################################################
function xtcCmsHtmlHeadjQueryAccordeon($val){
global $db;
global $client;
global $lang;
global $cfg;
global $area_tree;
global $sess;
global $perm;
global $area_rights;
global $item_rights;
global $_SESSION;
global $remakeCatTable;
global $remakeStrTable;
global $auth;
global $tpl;
global $edit;
global $a_content;
global $idartlang;
global $idcat;
global $idart;
/**
* CMS_HTMLHEAD
*/
$tmp = $a_content['CMS_HTMLHEAD'][$val];
$tmp = urldecode($tmp);
if ($edit) {
if ($tmp == "") {
$tmp = " ";
}
$insiteEditingDIV = new cHTMLDiv;
$insiteEditingDIV->setId("HTMLHEAD_".$db->f("idtype")."_".$val);
$insiteEditingDIV->setEvent("Focus", "this.style.border='1px solid #bb5577';");
$insiteEditingDIV->setEvent("Blur", "this.style.border='1px dashed #bfbfbf';");
$insiteEditingDIV->setStyleDefinition("border", "1px dashed #bfbfbf");
$insiteEditingDIV->setStyleDefinition("direction", langGetTextDirection($lang));
$insiteEditingDIV->updateAttributes(array("contentEditable" => "true"));
$insiteEditingDIV->setContent("_REPLACEMENT_");
/* Edit anchor and image */
$editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_HTMLHEAD&typenr=$val");
$editAnchor = new cHTMLLink;
$editAnchor->setLink("javascript:setcontent('$idartlang','" . $editLink . "');");
$editButton = new cHTMLImage;
$editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_edithead.gif");
$editButton->setBorder(0);
$editButton->setStyleDefinition("margin-right", "2px");
$editAnchor->setContent($editButton);
/* Save anchor and image */
$saveAnchor = new cHTMLLink;
$saveAnchor->setLink("javascript:setcontent('$idartlang','0')");
$saveButton = new cHTMLImage;
$saveButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_ok.gif");
$saveButton->setBorder(0);
$saveAnchor->setContent($saveButton);
/* Process for output with echo */
$finalEditButton = $editAnchor->render();
$finalEditingDiv = $insiteEditingDIV->render();
$finalEditingDiv = str_replace("_REPLACEMENT_", $tmp, $finalEditingDiv);
$finalSaveButton = $saveAnchor->render();
return $finalEditingDiv . $finalEditButton . $finalSaveButton;
}else{
$text = new Article($idart, $client, $lang);
$msgText = $text->getContent("CMS_HTMLHEAD", $val);
return $msgText;
}
}
function xtcCmsHtmljQueryAccordeon($val){
global $db;
global $client;
global $lang;
global $cfg;
global $area_tree;
global $sess;
global $perm;
global $area_rights;
global $item_rights;
global $_SESSION;
global $remakeCatTable;
global $remakeStrTable;
global $auth;
global $tpl;
global $edit;
global $a_content;
global $idartlang;
global $idcat;
global $idart;
/**
* CMS_HTML
*/
$tmp = $a_content['CMS_HTML'][$val];
$tmp = urldecode($tmp);
if ($edit) {
if ($tmp == "") {
$tmp = " ";
}
$insiteEditingDIV = new cHTMLDiv;
$insiteEditingDIV->setId("HTML_".$db->f("idtype")."_".$val);
$insiteEditingDIV->setEvent("Focus", "this.style.border='1px solid #bb5577';");
$insiteEditingDIV->setEvent("Blur", "this.style.border='1px dashed #bfbfbf';");
$insiteEditingDIV->setStyleDefinition("border", "1px dashed #bfbfbf");
$insiteEditingDIV->setStyleDefinition("direction", langGetTextDirection($lang));
$insiteEditingDIV->updateAttributes(array("contentEditable" => "true"));
$insiteEditingDIV->setContent("_REPLACEMENT_");
/* Edit anchor and image */
$editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_HTML&typenr=$val");
$editAnchor = new cHTMLLink;
$editAnchor->setLink("javascript:setcontent('$idartlang','" . $editLink . "');");
$editButton = new cHTMLImage;
$editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_edithtml.gif");
$editButton->setBorder(0);
$editButton->setStyleDefinition("margin-right", "2px");
$editAnchor->setContent($editButton);
/* Save anchor and image */
$saveAnchor = new cHTMLLink;
$saveAnchor->setLink("javascript:setcontent('$idartlang','0')");
$saveButton = new cHTMLImage;
$saveButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_ok.gif");
$saveButton->setBorder(0);
$saveAnchor->setContent($saveButton);
/* Process for output with echo */
$finalEditButton = $editAnchor->render();
$finalEditingDiv = $insiteEditingDIV->render();
$finalEditingDiv = str_replace("_REPLACEMENT_", $tmp, $finalEditingDiv);
$finalSaveButton = $saveAnchor->render();
return $finalEditingDiv . $finalEditButton . $finalSaveButton;
}else{
$text = new Article($idart, $client, $lang);
$msgText = $text->getContent("CMS_HTML", $val);
return $msgText;
}
}
################################################
################## Javascript ##################
################################################
if(!$contenido){
?>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery-ui.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#accordion").accordion({
active: <?php echo $fActive; ?>,
animated: '<?php echo $fBounceslide; ?>',
autoHeight: <?php echo $fAutoHeight; ?>,
event: '<?php echo $fEvent; ?>'
});
});
</script>
<?php
$requestUri = $_SERVER['REQUEST_URI'];
$LinkStart="<a href='$requestUri#top'>";
$LinkEnde="</a>";
}
####################################################
################## Ausgabe Felder ##################
####################################################
?>
<div id="accordion">
<?php
for($i=1;$i<=$fValueOut;$i++){ ?>
<h3><?php echo $LinkStart.xtcCmsHtmlHeadjQueryAccordeon($fValueStartId+$i).$LinkEnde; ?></h3>
<div><?php echo xtcCmsHtmljQueryAccordeon($fValueStartId+$i); ?></div>
<?php
}
?>
</div>
Viel Freude damit.
andy-man