<?php
class Options {

  private $db;

  public function __construct() {
    $this->db = new Db_layer();
  }

  //---[CZ]: výběr jazyků
  public function print_languages($lang) {
    $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";
    }
    }
  }
  
  //---[CZ]: výběr skinů
  public function print_themes($theme) {
    $dir=opendir("./themes/");
    while ($file=readdir($dir)){
    $file=explode(".", $file);
    $name=$file[0];
    if ($name!="" AND $name!="admin" AND $file[1]=="css") {
    echo ("<option value=\"".$file[0]."\"");
    if ($file[0]==$theme) { echo " selected=\"selected\""; }
    echo ">$name</option>\n";
    }
    }
  }
  
  //---[CZ]: výběr práv
  public function print_rights($item) {
    for ($i=0; $i<4; $i++) {
    echo "<option value=\"$i\"";
    if ($item==$i) { echo " selected=\"selected\""; }
    echo ">$i</option>\n";
    }
  }

}
?>