Hallo stese,
stese hat geschrieben:@xmurrix:
so wie ich das sehe werden die files für die eingabe benötigt, und die db elemente nur für die verarbeitung - also genau anders herum.
auf den ersten Blick scheint es so zu sein, wie du es schreibst. Habe mir zwar nicht alle DB Einträge zu den CMS Typen angesehen, aber bei einigen CMS Typen (CMS_HTML, CMS_TEXT) kommt der Code zum Bearbeiten der Daten aus der DB.
Beispiel DB-Code für CMS_HTML:
Code: Alles auswählen
/**
* CMS_HTML
*/
$tmp = $a_content['CMS_HTML'][$val];
$tmp = urldecode($tmp);
$tmp = str_replace("\$", "\\$", $tmp);
$tmp = AddSlashes(AddSlashes($tmp));
$tmp = str_replace("\\\'","'",$tmp);
cInclude("includes", "functions.lang.php");
cInclude("classes", "class.htmlelements.php");
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(stripslashes($tmp));
/* 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_speichern.gif");
$saveButton->setBorder(0);
$saveAnchor->setContent($saveButton);
/* Process for output with echo */
$finalEditButton = $editAnchor->render();
$finalEditButton = str_replace('"', '"', $finalEditButton);
$finalEditButton = str_replace('"', '"', $finalEditButton);
$finalEditingDiv = $insiteEditingDIV->render();
$finalEditingDiv = str_replace('"', '"', $finalEditingDiv);
$finalEditingDiv = str_replace('"', '"', $finalEditingDiv);
$finalSaveButton = $saveAnchor->render();
$finalSaveButton = str_replace('"', '"', $finalSaveButton);
$finalSaveButton = str_replace('"', '"', $finalSaveButton);
$tmp = $finalEditingDiv . $finalEditButton . $finalSaveButton;
}
Hier werden z. B. die contenteditable div-Container für CMS_HTML generiert, inklusive der Buttons für Speichern und Editieren im wysiwyg-Editor.
Beispiel include.CMS_HTML.php
Code: Alles auswählen
<?php
/******************************************
* File : include.CMS_HTML.php
* Project : Contenido
* Descr : Include file for editiing
* content of type CMS_HTML
*
* Author : Jan Lengowski
* Created : 07.05.2003
* Modified : 07.05.2003
*
* © four for business AG
******************************************/
if ( $doedit == "1" ) {
consaveContentEntry($idartlang, "CMS_HTML", $typenr, $CMS_HTML);
conGenerateCodeForArtInAllCategories($idart);
header( "location:".$sess->url($cfgClient[$client]["path"]["htmlpath"]."front_content.php?area=$tmp_area&idart=$idart&idcat=$idcat&changeview=edit")."");
}
header("Content-Type: text/html; charset={$encoding[$lang]}");
?>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="<?php print $cfg["path"]["contenido_fullhtml"].$cfg["path"]["styles"] ?>contenido.css">
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $encoding[$lang] ?>">
</head>
<body>
<table width="100%" border=0 cellspacing="0" cellpadding="0">
<tr>
<td width="10" rowspan="4"><img src="<?php print $cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"] ?>spacer.gif" width="10" height="10"></td>
<td width="100%"><img src="<?php print $cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"] ?>spacer.gif" width="10" height="10"></td>
<td width="10" rowspan="4"><img src="<?php print $cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"] ?>spacer.gif" width="10" height="10"></td>
</tr>
<tr>
<td>
<?php
getAvailableContentTypes($idartlang);
echo " <FORM method="post" action="".$cfg["path"]["contenido_fullhtml"].$cfg["path"]["includes"]."include.backendedit.php">";
$sess->hidden_session();
echo " <INPUT type=hidden name=lang value="$lang">";
// echo " <INPUT type=hidden name=submit value="editcontent">";
echo " <INPUT type=hidden name=typenr value="$typenr">";
echo " <INPUT type=hidden name=idart value="$idart">";
echo "<INPUT type=hidden name=doedit value=1>";
echo " <INPUT type=hidden name=action value="10">";
echo " <INPUT type=hidden name=type value="$type">";
echo " <INPUT type=hidden name=idcat value="$idcat">";
echo " <INPUT type=hidden name=idartlang value="$idartlang">";
echo "<INPUT type=hidden name=changeview value="edit">";
echo " <TABLE cellpadding=2 width=100% cellspacing=0 border=0>";
echo " <TR><TD valign=top class=text_medium nowrap> ".$typenr.". ".$a_description[$type][$typenr].": </TD></tr><tr><td>";
include ($cfg["path"]["wysiwyg"] . 'editor.php');
echo "</td> </TR>";
$tmp_area = "con_editcontent";
echo " <TR valign=top><TD colspan=2><br>
<a href=".$sess->url($cfgClient[$client]["path"]["htmlpath"]."front_content.php?area=$tmp_area&idart=$idart&idcat=$idcat&lang=$lang")."><img src="".$cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_cancel.gif" border=0></a>
<INPUT type=image name=submit value=editcontent src="".$cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_ok.gif" border=0>
</TD></TR>";
echo " </TABLE>
</FORM>";
?>
</td></tr></table>
</body>
</HTML>
Am Anfang ist die eine if-Bedingung in der die Inhalte gespeichert werden (mit der header-Weiterleitung).
Falls die Bedingung nicht zutrifft, wird der Rest der Seite ausgegeben, die auch die Formularfelder zum Editieren der Daten für den CMS Typ enthalten. Allerdings konnte ich nicht feststellen, dass dieser Abschnitt überhaupt ausgeführt wird.
Habe testhalber nach der if-Bedingung eine die('foo') eingebaut, um zu sehen, ob was passiert - dem war nicht so.
Kann aber sein, dass das bei den anderen CMS Typen anders ist...
Jemand muss doch die Funktionalität zu den CMS Typen kennen, ein Feedback seitens 4fb zu diesem Thema würde einiges klären.
Gruß
xmurrix