<?php

// -----------------------------------------------------------------
// tady můžete nastavit práva (1 - 3)
// here you can set the rights (1 - 3)
if ($rights>=3):
// -----------------------------------------------------------------

if ($submit!="" AND $sql) {
echo "<div class=\"popup-success\">$lang_alert_success</div>";
}

?>

<h2><?php echo($lang_options); ?></h2>

<form action="./admin.php?f=options" method="post">

<div><strong><?php echo($lang_form_language_selection); ?>:</strong><br />
<select name="selected_language" style="width: 100px;">
<?php

$dir=opendir("./languages/");
while ($file=readdir($dir)){
$file=explode(".", $file);
$lang_name=strtoupper($file[0]);
if ($lang_name!="") {
echo ("<option value=\"".$file[0]."\"");
if ($file[0]==$lang) { echo " selected=\"selected\""; }
echo ">$lang_name</option>\n";
}
}

?>
</select>
</div>

<div><strong><?php echo($lang_form_theme_selection); ?>:</strong><br />
<select name="selected_theme" style="width: 200px;">
<?php

$dir=opendir("./styles/");
while ($file=readdir($dir)){
$file=explode(".", $file);
$lang_name=$file[0];
if ($lang_name!="" AND $lang_name!="admin" AND $file[1]=="css") {
echo ("<option value=\"".$file[0]."\"");
if ($file[0]==$theme) { echo " selected=\"selected\""; }
echo ">$lang_name</option>\n";
}
}

?>
</select>
</div>

<div><strong><?php echo($lang_form_sitename); ?>:</strong><br /><input type="text" name="sitename" value="<?php echo ($sitename); ?>" style="width: 300px;" /></div>

<div><strong><?php echo($lang_form_header); ?>:</strong><br /><input type="checkbox" name="show_infolane" value="1"<?php if ($show_infolane==1) { echo " checked=\"checked\""; } ?> /> <?php echo "$lang_form_show_infolane"; ?><br />
<input type="checkbox" name="show_sitename" value="1"<?php if ($show_sitename==1) { echo " checked=\"checked\""; } ?> /> <?php echo "$lang_form_show_sitename"; ?><br />
<strong><?php echo($lang_form_header_wallpaper); ?>:</strong><br /><input type="text" name="header_wallpaper" value="<?php if ($header_wallpaper=="") { echo "/gallery/"; } else { echo ($header_wallpaper); } ?>" style="width: 300px;" /> <?php echo($lang_form_header_wallpaper_height); ?>: <input type="text" name="header_wallpaper_height" value="<?php echo ($header_wallpaper_height); ?>" style="width: 30px;"<?php if ($submit!="" AND $_POST["header_wallpaper_height"]=="" AND $_POST["header_wallpaper"]!="" AND $_POST["header_wallpaper"]!="/gallery/") { echo " class=\"input-error\""; } ?> /> px</div>

<div><strong><?php echo($lang_index_news); ?> box:</strong><br /><input type="checkbox" name="show_news_box" value="1"<?php if ($show_news_box==1) { echo " checked=\"checked\""; } ?> /> <?php echo "$lang_form_show"; ?>, <?php echo($lang_form_number_of_items); ?>: <input type="text" name="news_box_items" value="<?php echo ($news_box_items); ?>" style="width: 30px;" /></div>

<div><strong><?php echo($lang_index_promo); ?> box:</strong><br /><input type="checkbox" name="show_promo_box" value="1"<?php if ($show_promo_box==1) { echo " checked=\"checked\""; } ?> /> <?php echo "$lang_form_show"; ?>, <?php echo($lang_form_number_of_items); ?>: <input type="text" name="promo_box_items" value="<?php echo ($promo_box_items); ?>" style="width: 30px;" /></div>

<div><strong><?php echo($lang_form_users_must_be_logged_in_for_writing_comments); ?>:</strong><br /><input type="radio" name="login_for_comments" value="1"<?php if ($login_for_comments==1) { echo " checked=\"checked\""; } ?> /> <?php echo "$lang_yes"; ?> <input type="radio" name="login_for_comments" value="0"<?php if ($login_for_comments==0) { echo " checked=\"checked\""; } ?> /> <?php echo "$lang_no"; ?></div>

<div><strong><?php echo($lang_form_show_text_of_the_article_if_perex_is_null); ?>:</strong><br /><input type="radio" name="show_text" value="1"<?php if ($show_text==1) { echo " checked=\"checked\""; } ?> /> <?php echo "$lang_yes"; ?> <input type="radio" name="show_text" value="0"<?php if ($show_text==0) { echo " checked=\"checked\""; } ?> /> <?php echo "$lang_no"; ?></div>

<div><strong><?php echo($lang_form_sort_sections_by_name); ?>:</strong><br /><input type="radio" name="sort_sections_by_name" value="1"<?php if ($sort_sections_by_name==1) { echo " checked=\"checked\""; } ?> /> <?php echo "$lang_yes"; ?> <input type="radio" name="sort_sections_by_name" value="0"<?php if ($sort_sections_by_name==0) { echo " checked=\"checked\""; } ?> /> <?php echo "$lang_no"; ?></div>

<div><strong><?php echo($lang_form_number_of_articles_in_sections); ?>:</strong><br /><input type="text" name="articles_number" value="<?php echo ($articles_number); ?>" style="width: 30px;" /></div>

<script src="./components/formater.js" type="text/javascript"></script>

<div><strong><?php echo($lang_form_content_of_left_column); ?>:</strong><br />
<div class="format-buttons">
<a href="#" onclick="format('[.strong.]', '[./strong.]', 'left_column'); return false;"><strong>B</strong></a>
<a href="#" onclick="format('[.em.]', '[./em.]', 'left_column'); return false;"><em>I</em></a>
<a href="#" onclick="format('[.underline.]', '[./underline.]', 'left_column'); return false;"><span style="text-decoration: underline;">U</span></a>
<a href="#" onclick="format('[.menu-title.]', '[./menu-title.]', 'left_column'); return false;">MENU TITLE</a>
<a href="#" onclick="var img=prompt('URL:', '/gallery/'); alt=prompt('Alt:', ''); format('[.img.]' + img + '[.alt]', alt + '[./]', 'left_column'); return false;">IMG</a>
<a href="#" onclick="var url=prompt('URL:', 'http://'); format('[.link.]' + url + '[.]', '[./link.]', 'left_column'); return false;">LINK</a>
<a href="#" onclick="format('[.center.]', '', 'left_column'); return false;">&gt;_&lt;</a>
</div>

<textarea name="left_column" id="left_column" cols="" rows="" style="width: 700px; height: 100px;"><?php echo ($left_column); ?></textarea><br /><strong><?php echo($lang_form_content_of_right_column); ?>:</strong>

<div class="format-buttons">
<a href="#" onclick="format('[.strong.]', '[./strong.]', 'right_column'); return false;"><strong>B</strong></a>
<a href="#" onclick="format('[.em.]', '[./em.]', 'right_column'); return false;"><em>I</em></a>
<a href="#" onclick="format('[.underline.]', '[./underline.]', 'right_column'); return false;"><span style="text-decoration: underline;">U</span></a>
<a href="#" onclick="format('[.menu-title.]', '[./menu-title.]', 'right_column'); return false;">MENU TITLE</a>
<a href="#" onclick="var img=prompt('URL:', '/gallery/'); alt=prompt('Alt:', ''); format('[.img.]' + img + '[.alt]', alt + '[./]', 'right_column'); return false;">IMG</a>
<a href="#" onclick="var url=prompt('URL:', 'http://'); format('[.link.]' + url + '[.]', '[./link.]', 'right_column'); return false;">LINK</a>
<a href="#" onclick="format('[.center.]', '', 'right_column'); return false;">&gt;_&lt;</a>
</div>

<textarea name="right_column" id="right_column" cols="" rows="" style="width: 700px; height: 100px;"><?php echo ($right_column); ?></textarea></div>

<div><input type="submit" name="submit" value="<?php echo($lang_button_save); ?>" /></div>

</form>

<?php else: $access_denied=1; endif; ?>