12 if(isset($_POST[
'save']))
14 if (isset($_POST[
'robotsText-long']) && (!empty($_POST[
'robotsText-long'])))
16 if (settings::setLongSetting(
$db,
"robotsText-long", $_POST[
'robotsText-long']))
22 alert::draw(
"danger",
$lang[
'ERROR'],
"$lang[ROBOTS_TXT] $lang[DATABASE] $lang[NOT_SAVED]",
"", 2400);
25 if (sys::setRobotsText(
"../", $_POST[
'robotsText-long']))
27 alert::draw(
"success",
$lang[
'SUCCESS'],
"$lang[ROBOTS_TXT] $lang[SAVED]",
"", 2400);
31 alert::draw(
"danger",
$lang[
'ERROR'],
"$lang[ROBOTS_TXT] $lang[NOT_SAVED]",
"", 3400);
42 <!-- include summernote css/js-->
43 <!-- include codemirror (codemirror.css, codemirror.js, xml.js) -->
44 <link rel=
"stylesheet" type=
"text/css" href=
"../system/engines/codemirror/codemirror.min.css">
45 <link rel=
"stylesheet" type=
"text/css" href=
"../system/engines/codemirror/themes/<?php echo $editorSettings['editorTheme']; ?>.css">
46 <link rel=
"stylesheet" type=
"text/css" href=
"../system/engines/codemirror/show-hint.min.css">
47 <script
type=
"text/javascript" src=
"../system/engines/codemirror/codemirror-compressed.js"></script>
48 <script
type=
"text/javascript" src=
"../system/engines/codemirror/auto-refresh.js"></script>
51 <link href=
"../system/engines/summernote/dist/summernote.css" rel=
"stylesheet">
52 <script src=
"../system/engines/summernote/dist/summernote.min.js"></script>
53 <script
type=
"text/javascript">
54 $(document).
ready(
function() {
56 var editor = (
'textarea#summernote');
59 $(editor).
on(
'summernote.init',
function() {
61 $(editor).summernote(
'codeview.toggle');
65 $(editor).summernote({
76 lang:
'<?php echo $lang['CURRENT_LANGUAGE
']; ?>',
80 theme:
'<?php echo $editorSettings['editorTheme
']; ?>',
87 autoCloseBrackets: <?php echo
$editorSettings[
'editorCloseBrackets'];?>,
89 value:
"<html>\n " + document.documentElement.innerHTML +
"\n</html>",
91 matchTags: {bothTags: <?php echo
$editorSettings[
'editorMatchTags']; ?>},
93 "Ctrl-J":
"toMatchingTag",
94 "Ctrl-Space":
"autocomplete"
106 <!-- Content Wrapper. Contains page content -->
107 <div class=\"content-wrapper\" id=\"content-FX\">
108 <!-- Content Header (Page header) -->
109 <section class=\"content-header\">";
111 echo backend::getTitle(
$lang[
'SETTINGS'],
$lang[
'ROBOTS_TXT']);
112 echo backend::getSettingsBreadcrumbs(
$lang);
113 echo
"</section><!-- Main content -->
114 <section class=\"content\">";
117 <form
id=
"frontend-edit-form" action=
"index.php?page=settings-robots" method=
"POST">
119 <div
class=
"box-body">
120 <div
class=
"col-md-10">
121 <?php echo
"<h4><i class=\"fa fa-android\"></i> $lang[ROBOTS_TXT] <small>$lang[CONFIGURE]</small></h4>"; ?>
123 <div
class=
"col-md-2">
124 <button
class=
"btn btn-success pull-right" id=
"save" name=
"save" style=
"margin-top:2px;"><
i id=
"savebuttonIcon" class=
"fa fa-check"></
i>&
nbsp;&
nbsp;<?php echo
$lang[
'SAVE_SETTINGS']; ?></button>
131 <div
class=
"col-md-8">
133 <div
class=
"box-body">
134 <label
for=
"summernote"><?php echo
$lang[
'DATA_PRIVACY'].
" & ".
$lang[
'PRIVACY']; ?> - <small><?php echo
$lang[
'ROBOTS_SUBTEXT']; ?> </small></label>
136 <textarea
name=
"robotsText-long" cols=
"64" rows=
"28" id=
"summernote"><?php echo
$content; ?></textarea>
140 <div
class=
"col-md-4">
142 <div
class=
"box-header with-border">
143 <h3
class=
"box-title"><?php echo
$lang[
'ROBOTS_TXT']; ?> <small> <?php echo
$lang[
'HELP']; ?></small></h3>
145 <div
class=
"box-body">
152 <script
type=
"text/javascript">
153 $(document).
ready(
function() {
154 function saveHotkey() {
157 if (!(
event.which === 115 && (navigator.platform.match(
"Mac") ?
event.metaKey :
event.ctrlKey)) && !(
event.which === 19))
return true;
158 event.preventDefault();
164 $(document).keydown(
function (
event) {
165 if (
event.which === 83 && (navigator.platform.match(
"Mac") ?
event.metaKey :
event.ctrlKey)) {
166 event.preventDefault();
177 var savebutton = (
'#save');
178 var savebuttonIcon = (
'#savebuttonIcon');
180 var editor = (
'textarea#summernote');
183 $(savebutton).click(
function () {
184 $(savebutton).removeClass(
'btn btn-success').addClass(
'btn btn-warning disabled');
185 $(savebuttonIcon).removeClass(
'fa fa-check').addClass(
'fa fa-spinner fa-spin fa-fw');
187 if ($(editor).summernote(
'codeview.isActivated')) {
189 $(editor).summernote(
'codeview.deactivate');
print $lang['FILEMAN_UPLOAD']
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.
The sys class - handles yawk's system core functions.
<!-- backend language -->< h3 >< i class="fa fa-language"></i > & nbsp
if(isset($_POST['save'])) $editorSettings
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);});})