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

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

case "edit" :

$id = $_GET['id'];

switch ($id) {

case "1" :

$resulty = array('<?php echo \'<a href="?jtcms-article=\'.$result["id"].\'">\'.$result["nazev"].\'</a>\'; ?'.'>',
                 '<?php echo $result["nazev"]; ?'.'>',
                 '<?php echo $result["id"]; ?'.'>',
                 '<?php show_content($result["perex"]); ?'.'>',
                 '<?php show_content($result["obsah"]); ?'.'>',
                 '<?php if (!empty($result["obrazek"]) && file_exists("./admin/data/art_img/".$result["obrazek"])) {echo \'<img src="./admin/data/art_img/\'.$result["obrazek"].\'" alt="\'.$result["obrazek"].\'" width="\'.$img_width.\'" height="\'.$img_height.\'">\';}; ?'.'>',
                 '<?php echo "./data/admin/art_img/".$result["obrazek"]; ?'.'>',
                 '<?php echo $img_width; ?'.'>',
                 '<?php echo $img_height; ?'.'>',
                 '<?php echo $result["obrazek"]; ?'.'>',
                 '<?php echo StrFTime("%H:%M %d.%m.%Y", strtotime($result["datum"])); ?'.'>',
                 '<?php echo StrFTime("%d.%m.%Y %H:%M", strtotime($result["datum"])); ?'.'>',
                 '<?php echo StrFTime("%d.%m.%Y", strtotime($result["datum"])); ?'.'>',
                 '<?php echo StrFTime("%H:%M", strtotime($result["datum"])); ?'.'>',
                 '<?php echo StrFTime("%A %d.%m.%Y", strtotime($result["datum"])); ?'.'>',
                 '<?php echo $result["pocet"]; ?'.'>',
                 '<?php echo \'<a href="?jtcms-category=\'.$result["kategorie"].\'">\'.$kategorie.\'</a>\'; ?'.'>',
                 '<?php echo $kategorie; ?'.'>',
                 '<?php echo $pridal; ?'.'>',
                 '<?php echo $pridal_text; ?'.'>',
                 '<?php echo \'<a href="?jtcms-article=\'.$result["id"].\'">Celý článek</a>\'; ?'.'>',
                 '<?php echo \'<a href="?jtcms-article=\'.$result["id"].\'">\'; ?'.'>',
                 '<?php echo \'</a>\'; ?'.'>',
                 '<?php echo \'<a href="?jtcms-article=\'.$result["id"].\'#jtcms-kom-form">\'.$komentare.\'</a>\'; ?'.'>',
                 '<?php echo $komentare; ?'.'>',
                 '<?php if (isset($stitky_a)) {for ($p = 0; $p < count($stitky_a); $p++) {echo $stitky_a[$p]; if ($p != (count($stitky_a)-1)) {echo \', \';};};}; ?'.'>',
                 '<?php if (isset($stitky_text)) {for ($p = 0; $p < count($stitky_text); $p++) {echo $stitky_text[$p]; if ($p != (count($stitky_text)-1)) {echo \', \';};};}; ?'.'>'
                 ); 
                                                                  
$slozene = array('{NAZEV}','{NAZEV_TEXT}','{ID}','{PEREX}','{OBSAH}','{IMAGE}','{IMAGE_URL}','{IMAGE_WIDTH}','{IMAGE_HEIGHT}','{IMAGE_NAME}',
                 '{DATUM_TIMEDATE}','{DATUM_DATETIME}','{DATUM_DATE}','{DATUM_TIME}','{DATUM_DAY_DATE}','{PRECTENI}','{KATEGORIE}','{KATEGORIE_TEXT}',
                 '{PRIDAL}','{PRIDAL_TEXT}','{LINK}','{LINK_CUS}','{/LINK_CUS}','{KOMENTARE}','{KOMENTARE_TEXT}','{STITKY}','{STITKY_TEXT}');

break;

case "2" :

$resulty = array('<?php echo \'<a href="?jtcms-article=\'.$result["id"].\'">\'.$result["nazev"].\'</a>\'; ?'.'>',
                 '<?php echo $result["nazev"]; ?'.'>',
                 '<?php echo $result["id"]; ?'.'>',
                 '<?php show_content($result["perex"]); ?'.'>',
                 '<?php show_content($result["obsah"]); ?'.'>',
                 '<?php if (!empty($result["obrazek"]) && file_exists("./admin/data/art_img/".$result["obrazek"])) {echo \'<img src="./admin/data/art_img/\'.$result["obrazek"].\'" alt="\'.$result["obrazek"].\'" width="\'.$img_width.\'" height="\'.$img_height.\'">\';}; ?'.'>',
                 '<?php echo "./data/admin/art_img/".$result["obrazek"]; ?'.'>',
                 '<?php echo $img_width; ?'.'>',
                 '<?php echo $img_height; ?'.'>',
                 '<?php echo $result["obrazek"]; ?'.'>',
                 '<?php echo StrFTime("%H:%M %d.%m.%Y", strtotime($result["datum"])); ?'.'>',
                 '<?php echo StrFTime("%d.%m.%Y %H:%M", strtotime($result["datum"])); ?'.'>',
                 '<?php echo StrFTime("%d.%m.%Y", strtotime($result["datum"])); ?'.'>',
                 '<?php echo StrFTime("%H:%M", strtotime($result["datum"])); ?'.'>',
                 '<?php echo StrFTime("%A %d.%m.%Y", strtotime($result["datum"])); ?'.'>',
                 '<?php echo $result["pocet"]; ?'.'>',
                 '<?php echo \'<a href="?jtcms-category=\'.$result["kategorie"].\'">\'.$kategorie.\'</a>\'; ?'.'>',
                 '<?php echo $kategorie; ?'.'>',
                 '<?php echo $pridal; ?'.'>',
                 '<?php echo $pridal_text; ?'.'>',
                 '<?php echo \'<a href="?jtcms-article=\'.$result["id"].\'">Celý článek</a>\'; ?'.'>',
                 '<?php echo \'<a href="?jtcms-article=\'.$result["id"].\'">\'; ?'.'>',
                 '<?php echo \'</a>\'; ?'.'>',
                 '<?php echo \'<a href="?jtcms-article=\'.$result["id"].\'#jtcms-kom-form">\'.$komentare.\'</a>\'; ?'.'>',
                 '<?php echo $komentare; ?'.'>',
                 '<?php if (isset($stitky_a)) {for ($p = 0; $p < count($stitky_a); $p++) {echo $stitky_a[$p]; if ($p != (count($stitky_a)-1)) {echo \', \';};};}; ?'.'>',
                 '<?php if (isset($stitky_text)) {for ($p = 0; $p < count($stitky_text); $p++) {echo $stitky_text[$p]; if ($p != (count($stitky_text)-1)) {echo \', \';};};}; ?'.'>'
                 ); 
                                                                  
$slozene = array('{NAZEV}','{NAZEV_TEXT}','{ID}','{PEREX}','{OBSAH}','{IMAGE}','{IMAGE_URL}','{IMAGE_WIDTH}','{IMAGE_HEIGHT}','{IMAGE_NAME}',
                 '{DATUM_TIMEDATE}','{DATUM_DATETIME}','{DATUM_DATE}','{DATUM_TIME}','{DATUM_DAY_DATE}','{PRECTENI}','{KATEGORIE}','{KATEGORIE_TEXT}',
                 '{PRIDAL}','{PRIDAL_TEXT}','{LINK}','{LINK_CUS}','{/LINK_CUS}','{KOMENTARE}','{KOMENTARE_TEXT}','{STITKY}','{STITKY_TEXT}');

break;

case "3" :

$resulty = array('<?php for($c=1; $c<$pocet_stran+1; $c++) {echo \'<a href="?page=\'.$c; if (isset($_GET[\'jtcms-category\'])) {echo \'&amp;jtcms-category=\'.$_GET[\'jtcms-category\'];}; if (isset($_GET[\'jtcms-tag\'])) {echo \'&amp;jtcms-tag=\'.$_GET[\'jtcms-tag\'];}; echo \'"\'; if ((isset($_GET[\'page\']) && $_GET[\'page\'] == $c) or (!isset($_GET[\'page\']) && $c == 1)) {echo \' class="jtcms-pag-aktiv"\';}; echo \'>\'.$c.\'</a>\'."\n";}; ?'.'>'
                );
                
$slozene = array('{STRANKOVANI}');

break;

case "4" :

$resulty = array('<?php echo \'<a href="?jtcms-article=\'.$result["id"].\'">\'.$result["nazev"].\'</a>\'; ?'.'>',
                 '<?php echo $result["nazev"]; ?'.'>',
                 '<?php echo $result["id"]; ?'.'>',
                 '<?php show_content($result["obsah"]); ?'.'>',
                 '<?php echo StrFTime("%H:%M %d.%m.%Y", strtotime($result["datum"])); ?'.'>',
                 '<?php echo StrFTime("%d.%m.%Y %H:%M", strtotime($result["datum"])); ?'.'>',
                 '<?php echo StrFTime("%d.%m.%Y", strtotime($result["datum"])); ?'.'>',
                 '<?php echo StrFTime("%H:%M", strtotime($result["datum"])); ?'.'>',
                 '<?php echo StrFTime("%A %d.%m.%Y", strtotime($result["datum"])); ?'.'>',
                 '<?php echo $result["pocet"]; ?'.'>',
                 '<?php echo $pridal; ?'.'>',
                 '<?php echo $pridal_text; ?'.'>',
                 '<?php echo \'<a href="?jtcms-article=\'.$result["id"].\'#jtcms-kom-form">\'.$komentare.\'</a>\'; ?'.'>',
                 '<?php echo $komentare; ?'.'>'
                );
                
$slozene = array('{NAZEV}','{NAZEV_TEXT}','{ID}','{OBSAH}','{DATUM_TIMEDATE}','{DATUM_DATETIME}','{DATUM_DATE}','{DATUM_TIME}','{DATUM_DAY_DATE}',
                 '{PRECTENI}','{PRIDAL}','{PRIDAL_TEXT}','{KOMENTARE}','{KOMENTARE_TEXT}');
                                                                                    
break;

case "5" :

$resulty = array('<?php echo $result["id"]; ?'.'>',
                 '<?php echo \'<a href="?jtcms-category=\'.$result["id"].\'">\'.$result["nazev"].\'</a>\'; ?'.'>',
                 '<?php echo $result["nazev"]; ?'.'>',
                 '<?php echo $pocet; ?'.'>',
                );

$slozene = array('{ID}','{NAZEV}','{NAZEV_TEXT}','{POCET}');

break;

case "6" :

$resulty = array('<?php echo $result["id"]; ?'.'>',
                 '<?php echo \'<a href="?jtcms-page=\'.$result["id"].\'">\'.$result["nazev"].\'</a>\'; ?'.'>',
                 '<?php echo $result["nazev"]; ?'.'>',
                );

$slozene = array('{ID}','{NAZEV}','{NAZEV_TEXT}');

break;

case "7" :

$resulty = array('<?php echo $result["id"]; ?'.'>',
                 '<?php echo $result["obsah"]; ?'.'>',
                 '<?php echo $result["jmeno"]; ?'.'>',
                 '<?php echo $result["mail"]; ?'.'>',
                 '<?php echo \'<a href="\'.$result["web"].\'">\'.$result["web"].\'</a>\'; ?'.'>',
                 '<?php echo $result["web"]; ?'.'>',
                 '<?php if (!empty($result["web"])) {echo \'<a href="\'.$result["web"].\'">\'.$result["jmeno"].\'</a>\';} else {echo $result["jmeno"];}; ?'.'>',
                 '<?php echo StrFTime("%H:%M %d.%m.%Y", strtotime($result["datum"])); ?'.'>',
                 '<?php echo StrFTime("%d.%m.%Y %H:%M", strtotime($result["datum"])); ?'.'>',
                 '<?php echo StrFTime("%d.%m.%Y", strtotime($result["datum"])); ?'.'>',
                 '<?php echo StrFTime("%H:%M", strtotime($result["datum"])); ?'.'>',
                 '<?php echo StrFTime("%A %d.%m.%Y", strtotime($result["datum"])); ?'.'>'
                );
                                                  
$slozene = array('{ID}','{OBSAH}','{JMENO}','{MAIL}','{WEB}','{WEB_TEXT}','{JMENO_WEB}',
                 '{DATUM_TIMEDATE}','{DATUM_DATETIME}','{DATUM_DATE}','{DATUM_TIME}','{DATUM_DAY_DATE}');

break;

case "8" :

$resulty = array('<form method="post" action="<?php if (isset($_GET["jtcms-article"])) {echo \'?jtcms-article=\'.$id.\'&amp;jtcms-kom=added\';} else {echo \'?jtcms-page=\'.$id.\'&amp;jtcms-kom=added\';}; ?'.'>" id="jtcms-kom-form">',
                 'name="jtcms_jmeno"<?php if (!empty($_POST["jtcms_jmeno"])) {echo \' value="\'.htmlspecialchars($_POST["jtcms_jmeno"]).\'"\';}; ?'.'>',
                 'name="jtcms_mail"<?php if (!empty($_POST["jtcms_mail"])) {echo \' value="\'.htmlspecialchars($_POST["jtcms_mail"]).\'"\';}; ?'.'>',
                 'name="jtcms_web"<?php if (!empty($_POST["jtcms_web"])) {echo \' value="\'.htmlspecialchars($_POST["jtcms_web"]).\'"\';}; ?'.'>',
                 '<?php if (!empty($_POST["jtcms_obsah"])) {echo htmlspecialchars($_POST["jtcms_obsah"]);}; ?'.'></textarea>'); 

$slozene = array('<form>',
                 'name="jtcms_jmeno"',
                 'name="jtcms_mail"',
                 'name="jtcms_web"',
                 '</textarea>');

break;

case "11" :

$resulty = array('./admin/data/gal/\'.$id.\'/\'.$soubor.\'',
                 '\'.$id.\'',
                 '\'.$soubor.\'',                     
                 '\'.$sirka.\'',
                 '\'.$vyska.\'');
                     
$slozene = array('{CESTA}',
                 '{ID}',
                 '{NAZEV}',                     
                 '{AUTO_WIDTH}',
                 '{AUTO_HEIGHT}');

break;

case "12" :

$resulty = array('<?php echo $result["id"]; ?'.'>',
                 '<?php echo \'<a href="?jtcms-tag=\'.$result["id"].\'">\'.$result["nazev"].\'</a>\'; ?'.'>',
                 '<?php echo $result["nazev"]; ?'.'>');
                 
$slozene = array('{ID}','{NAZEV}','{NAZEV_TEXT}');

break;

case "13" :

$resulty = array('<?php echo $result["id"]; ?'.'>',
                 '<?php echo $result["jmeno"]; ?'.'>',
                 '<?php echo $result["mail"]; ?'.'>',
                 '<?php echo $result["info1"]; ?'.'>',
                 '<?php echo StrFTime("%d.%m.%Y", strtotime($result["info2"])); ?'.'>',
                 '<?php echo $result["info3"]; ?'.'>',
                 '<?php echo $result["info4"]; ?'.'>',
                 '<?php echo $result["info5"]; ?'.'>',
                 '<?php echo $result["info12"]; ?'.'>',
                 '<?php echo $result["info13"]; ?'.'>',
                 '<?php echo $result["info14"]; ?'.'>',
                 '<?php echo $result["info15"]; ?'.'>',
                 '<?php echo $result["info16"]; ?'.'>',
                 '<?php echo $result["info17"]; ?'.'>',
                 '<?php echo $result["info18"]; ?'.'>'
                );
      
$slozene = array('{ID}','{PREZDIVKA}','{MAIL}','{JMENO_PRIJMENI}','{NAROZENI}','{POHLAVI}','{BYDLISTE}','{O_MNE}','{WEB}','{TELEFON}','{TWITTER}','{FACEBOOK}',
                 '{GOOGLE+}','{ICQ}','{SKYPE}','{O_MNE}');

break;
};

echo '<h1>'.$lang['set_templates_edit_template'].'</h1><br />';

  if (empty($id) or !fopen("stuff/templates/template_".$id.".php", "r")) {
    echo '<div class="oznameni_div">';
    echo '<div class="chyba">'.$lang['set_templates_error'].'</div>';
    if (empty($id)) {echo '<p>'.$lang['set_templates_er_1'].'</p>';};
    if (!fopen("stuff/templates/template_".$id.".php", "r")) {echo '<p>'.$lang['set_templates_er_2'].'</p>';};
    echo '</div>';
    
    include_end();
    exit();
  };
  
  if (!isset($_GET['work'])) {$_GET['work'] = "default";};
  if ($_GET['work'] == "complete") {
    echo '<div class="oznameni_div">';
    echo '<p>'.$lang['set_templates_work_1'].'</p>';
    echo '</div>';
  }; 

$soubor = fopen("stuff/templates/template_".$id.".php", "r");
$sablona = fread($soubor, filesize("stuff/templates/template_".$id.".php"));
fclose($soubor);

$sablona = str_replace($resulty,$slozene,$sablona);

  if ($id == 11) {$sablona = str_replace('<?php $kod .= \'', '', $sablona);
                  $sablona = str_replace('\'; ?'.'>', '', $sablona);};
  
  
if (!empty($_POST)) {
  $sablona = $_POST['sablona'];
  $sablona = str_replace($slozene,$resulty,$sablona);
  if ($id == 11) {$sablona = str_replace("'", "\"", $sablona);
                  $sablona = '<?php $kod .= \''.$sablona.'\'; ?'.'>';};
  $soubor = fopen("stuff/templates/template_".$id.".php", "w");
  fwrite($soubor, $sablona);
  fclose($soubor);
  
  Header("Location: set_templates.php?action=edit&id=".$id."&work=complete");
  echo '<script type="text/javascript">location.replace("set_templates.php?action=edit&id='.$id.'work=complete")</script>';
};
  
switch ($_GET['id']) {

case "1" :
?>
<div class="templates">
<div>
  <span class="tag">{NAZEV}</span> = <?php echo $lang['set_templates_1_1']; ?> - <span onclick="$(this).next().slideToggle();" class="moznosti"><?php echo $lang['set_templates_more_options']; ?></span>
    <div class="nastaveni">
      <span class="tag">{NAZEV_TEXT}</span> = <?php echo $lang['set_templates_1_2']; ?>
    </div>
</div>
<div>
  <span class="tag">{ID}</span> = <?php echo $lang['set_templates_1_3']; ?><br />
</div>
<div>
  <span class="tag">{PEREX}</span> = <?php echo $lang['set_templates_1_4']; ?><br />
</div>
<div>
  <span class="tag">{OBSAH}</span> = <?php echo $lang['set_templates_1_5']; ?><br />
</div>
<div>
  <span class="tag">{IMAGE}</span> = <?php echo $lang['set_templates_1_21']; ?> - <span onclick="$(this).next().slideToggle();" class="moznosti"><?php echo $lang['set_templates_more_options']; ?></span>
    <div class="nastaveni">
      <span class="tag">{IMAGE_URL}</span> = <?php echo $lang['set_templates_1_22']; ?><br />
      <span class="tag">{IMAGE_WIDTH}</span> = <?php echo $lang['set_templates_1_23']; ?><br />
      <span class="tag">{IMAGE_HEIGHT}</span> = <?php echo $lang['set_templates_1_24']; ?><br />
      <span class="tag">{IMAGE_NAME}</span> = <?php echo $lang['set_templates_1_25']; ?><br />
    </div>
</div>
<div>
  <span class="tag">{DATUM_TIMEDATE}</span> = <?php echo $lang['set_templates_1_6']; ?> - <span onclick="$(this).next().slideToggle();" class="moznosti"><?php echo $lang['set_templates_more_options']; ?></span>
    <div class="nastaveni">
      <span class="tag">{DATUM_DATETIME}</span> = <?php echo $lang['set_templates_1_7']; ?><br />
      <span class="tag">{DATUM_DATE}</span> = <?php echo $lang['set_templates_1_8']; ?><br />
      <span class="tag">{DATUM_TIME}</span> = <?php echo $lang['set_templates_1_9']; ?><br />
      <span class="tag">{DATUM_DAY_DATE}</span> = <?php echo $lang['set_templates_1_10']; ?><br />
    </div>
</div>
<div>
  <span class="tag">{PRECTENI}</span> = <?php echo $lang['set_templates_1_11']; ?><br />
</div>
<div>
  <span class="tag">{KATEGORIE}</span> = <?php echo $lang['set_templates_1_12']; ?> - <span onclick="$(this).next().slideToggle();" class="moznosti"><?php echo $lang['set_templates_more_options']; ?></span>
    <div class="nastaveni">
      <span class="tag">{KATEGORIE_TEXT}</span> = <?php echo $lang['set_templates_1_13']; ?><br />
    </div>
</div>
<div>
  <span class="tag">{PRIDAL}</span> = <?php echo $lang['set_templates_1_14']; ?> - <span onclick="$(this).next().slideToggle();" class="moznosti"><?php echo $lang['set_templates_more_options']; ?></span>
    <div class="nastaveni">
      <span class="tag">{PRIDAL_TEXT}</span> = <?php echo $lang['set_templates_1_26']; ?><br />
    </div>
</div>
<div>
  <span class="tag">{LINK}</span> = <?php echo $lang['set_templates_1_15']; ?> - <span onclick="$(this).next().slideToggle();" class="moznosti"><?php echo $lang['set_templates_more_options']; ?></span>
    <div class="nastaveni">
      <span class="tag">{LINK_CUS}</span> <span class="tag">{/LINK_CUS}</span> = <?php echo $lang['set_templates_1_16']; ?><br />
    </div>
</div>
<div>
  <span class="tag">{KOMENTARE}</span> = <?php echo $lang['set_templates_1_17']; ?> - <span onclick="$(this).next().slideToggle();" class="moznosti"><?php echo $lang['set_templates_more_options']; ?></span>
    <div class="nastaveni">
      <span class="tag">{KOMENTARE_TEXT}</span> = <?php echo $lang['set_templates_1_18']; ?><br />
    </div>
</div>
<div>
  <span class="tag">{STITKY}</span> = <?php echo $lang['set_templates_1_19']; ?> - <span onclick="$(this).next().slideToggle();" class="moznosti"><?php echo $lang['set_templates_more_options']; ?></span>
    <div class="nastaveni">
      <span class="tag">{STITKY_TEXT}</span> = <?php echo $lang['set_templates_1_20']; ?><br />
    </div>
</div>
</div>

<?php
break;

case "2" :
?>
<div class="templates">
<div>
  <span class="tag">{NAZEV}</span> = <?php echo $lang['set_templates_2_1']; ?> - <span onclick="$(this).next().slideToggle();" class="moznosti"><?php echo $lang['set_templates_more_options']; ?></span>
    <div class="nastaveni">
      <span class="tag">{NAZEV_TEXT}</span> = <?php echo $lang['set_templates_2_2']; ?><br />
    </div>
</div>
<div>
  <span class="tag">{ID}</span> = <?php echo $lang['set_templates_2_3']; ?><br />
</div>
<div>
  <span class="tag">{PEREX}</span> = <?php echo $lang['set_templates_2_4']; ?><br />
</div>
<div>
  <span class="tag">{OBSAH}</span> = <?php echo $lang['set_templates_2_5']; ?><br />
</div>
<div>
  <span class="tag">{IMAGE}</span> = <?php echo $lang['set_templates_1_21']; ?> - <span onclick="$(this).next().slideToggle();" class="moznosti"><?php echo $lang['set_templates_more_options']; ?></span>
    <div class="nastaveni">
      <span class="tag">{IMAGE_URL}</span> = <?php echo $lang['set_templates_1_22']; ?><br />
      <span class="tag">{IMAGE_WIDTH}</span> = <?php echo $lang['set_templates_1_23']; ?><br />
      <span class="tag">{IMAGE_HEIGHT}</span> = <?php echo $lang['set_templates_1_24']; ?><br />
      <span class="tag">{IMAGE_NAME}</span> = <?php echo $lang['set_templates_1_25']; ?><br />
    </div>
</div>
<div>
  <span class="tag">{DATUM_TIMEDATE}</span> = <?php echo $lang['set_templates_2_6']; ?> - <span onclick="$(this).next().slideToggle();" class="moznosti"><?php echo $lang['set_templates_more_options']; ?></span>
    <div class="nastaveni">
      <span class="tag">{DATUM_DATETIME}</span> = <?php echo $lang['set_templates_2_7']; ?><br />
      <span class="tag">{DATUM_DATE}</span> = <?php echo $lang['set_templates_2_8']; ?><br />
      <span class="tag">{DATUM_TIME}</span> = <?php echo $lang['set_templates_2_9']; ?><br />
      <span class="tag">{DATUM_DAY_DATE}</span> = <?php echo $lang['set_templates_2_10']; ?><br />
    </div>
</div>
<div>
  <span class="tag">{PRECTENI}</span> = <?php echo $lang['set_templates_2_11']; ?><br />
</div>
<div>
  <span class="tag">{KATEGORIE}</span> = <?php echo $lang['set_templates_2_12']; ?> - <span onclick="$(this).next().slideToggle();" class="moznosti"><?php echo $lang['set_templates_more_options']; ?></span>
    <div class="nastaveni">
      <span class="tag">{KATEGORIE_TEXT}</span> = <?php echo $lang['set_templates_2_13']; ?><br />
    </div>
</div>
<div>
  <span class="tag">{PRIDAL}</span> = <?php echo $lang['set_templates_2_14']; ?> - <span onclick="$(this).next().slideToggle();" class="moznosti"><?php echo $lang['set_templates_more_options']; ?></span>
    <div class="nastaveni">
      <span class="tag">{PRIDAL_TEXT}</span> = <?php echo $lang['set_templates_2_26']; ?><br />
    </div>
</div>
<div>
  <span class="tag">{LINK}</span> = <?php echo $lang['set_templates_2_15']; ?> - <span onclick="$(this).next().slideToggle();" class="moznosti"><?php echo $lang['set_templates_more_options']; ?></span>
    <div class="nastaveni">
      <span class="tag">{LINK_CUS}</span> <span class="tag">{/LINK_CUS}</span> = <?php echo $lang['set_templates_2_16']; ?><br />
    </div>
</div>
<div>
  <span class="tag">{KOMENTARE}</span> = <?php echo $lang['set_templates_2_17']; ?> - <span onclick="$(this).next().slideToggle();" class="moznosti"><?php echo $lang['set_templates_more_options']; ?></span>
    <div class="nastaveni">
      <span class="tag">{KOMENTARE_TEXT}</span> = <?php echo $lang['set_templates_2_18']; ?><br />
    </div>
</div>
<div>
  <span class="tag">{STITKY}</span> = <?php echo $lang['set_templates_2_19']; ?> - <span onclick="$(this).next().slideToggle();" class="moznosti"><?php echo $lang['set_templates_more_options']; ?></span>
    <div class="nastaveni">
      <span class="tag">{STITKY_TEXT}</span> = <?php echo $lang['set_templates_2_20']; ?><br />
    </div>
</div>
</div>
<?php
break;

case "3" : ?>

<div class="templates">
<div>
  <span class="tag">{STRANKOVANI}</span> = <?php echo $lang['set_templates_3_1']; ?><br />
</div>
<br />
<p><?php echo $lang['set_templates_3_2']; ?></p>
</div>

<?php
break;

case "4" : ?>

<div class="templates">
<div>
  <span class="tag">{NAZEV}</span> = <?php echo $lang['set_templates_4_1']; ?> - <span onclick="$(this).next().slideToggle();" class="moznosti"><?php echo $lang['set_templates_more_options']; ?></span>
    <div class="nastaveni">
      <span class="tag">{NAZEV_TEXT}</span> = <?php echo $lang['set_templates_4_2']; ?><br />
    </div>
</div>
<div>
  <span class="tag">{ID}</span> = <?php echo $lang['set_templates_4_3']; ?><br />
</div>
<div>
  <span class="tag">{OBSAH}</span> = <?php echo $lang['set_templates_4_4']; ?><br />
</div>
<div>
  <span class="tag">{DATUM_TIMEDATE}</span> = <?php echo $lang['set_templates_4_5']; ?> - <span onclick="$(this).next().slideToggle();" class="moznosti"><?php echo $lang['set_templates_more_options']; ?></span>
    <div class="nastaveni">
      <span class="tag">{DATUM_DATETIME}</span> = <?php echo $lang['set_templates_4_6']; ?><br />
      <span class="tag">{DATUM_DATE}</span> = <?php echo $lang['set_templates_4_7']; ?><br />
      <span class="tag">{DATUM_TIME}</span> = <?php echo $lang['set_templates_4_8']; ?><br />
      <span class="tag">{DATUM_DAY_DATE}</span> = <?php echo $lang['set_templates_4_9']; ?><br />
    </div>
</div>
<div>
  <span class="tag">{PRECTENI}</span> = <?php echo $lang['set_templates_4_10']; ?><br />
</div>
<div>
  <span class="tag">{PRIDAL}</span> = <?php echo $lang['set_templates_4_11']; ?> - <span onclick="$(this).next().slideToggle();" class="moznosti"><?php echo $lang['set_templates_more_options']; ?></span>
    <div class="nastaveni">
      <span class="tag">{PRIDAL_TEXT}</span> = <?php echo $lang['set_templates_4_14']; ?><br />
    </div>
</div>
<div>
  <span class="tag">{KOMENTARE}</span> = <?php echo $lang['set_templates_4_12']; ?> - <span onclick="$(this).next().slideToggle();" class="moznosti"><?php echo $lang['set_templates_more_options']; ?></span>
    <div class="nastaveni">
      <span class="tag">{KOMENTARE_TEXT}</span> = <?php echo $lang['set_templates_4_13']; ?><br />
    </div>
</div>
</div>


<?php
break;

case "5" : ?>

<div class="templates">
<div>
  <span class="tag">{ID}</span> = <?php echo $lang['set_templates_5_1']; ?><br />
</div>
<div>
  <span class="tag">{NAZEV}</span> = <?php echo $lang['set_templates_5_2']; ?> - <span onclick="$(this).next().slideToggle();" class="moznosti"><?php echo $lang['set_templates_more_options']; ?></span>
    <div class="nastaveni">
      <span class="tag">{NAZEV_TEXT}</span> = <?php echo $lang['set_templates_5_3']; ?><br />
    </div>
</div>
<div>
  <span class="tag">{POCET}</span> = <?php echo $lang['set_templates_5_4']; ?><br />
</div>
</div>

<?php
break;

case "6" : ?>

<div class="templates">
<div>
  <span class="tag">{ID}</span> = <?php echo $lang['set_templates_6_1']; ?><br />
</div>
<div>
  <span class="tag">{NAZEV}</span> = <?php echo $lang['set_templates_6_2']; ?> - <span onclick="$(this).next().slideToggle();" class="moznosti"><?php echo $lang['set_templates_more_options']; ?></span>
    <div class="nastaveni">
      <span class="tag">{NAZEV_TEXT}</span> = <?php echo $lang['set_templates_6_3']; ?><br />
    </div>
</div>
</div>

<?php
break;

case "7" : ?>

<div class="templates">
<div>
  <span class="tag">{ID}</span> = <?php echo $lang['set_templates_7_1']; ?><br />
</div>
<div>
  <span class="tag">{KOM_OBSAH}</span> = <?php echo $lang['set_templates_7_2']; ?><br />
</div>
<div>
  <span class="tag">{JMENO}</span> = <?php echo $lang['set_templates_7_3']; ?><br />
</div>
<div>
  <span class="tag">{MAIL}</span> = <?php echo $lang['set_templates_7_4']; ?><br />
</div>
<div>
  <span class="tag">{WEB}</span> = <?php echo $lang['set_templates_7_5']; ?> - <span onclick="$(this).next().slideToggle();" class="moznosti"><?php echo $lang['set_templates_more_options']; ?></span>
    <div class="nastaveni">
      <span class="tag">{WEB_TEXT}</span> = <?php echo $lang['set_templates_7_6']; ?><br />
    </div>
</div>
<div>
  <span class="tag">{JMENO_WEB}</span> = <?php echo $lang['set_templates_7_7']; ?><br />
</div>
<div>
  <span class="tag">{DATUM_TIMEDATE}</span> = <?php echo $lang['set_templates_7_8']; ?> - <span onclick="$(this).next().slideToggle();" class="moznosti"><?php echo $lang['set_templates_more_options']; ?></span>
    <div class="nastaveni">
      <span class="tag">{DATUM_DATETIME}</span> = <?php echo $lang['set_templates_7_9']; ?><br />
      <span class="tag">{DATUM_DATE}</span> = <?php echo $lang['set_templates_7_10']; ?><br />
      <span class="tag">{DATUM_TIME}</span> = <?php echo $lang['set_templates_7_11']; ?><br />
      <span class="tag">{DATUM_DAY_DATE}</span> = <?php echo $lang['set_templates_7_12']; ?><br />
    </div>
</div>
</div>

<?php
break;

case "8" : ?>

<div class="templates">
<div class="pozor"><?php echo $lang['set_templates_8_1']; ?></div>
<p><?php echo $lang['set_templates_8_2']; ?></p>
</div>

<?php
break;

case "11" :  ?>

<div class="templates">
<div>
  <span class="tag">{ID}</span> = <?php echo $lang['set_templates_11_1']; ?><br />
</div>
<div>
  <span class="tag">{NAZEV}</span> = <?php echo $lang['set_templates_11_2']; ?><br />
</div>
<div>
  <span class="tag">{CESTA}</span> = <?php echo $lang['set_templates_11_3']; ?><br />
</div>
<div>
  <span class="tag">{AUTO_WIDTH}</span> = <?php echo $lang['set_templates_11_4']; ?><br />
</div>
<div>
  <span class="tag">{AUTO_HEIGHT}</span> = <?php echo $lang['set_templates_11_5']; ?><br />
</div>
<br />
<p><?php echo $lang['set_templates_11_6']; ?></p>
</div>

<?php
break;

case "12" : ?>

<div class="templates">
<div>
  <span class="tag">{ID}</span> = <?php echo $lang['set_templates_12_1']; ?><br />
</div>
<div>
  <span class="tag">{NAZEV}</span> = <?php echo $lang['set_templates_12_2']; ?> - <span onclick="$(this).next().slideToggle();" class="moznosti"><?php echo $lang['set_templates_more_options']; ?></span>
    <div class="nastaveni">
      <span class="tag">{NAZEV_TEXT}</span> = <?php echo $lang['set_templates_12_3']; ?><br />
    </div>
</div>
</div>


<?php
break;

case "13" : ?>

<div class="templates">
<div>
  <span class="tag">{ID}</span> = <?php echo $lang['set_templates_13_1']; ?><br />
</div>
<div>
  <span class="tag">{PREZDIVKA}</span> = <?php echo $lang['set_templates_13_2']; ?><br />
</div>
<div>
  <span class="tag">{MAIL}</span> = <?php echo $lang['set_templates_13_15']; ?><br />
</div>
<div>
  <span class="tag">{JMENO_PRIJMENI}</span> = <?php echo $lang['set_templates_13_3']; ?><br />
</div>
<div>
  <span class="tag">{NAROZENI}</span> = <?php echo $lang['set_templates_13_4']; ?><br />
</div>
<div>
  <span class="tag">{POHLAVI}</span> = <?php echo $lang['set_templates_13_5']; ?><br />
</div>
<div>
  <span class="tag">{BYDLISTE}</span> = <?php echo $lang['set_templates_13_6']; ?><br />
</div>
<div>
  <span class="tag">{WEB}</span> = <?php echo $lang['set_templates_13_7']; ?><br />
</div>
<div>
  <span class="tag">{TELEFON}</span> = <?php echo $lang['set_templates_13_8']; ?><br />
</div>
<div>
  <span class="tag">{TWITTER}</span> = <?php echo $lang['set_templates_13_9']; ?><br />
</div>
<div>
  <span class="tag">{FACEBOOK}</span> = <?php echo $lang['set_templates_13_10']; ?><br />
</div>
<div>
  <span class="tag">{GOOGLE+}</span> = <?php echo $lang['set_templates_13_11']; ?><br />
</div>
<div>
  <span class="tag">{ICQ}</span> = <?php echo $lang['set_templates_13_12']; ?><br />
</div>
<div>
  <span class="tag">{SKYPE}</span> = <?php echo $lang['set_templates_13_13']; ?><br />
</div>
<div>
  <span class="tag">{O_MNE}</span> = <?php echo $lang['set_templates_13_14']; ?><br />
</div>
</div>

<?php
break;

}; ?>
<br />
<form method="post" action="set_templates.php?action=edit&amp;id=<?php echo $id; ?>" id="templates_form">
<textarea warp="hard" name="sablona"><?php echo htmlspecialchars($sablona); ?></textarea>
<br /><br />
<div class="tac">
<input type="submit" name="submit" value="<?php echo $lang['set_templates_submit_button']; ?>" class="submit" />
</div>
</form>  

<?php
break;

default : 

echo '<h1>'.$lang['set_templates_h1'].'</h1>';
echo '<br />';
?>

<div class="templates_seznam">
<div><a href="set_templates.php?action=edit&amp;id=1"><?php echo $lang['set_templates_def_1_1']; ?></a> - <?php echo $lang['set_templates_def_1_2']; ?></div>
<div><a href="set_templates.php?action=edit&amp;id=2"><?php echo $lang['set_templates_def_2_1']; ?></a> - <?php echo $lang['set_templates_def_2_2']; ?></div>
<div><a href="set_templates.php?action=edit&amp;id=3"><?php echo $lang['set_templates_def_3_1']; ?></a> - <?php echo $lang['set_templates_def_3_2']; ?></div>
<div><a href="set_templates.php?action=edit&amp;id=4"><?php echo $lang['set_templates_def_4_1']; ?></a> - <?php echo $lang['set_templates_def_4_2']; ?></div>
<div><a href="set_templates.php?action=edit&amp;id=5"><?php echo $lang['set_templates_def_5_1']; ?></a> - <?php echo $lang['set_templates_def_5_2']; ?></div>
<div><a href="set_templates.php?action=edit&amp;id=6"><?php echo $lang['set_templates_def_6_1']; ?></a> - <?php echo $lang['set_templates_def_6_2']; ?></div>
<div><a href="set_templates.php?action=edit&amp;id=12"><?php echo $lang['set_templates_def_12_1']; ?></a> - <?php echo $lang['set_templates_def_12_2']; ?></div>
<div><a href="set_templates.php?action=edit&amp;id=7"><?php echo $lang['set_templates_def_7_1']; ?></a> - <?php echo $lang['set_templates_def_7_2']; ?></div>
<div><a href="set_templates.php?action=edit&amp;id=8"><?php echo $lang['set_templates_def_8_1']; ?></a> - <?php echo $lang['set_templates_def_8_2']; ?></div>
<div><a href="set_templates.php?action=edit&amp;id=9"><?php echo $lang['set_templates_def_9_1']; ?></a> - <?php echo $lang['set_templates_def_9_2']; ?></div>
<div><a href="set_templates.php?action=edit&amp;id=10"><?php echo $lang['set_templates_def_10_1']; ?></a> - <?php echo $lang['set_templates_def_10_2']; ?></div>
<div><a href="set_templates.php?action=edit&amp;id=11"><?php echo $lang['set_templates_def_11_1']; ?></a> - <?php echo $lang['set_templates_def_11_2']; ?></div>
<div><a href="set_templates.php?action=edit&amp;id=13"><?php echo $lang['set_templates_def_13_1']; ?></a> - <?php echo $lang['set_templates_def_13_2']; ?></div>
</div>

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

<?php
};

include_end();
?>
