<?php
$druh = "zacleneni";
include "head.php";
$menu2 = include_menu2($druh);
include_head($lang['set_integration_title'], $druh);

if (!isset($_GET['action'])) {$_GET['action'] = "default";}; 
switch ($_GET['action']) {

case "page" : 
  $id = $_GET['id'];
  $query = mysql_query("SELECT * FROM jtcms_stranky WHERE id='".$id."' LIMIT 1");
  $radku = mysql_num_rows($query);
  $result = mysql_fetch_array($query);

 if (empty($id) or $radku == 0) {
    echo '<div class="oznameni_div">';
    echo '<div class="chyba">'.$lang['set_integration_error'].'</div>';
    if (empty($id)) {echo '<p>'.$lang['set_integration_er_1'].'</p>';};
    if ($radku == 0) {echo '<p>'.$lang['set_integration_er_2'].'</p>';};
    echo '</div>';
    
    include_end();
    exit();
  };
?>

<h1><?php echo $lang['set_integration_insert_page']; ?></h1> 
<br /> 
<div class="kod_vlozeni" id="kod">
<?php echo $lang['set_integration_code_for_page']; ?> <strong><?php echo $result['nazev']; ?></strong><br /><br />
<?php echo $lang['set_integration_code_instruction_1']; ?><br /><br />
<textarea wrap="hard">
<?php
echo '<?php
  $jtcms_mode = "page";
  $jtcms_page = '.$id.';
  include "admin/jtcms_show.php";
?'.'>';
?>
</textarea>
</div>
 
<?php
break;

default : ?>

<h1><?php echo $lang['set_integration_h1']; ?></h1>
<br />

<div class="kod_vlozeni">
<br />
<p><?php echo $lang['set_integration_instruction_1']; ?></p>
<p><?php echo $lang['set_integration_instruction_2']; ?></p>
<br />
</div>

<br /><br />

<h2 class="kod_vlozeni_h2"><?php echo $lang['set_integration_h2_1']; ?></h2>
<div class="kod_vlozeni">
<br />
<?php echo $lang['set_integration_p_1']; ?><br /><br />
<textarea wrap="hard">
<?php
echo '<?php
  include "admin/jtcms_show.php";
?'.'>';
?>
</textarea>
</div>

<br /><br />

<h2 class="kod_vlozeni_h2"><?php echo $lang['set_integration_h2_2']; ?></h2>
<div class="kod_vlozeni">
<br />
<?php echo $lang['set_integration_p_2']; ?><br /><br />
<textarea wrap="hard">
<?php
echo '<?php
  $jtcms_menu = "kategorie";
  include "admin/jtcms_show_menu.php";
?'.'>';
?>
</textarea>
</div>

<br /><br />

<h2 class="kod_vlozeni_h2"><?php echo $lang['set_integration_h2_3']; ?></h2>
<div class="kod_vlozeni">
<br />
<?php echo $lang['set_integration_p_3']; ?><br /><br />
<textarea wrap="hard">
<?php
echo '<?php
  $jtcms_menu = "stranky";
  include "admin/jtcms_show_menu.php";
?'.'>';
?>
</textarea>
</div>

<br /><br />

<h2 class="kod_vlozeni_h2"><?php echo $lang['set_integration_h2_5']; ?></h2>
<div class="kod_vlozeni">
<br />
<?php echo $lang['set_integration_p_5']; ?><br /><br />
<textarea wrap="hard">
<?php
echo '<?php
  $jtcms_menu = "stitky";
  include "admin/jtcms_show_menu.php";
?'.'>';
?>
</textarea>
</div>

<br /><br />

<h2 class="kod_vlozeni_h2"><?php echo $lang['set_integration_h2_4']; ?></h2>
<div class="kod_vlozeni">
<br />
<?php echo $lang['set_integration_p_4']; ?><br /><br />
<textarea wrap="hard">
<?php
echo '<?php
  $jtcms_mode = "rss";
  $jtcms_rss_cesta = "/";
  include "admin/jtcms_show.php";
?'.'>';
?>
</textarea>
</div>
<?php
};

include_end();
?>