init
This commit is contained in:
42
module/iframe/collection_iframe_line_listform.inc.php
Normal file
42
module/iframe/collection_iframe_line_listform.inc.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_field_iframe_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="iframe" />
|
||||
|
||||
<?php
|
||||
if (!is_array($headerData)) {
|
||||
$width = 450;
|
||||
$height = 300;
|
||||
} else {
|
||||
$width = $headerData["width"];
|
||||
$height = $headerData["height"];
|
||||
}
|
||||
?>
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<?php input($translation->get("element_width"), "module_input_iframe_width_" . $fieldSetup['id'], "code", $width) ?>
|
||||
</td>
|
||||
<td>
|
||||
<? input($translation->get("iframe_page_url"), "module_input_iframe_url_" . $fieldSetup['id'], "text", $headerData["url"], 255) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php input($translation->get("element_height"), "module_input_iframe_height_" . $fieldSetup['id'], "code", $height) ?>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
44
module/iframe/component_iframe_listform.inc.php
Normal file
44
module/iframe/component_iframe_listform.inc.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_iframe_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_iframe"); ?>
|
||||
<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="11">
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
<?
|
||||
$query = "SELECT iframe_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 iframe_header left join main_admin_user ON iframe_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>
|
||||
159
module/iframe/edit_iframe.inc.php
Normal file
159
module/iframe/edit_iframe.inc.php
Normal file
@@ -0,0 +1,159 @@
|
||||
<?php
|
||||
$messages = array();
|
||||
$error = FALSE;
|
||||
if (isset($custom_action)) {
|
||||
$action = $custom_action;
|
||||
} else {
|
||||
$action = $_REQUEST["action"];
|
||||
}
|
||||
|
||||
switch ($action) {
|
||||
|
||||
case 'edit_iframe':
|
||||
edit_iframe();
|
||||
break;
|
||||
case 'delete_iframe':
|
||||
delete_iframe();
|
||||
break;
|
||||
case 'new_iframe':
|
||||
require_once("edit_iframe_cardform.inc.php");
|
||||
break;
|
||||
case 'save_iframe':
|
||||
save_iframe();
|
||||
break;
|
||||
|
||||
default:
|
||||
require_once("edit_iframe_listform.inc.php");
|
||||
break;
|
||||
}
|
||||
|
||||
function edit_iframe( $_id = "", $messages = array() ) {
|
||||
if ((int)$_id > 0) {
|
||||
$input_id = $_id;
|
||||
} else {
|
||||
$input_id = $_REQUEST["input_id"];
|
||||
}
|
||||
|
||||
if ($input_id <> '') {
|
||||
$query = "SELECT * FROM iframe_header WHERE id = '" . $input_id . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$input_iframe = @mysqli_fetch_array($result);
|
||||
require_once("edit_iframe_cardform.inc.php");
|
||||
}
|
||||
} else {
|
||||
$input_iframe = array();
|
||||
require_once("edit_iframe_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
function delete_iframe() {
|
||||
if ($_REQUEST["input_id"] <> '') {
|
||||
$query = "DELETE FROM iframe_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 = 11 AND main_sitepart_header_id = '" . $_REQUEST["input_id"]."'";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
update_sitepart_changes(11, $_REQUEST["input_id"], TRUE);
|
||||
}
|
||||
require_once("edit_iframe_listform.inc.php");
|
||||
}
|
||||
|
||||
function save_iframe() {
|
||||
|
||||
$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 iframe_header SET
|
||||
description = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_description"]) . "',
|
||||
modified_date = " . time() . ",
|
||||
modified_user = " . (int)$GLOBALS["admin_user"]['id'] . ",
|
||||
width = '" . (int)$_REQUEST["input_width"] . "',
|
||||
height = '" . (int)$_REQUEST["input_height"] . "',
|
||||
url = '" . addhttp($_REQUEST["input_url"]) . "',
|
||||
all_languages = " . $input_all_languages . "
|
||||
WHERE id = '" . $_REQUEST["input_id"] . "'
|
||||
LIMIT 1";
|
||||
$inserted = FALSE;
|
||||
$input_id = $_REQUEST["input_id"];
|
||||
} else {
|
||||
$query = "INSERT INTO iframe_header
|
||||
(main_language_id, description, modified_date, modified_user, width, height, url, all_languages)
|
||||
VALUES (
|
||||
" . $GLOBALS["language"]['id'] . ",
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST['input_description']) . "',
|
||||
" . time() . ",
|
||||
" . (int)$GLOBALS["admin_user"]['id'] . ",
|
||||
'" . (int)$_REQUEST["input_width"] . "',
|
||||
'" . (int)$_REQUEST["input_height"] . "',
|
||||
'" . addhttp($_REQUEST["input_url"]) . "',
|
||||
" . $input_all_languages . "
|
||||
)";
|
||||
$inserted = TRUE;
|
||||
}
|
||||
|
||||
if (($_REQUEST["input_description"] == '')) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_description") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
|
||||
if (($_REQUEST["input_url"] == '')) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("iframe_error1") . "</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("iframe_msg_success1") . '</div>';
|
||||
} else {
|
||||
$messages[] = '<div class="successbox">' . $translation->get("iframe_msg_success2") . '</div>';
|
||||
}
|
||||
|
||||
update_sitepart_changes(11, $input_id);
|
||||
|
||||
if (is_page_edit()) {
|
||||
header('EDIT_ERROR: 1'); // verhindern, dass overlay geschlossen wird
|
||||
if (line_already_exists($_REQUEST["input_page_id"], 11, $input_id) === FALSE) {
|
||||
assoc_sitepart(11, $input_id, FALSE);
|
||||
}
|
||||
|
||||
if ($_REQUEST['force_close'] == 1) {
|
||||
edit_content_page();
|
||||
return;
|
||||
}
|
||||
|
||||
edit_iframe($input_id, $messages);
|
||||
|
||||
} elseif (is_component_edit()) {
|
||||
header('EDIT_ERROR: 1'); // verhindern, dass overlay geschlossen wird
|
||||
if (line_already_exists($_REQUEST["input_component_id"], 11, $input_id) === FALSE) {
|
||||
assoc_sitepart(11, $input_id, FALSE);
|
||||
}
|
||||
|
||||
if ($_REQUEST['force_close'] == 1) {
|
||||
edit_component("", $messages);
|
||||
return;
|
||||
}
|
||||
|
||||
edit_iframe($input_id, $messages);
|
||||
} else {
|
||||
edit_iframe($input_id, $messages);
|
||||
}
|
||||
|
||||
} else {
|
||||
header('EDIT_ERROR: 1');
|
||||
$input_iframe["description"] = $_REQUEST["input_description"];
|
||||
$input_iframe["width"] = $_REQUEST["input_width"];
|
||||
$input_iframe["height"] = $_REQUEST["input_height"];
|
||||
$input_iframe["url"] = $_REQUEST["input_url"];
|
||||
$input_iframe["all_languages"] = $input_all_languages;
|
||||
require_once("edit_iframe_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
84
module/iframe/edit_iframe_cardform.inc.php
Normal file
84
module/iframe/edit_iframe_cardform.inc.php
Normal file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_iframe_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_iframe["id"] == "") {
|
||||
echo $translation->get("new_iframe");
|
||||
} else {
|
||||
echo $translation->get("edit_iframe");
|
||||
}
|
||||
?>
|
||||
<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_iframe', true)"); ?>
|
||||
|
||||
|
||||
<?= button("save", $translation->get("save_and_close"), $formname, "loadCard('save_iframe', true, '', true)"); ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php
|
||||
if ($input_iframe["id"] != "" && is_page_edit() === FALSE && is_component_edit() === FALSE) {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_iframe', true, '{$translation->get('delete_iframe_confirm')}', true)", "", FALSE);
|
||||
}
|
||||
?>
|
||||
<?= button("reset", $translation->get("restore"), $formname, "?action=edit_iframe", "", 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_iframe["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="11">
|
||||
<input type="hidden" name="get_real_page_link_id" value="1" />
|
||||
|
||||
<?php
|
||||
if (!is_array($input_iframe)) {
|
||||
$width = 450;
|
||||
$height = 300;
|
||||
} else {
|
||||
$width = $input_iframe["width"];
|
||||
$height = $input_iframe["height"];
|
||||
}
|
||||
?>
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("description"), "input_description", "text", $input_iframe["description"], 255) ?>
|
||||
<?php input($translation->get("element_width"), "input_width", "code", $width) ?>
|
||||
<?php input($translation->get("element_height"), "input_height", "code", $height) ?>
|
||||
<? input($translation->get("show_in_all_languages"), "input_all_languages", "checkbox", $input_iframe["all_languages"]) ?>
|
||||
</td>
|
||||
<td>
|
||||
<? input($translation->get("iframe_page_url"), "input_url", "text", $input_iframe["url"], 255) ?>
|
||||
<?php
|
||||
if ($input_iframe["id"] != "") {
|
||||
show_changed_on($input_iframe["id"], "iframe_header");
|
||||
show_changed_by($input_iframe["id"], "iframe_header");
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
32
module/iframe/edit_iframe_listform.inc.php
Normal file
32
module/iframe/edit_iframe_listform.inc.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_iframe_list";
|
||||
$inputname = "input_id";
|
||||
?>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new_iframe', true)"); ?>
|
||||
<?= button("edit", $translation->get("edit"), $formname, "loadCard('edit_iframe')"); ?>
|
||||
<?= button("delete", $translation->get("delete"), $formname, "sendRequest('delete_iframe', false, '{$translation->get('delete_iframe_confirm')}')"); ?>
|
||||
</ul>
|
||||
|
||||
<div id="mainContent">
|
||||
|
||||
<?php echo current_website_language($site, $language); ?>
|
||||
<h1><?php echo get_translation('left_extern'); ?></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 iframe_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 iframe_header left join main_admin_user ON iframe_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_iframe");
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
10
module/iframe/iframe.php
Normal file
10
module/iframe/iframe.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?
|
||||
|
||||
function iframe_show( $sitepart_id ) {
|
||||
require("show_iframe.inc.php");
|
||||
}
|
||||
|
||||
function iframe_edit() {
|
||||
|
||||
require('edit_iframe.inc.php');
|
||||
}
|
||||
42
module/iframe/page_iframe_listform.inc.php
Normal file
42
module/iframe/page_iframe_listform.inc.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_iframe_list";
|
||||
$inputname = "input_id";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php echo $translation->get("assign_iframe"); ?>
|
||||
<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="11">
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
<?
|
||||
$query = "SELECT iframe_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 iframe_header left join main_admin_user ON iframe_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>
|
||||
18
module/iframe/show_iframe.inc.php
Normal file
18
module/iframe/show_iframe.inc.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
$query = "SELECT * FROM iframe_header WHERE id = '" . $sitepart_id."'";
|
||||
$iframe_url = "";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$iframe = @mysqli_fetch_array($result);
|
||||
$iframe_url = $iframe['url'];
|
||||
$iframe_width = $iframe['width'];
|
||||
$iframe_height = $iframe['height'];
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ($iframe_url != ""): ?>
|
||||
<div class="iframecontent">
|
||||
<iframe width="<?php echo $iframe_width; ?>" height="<?php echo $iframe_height; ?>"
|
||||
src="<?php echo $iframe_url; ?>"></iframe>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
Reference in New Issue
Block a user