10 if (isset(
$_GET[
'save']) AND
$_GET[
'save'] ===
'true') {
12 foreach ($_POST as $property =>
$value) {
13 if ($property !=
"save") {
19 if (isset(
$_GET[
'toggle']) AND
$_GET[
'toggle'] ===
'true')
21 if (
$_GET[
'set'] ===
'1')
31 alert::draw(
"danger",
"$lang[ERROR]",
"Could not toggle page $_GET[property]",
"", 2000);
36 <script
type=
"text/javascript">
37 $(document).
ready(
function() {
38 $(
'#table-sort').dataTable( {
40 "bLengthChange":
false,
51 <!-- Content Wrapper. Contains page content -->
52 <div class=\"content-wrapper\" id=\"content-FX\">
53 <!-- Content Header (Page header) -->
54 <section class=\"content-header\">";
56 echo backend::getTitle(
$lang[
'SETTINGS_EXPERT'],
$lang[
'SETTINGS_EXPERT_SUBTEXT']);
57 echo
"<ol class=\"breadcrumb\">
58 <li><a href=\"index.php\" title=\"$lang[DASHBOARD]\"><i class=\"fa fa-dashboard\"></i> $lang[DASHBOARD]</a></li>
59 <li><a href=\"index.php?page=settings-backend\" class=\"active\" title=\"$lang[BACKEND_SETTINGS] $lang[BACKEND_SETTINGS_SUBTEXT]\"> $lang[BACKEND_SETTINGS] $lang[BACKEND_SETTINGS_SUBTEXT]</a></li>
63 <section class=\"content\">";
67 <form
name=
"settings" action=
"index.php?page=settings-manage&save=true" method=
"post">
68 <input
type=
"submit" name=
"save" class=
"btn btn-success pull-right" value=
"<?php print $lang['SETTINGS_SAVE'];?>">
70 <table style=
"width:100%;" class=
"table table-striped table-hover table-responsive" id=
"table-sort">
73 <td style=
"width:3%;"><strong>&
nbsp;</strong></td>
74 <td style=
"width:20%;"><strong><
i class=
"fa fa-caret-down"></
i> <?php print
$lang[
'SETTING']; ?></strong></td>
75 <td style=
"width:27%;"><strong><
i class=
"fa fa-caret-down"></
i> <?php print
$lang[
'SETTING_VALUE']; ?></strong></td>
76 <td style=
"width:25%;"><strong><?php print
$lang[
'LABEL']; ?></strong></td>
77 <td style=
"width:25%;"><strong><?php print
$lang[
'DESCRIPTION']; ?></strong></td>
82 if (isset(
$_GET[
'type']) && (is_numeric(
$_GET[
'type'])))
87 if (
$res =
$db->query(
"SELECT * FROM {settings}"))
89 while($row = mysqli_fetch_assoc(
$res)){
91 if ($row[
'activated']==1)
92 { $pub =
"success"; $pubtext=
"$lang[ON_]"; }
93 else { $pub =
"danger"; $pubtext=
"$lang[OFF_]"; }
96 <td><a title=\"toggle status\" href=\"index.php?page=settings-manage&toggle=true&property=".$row[
'property'].
"&set=".$row[
'activated'].
"\">
97 <span class=\"label label-$pub\">$pubtext</span></a></td>
98 <td>".$row[
'property'].
"</td>
99 <td><input type=\"text\" name=\"".$row[
'property'].
"\" class=\"form-control\" value=\"".$row[
'value'].
"\"></td>
100 <td>".$row[
'label'].
"</td>
101 <td>".$row[
'description'].
"</td>
Throws a fancy Bootstrap Alert (success, info, warning or danger)
Backend class serves a few useful functions for the admin backend.
Mysqli database class; returns db connection object.
The language class - support multilingual backend.
Settings class: get and set YaWK system settings.
This class serves methods to create backup from files.
<!-- backend language -->< h3 >< i class="fa fa-language"></i > & nbsp
print $lang['SETTINGS_SAVE']
document ready(function() { $('a[data-confirm]').click(function(ev) { modal='#dataConfirmModal';var href=$(this).attr('href');var title=$(this).attr('title');var icon=$(this).attr('data-icon');if(!icon) { icon='fa fa-trash-o';} if(!$(modal).length) { $('body').append('< div id="dataConfirmModal" class="modal fade" role="dialog" aria-labelledby="dataConfirmLabel" aria-hidden="true">< div class="modal-dialog">< div class="modal-content">< div class="modal-header">< button type="button" class="close" data-dismiss="modal" aria-hidden="true">< i class="fa fa-times"></i ></button >< br >< div class="col-md-1">< h3 class="modal-title">< i class="'+icon+'"></i ></h3 ></div >< div class="col-md-11">< h3 class="modal-title" id="dataConfirmLabel">'+title+'</h3 ></div ></h3 ></div >< div class="modal-body"></div >< div class="modal-footer">< button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true">Abbrechen</button >< a type="button" class="btn btn-danger" id="dataConfirmOK">< i class="'+icon+'"></i > L öschen</a ></div ></div ></div ></div >');} $(modal).find('.modal-body').text($(this).attr('data-confirm'));$('#dataConfirmOK').attr('href', href);$(modal).modal({show:true});return false;});$('#terminateUser').click(function() { var terminate=window.confirm("ACHTUNG!\nDas wird Deinen Account permanent deaktivieren.\n"+"Bist Du Dir sicher, dass Du das tun willst?");if(terminate===true) { var terminateUser=window.confirm("Bist Du Dir wirklich ganz sicher?\n"+"Diese Aktion kann nicht rueckgaengig gemacht werden.");if(terminateUser===true) { $.get('system/templates/YaWK-bootstrap3/js/terminate-user.php', function(data) { if(data==="true") { setTimeout("window.location='logout.html'", 0);} else { alert("Fehler: "+data);} });} } });function dismissNotifications() { $.ajax({ url:'js/dismiss-notifications.php', type:'POST', success:function(data) { if(!data) { alert('Something went wrong!');return false;} } });$("#bell-label").fadeOut();$('#notification-header').html('You have 0 notifications');$('#notification-menu').fadeOut();} $("#dismiss").click(function() { dismissNotifications();});function disableButtons(delay) { $('#loginButton').removeClass().addClass('btn btn-success disabled').attr('id', 'LOGIN_FORBIDDEN');$('#resetPasswordButton').removeClass().addClass('btn btn-danger disabled');setTimeout(function() { $('#LOGIN_FORBIDDEN').attr('id', 'loginButton').removeClass().addClass('btn btn-success');$('#resetPasswordButton').removeClass().addClass('btn btn-danger');}, delay);} $("#loginButton").click(function(){ if($('#loginButton').length > 0) { if($('#loginButton').hasClass('btn') &&$('#loginButton').hasClass('btn-success') &&$('#loginButton').hasClass('disabled')) { } else { $("#loginForm").submit();disableButtons(10000);} } else if($('#LOGIN_FORBIDDEN').length > 0) { if($('#LOGIN_FORBIDDEN').hasClass('btn') &&$('#LOGIN_FORBIDDEN').hasClass('btn-success') &&$('#LOGIN_FORBIDDEN').hasClass('disabled')) { } else { } } });$("#blockedBtn").hover(function() { $("#blockedBtn").hide();$("#askBtn").fadeIn(820);});})