<commit_before>
<?php if(defined("_SECURITY")){
     $acl = new ACL();
     if($acl -> hasPermission("settings_simple")){
        
        
         $languages = getAllLanguages();
        
         if(isset($_POST["submit"])){
             for($i = 0; $i < count($languages); $i++){
                
                 $lang = $languages[$i];
                 if(isset($_POST["frontpage_" . $lang])){
                     $page = db_escape($_POST["frontpage_" . $lang]);
                     setconfig("frontpage_" . $lang, $page);
                     if($lang == getconfig("default_language")){
                         setconfig("frontpage", $page);
                         }
                     }
                 }
             }
        
        
        
         $frontpages = array();
        
         for($i = 0; $i < count($languages); $i++){
             $lang = $languages[$i];
             $frontpages[$lang] = getconfig("frontpage_" . $lang);
            
             if(!$frontpages[$lang])
                 $frontpages[$lang] = getconfig("frontpage");
            
            
             }
        
        
        ?>
<h1><?php echo TRANSLATION_FRONTPAGE;?></h1>
<form action="index.php?action=frontpage_settings" id="frontpage_settings" method="post">
<table border=0>
<tr>
<td style="min-width:100px;"><strong>Sprache</strong></td>
<td><strong>Startseite</strong></td>
</tr>
<?php
        for($n = 0; $n < count($languages); $n++){
             $lang = $languages[$n];
            ?>
<tr>
<td><?php echo $lang;
            ?></td>
<td>
<select name="frontpage_<?php echo $lang;
            ?>" size=1 style="width:400px">
<?php

         $pages = getAllPages($lang, "title", true);
 
   for($i = 0; $i < count($pages);$i++){
                 if($pages[$i] == $frontpages[$lang]){
                     echo "<option value='" . $pages[$i]["id"] . "' selected='selected'>" . $pages[$i]["title"] . " (ID: " . $pages[$i]["id"].")</option>";
                     }else{
                     echo "<option value='" . $pages[$i]["id"] . "'>" . $pages[$i]["title"] . " (ID: " . $pages[$i]["id"].")</option>";
                     }
                
                 }
             ?>
</select>

</td>
<?php }
        ?>
<tr>
<td>
</td>
<td style="text-align:center">
<input type="submit" name="submit" value="Einstellungen Speichern">
</td>
</table>
</form>

<script type="text/javascript">
$("#frontpage_settings").ajaxForm({beforeSubmit: function(e){
  $("#message").html("");
  $("#loading").show();
  }, 
  success:function(e){
  $("#loading").hide();  
  $("#message").html("<span style=\"color:green;\">Die Einstellungen wurden gespeichert.</span>");
  }
  

}); 

</script>

<?php }else{
        noperms();
        }
    
    }
?><commit_msg>Frontpage trägt nun wieder systemname statt ID ein<commit_after>
<?php if(defined("_SECURITY")){
     $acl = new ACL();
     if($acl -> hasPermission("settings_simple")){
        
        
         $languages = getAllLanguages();
        
         if(isset($_POST["submit"])){
             for($i = 0; $i < count($languages); $i++){
                
                 $lang = $languages[$i];
                 if(isset($_POST["frontpage_" . $lang])){
                     $page = db_escape($_POST["frontpage_" . $lang]);
                     setconfig("frontpage_" . $lang, $page);
                     if($lang == getconfig("default_language")){
                         setconfig("frontpage", $page);
                         }
                     }
                 }
             }
        
        
        
         $frontpages = array();
        
         for($i = 0; $i < count($languages); $i++){
             $lang = $languages[$i];
             $frontpages[$lang] = getconfig("frontpage_" . $lang);
            
             if(!$frontpages[$lang])
                 $frontpages[$lang] = getconfig("frontpage");
            
            
             }
        
        
        ?>
<h1><?php echo TRANSLATION_FRONTPAGE;?></h1>
<form action="index.php?action=frontpage_settings" id="frontpage_settings" method="post">
<table border=0>
<tr>
<td style="min-width:100px;"><strong>Sprache</strong></td>
<td><strong>Startseite</strong></td>
</tr>
<?php
        for($n = 0; $n < count($languages); $n++){
             $lang = $languages[$n];
            ?>
<tr>
<td><?php echo $lang;
            ?></td>
<td>
<select name="frontpage_<?php echo $lang;
            ?>" size=1 style="width:400px">
<?php

         $pages = getAllPages($lang, "title", true);
 
   for($i = 0; $i < count($pages);$i++){
                 if($pages[$i]["systemname"] == $frontpages[$lang]){
                     echo "<option value='" . $pages[$i]["systemname"] . "' selected='selected'>" . $pages[$i]["title"] . " (ID: " . $pages[$i]["id"].")</option>";
                     }else{
                     echo "<option value='" . $pages[$i]["systemname"] . "'>" . $pages[$i]["title"] . " (ID: " . $pages[$i]["id"].")</option>";
                     }
                
                 }
             ?>
</select>

</td>
<?php }
        ?>
<tr>
<td>
</td>
<td style="text-align:center">
<input type="submit" name="submit" value="Einstellungen Speichern">
</td>
</table>
</form>

<script type="text/javascript">
$("#frontpage_settings").ajaxForm({beforeSubmit: function(e){
  $("#message").html("");
  $("#loading").show();
  }, 
  success:function(e){
  $("#loading").hide();  
  $("#message").html("<span style=\"color:green;\">Die Einstellungen wurden gespeichert.</span>");
  }
  

}); 

</script>

<?php }else{
        noperms();
        }
    
    }
?>
{'fraction_non_alphanumeric': 0.21003750669762458, 'fraction_numerical': 0.005000893016610109, 'mean_word_length': 1.8056112224448897, 'pattern_counts': {'":': 0, '<': 101, '<?xml version=': 0, '>': 95, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4868076', 'n_tokens_mistral': 1772, 'n_tokens_neox': 1730, 'n_words': 285}