init
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_field_textcontent_list_" . $fieldSetup['id'];
|
||||
$inputname = "input_id";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
$input_collection_id = (isset($_REQUEST["input_collection_id"]) ? $_REQUEST["input_collection_id"] : "");
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input type="hidden" name="input_page_id" value="<?php echo $input_page_id; ?>" />
|
||||
<input type="hidden" name="input_collection_id" value="<?php echo $input_collection_id; ?>" />
|
||||
<input type="hidden" name="collection_modul_input_<?php echo $fieldSetup['id']; ?>" value="textcontent" />
|
||||
|
||||
<table style="height:550px;" class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<?php
|
||||
show_ck_editor($headerData['content'], "dc", 'layout/frontend/' . $GLOBALS["layout"]["code"] . '/dist/css/fck.css', 'layout/frontend/' . $GLOBALS["layout"]["code"] . '/fckstyles.xml', "module_input_textcontent_text_" . $fieldSetup['id']);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
46
module/textcontent/component_textcontent_listform.inc.php
Normal file
46
module/textcontent/component_textcontent_listform.inc.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_textcontent_list";
|
||||
$inputname = "input_id";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
$input_component_id = (isset($_REQUEST["input_component_id"]) ? $_REQUEST["input_component_id"] : "");
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php echo $translation->get("assign_textcontents"); ?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("left", $translation->get("back"), $formname, "loadCard('edit_component', true)"); ?>
|
||||
<?= button("link", $translation->get("assoc_with_component"), $formname, "loadCard('assoc_line_component')"); ?>
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_id" value="" />
|
||||
<input type="hidden" name="get_real_page_link_id" value="1" />
|
||||
<input type="hidden" name="input_page_id" value="<?php echo $input_page_id; ?>" />
|
||||
<input type="hidden" name="input_component_id" value="<?php echo $input_component_id; ?>" />
|
||||
<input name="data-sitepartid" type="hidden" value="1">
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
<?
|
||||
$query = "SELECT textcontent_header.id, description AS '" . $translation->get("description") . "', from_unixtime(modified_date, '%d.%m.%Y %H:%i:%s') AS '" . $translation->get("changed_on") . "', main_admin_user.name AS '" . $translation->get("changed_by") . "' from textcontent_header left join main_admin_user ON textcontent_header.modified_user = main_admin_user.id where (main_language_id = " . (int)$GLOBALS["language"]['id'] . " OR all_languages = 1) and collection_header = 0 order by id asc";
|
||||
//echo $query;
|
||||
$format = array('option', 'text', 'text', 'text');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_id", "assoc_line_component");
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
169
module/textcontent/edit_contactform_line_cardform.inc.php
Normal file
169
module/textcontent/edit_contactform_line_cardform.inc.php
Normal file
@@ -0,0 +1,169 @@
|
||||
<?
|
||||
$formname = "form_line_card";
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
$input_collection_id = (isset($_REQUEST["input_collection_id"]) ? $_REQUEST["input_collection_id"] : "");
|
||||
$collection_setup_content_id = (isset($_REQUEST["collection_setup_content_id"]) ? $_REQUEST["collection_setup_content_id"] : "");
|
||||
$input_component_id = (isset($_REQUEST["input_component_id"]) ? $_REQUEST["input_component_id"] : "");
|
||||
$header_id = (isset($input_line["header_id"]) ? $input_line["header_id"] : "");
|
||||
|
||||
$queryform = "SELECT * FROM contactform_header WHERE id = '" . $header_id . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $queryform);
|
||||
$contactform = @mysqli_fetch_array($result);
|
||||
$is_multiform = $contactform['is_multistep'];
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_line["id"] == "") {
|
||||
echo $translation->get("new_contactform_field");
|
||||
} else {
|
||||
echo $translation->get("edit_contactform_field");
|
||||
}
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?
|
||||
if (is_collection_edit()) {
|
||||
button("left", $translation->get("overview"), $formname, "loadCard('edit_collection', true)");
|
||||
} else {
|
||||
button("left", $translation->get("overview"), $formname, "loadCard('edit_contactform', true)");
|
||||
}
|
||||
?>
|
||||
<?= button("save", $translation->get("save"), $formname, "loadCard('save_line_contactform', true)"); ?>
|
||||
<?= button("save", $translation->get("save_and_close"), $formname, "jQuery('#save_and_close', jQuery('#" . $formname . "')).val(1);loadCard('save_line_contactform', true)"); ?>
|
||||
<?php
|
||||
if ($input_line["id"] != "") {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_line_contactform', true, '{$translation->get('delete_contactform_field_confirm')}')");
|
||||
}
|
||||
?>
|
||||
<?= button("reset", $translation->get("restore"), $formname, "?action=edit"); ?>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post" enctype="multipart/form-data">
|
||||
<input name="input_line_id" type="hidden" value="<?= $input_line["id"] ?>" />
|
||||
<input name="input_id" type="hidden" value="<?= $header_id; ?>" />
|
||||
<input type="hidden" name="input_page_id" value="<?php echo $input_page_id; ?>" />
|
||||
<input type="hidden" name="input_collection_id" value="<?php echo $input_collection_id; ?>" />
|
||||
<input type="hidden" name="collection_setup_content_id" value="<?php echo $collection_setup_content_id; ?>" />
|
||||
<input type="hidden" name="input_component_id" value="<?php echo $input_component_id; ?>" />
|
||||
<input name="save_and_close" id="save_and_close" type="hidden" value="0" />
|
||||
<input type="hidden" name="linklist_form" value="form_field_contactform_list" />
|
||||
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
|
||||
if($is_multiform){
|
||||
$section_id = 0;
|
||||
$query = " SELECT * FROM contactform_section WHERE contactform_id = ".$header_id;
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
?>
|
||||
<?php
|
||||
$queryLine = "SELECT * FROM multi_contactform_link WHERE main_sitepart_header_id = '" . $input_textcontent["id"] . "' LIMIT 1";
|
||||
$resultLine = @mysqli_query($GLOBALS['mysql_con'], $queryLine);
|
||||
$input_line = array();
|
||||
$input_line['layout_area_id'] = '';
|
||||
if (@mysqli_num_rows($resultLine) == 1) {
|
||||
$input_line = @mysqli_fetch_array($resultLine);
|
||||
}
|
||||
?>
|
||||
<? layout_area_select($translation->get("layout_area"), "input_layout_area_id", $input_line['layout_area_id']); ?>
|
||||
<div class="label"><label for="abschnitt">Abschnitt Auswählen</label></div>
|
||||
<div class="input">
|
||||
|
||||
<select class="select" name="section_id" id="section_id">
|
||||
<?php while( $row = mysqli_fetch_array($result)){ ?>
|
||||
<option
|
||||
value="<?= $row['id']?>" <?php if($row['id'] == $input_line['section_id']){ echo 'selected';} ?>><?php echo $row['name'] ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="label"><label for="abschnitt">Nächste Abschnitt</label></div>
|
||||
<div class="input">
|
||||
|
||||
<select class="select" name="next_section_id" id="next_section_id">
|
||||
<option value="NA" <?php if($input_line['next_section_id'] == 'NA'){ echo 'selected'; } ?>>---</option>
|
||||
<?php $result = @mysqli_query($GLOBALS['mysql_con'], $query); while( $row = mysqli_fetch_array($result)){ ?>
|
||||
<option
|
||||
value="<?= $row['id']?>" <?php if($row['id'] == $input_line['next_section_id']){ echo 'selected';} ?>><?php echo $row['name'] ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="label"><label for="abschnitt">Bild</label></div>
|
||||
<div class="input">
|
||||
<input type="file" name="field_img">
|
||||
<?php
|
||||
$valFile = '';
|
||||
if($input_line["field_img"] != '' && $input_line["field_img"] != NULL){
|
||||
$valFile = $input_line["field_img"];
|
||||
}
|
||||
?>
|
||||
<input type="hidden" name="field_img_old" value="<?=$valFile;?>">
|
||||
<?php
|
||||
if($input_line["field_img"] != NULL && $input_line["field_img"] != ''){
|
||||
echo "<div class='img_container intranet_user_image'><img class='img-fluid' src='/userdata/collection/resize/".$input_line["field_img"]."'></div>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="label"><label for="abschnitt" >Icon</label></div>
|
||||
<div class="input">
|
||||
<input type="text" name="icon" value="<?= $input_line["icon"];?>">
|
||||
</div>
|
||||
|
||||
|
||||
<? } ?>
|
||||
<div class="label"><label for="input_typ">Typ</label></div>
|
||||
<div class="input">
|
||||
<select class="select" name="input_typ" id="input_typ">
|
||||
<option<?= ($input_line["typ"] == 1) ? " selected=\"selected\"" : " "; ?>
|
||||
value="1"><?php echo $translation->get("textfield"); ?></option>
|
||||
<option<?= ($input_line["typ"] == 2) ? " selected=\"selected\"" : " "; ?>
|
||||
value="2"><?php echo $translation->get("textarea"); ?></option>
|
||||
<option<?= ($input_line["typ"] == 3) ? " selected=\"selected\"" : " "; ?>
|
||||
value="3"><?php echo $translation->get("yesno"); ?></option>
|
||||
<option<?= ($input_line["typ"] == 4) ? " selected=\"selected\"" : " "; ?>
|
||||
value="4"><?php echo $translation->get("optionfield"); ?></option>
|
||||
<option<?= ($input_line["typ"] == 5) ? " selected=\"selected\"" : " "; ?>
|
||||
value="5"><?php echo $translation->get("headline"); ?></option>
|
||||
<option<?= ($input_line["typ"] == 6) ? " selected=\"selected\"" : " "; ?>
|
||||
value="6"><?php echo $translation->get("spacerow"); ?></option>
|
||||
<option<?= ($input_line["typ"] == 7) ? " selected=\"selected\"" : " "; ?>
|
||||
value="7"><?php echo $translation->get("title_news"); ?></option>
|
||||
<option<?= ($input_line["typ"] == 8) ? " selected=\"selected\"" : " "; ?>
|
||||
value="8"><?php echo $translation->get("file"); ?></option>
|
||||
<?php if($is_multiform){ ?>
|
||||
<option<?= ($input_line["typ"] == 9) ? " selected=\"selected\"" : " "; ?>
|
||||
value="9"><?php echo $translation->get("checkbox"); ?></option>
|
||||
<option<?= ($input_line["typ"] == 10) ? " selected=\"selected\"" : " "; ?>
|
||||
value="10"><?php echo 'Radio'; ?></option>
|
||||
<?php } ?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<? input($translation->get("textkey"), "input_code", "text", $input_line["code"], 50) ?>
|
||||
<? input($translation->get("caption"), "input_name", "text", $input_line["name"], 250) ?>
|
||||
<? input($translation->get("caption_in_field"), "input_infield", "checkbox", $input_line["infield"]) ?>
|
||||
<? input($translation->get("mandatory_field"), "input_mandatory", "checkbox", $input_line["mandatory"]) ?>
|
||||
<br />
|
||||
<? input($translation->get("optionvalues"), "input_option_string", "text", $input_line["option_string"], 200) ?>
|
||||
</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
179
module/textcontent/edit_textcontent.inc.php
Normal file
179
module/textcontent/edit_textcontent.inc.php
Normal file
@@ -0,0 +1,179 @@
|
||||
<?php
|
||||
$messages = array();
|
||||
$error = FALSE;
|
||||
if (isset($custom_action)) {
|
||||
$action = $custom_action;
|
||||
} else {
|
||||
$action = $_REQUEST["action"];
|
||||
}
|
||||
|
||||
switch ($action) {
|
||||
|
||||
case 'edit_textcontent':
|
||||
edit_textcontent();
|
||||
break;
|
||||
case 'delete_textcontent':
|
||||
delete_textcontent();
|
||||
break;
|
||||
case 'new_textcontent':
|
||||
require_once("edit_textcontent_cardform.inc.php");
|
||||
break;
|
||||
case 'new_contact_textcontent':
|
||||
require_once("edit_textcontent_contact_cardform.inc.php");
|
||||
break;
|
||||
case 'save_textcontent':
|
||||
save_textcontent();
|
||||
break;
|
||||
|
||||
default:
|
||||
require_once("edit_textcontent_listform.inc.php");
|
||||
break;
|
||||
}
|
||||
|
||||
function edit_textcontent( $_id = "", $messages = array() ) {
|
||||
if ((int)$_id > 0) {
|
||||
$input_id = $_id;
|
||||
} else {
|
||||
$input_id = $_REQUEST["input_id"];
|
||||
}
|
||||
|
||||
if ($input_id <> '') {
|
||||
$query = "SELECT * FROM textcontent_header WHERE id = '" . $input_id . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$input_textcontent = @mysqli_fetch_array($result);
|
||||
if(isset($_REQUEST['input_contactform_id'])){
|
||||
require_once("edit_textcontent_contact_cardform.inc.php");
|
||||
}else{
|
||||
require_once("edit_textcontent_cardform.inc.php");
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
$input_textcontent = array();
|
||||
require_once("edit_textcontent_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
function delete_textcontent() {
|
||||
if ($_REQUEST["input_id"] <> '') {
|
||||
$query = "DELETE FROM textcontent_header WHERE id = '" . $_REQUEST["input_id"] . "' LIMIT 1";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
// zuordnung von Seiten loeschen
|
||||
$query = "DELETE FROM main_page_link WHERE main_sitepart_id = 1 AND main_sitepart_header_id = '" . $_REQUEST["input_id"]."'";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
|
||||
$query = "DELETE FROM multi_contactform_link WHERE main_sitepart_id = 1 AND main_sitepart_header_id = '" . $_REQUEST["input_id"]."'";
|
||||
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
update_sitepart_changes(1, $_REQUEST["input_id"], TRUE);
|
||||
}
|
||||
require_once("edit_textcontent_listform.inc.php");
|
||||
}
|
||||
|
||||
function save_textcontent() {
|
||||
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$input_id = "";
|
||||
$input_all_languages = ($_POST["input_all_languages"] == "on") ? 1 : 0;
|
||||
|
||||
if ($_REQUEST["input_id"] <> '') {
|
||||
$query = "UPDATE textcontent_header SET
|
||||
description = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_description"]) . "',
|
||||
modified_date = " . time() . ",
|
||||
modified_user = " . (int)$GLOBALS["admin_user"]['id'] . ",
|
||||
content = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["textcontent"]) . "',
|
||||
type = 0,
|
||||
all_languages = " . $input_all_languages . "
|
||||
WHERE id = " . $_REQUEST["input_id"] . "
|
||||
LIMIT 1";
|
||||
$inserted = FALSE;
|
||||
$input_id = $_REQUEST["input_id"];
|
||||
} else {
|
||||
$query = "INSERT INTO textcontent_header
|
||||
(main_language_id, description, modified_date, modified_user, type, content, all_languages)
|
||||
VALUES (
|
||||
'" . $GLOBALS["language"]['id'] . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST['input_description']) . "',
|
||||
" . time() . ",
|
||||
" . (int)$GLOBALS["admin_user"]['id'] . ",
|
||||
0,
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST['textcontent']) . "',
|
||||
" . $input_all_languages . "
|
||||
)";
|
||||
$inserted = TRUE;
|
||||
}
|
||||
|
||||
if (($_REQUEST["input_description"] == '')) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_description") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
|
||||
|
||||
if (!$error) {
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if ($inserted == TRUE) {
|
||||
$input_id = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
$messages[] = '<div class="successbox">' . $translation->get("textcontent_msg_success1") . '</div>';
|
||||
} else {
|
||||
$messages[] = '<div class="successbox">' . $translation->get("textcontent_msg_success2") . '</div>';
|
||||
}
|
||||
|
||||
update_sitepart_changes(1, $input_id);
|
||||
|
||||
if (is_page_edit()) {
|
||||
header('EDIT_ERROR: 1'); // verhindern, dass overlay geschlossen wird
|
||||
if (line_already_exists($_REQUEST["input_page_id"], 1, $input_id) === FALSE) {
|
||||
assoc_sitepart(1, $input_id, FALSE);
|
||||
}
|
||||
|
||||
if ($_REQUEST['force_close'] == 1) {
|
||||
edit_content_page();
|
||||
return;
|
||||
}
|
||||
|
||||
edit_textcontent($input_id, $messages);
|
||||
|
||||
} else if(is_contact_edit()){
|
||||
|
||||
header('EDIT_ERROR: 1'); // verhindern, dass overlay geschlossen wird
|
||||
if (line_already_exists($_REQUEST["input_section_id"], 1, $input_id) === FALSE) {
|
||||
|
||||
assoc_sitepart(1, $input_id, FALSE);
|
||||
}
|
||||
|
||||
if ($_REQUEST['force_close'] == 1) {
|
||||
edit_contactform();
|
||||
return;
|
||||
}
|
||||
|
||||
edit_textcontent($input_id, $messages);
|
||||
}
|
||||
elseif (is_component_edit()) {
|
||||
header('EDIT_ERROR: 1'); // verhindern, dass overlay geschlossen wird
|
||||
if (line_already_exists($_REQUEST["input_component_id"], 1, $input_id) === FALSE) {
|
||||
assoc_sitepart(1, $input_id, FALSE);
|
||||
}
|
||||
|
||||
if ($_REQUEST['force_close'] == 1) {
|
||||
edit_component("", $messages);
|
||||
return;
|
||||
}
|
||||
|
||||
edit_textcontent($input_id, $messages);
|
||||
} else {
|
||||
edit_textcontent($input_id, $messages);
|
||||
}
|
||||
|
||||
} else {
|
||||
header('EDIT_ERROR: 1');
|
||||
$input_textcontent["description"] = $_REQUEST["input_description"];
|
||||
$input_textcontent["type"] = 0;
|
||||
$input_textcontent["content"] = $_REQUEST["textcontent"];
|
||||
$input_textcontent["id"] = $_REQUEST["input_id"];
|
||||
$input_textcontent["all_languages"] = $input_all_languages;
|
||||
require_once("edit_textcontent_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
74
module/textcontent/edit_textcontent_cardform.inc.php
Normal file
74
module/textcontent/edit_textcontent_cardform.inc.php
Normal file
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_textcontent_card";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
$input_component_id = (isset($_REQUEST["input_component_id"]) ? $_REQUEST["input_component_id"] : "");
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_textcontent["id"] == "") {
|
||||
echo $translation->get("new_textcontent");
|
||||
} else {
|
||||
echo $translation->get("edit_textcontent");
|
||||
}
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?php
|
||||
if (is_page_edit() || is_component_edit()) {
|
||||
button("left", $translation->get("back"), $formname, "loadCard('edit_content_page', true)");
|
||||
}
|
||||
?>
|
||||
|
||||
<?= button("save", $translation->get("save"), $formname, "loadCard('save_textcontent', true)"); ?>
|
||||
|
||||
|
||||
<?= button("save", $translation->get("save_and_close"), $formname, "loadCard('save_textcontent', true, '', true)"); ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php
|
||||
if ($input_textcontent["id"] != "" && is_page_edit() === FALSE && is_component_edit() === FALSE) {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_textcontent', true, '{$translation->get('delete_textcontent_confirm')}', true)", "", FALSE);
|
||||
}
|
||||
?>
|
||||
<?= button("reset", $translation->get("restore"), $formname, "?action=edit_textcontent", "", FALSE); ?>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_textcontent["id"] ?>">
|
||||
<input name="input_page_id" type="hidden" value="<?= $input_page_id ?>">
|
||||
<input type="hidden" name="input_component_id" value="<?php echo $input_component_id; ?>" />
|
||||
<input name="data-sitepartid" type="hidden" value="1">
|
||||
<input type="hidden" name="get_real_page_link_id" value="1" />
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("description"), "input_description", "text", $input_textcontent["description"], 255) ?>
|
||||
<!-- <? input($translation->get("show_in_all_languages"), "input_all_languages", "checkbox", $input_textcontent["all_languages"]) ?> -->
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<h2><?php echo $translation->get("content"); ?></h2>
|
||||
<?php
|
||||
show_ck_editor($input_textcontent['content'], "dc", 'layout/frontend/' . $GLOBALS["layout"]["code"] . '/dist/css/fck.css', 'layout/frontend/' . $GLOBALS["layout"]["code"] . '/fckstyles.xml');
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
104
module/textcontent/edit_textcontent_contact_cardform.inc.php
Normal file
104
module/textcontent/edit_textcontent_contact_cardform.inc.php
Normal file
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_textcontent_card";
|
||||
$input_section_id = (isset($_REQUEST["input_section_id"]) ? $_REQUEST["input_section_id"] : "");
|
||||
$input_contactform_id = (isset($_REQUEST["input_contactform_id"]) ? $_REQUEST["input_contactform_id"] : "");
|
||||
|
||||
$input_component_id = (isset($_REQUEST["input_component_id"]) ? $_REQUEST["input_component_id"] : "");
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_textcontent["id"] == "") {
|
||||
echo $translation->get("new_textcontent");
|
||||
} else {
|
||||
echo $translation->get("edit_textcontent");
|
||||
}
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?php
|
||||
|
||||
button("left", $translation->get("back"), $formname, "loadCard('edit_contactform', true)");
|
||||
|
||||
?>
|
||||
|
||||
<?= button("save", $translation->get("save"), $formname, "loadCard('save_textcontent', true)"); ?>
|
||||
|
||||
|
||||
<?php
|
||||
// button("save", $translation->get("save_and_close"), $formname, "loadCard('save_textcontent', true, '', true)");
|
||||
?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php
|
||||
if ($input_textcontent["id"] != "" && is_page_edit() === FALSE && is_component_edit() === FALSE) {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_textcontent', true, '{$translation->get('delete_textcontent_confirm')}', true)", "", FALSE);
|
||||
}
|
||||
?>
|
||||
<?= button("reset", $translation->get("restore"), $formname, "?action=edit_textcontent", "", FALSE); ?>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_textcontent["id"] ?>">
|
||||
<input name="input_section_id" type="hidden" value="<?= $input_section_id ?>">
|
||||
<input type="hidden" name="input_component_id" value="<?php echo $input_component_id; ?>" />
|
||||
<input name="data-sitepartid" type="hidden" value="1">
|
||||
<input type="hidden" name="input_contactform_id" value="<?= $input_contactform_id;?>">
|
||||
<input type="hidden" name="get_real_page_link_id" value="1" />
|
||||
<?php
|
||||
$queryLine = "SELECT * FROM multi_contactform_link WHERE main_sitepart_header_id = '" . $input_textcontent["id"] . "' LIMIT 1";
|
||||
$resultLine = @mysqli_query($GLOBALS['mysql_con'], $queryLine);
|
||||
$input_line = array();
|
||||
$input_line['layout_area_id'] = '';
|
||||
if (@mysqli_num_rows($resultLine) == 1) {
|
||||
$input_line = @mysqli_fetch_array($resultLine);
|
||||
}
|
||||
?>
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? layout_class_select($translation->get("layout_area"), "input_layout_area_id", $input_line['layout_area_id']); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("description"), "input_description", "text", $input_textcontent["description"], 255) ?>
|
||||
<?
|
||||
// input($translation->get("show_in_all_languages"), "input_all_languages", "checkbox", $input_textcontent["all_languages"])
|
||||
?>
|
||||
<? input($translation->get("active"), "input_active", "checkbox", $input_line['active']); ?>
|
||||
<? input($translation->get("self_definded_class"), "layout_class_defined", "text", $input_line["layout_class_defined"], 50) ?>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
if ($input_textcontent["id"] != "") {
|
||||
show_changed_on($input_textcontent["id"], "textcontent_header");
|
||||
show_changed_by($input_textcontent["id"], "textcontent_header");
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<h2><?php echo $translation->get("content"); ?></h2>
|
||||
<?php
|
||||
show_ck_editor($input_textcontent['content'], "dc", 'layout/frontend/' . $GLOBALS["layout"]["code"] . '/dist/css/fck.css', 'layout/frontend/' . $GLOBALS["layout"]["code"] . '/fckstyles.xml');
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
32
module/textcontent/edit_textcontent_listform.inc.php
Normal file
32
module/textcontent/edit_textcontent_listform.inc.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_textcontent_list";
|
||||
$inputname = "input_id";
|
||||
?>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new_textcontent', true)"); ?>
|
||||
<?= button("edit", $translation->get("edit"), $formname, "loadCard('edit_textcontent')"); ?>
|
||||
<?= button("delete", $translation->get("delete"), $formname, "sendRequest('delete_textcontent', false, '{$translation->get('delete_textcontent_confirm')}')"); ?>
|
||||
</ul>
|
||||
|
||||
<div id="mainContent">
|
||||
|
||||
<?php echo current_website_language($site, $language); ?>
|
||||
<h1><?php echo get_translation('left_text'); ?></h1>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_id" value="" />
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
<?
|
||||
$query = "SELECT textcontent_header.id, description AS '" . $translation->get("description") . "', from_unixtime(modified_date, '%d.%m.%Y %H:%i:%s') AS '" . $translation->get("changed_on") . "', main_admin_user.name AS '" . $translation->get("changed_by") . "' from textcontent_header left join main_admin_user ON textcontent_header.modified_user = main_admin_user.id where (main_language_id = " . (int)$GLOBALS["language"]['id'] . " OR all_languages = 1) and collection_header = 0 order by id asc";
|
||||
//echo $query;
|
||||
$format = array('option', 'text', 'text', 'text');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_id", "edit_textcontent");
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
46
module/textcontent/page_textcontent_listform.inc.php
Normal file
46
module/textcontent/page_textcontent_listform.inc.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_textcontent_list";
|
||||
$inputname = "input_id";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
$input_component_id = (isset($_REQUEST["input_component_id"]) ? $_REQUEST["input_component_id"] : "");
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php echo $translation->get("assign_textcontents"); ?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("left", $translation->get("back"), $formname, "loadCard('edit_content_page', true)"); ?>
|
||||
<?= button("link", $translation->get("assoc_with_page"), $formname, "loadCard('assoc_line_page')"); ?>
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_id" value="" />
|
||||
<input type="hidden" name="get_real_page_link_id" value="1" />
|
||||
<input type="hidden" name="input_page_id" value="<?php echo $input_page_id; ?>" />
|
||||
<input type="hidden" name="input_component_id" value="<?php echo $input_component_id; ?>" />
|
||||
<input name="data-sitepartid" type="hidden" value="1">
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
<?
|
||||
$query = "SELECT textcontent_header.id, description AS '" . $translation->get("description") . "', from_unixtime(modified_date, '%d.%m.%Y %H:%i:%s') AS '" . $translation->get("changed_on") . "', main_admin_user.name AS '" . $translation->get("changed_by") . "' from textcontent_header left join main_admin_user ON textcontent_header.modified_user = main_admin_user.id where (main_language_id = " . (int)$GLOBALS["language"]['id'] . " OR all_languages = 1) and collection_header = 0 order by id asc";
|
||||
//echo $query;
|
||||
$format = array('option', 'text', 'text', 'text');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_id", "assoc_line_page");
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
27
module/textcontent/textcontent.php
Normal file
27
module/textcontent/textcontent.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?
|
||||
|
||||
function textcontent_show( $sitepart_id ) {
|
||||
$query = "SELECT * FROM textcontent_header WHERE id = '" . $sitepart_id . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$textcontent = @mysqli_fetch_array($result);
|
||||
|
||||
$ckeditorString = "";
|
||||
if ($GLOBALS["live_edit_mode"] === TRUE) {
|
||||
$ckeditorString = 'id="textcontent_editor_' . $sitepart_id . '" contenteditable="true" data-textcontentid="' . $sitepart_id . '"';
|
||||
}
|
||||
|
||||
echo "\n<div class=\"textcontent\" " . $ckeditorString . ">\n";
|
||||
|
||||
$host_pattern = '/{contact}/i';
|
||||
$host_content = $GLOBALS["main_contact"]["name"];
|
||||
$textcontent['content'] = preg_replace($host_pattern, $host_content, $textcontent['content']);
|
||||
|
||||
echo $textcontent["content"] . "\n";
|
||||
echo "</div>\n";
|
||||
}
|
||||
}
|
||||
|
||||
function textcontent_edit() {
|
||||
require('edit_textcontent.inc.php');
|
||||
}
|
||||
Reference in New Issue
Block a user