#30 imprint settings

This commit is contained in:
Ulrich Block 2014-09-21 20:22:38 +02:00
parent 2924d154e3
commit f836de67ca
3 changed files with 88 additions and 21 deletions

View File

@ -69,32 +69,31 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
$query2 = $sql->prepare("UPDATE imprints SET `imprint`=? WHERE `language`=? AND `resellerid`=? LIMIT 1");
$query3 = $sql->prepare("INSERT INTO `imprints` (`language`,`imprint`,`resellerid`) VALUES (?,?,?)");
if ($ui->escaped('languages', 'post')) {
if ($ui->st('languages', 'post')) {
$languages = (array) $ui->escaped('languages', 'post');
$languages = (array) $ui->st('languages', 'post');
foreach ($languages as $language) {
if (small_letters_check($language, 2)) {
$description = $ui->escaped('description', 'post', $language);
$description = $ui->escaped('description', 'post', $language);
$query->execute(array($language, $reseller_id));
$num = $query->rowCount();
$query->execute(array($language, $reseller_id));
if ($num == 1) {
$query2->execute(array($description, $language, $reseller_id));
if ($query2->rowCount() > 0) {
$changed = true;
}
} else {
$query3->execute(array($language, $description, $reseller_id));
if ($query3->rowCount() > 0) {
$changed = true;
}
if ($query->rowCount() == 1) {
$query2->execute(array($description, $language, $reseller_id));
if ($query2->rowCount() > 0) {
$changed = true;
}
}
} else {
$query3->execute(array($language, $description, $reseller_id));
if ($query3->rowCount() > 0) {
$changed = true;
}
}
}
$query = $sql->prepare("SELECT `language` FROM `imprints` WHERE `resellerid`=?");
@ -129,7 +128,7 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
} else {
$foundlanguages = array();
$foundLanguages = array();
$query = $sql->prepare("SELECT `template` FROM `settings` WHERE `resellerid`=? LIMIT 1");
$query->execute(array($reseller_id));
@ -142,7 +141,7 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
$query = $sql->prepare("SELECT `imprint` FROM `imprints` WHERE `language`=? AND `resellerid`=? LIMIT 1");
$query->execute(array($langrow, $reseller_id));
$foundlanguages[] = array('lang' => $langrow, 'imprint' => $query->fetchColumn(), 'style' => $query->rowCount());
$foundLanguages[] = array('lang' => $langrow, 'imprint' => $query->fetchColumn(), 'style' => $query->rowCount());
}
$template_file = 'admin_settings_imprint.tpl';

View File

@ -46,8 +46,8 @@ $gssprache = getlanguagefile('gserver', $user_language, $reseller_id);
$placeholders = array('%%', '%ad%', '%add%', '%dl%', '%del%', '%md%', '%mod%', '%start%', '%restart%', '%stop%', '%upd%', '%fail%', '%ok%', '%psw%', '%cfg%', '%import%', '%reinstall%', '%backup%', '%use%');
$replace = array('', $gsprache->add, $gsprache->add, $gsprache->del, $gsprache->del, $gsprache->mod, $gsprache->mod, $gsprache->start, $gsprache->start, $gsprache->stop, $gsprache->update,'','', $gssprache->password, $gssprache->config, $gsprache->import, $gssprache->reinstall, $gsprache->backup, $gsprache->use);
$placeholders2 = array('%voserver%', '%gserver%', '%user%', '%fastdl%', '%master%', '%user%', '%root%', '%addon%', '%settings%', '%vserver%', '%ticket_subject%', '%reseller%', '%virtual%', '%eac%', '%resync%', '%virtualimage%', '%template%', '%voserver%', '%emailsettings%', '%dns%', '%tsdns%', '%pmode%', '%file%');
$replace2 = array($gsprache->voiceserver, $gsprache->gameserver, $gsprache->user, $gsprache->fastdownload, $gsprache->master, $gsprache->user, $gsprache->root, $gsprache->addon2, $gsprache->settings, $gsprache->virtual, $gsprache->support, $gsprache->reseller, $gsprache->hostsystem,'Easy Anti Cheat', $gssprache->resync, $gsprache->virtual . ' ' . $gsprache->template, $gsprache->template, $gsprache->voiceserver,'E-Mail '.$gsprache->settings, 'TSDNS', 'TSDNS', $gssprache->protect, $gsprache->file);
$placeholders2 = array('%modules%', '%voserver%', '%gserver%', '%user%', '%fastdl%', '%master%', '%user%', '%root%', '%addon%', '%settings%', '%vserver%', '%ticket_subject%', '%reseller%', '%virtual%', '%eac%', '%resync%', '%virtualimage%', '%template%', '%voserver%', '%emailsettings%', '%dns%', '%tsdns%', '%pmode%', '%file%');
$replace2 = array($gsprache->modules, $gsprache->voiceserver, $gsprache->gameserver, $gsprache->user, $gsprache->fastdownload, $gsprache->master, $gsprache->user, $gsprache->root, $gsprache->addon2, $gsprache->settings, $gsprache->virtual, $gsprache->support, $gsprache->reseller, $gsprache->hostsystem,'Easy Anti Cheat', $gssprache->resync, $gsprache->virtual . ' ' . $gsprache->template, $gsprache->template, $gsprache->voiceserver,'E-Mail '.$gsprache->settings, 'TSDNS', 'TSDNS', $gssprache->protect, $gsprache->file);
if ($sSearch) {
$sSearch = str_replace($replace, $placeholders, str_replace($replace2, $placeholders2, $sSearch));

View File

@ -0,0 +1,68 @@
<section class="content-header">
<h1><?php echo $gsprache->imprint.' '.$gsprache->settings;?></h1>
<ol class="breadcrumb">
<li><a href="admin.php"><i class="fa fa-home"></i> Home</a></li>
<li class="active"><?php echo $gsprache->imprint.' '.$gsprache->settings;?></li>
</ol>
</section>
<section class="content">
<div class="row">
<div class="col-md-12">
<div class="box box-info">
<form role="form" action="admin.php?w=si&amp;r=si" onsubmit="return confirm('<?php echo $gsprache->sure;?>');" method="post">
<input type="hidden" name="token" value="<?php echo token();?>">
<input type="hidden" name="action" value="md">
<div class="box-body">
<div class="form-group">
<?php foreach ($foundLanguages as $array){ ?>
<label class="checkbox-inline">
<input name="languages[]" value="<?php echo $array['lang'];?>" onclick="textdrop('<?php echo $array['lang'];?>');" type="checkbox" <?php if($array['style']==1) echo 'checked';?>> <img src="images/flags/<?php echo $array['lang'];?>.png" alt="Flag: 16_<?php echo $array['lang'];?>'.png"/>
</label>
<?php } ?>
</div>
<?php foreach ($foundLanguages as $array) { ?>
<div id="<?php echo $array['lang'];?>" class="form-group <?php if ($array['style']==0) echo 'display_none';?>">
<label for="inputLangs-<?php echo $array['lang'];?>"><img src="images/flags/<?php echo $array['lang'];?>.png" alt="Flag: 16_<?php echo $array['lang'];?>'.png"/></label>
<textarea class="form-control" id="inputLangs-<?php echo $array['lang'];?>" name="description[<?php echo $array['lang'];?>]" rows="8"><?php echo $array['imprint'];?></textarea>
</div>
<?php } ?>
</div>
<div class="box-footer">
<button class="btn btn-primary" id="inputEdit" type="submit"><i class="fa fa-save">&nbsp;<?php echo $gsprache->save;?></i></button>
</div>
</form>
</div>
</div>
</div>
</section>
<script type="text/javascript">
window.onDomReady = initReady;
function initReady(fn) {
if(document.addEventListener) {
document.addEventListener("DOMContentLoaded", fn, false);
} else {
document.onreadystatechange = function() {
readyState(fn);
}
}
}
function readyState(func) {
if(document.readyState == "interactive" || document.readyState == "complete") {
func();
}
}
window.onDomReady(onReady); function onReady() {
SwitchShowHideRows('init_ready');
}
</script>