init
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_line_slidecontent_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" class="selected_linklist_row" name="input_line_id" value="" />
|
||||
<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 $fieldSetup['id']; ?>" />
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new_line_slidecontent', true)", "", FALSE); ?>
|
||||
<?= button("edit", $translation->get("edit"), $formname, "loadCard('edit_line_slidecontent')", "", FALSE); ?>
|
||||
<?= button("delete", $translation->get("delete"), $formname, "loadCard('delete_line_slidecontent', false, '{$translation->get('delete_line_confirm')}')", "", FALSE); ?>
|
||||
<?= button("up", $translation->get("go_up"), $formname, "loadCard('moveup_line_slidecontent')", "", FALSE); ?>
|
||||
<?= button("down", $translation->get("go_down"), $formname, "loadCard('movedown_line_slidecontent')", "", FALSE); ?>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?
|
||||
|
||||
$query = "SELECT * FROM main_collection_link WHERE main_collection_id = " . $collectionData['id'] . " AND main_collection_setup_content_id = " . $fieldSetup['id'];
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$num_rows = @mysqli_num_rows($result);
|
||||
if ($num_rows == 0) {
|
||||
echo "<div class=\"infobox\">" . $translation->get("no_rows_found") . "</div></form>";
|
||||
return;
|
||||
}
|
||||
|
||||
$row = @mysqli_fetch_array($result, 1);
|
||||
|
||||
$query = "SELECT id, headline AS '" . $translation->get("headline") . "' FROM slidecontent_line WHERE header_id = " . $row['main_sitepart_header_id'] . " ORDER BY sorting ASC";
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_line_id", "edit_line_slidecontent", TRUE, "update_sortorder_slidecontent");
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
43
module/slidecontent/component_slidecontent_listform.inc.php
Normal file
43
module/slidecontent/component_slidecontent_listform.inc.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_slidecontent_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_slidecontent"); ?>
|
||||
<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 (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="4">
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
<?
|
||||
$query = "SELECT slidecontent_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 slidecontent_header left join main_admin_user ON slidecontent_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>
|
||||
402
module/slidecontent/edit_slidecontent.inc.php
Normal file
402
module/slidecontent/edit_slidecontent.inc.php
Normal file
@@ -0,0 +1,402 @@
|
||||
<?
|
||||
date_default_timezone_set('Europe/Berlin');
|
||||
|
||||
$messages = array();
|
||||
$error = FALSE;
|
||||
|
||||
if (isset($custom_action)) {
|
||||
$action = $custom_action;
|
||||
} else {
|
||||
$action = $_REQUEST["action"];
|
||||
}
|
||||
|
||||
switch ($action) {
|
||||
case 'new_slidecontent':
|
||||
require_once("edit_slidecontent_cardform.inc.php");
|
||||
break;
|
||||
case 'save_slidecontent':
|
||||
save_slidecontent();
|
||||
break;
|
||||
case 'edit_slidecontent':
|
||||
edit_slidecontent();
|
||||
break;
|
||||
case 'delete_slidecontent' :
|
||||
delete_slidecontent();
|
||||
break;
|
||||
|
||||
case 'new_line_slidecontent':
|
||||
new_line_slidecontent();
|
||||
break;
|
||||
case 'edit_line_slidecontent':
|
||||
edit_line_slidecontent();
|
||||
break;
|
||||
case 'delete_line_slidecontent':
|
||||
delete_line_slidecontent();
|
||||
break;
|
||||
case 'save_line_slidecontent':
|
||||
save_slidecontent_entry();
|
||||
break;
|
||||
|
||||
case 'moveup_line_slidecontent':
|
||||
moveup_pic_slidecontent();
|
||||
edit_slidecontent();
|
||||
break;
|
||||
case 'movedown_line_slidecontent':
|
||||
movedown_pic_slidecontent();
|
||||
edit_slidecontent();
|
||||
break;
|
||||
|
||||
case 'update_sortorder_slidecontent':
|
||||
update_sortorder_slidecontent();
|
||||
break;
|
||||
|
||||
default:
|
||||
require_once("edit_slidecontent_listform.inc.php");
|
||||
break;
|
||||
}
|
||||
|
||||
function update_sortorder_slidecontent() {
|
||||
$sorting = 1;
|
||||
foreach ($_POST['linklistid'] as $itemId) {
|
||||
$query = "UPDATE slidecontent_line SET sorting = " . $sorting . " WHERE id = '" . $itemId."'";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$sorting++;
|
||||
}
|
||||
}
|
||||
|
||||
function new_line_slidecontent() {
|
||||
$input_line = array();
|
||||
|
||||
if (is_collection_edit()) {
|
||||
$collection_link = get_collection_link($_REQUEST['input_collection_id'], $_REQUEST['collection_setup_content_id']);
|
||||
if (isset($collection_link['main_sitepart_header_id'])) {
|
||||
$input_line['header_id'] = $collection_link['main_sitepart_header_id'];
|
||||
}
|
||||
} else {
|
||||
$input_line['header_id'] = $_REQUEST['input_id'];
|
||||
}
|
||||
|
||||
require_once("edit_slidecontent_line_cardform.inc.php");
|
||||
}
|
||||
|
||||
function edit_slidecontent( $_id = "", $messages = array() ) {
|
||||
|
||||
if (is_collection_edit()) {
|
||||
edit_collection();
|
||||
return;
|
||||
}
|
||||
|
||||
if ((int)$_id > 0) {
|
||||
$input_id = $_id;
|
||||
} else {
|
||||
$input_id = $_REQUEST["input_id"];
|
||||
}
|
||||
|
||||
if ($input_id <> '') {
|
||||
|
||||
$query = "SELECT * FROM slidecontent_header WHERE id = '" . $input_id . "' LIMIT 1";
|
||||
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
|
||||
$input_slidecontent = @mysqli_fetch_array($result);
|
||||
|
||||
require_once("edit_slidecontent_cardform.inc.php");
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
require_once("edit_slidecontent_cardform.inc.php");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function edit_line_slidecontent( $_id = "", $messages = array() ) {
|
||||
if ((int)$_id > 0) {
|
||||
$line_id = $_id;
|
||||
} else {
|
||||
$line_id = $_REQUEST["input_line_id"];
|
||||
}
|
||||
|
||||
if ($line_id <> '') {
|
||||
$query = "SELECT * FROM slidecontent_line WHERE id = '" . $line_id . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$input_line = @mysqli_fetch_array($result);
|
||||
require_once("edit_slidecontent_line_cardform.inc.php");
|
||||
}
|
||||
} else {
|
||||
require_once("edit_slidecontent_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function save_slidecontent() {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$input_id = "";
|
||||
$input_all_languages = ($_POST["input_all_languages"] == "on") ? 1 : 0;
|
||||
|
||||
//pruefen ob Bild ausgewaehlt
|
||||
if ($_REQUEST["input_id"] <> '') {
|
||||
$insertquery = "UPDATE slidecontent_header SET
|
||||
description = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_description"]) . "',
|
||||
modified_date = " . time() . ",
|
||||
modified_user = " . (int)$GLOBALS["admin_user"]['id'] . ",
|
||||
all_languages = " . $input_all_languages . "
|
||||
WHERE id = '" . $_REQUEST["input_id"] . "'
|
||||
LIMIT 1";
|
||||
$inserted = FALSE;
|
||||
$input_id = $_REQUEST["input_id"];
|
||||
} else {
|
||||
$insertquery = "INSERT INTO slidecontent_header
|
||||
(main_language_id, modified_date, modified_user, description, all_languages)
|
||||
VALUES (
|
||||
" . (int)$GLOBALS["language"]['id'] . ",
|
||||
" . time() . ",
|
||||
" . (int)$GLOBALS["admin_user"]['id'] . ",
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_description"]) . "',
|
||||
" . $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'], $insertquery);
|
||||
|
||||
if ($inserted == TRUE) {
|
||||
$input_id = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
$messages[] = '<div class="successbox">' . $translation->get("slidecontent_msg_success1") . '</div>';
|
||||
} else {
|
||||
$messages[] = '<div class="successbox">' . $translation->get("slidecontent_msg_success2") . '</div>';
|
||||
}
|
||||
|
||||
update_sitepart_changes(4, $input_id);
|
||||
|
||||
if (is_page_edit()) {
|
||||
header('EDIT_ERROR: 1'); // verhindern, dass overlay geschlossen wird
|
||||
if (line_already_exists($_REQUEST["input_page_id"], 4, $input_id) === FALSE) {
|
||||
assoc_sitepart(4, $input_id, FALSE);
|
||||
}
|
||||
|
||||
if ($_REQUEST['force_close'] == 1) {
|
||||
edit_content_page();
|
||||
return;
|
||||
}
|
||||
|
||||
edit_slidecontent($input_id, $messages);
|
||||
|
||||
} elseif (is_component_edit()) {
|
||||
header('EDIT_ERROR: 1'); // verhindern, dass overlay geschlossen wird
|
||||
if (line_already_exists($_REQUEST["input_component_id"], 4, $input_id) === FALSE) {
|
||||
assoc_sitepart(4, $input_id, FALSE);
|
||||
}
|
||||
|
||||
if ($_REQUEST['force_close'] == 1) {
|
||||
edit_component("", $messages);
|
||||
return;
|
||||
}
|
||||
|
||||
edit_slidecontent($input_id, $messages);
|
||||
} else {
|
||||
edit_slidecontent($input_id, $messages);
|
||||
}
|
||||
|
||||
} else {
|
||||
header('EDIT_ERROR: 1');
|
||||
$input_slidecontent = array();
|
||||
$input_slidecontent["id"] = $_REQUEST["input_id"];
|
||||
$input_slidecontent["description"] = $_REQUEST["input_description"];
|
||||
$input_slidecontent["all_languages"]= $input_all_languages;
|
||||
|
||||
require_once("edit_slidecontent_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
function delete_slidecontent() {
|
||||
if ($_REQUEST["input_id"] <> '') {
|
||||
$query = "DELETE FROM slidecontent_header WHERE id = '" . $_REQUEST["input_id"] . "' LIMIT 1";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
$query = "DELETE FROM slidecontent_line WHERE header_id = '" . $_REQUEST["input_id"]."'";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
// zuordnung von Seiten loeschen
|
||||
$query = "DELETE FROM main_page_link WHERE main_sitepart_id = 4 AND main_sitepart_header_id = '" . $_REQUEST["input_id"]."'";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
update_sitepart_changes(4, $_REQUEST["input_id"], TRUE);
|
||||
}
|
||||
require_once("edit_slidecontent_listform.inc.php");
|
||||
}
|
||||
|
||||
|
||||
function delete_line_slidecontent() {
|
||||
if ($_REQUEST["input_line_id"] <> '') {
|
||||
$query = "SELECT * FROM slidecontent_line WHERE id= '" . $_REQUEST["input_line_id"]."'";
|
||||
$result = mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
//Loeschen der Dateien und des DB-Eintrags wenn Eintrag vorhanden
|
||||
if (mysqli_num_rows($result) > 0) {
|
||||
$row = mysqli_fetch_array($result);
|
||||
$query = "DELETE FROM slidecontent_line WHERE id = '" . $_REQUEST["input_line_id"] . "' LIMIT 1";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
}
|
||||
edit_slidecontent();
|
||||
}
|
||||
|
||||
/**
|
||||
* save_slidecontent_entry() Speichern einzelner Bilder
|
||||
*
|
||||
*/
|
||||
|
||||
function save_slidecontent_entry() {
|
||||
$latlng = geoencode($_POST["input_address"]);
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$messages = array();
|
||||
$id = $_REQUEST["input_line_id"];
|
||||
|
||||
// wenn in kollektion, dann die dummy header id auslesen bzw erstmal anlegen
|
||||
if (is_collection_edit() && (!isset($_REQUEST['input_id']) || (int)$_REQUEST['input_id'] == 0)) {
|
||||
// neue dummy gallery anlegen
|
||||
// optionen auslesen
|
||||
$query = "SELECT options FROM main_collection_setup_content WHERE id = '" . $_POST['collection_setup_content_id']."'";
|
||||
$result = mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$row = mysqli_fetch_array($result);
|
||||
|
||||
$options = unserialize($row['options']);
|
||||
// hinzufuegen zur datenbank
|
||||
$insertquery = "INSERT INTO slidecontent_header
|
||||
(main_language_id, description, modified_date, modified_user, collection_header)
|
||||
VALUES (
|
||||
'" . $GLOBALS["language"]['id'] . "',
|
||||
'',
|
||||
" . time() . ",
|
||||
" . (int)$GLOBALS["admin_user"]['id'] . ",
|
||||
1
|
||||
)";
|
||||
|
||||
@mysqli_query($GLOBALS['mysql_con'], $insertquery);
|
||||
$header_id = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
|
||||
$query = "INSERT INTO main_collection_link (main_collection_id, main_collection_setup_content_id, main_sitepart_header_id, main_sitepart_id)
|
||||
VALUES (
|
||||
'" . $_REQUEST['input_collection_id'] . "',
|
||||
'" . $_REQUEST['collection_setup_content_id'] . "',
|
||||
" . $header_id . ",
|
||||
4
|
||||
)";
|
||||
mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
} else {
|
||||
$header_id = (int)$_REQUEST['input_id'];
|
||||
}
|
||||
|
||||
if ($_REQUEST["input_line_id"] <> '') {
|
||||
$query = "UPDATE slidecontent_line
|
||||
SET modified_date = " . time() . ",
|
||||
modified_user = " . (int)$GLOBALS["admin_user"]['id'] . ",
|
||||
headline = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_headline"]) . "',
|
||||
content = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["textcontent"]) . "'
|
||||
WHERE id = '" . $_REQUEST["input_line_id"] . "' LIMIT 1";
|
||||
$inserted = FALSE;
|
||||
} else {
|
||||
$sorting = @mysqli_fetch_array(@mysqli_query($GLOBALS['mysql_con'], "SELECT MAX(sorting)+1 AS 'newsorting' FROM slidecontent_line WHERE header_id = '" . $header_id."'"));
|
||||
$sorting = ($sorting["newsorting"] <> "") ? $sorting = $sorting["newsorting"] : $sorting = 1;
|
||||
$query = "INSERT INTO slidecontent_line (header_id, headline, content ,sorting, modified_date, modified_user)
|
||||
VALUES (
|
||||
'" . $header_id . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_headline"]) . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["textcontent"]) . "',
|
||||
" . $sorting . ",
|
||||
" . time() . ",
|
||||
" . (int)$GLOBALS["admin_user"]['id'] . "
|
||||
)";
|
||||
$inserted = TRUE;
|
||||
}
|
||||
if (($_REQUEST["input_headline"] == '')) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_headline") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
|
||||
|
||||
// benoetigt fuer ajax calls
|
||||
if ($error === TRUE) {
|
||||
header('EDIT_ERROR: 1');
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if ($_REQUEST['save_and_close'] == 1) {
|
||||
|
||||
edit_slidecontent();
|
||||
} else {
|
||||
if ($inserted === TRUE) {
|
||||
$id = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
$messages[] = '<div class="successbox">' . $translation->get("slidecontent_line_msg_success1") . '</div>';
|
||||
} else {
|
||||
$messages[] = '<div class="successbox">' . $translation->get("slidecontent_line_msg_success2") . '</div>';
|
||||
}
|
||||
edit_line_slidecontent($id, $messages);
|
||||
}
|
||||
|
||||
} else {
|
||||
$input_line["id"] = $_REQUEST["input_line_id"];
|
||||
$input_line["header_id"] = $header_id;
|
||||
$input_line["headline"] = $_REQUEST["input_title"];
|
||||
$input_line["content"] = $_REQUEST["textcontent"];
|
||||
require_once("edit_slidecontent_line_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* moveup_pic() Bild nach oben
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
function moveup_pic_slidecontent() {
|
||||
move_pic_slidecontent("<", "DESC", $_POST["input_line_id"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* movedown_pic() Bild nach unten
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
function movedown_pic_slidecontent() {
|
||||
move_pic_slidecontent(">", "ASC", $_POST["input_line_id"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* move_pic() Soprtierung der Galerieeintraege
|
||||
*
|
||||
* @param mixed $way
|
||||
* @param mixed $order
|
||||
* @param mixed $pic_id
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
function move_pic_slidecontent( $way, $order, $pic_id ) {
|
||||
$query = "SELECT * FROM slidecontent_line WHERE id = '" . $pic_id . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$curr_pic = @mysqli_fetch_array($result);
|
||||
}
|
||||
$query = "SELECT * FROM slidecontent_line WHERE header_id = " . $curr_pic['header_id'] . " AND sorting " . $way . " " . $curr_pic["sorting"] . " ORDER BY sorting " . $order . " LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$change_pic = @mysqli_fetch_array($result);
|
||||
}
|
||||
if (($curr_pic["id"] <> '') && ($change_pic["id"] <> '')) {
|
||||
$query = "UPDATE slidecontent_line SET sorting = " . $change_pic["sorting"] . " WHERE id = " . $curr_pic["id"];
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$query = "UPDATE slidecontent_line SET sorting = " . $curr_pic["sorting"] . " WHERE id = " . $change_pic["id"];
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
}
|
||||
96
module/slidecontent/edit_slidecontent_cardform.inc.php
Normal file
96
module/slidecontent/edit_slidecontent_cardform.inc.php
Normal file
@@ -0,0 +1,96 @@
|
||||
<?
|
||||
$formname = "form_slidecontent_cardform";
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$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 if ($input_slidecontent["id"] == "") {
|
||||
echo $translation->get("new_slidecontent");
|
||||
} else {
|
||||
echo $translation->get("edit_slidecontent");
|
||||
}
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?php
|
||||
// Zurueck zur uebersicht
|
||||
if (is_page_edit() || is_component_edit()) {
|
||||
button("left", $translation->get("back"), $formname, "loadCard('edit_content_page', true)");
|
||||
}
|
||||
|
||||
// Speichern button
|
||||
button("save", $translation->get("save"), $formname, "loadCard('save_slidecontent', true)");
|
||||
|
||||
// Speichern und schliessen
|
||||
button("save", $translation->get("save_and_close"), $formname, "loadCard('save_slidecontent', true, '', true)");
|
||||
?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php
|
||||
// Loeschen button
|
||||
if ($input_slidecontent["id"] != "" && is_page_edit() === FALSE && is_component_edit() === FALSE) {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_slidecontent', true, '{$translation->get('delete_slidecontent_confirm')}', true)", "", FALSE);
|
||||
}
|
||||
|
||||
// Zuruecksetzen
|
||||
button("reset", $translation->get("restore"), $formname, "?action=edit", "", FALSE);
|
||||
?>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
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_slidecontent["id"] ?>">
|
||||
<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="4">
|
||||
|
||||
<?php
|
||||
if (!is_array($input_slidecontent)) {
|
||||
$width = 450;
|
||||
$height = 450;
|
||||
} else {
|
||||
$width = $input_slidecontent["width"];
|
||||
$height = $input_slidecontent["height"];
|
||||
}
|
||||
?>
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("description"), "input_description", "text", $input_slidecontent["description"], 255) ?>
|
||||
<? input($translation->get("show_in_all_languages"), "input_all_languages", "checkbox", $input_slidecontent["all_languages"]) ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
if ($input_slidecontent["id"] != "") {
|
||||
show_changed_on($input_slidecontent["id"], "slidecontent_header");
|
||||
show_changed_by($input_slidecontent["id"], "slidecontent_header");
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<br />
|
||||
<?
|
||||
if ($input_slidecontent['id'] != "") {
|
||||
require_once("edit_slidecontent_line_listform.inc.php");
|
||||
}
|
||||
?>
|
||||
76
module/slidecontent/edit_slidecontent_line_cardform.inc.php
Normal file
76
module/slidecontent/edit_slidecontent_line_cardform.inc.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<?
|
||||
$formname = "form_slidecontent_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"] : "");
|
||||
$header_id = (isset($input_line["header_id"]) ? $input_line["header_id"] : "");
|
||||
$input_component_id = (isset($_REQUEST["input_component_id"]) ? $_REQUEST["input_component_id"] : "");
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_line["id"] == "") {
|
||||
echo $translation->get("new_slidecontent_line");
|
||||
} else {
|
||||
echo $translation->get("edit_slidecontent_line");
|
||||
}
|
||||
?>
|
||||
<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_slidecontent', true)");
|
||||
}
|
||||
?>
|
||||
<?= button("save", $translation->get("save"), $formname, "loadCard('save_line_slidecontent', true)"); ?>
|
||||
<?= button("save", $translation->get("save_and_close"), $formname, "jQuery('#save_and_close', jQuery('#" . $formname . "')).val(1);loadCard('save_line_slidecontent', true)"); ?>
|
||||
<?php
|
||||
if ($input_line["id"] != "") {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_line_slidecontent', true, '{$translation->get('delete_line_confirm')}')");
|
||||
}
|
||||
?>
|
||||
<?= button("reset", $translation->get("restore"), $formname, "?action=edit"); ?>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<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 type="hidden" name="linklist_form" value="form_line_slidecontent_list" />
|
||||
<input name="save_and_close" id="save_and_close" type="hidden" value="0" />
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("headline"), "input_headline", "text", $input_line["headline"], 255) ?>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<h2><?php echo $translation->get("content"); ?></h2>
|
||||
<?php
|
||||
show_ck_editor($input_line['content'], "dc", 'layout/frontend/' . $GLOBALS["layout"]["code"] . '/dist/css/fck.css', 'layout/frontend/' . $GLOBALS["layout"]["code"] . '/fckstyles.xml');
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
32
module/slidecontent/edit_slidecontent_line_listform.inc.php
Normal file
32
module/slidecontent/edit_slidecontent_line_listform.inc.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_slidecontent_line_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"] : "");
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_id ?>">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_line_id" value="" />
|
||||
<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; ?>" />
|
||||
|
||||
<h2><?php echo $translation->get("slidecontent_field_headline"); ?></h2>
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new_line_slidecontent', true)", "", FALSE); ?>
|
||||
<?= button("edit", $translation->get("edit"), $formname, "loadCard('edit_line_slidecontent')", "", FALSE); ?>
|
||||
<?= button("delete", $translation->get("delete"), $formname, "loadCard('delete_line_slidecontent', false, '{$translation->get('delete_line_confirm')}')", "", FALSE); ?>
|
||||
<?= button("up", $translation->get("go_up"), $formname, "loadCard('moveup_line_slidecontent')", "", FALSE); ?>
|
||||
<?= button("down", $translation->get("go_down"), $formname, "loadCard('movedown_line_slidecontent')", "", FALSE); ?>
|
||||
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?
|
||||
$query = "SELECT id, headline AS '" . $translation->get("headline") . "' FROM slidecontent_line WHERE header_id = '" . $input_id . "' ORDER BY sorting ASC";
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_line_id", "edit_line_slidecontent", TRUE, "update_sortorder_slidecontent");
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
32
module/slidecontent/edit_slidecontent_listform.inc.php
Normal file
32
module/slidecontent/edit_slidecontent_listform.inc.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_slidecontent_list";
|
||||
$inputname = "input_id";
|
||||
?>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new_slidecontent', true)"); ?>
|
||||
<?= button("edit", $translation->get("edit"), $formname, "loadCard('edit_slidecontent')"); ?>
|
||||
<?= button("delete", $translation->get("delete"), $formname, "sendRequest('delete_slidecontent', false, '{$translation->get('delete_slidecontent_confirm')}')"); ?>
|
||||
</ul>
|
||||
|
||||
<div id="mainContent">
|
||||
|
||||
<?php echo current_website_language($site, $language); ?>
|
||||
<h1><?php echo get_translation('left_slidecontent'); ?></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 slidecontent_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 slidecontent_header left join main_admin_user ON slidecontent_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_slidecontent");
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
41
module/slidecontent/page_slidecontent_listform.inc.php
Normal file
41
module/slidecontent/page_slidecontent_listform.inc.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_slidecontent_list";
|
||||
$inputname = "input_id";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php echo $translation->get("assign_slidecontent"); ?>
|
||||
<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 (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 name="data-sitepartid" type="hidden" value="4">
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
<?
|
||||
$query = "SELECT slidecontent_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 slidecontent_header left join main_admin_user ON slidecontent_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>
|
||||
53
module/slidecontent/show_slidecontent.inc.php
Normal file
53
module/slidecontent/show_slidecontent.inc.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<div class="slidecontent">
|
||||
|
||||
<div class="sitepart_<?= $sitepart_id ?>">
|
||||
|
||||
<?
|
||||
|
||||
if (isset($_GET["slidecontent" . $sitepart_id]) && $_GET["slidecontent" . $sitepart_id] <> '') {
|
||||
|
||||
$query = "SELECT * FROM slidecontent_line WHERE id = '" . $_GET["slidecontent" . $sitepart_id] . "' LIMIT 1";
|
||||
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
|
||||
$slidecontent = @mysqli_fetch_array($result);
|
||||
|
||||
$headline = $slidecontent['headline'];
|
||||
$content = $slidecontent['content'];
|
||||
$slidecontent_item = "\n<div class=\"slide_container\">\n<div class=\"slidecontent_headline\">\n<h3>$headline</h3>\n</div>\n<div class=\"slidecontent_content_container\">\n$content\n</div>\n<br />\n</div>\n";
|
||||
|
||||
echo $slidecontent_item;
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
$query = "SELECT * FROM slidecontent_line WHERE header_id = '" . $sitepart_id . "' ORDER BY sorting asc";
|
||||
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
if (@mysqli_num_rows($result) > 0) {
|
||||
|
||||
while ($slidecontent = @mysqli_fetch_array($result)) {
|
||||
|
||||
$headline = $slidecontent['headline'];
|
||||
$content = $slidecontent['content'];
|
||||
$slidecontent_item = "\n<div class=\"slide_container\">\n<div class=\"slidecontent_headline\">\n$headline\n</div>\n<div class=\"slidecontent_content_container\">\n$content\n</div>\n</div>\n";
|
||||
|
||||
echo $slidecontent_item;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
8
module/slidecontent/slidecontent.php
Normal file
8
module/slidecontent/slidecontent.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?
|
||||
function slidecontent_show( $sitepart_id ) {
|
||||
require("show_slidecontent.inc.php");
|
||||
}
|
||||
|
||||
function slidecontent_edit() {
|
||||
require_once('edit_slidecontent.inc.php');
|
||||
}
|
||||
Reference in New Issue
Block a user