23 if (isset(
$_GET[
'toggle']) && (
$_GET[
'toggle'] ===
"1"))
25 if (isset(
$_GET[
'id']) && isset(
$_GET[
'published']) && isset(
$_GET[
'title']))
29 alert::draw(
"danger",
"$lang[ERROR]",
"$lang[PAGE_TOGGLE_FAILED]",
"", 5800);
35 if (isset(
$_GET[
'lock']) && (
$_GET[
'lock']) ===
"1")
38 if (isset(
$_GET[
'id']) && (isset(
$_GET[
'locked'])))
42 $locked =
$db->quote(
$_GET[
'locked']);
45 if ($locked ===
'1') { $setLock = 0; $status =
"$lang[UNLOCKED]"; $color=
"success"; }
46 if ($locked ===
'0') { $setLock = 1; $status =
"$lang[LOCKED]"; $color=
"danger"; }
47 else { $setLock = 0; $status=
''; }
53 alert::draw(
"$color",
"$lang[PAGE] $lang[IS] $status",
"$lang[PAGE] $lang[IS] $status",
"",800);
57 alert::draw(
"danger",
"$lang[ERROR]",
"$lang[PAGE_LOCK_FAILED]",
"page=pages", 4300);
63 if (isset(
$_GET[
'del']) && (
$_GET[
'del'] ===
"1"))
65 if (isset(
$_GET[
'delete']) && (
$_GET[
'delete'] ==
"true")){
67 if (isset(
$_GET[
'id']))
76 alert::draw(
"success",
"Erfolg!",
"$lang[PAGE] " .
$_GET[
'alias'] .
" $lang[PAGE_DEL_OK]",
"", 800);
81 alert::draw(
"danger",
"Error!",
"$lang[PAGE] " .
$_GET[
'alias'] .
" $lang[PAGE_DEL_FAILED]",
"", 6800);
89 if (isset(
$_GET[
'alias']))
100 if (isset(
$_GET[
'newLanguage']) && (
$_GET[
'newLanguage'] ===
"true"))
102 if (isset($_POST[
'language']) && (!empty($_POST[
'language'])))
104 $page->language = mb_substr($_POST[
'language'], 0,2);
105 $page->title_new = $_POST[
'modalTitle'];
106 $page->alias_new = $_POST[
'modalAlias'];
107 $page->id = $_POST[
'pageID'];
108 $page->newLanguage =
true;
116 $page->newLanguage =
false;
122 print alert::draw(
"success",
"$lang[SUCCESS]",
"$lang[PAGE] ".
$_GET[
'alias'].
" $lang[PAGE_COPY_OK]",
"",
"1200");
126 print alert::draw(
"danger",
"$lang[ERROR]",
"$_GET[alias] $lang[PAGE_COPY_FAILED]",
"",
"6800");
132 <script
type=
"text/javascript">
134 $(document).
ready(
function() {
137 $(document).
on(
"click",
"#languageCopyLink",
function () {
138 const pageID = $(
this).data(
'id');
139 const alias = $(
this).data(
'alias');
140 const title = $(
this).data(
'title');
143 $(
"#pageID").val(pageID);
144 $(
"#modalAlias").val(
alias);
145 $(
"#alias").val(
alias);
146 $(
"#modalTitle").val(
title);
148 $(
'#modalForm').attr(
'action',
'index.php?page=pages©=1&newLanguage=true©=true&alias='+
alias);
151 $(
"#titlePageID").text(
"ID"+pageID+
" "+
alias+
" "+
title);
154 $(
'#table-sort').dataTable( {
156 "bLengthChange":
false,
165 <!-- Modal --MOVE TO ARCHIVE-- -->
166 <div
class=
"modal fade" id=
"myModal" tabindex=
"-1" role=
"dialog" aria-labelledby=
"myModal2Label" aria-hidden=
"true">
167 <div
class=
"modal-dialog">
168 <div
class=
"modal-content">
169 <form enctype=
"multipart/form-data" id=
"modalForm" action=
"index.php?page=pages©=1&newLanguage=true©=true" method=
"POST">
170 <input
type=
"hidden" id=
"pageID" name=
"pageID">
171 <div
class=
"modal-header">
172 <!-- modal header with close controls -->
173 <button
type=
"button" class=
"close" data-dismiss=
"modal" aria-hidden=
"true"><
i class=
"fa fa-times"></
i> </button>
175 <div
class=
"col-md-1"><h3
class=
"modal-title"><
i class=
"fa fa-language"></
i></h3></div>
176 <div
class=
"col-md-11"><h3
class=
"modal-title"><?php echo
$lang[
'COPY_PAGE_NEW_LANGUAGE']; ?> </h3>
177 <div
id=
"titlePageID"></div>
182 <div
class=
"modal-body">
183 <label
for=
"modalAlias"><?php echo
$lang[
'FILENAME']; ?></label>
184 <input
type=
"text" class=
"form-control" id=
"modalAlias" name=
"modalAlias" placeholder=
"<?php echo $lang['FILENAME']; ?>" readonly>
186 <label
for=
"modalTitle"><?php echo
$lang[
'NEW_PAGE_TITLE']; ?></label>
187 <input
type=
"text" class=
"form-control" id=
"modalTitle" name=
"modalTitle" placeholder=
"<?php echo $lang['NEW_PAGE_TITLE']; ?>">
189 <label
for=
"language"><?php echo
$lang[
'ASSIGN_NEW_LANGUAGE']; ?></label>
190 <select
id=
"language" name=
"language" class=
"form-control">
191 <?php echo language::drawLanguageSelectOptions(); ?>
195 <!-- modal footer /
w submit btn -->
196 <div
class=
"modal-footer">
197 <input
class=
"btn btn-large btn-default" data-dismiss=
"modal" aria-hidden=
"true" type=
"submit" value=
"<?php echo $lang['CANCEL']; ?>">
198 <button
class=
"btn btn-large btn-success" type=
"submit"><
i class=
"fa fa-check"></
i>&
nbsp; <?php echo
$lang[
'PAGE_COPY']; ?></button>
202 </div> <!-- modal content -->
203 </div> <!-- modal dialog -->
204 </div> <!-- modal fade
window -->
209 <!-- Content Wrapper. Contains page content -->
210 <div class=\"content-wrapper\" id=\"content-FX\">
211 <!-- Content Header (Page header) -->
212 <section class=\"content-header\">";
214 echo backend::getTitle(
$lang[
'PAGES'],
$lang[
'PAGES_SUBTEXT']);
215 echo
"<ol class=\"breadcrumb\">
216 <li><a href=\"index.php\" title=\"$lang[DASHBOARD]\"><i class=\"fa fa-dashboard\"></i> $lang[DASHBOARD]</a></li>
217 <li class=\"active\"><a href=\"index.php?page=pages\" title=\"$lang[PAGES]\"> $lang[PAGES]</a></li>
220 <!-- Main content -->
221 <section class=\"content\">";
226 <div
class=
"box box-default">
227 <div
class=
"box-body"> -->
229 <div
class=
"box box-default">
230 <div
class=
"box-body">
231 <
a class=
"btn btn-success pull-right" href=
"index.php?page=page-new">
232 <
i class=
"glyphicon glyphicon-plus"></
i> &
nbsp;<?php print
$lang[
'PAGE+']; ?></
a>
234 <table style=
"width: 100%; border-collapse: collapse;" class=
"table table-striped table-hover table-responsive" id=
"table-sort">
237 <td style=
"width: 3%;"><
b><?php echo
$lang[
'STATUS']; ?> </
b></td>
238 <td style=
"width: 3%;"><
b>&
nbsp;</
b></td>
239 <td style=
"width: 3%;"><
b><?php echo
$lang[
'ID']; ?> </
b></td>
240 <td style=
"width: 30%;"><
b><
i class=
"fa fa-caret-down"></
i> <?php print
$lang[
'TITLE']; ?></
b></td>
241 <td style=
"width: 30%;"><
b><
i class=
"fa fa-caret-down"></
i> <?php print
$lang[
'FILENAME']; ?></
b></td>
242 <td style=
"width: 5%" class=
"text-center"><
b><?php print
$lang[
'TYPE']; ?></
b></td>
243 <td style=
"width: 5%" class=
"text-center"><
b><?php print
$lang[
'RIGHTS']; ?></
b></td>
244 <td style=
"width: 5%" class=
"text-center"><
b><?php print
$lang[
'LANGUAGE']; ?></
b></td>
245 <td style=
"width: 16%" class=
"text-center"><
b><?php print
$lang[
'ACTIONS']; ?></
b></td>
257 foreach (
$rows AS $row) {
259 if ($row[
'published']===
'1')
261 $pub =
"success"; $pubtext=
"On";
265 $pub =
"danger"; $pubtext =
"Off";
270 if ($row[
'plugin'] !==
'0'){
271 $type =
"<a href=\"index.php?plugin=".$row[
'plugin'].
"\">$lang[PLUGIN]</a>";
275 if ($row[
'blogid'] !==
'0')
277 $type =
"<a href=\"index.php?plugin=blog&pluginpage=blog-entries&blogid=".$row[
'blogid'].
"\">$lang[BLOG]</a>";
280 $type =
"$lang[PAGE]";
284 if ($row[
'locked'] !==
'0')
286 $lockIcon =
"<i class=\"fa fa-lock\"></i>";
287 $lockHover =
"style=\"cursor:not-allowed;\"";
288 $lockHref =
"href=\"#\"";
289 $lockLink =
"href=\"index.php?page=pages&lock=1&id=".$row[
'id'].
"&locked=".$row[
'locked'].
"\"";
290 $lockTitle =
"title=\"".$lang[
'PAGE_UNLOCK'].
"\"";
291 $lockLinkTitle =
"title=\"".$lang[
'PAGE_LOCKED'].
"\"";
292 $lockLanguageCopyTitle =
"title=\"".$lang[
'ASSIGN_NEW_LANGUAGE'].
"\"";
293 $lockAction =
"<a class=\"fa fa-unlock-alt\" ".$lockTitle.
" ".$lockLink.
"></a> ";
294 $lockEditLink =
"href=\"index.php?page=pages&lock=1&id=".$row[
'id'].
"&locked=".$row[
'locked'].
"\"";
295 $lockDeleteLink =
"href = \"#\" ".$lockHover.
" ";
296 $lockCopyLink =
"".$lockHover.
" href=\"#\"";
297 $lockLanguageCopyLink =
"".$lockHover.
" href=\"#\"";
303 $lockLink =
"href=\"index.php?page=pages&lock=1&id=".$row[
'id'].
"&locked=".$row[
'locked'].
"\"";
304 $lockHref =
"href=\"index.php?page=page-edit&id=".$row[
'id'].
"\"";
305 $lockTitle =
"title=\"".$lang[
'PAGE_LOCK'].
"\"";
306 $lockLinkTitle =
"title=\"".$lang[
'EDIT'].
"\"";
307 $lockLanguageCopyTitle =
"title=\"".$lang[
'ASSIGN_NEW_LANGUAGE'].
"\"";
308 $lockAction =
"<a class=\"fa fa-lock\" ".$lockTitle.
" ".$lockLink.
"></a> ";
309 $lockCopyLink =
"title=\"".$lang[
'PAGE_COPY'].
"\" href=\"index.php?page=pages©=1&title=".$row[
'title'].
"&id=".$row[
'id'].
"&alias=".$row[
'alias'].
"©=true\"";
310 $lockDeleteLink =
"role=\"dialog\" data-confirm=\"$lang[PAGE] «".$row[
'title'].
" / ".$row[
'alias'].
".html» $lang[PAGE_DEL_CONFIRM]\"
311 title=\"".
$lang[
'PAGE_DELETE'].
"\" href=\"index.php?page=pages&del=1&alias=".$row[
'alias'].
"&id=".$row[
'id'].
"&delete=true\"";
312 $lockLanguageCopyLink =
"id=\"languageCopyLink\" data-toggle=\"modal\" data-target=\"#myModal\" data-title=\"".$row[
'title'].
"\" data-alias=\"".$row[
'alias'].
"\" data-id=\"".$row[
'id'].
"\" ";
316 <td class=\"text-center\">
317 <a title=\"toggle status\" href=\"index.php?page=pages&toggle=1&id=".$row[
'id'].
"&title=".$row[
'title'].
"&published=".$row[
'published'].
"\">
318 <span class=\"label label-$pub\">$pubtext</span></a> </td>
319 <td>".$lockIcon.
"</i></td>
320 <td>".$row[
'id'].
"</td>
321 <td><a ".$lockHover.
" ".$lockLinkTitle.
" ".$lockHref.
"><div style=\"width:100%\">".$row[
'title'].
"</div></a></td>
322 <td><a ".$lockHover.
" ".$lockLinkTitle.
" ".$lockHref.
"><div style=\"width:100%\">".$row[
'alias'].
".html</div></a></td>
324 <td class=\"text-center\">".
$type.
"</td>
325 <td class=\"text-center\">".$row[
'gid'].
"</td>
326 <td class=\"text-center\">".$row[
'lang'].
"</td>
327 <td class=\"text-center\">
329 <a class=\"fa fa-copy\" ".$lockCopyLink.
" ></a>
330 <a class=\"fa fa-edit\" ".$lockHover.
" ".$lockLinkTitle.
" ".$lockHref.
"></a>
331 <a class=\"fa fa-language\" style=\"cursor: pointer\" ".$lockLanguageCopyLink.
" ".$lockLanguageCopyTitle.
"></a>
332 <a class=\"fa fa-trash-o\" ".$lockDeleteLink.
"></a>
348 <!-- Start FOOTER -->
349 <div
class=
"box box-default">
350 <div
class=
"box-header with-border">
351 <h3
class=
"box-title"><
i class=
"glyphicon glyphicon-stats"></
i> &
nbsp;<?php print
$lang[
'PAGE_STATS']; ?></h3>
353 <div
class=
"box-body">
358 if (
$i_pages > 1) { $seiten=
"$i_pages $pages $lang[OVERALL]"; }
359 else if (
$i_pages = 1) { $seiten=
"$i_pages $page"; }
360 else { $seiten =
"$lang[NO_PAGE_CREATED]"; }
363 else if (
$i_pages_published == 1) { $pub=
"$i_pages_published $page $lang[PUBLISHED]."; }
364 else { $pub =
"$lang[NO_PAGE_PUBLISHED]"; }
368 else { $unpub =
$lang[
'PAGES_ONLINE']; }
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.
The default pages class. Provide all functions to handle static pages.
<!-- backend language -->< h3 >< i class="fa fa-language"></i > & nbsp
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);});})