1 <!-- iconpicker css + JS -->
2 <link href=
"../system/engines/iconpicker/css/fontawesome-iconpicker.min.css" rel=
"stylesheet">
3 <script src=
"../system/engines/iconpicker/js/fontawesome-iconpicker.min.js"></script>
4 <script
type=
"text/javascript">
5 $(document).
ready(
function () {
6 $(
'#icon').iconpicker();
10 function saveHotkey() {
13 if (!(
event.which === 115 && (navigator.platform.match(
"Mac") ?
event.metaKey :
event.ctrlKey)) && !(
event.which == 19))
return true;
14 event.preventDefault();
19 $(document).keydown(
function (
event) {
20 if (
event.which === 83 && (navigator.platform.match(
"Mac") ?
event.metaKey :
event.ctrlKey)) {
21 event.preventDefault();
22 $(
'#savebutton').click();
33 include
'../system/plugins/blog/classes/blog.php';
35 if (!isset(
$blog)) {
$blog = new \YAWK\PLUGINS\BLOG\blog(); }
37 if (!isset($language) || (!isset(
$lang)))
43 if (isset(
$_GET[
'blogid'])) {
52 if (isset($_POST[
'setup']))
54 $blog->blogid =
$db->quote($_POST[
'blogid']);
55 $blog->name =
$db->quote($_POST[
'name']);
56 $blog->description =
$db->quote($_POST[
'description']);
57 $blog->icon =
$db->quote($_POST[
'icon']);
58 $blog->gid =
$db->quote($_POST[
'gid']);
61 $blog->showTitle =
$db->quote($_POST[
'showTitle']);
62 $blog->showDesc =
$db->quote($_POST[
'showDesc']);
63 $blog->showDate =
$db->quote($_POST[
'showDate']);
64 $blog->showAuthor =
$db->quote($_POST[
'showAuthor']);
65 $blog->permaLink =
$db->quote($_POST[
'permaLink']);
66 $blog->preview =
$db->quote($_POST[
'preview']);
67 $blog->voting =
$db->quote($_POST[
'voting']);
68 $blog->spacer =
$db->quote($_POST[
'spacer']);
69 $blog->frontendIcon =
$db->quote($_POST[
'frontendIcon']);
70 $blog->showTotalVotes =
$db->quote($_POST[
'showTotalVotes']);
73 if (!isset($_POST[
'layout'])) {
76 $blog->layout =
$db->quote($_POST[
'layout']);
80 if (!isset($_POST[
'sequence'])) {
81 $blog->sequence =
"0";
83 $blog->sequence = $_POST[
'sequence'];
85 if (!isset($_POST[
'sortation'])) {
86 $blog->sortation =
"0";
88 $blog->sortation = $_POST[
'sortation'];
92 if (!isset($_POST[
'comments'])) {
93 $blog->comments =
"0";
95 $blog->comments = $_POST[
'comments'];
99 if (!isset($_POST[
'showTotalVotes']))
101 $blog->showTotalVotes =
"0";
105 $blog->showTotalVotes = $_POST[
'showTotalVotes'];
109 if (!isset($_POST[
'limitEntries']))
111 $blog->limitEntries = 0;
113 $blog->limitEntries =
$db->quote($_POST[
'limitEntries']);
119 echo
YAWK\alert::draw(
"success",
"$lang[SUCCESS]",
"$lang[SETTINGS_SAVED]",
"", 1200);
123 echo
YAWK\alert::draw(
"danger",
"$lang[ERROR] ",
"$lang[SETTINGS] $lang[BLOG] $lang[ID] " . $_POST[
'blogid'] .
" " .
$blog->name .
" - " .
$blog->description .
" $lang[NOT_SAVED]",
"plugin=blog",
"3800");
151 if (
$blog->showTitle ===
'1') {
152 $titleChecked =
"checked";
159 if (
$blog->showDesc ===
'1') {
165 if (
$blog->showDate ===
'1') {
171 if (
$blog->showAuthor ===
'1') {
174 $blog->showAuthor = 0;
177 if (
$blog->permaLink ===
'1') {
180 $blog->permaLink = 0;
183 if (
$blog->preview ===
'1') {
189 if (
$blog->spacer ===
'1') {
195 if (
$blog->frontendIcon ===
'1') {
198 $blog->frontendIcon = 0;
203 if (
$blog->layout ===
'0') {
204 $layout0Checked =
"checked";
206 $layout0Checked =
"";
208 if (
$blog->layout ===
'1') {
209 $layout1Checked =
"checked";
211 $layout1Checked =
"";
213 if (
$blog->layout ===
'2') {
214 $layout2Checked =
"checked";
216 $layout2Checked =
"";
218 if (
$blog->layout ===
'3') {
219 $layout3Checked =
"checked";
221 $layout3Checked =
"";
223 if (
$blog->layout ===
'4') {
224 $layout4Checked =
"checked";
226 $layout4Checked =
"";
230 if (
$blog->sequence ===
'0') {
231 $sequenceDateChecked =
"checked";
233 $sequenceDateChecked =
"";
235 if (
$blog->sequence ===
'1') {
236 $sequenceTitleChecked =
"checked";
238 $sequenceTitleChecked =
"";
240 if (
$blog->sortation ===
'0') {
241 $ascChecked =
"checked";
245 if (
$blog->sortation ===
'1') {
246 $descChecked =
"checked";
252 if (
$blog->comments ===
'0') {
253 $commentsOffChecked =
"";
255 $commentsOffChecked =
"checked";
257 if (
$blog->comments ===
'1') {
258 $commentsOnChecked =
"checked";
260 $commentsOnChecked =
"";
264 if (
$blog->voting ===
'0') {
265 $votingOffChecked =
"checked";
267 $votingOffChecked =
"";
269 if (
$blog->voting ===
'1') {
270 $votingOnChecked =
"checked";
272 $votingOnChecked =
"";
278 if (
$blog->showTotalVotes ==
'1') {
290 <!-- Content Wrapper. Contains page content -->
291 <div class=\"content-wrapper\" id=\"content-FX\">
292 <!-- Content Header (Page header) -->
293 <section class=\"content-header\">";
295 echo \YAWK\backend::getTitle(
$lang[
'BLOG'],
$lang[
'BLOG_SETUP']);
296 echo
"<ol class=\"breadcrumb\">
297 <li><a href=\"index.php\" title=\"$lang[DASHBOARD]\"><i class=\"fa fa-dashboard\"></i> $lang[DASHBOARD]</a></li>
298 <li><a href=\"index.php?page=plugins\" title=\"$lang[PLUGINS]\"> $lang[PLUGINS]</a></li>
299 <li><a href=\"index.php?plugin=blog\" title=\"$lang[BLOG]\"> $lang[BLOG]</a></li>
300 <li class=\"active\"><a href=\"index.php?plugin=blog&pluginpage=blog-setup\" title=\"$lang[SETUP]\"> $lang[SETUP]</a></li>
303 <!-- Main content -->
304 <section class=\"content\">";
307 <div
class=
"box box-default">
308 <div
class=
"box-body">
309 <form action=
"index.php?plugin=blog&pluginpage=blog-setup&blogid=<?php echo $blog->blogid; ?>" class=
"form-inline" role=
"form" method=
"POST">
311 <div
class=
"col-md-6">
312 <h4><?php echo
$lang[
'BLOG'].
" ".
$lang[
'SETTINGS'].
": <b>".
$blog->name.
"</b>"; ?></h4>
314 <div
class=
"col-md-6">
316 <button
class=
"btn btn-success pull-right" type=
"submit" name=
"create" id=
"savebutton"><
i class=
"fa fa-save"></
i> &
nbsp;<?php echo
$lang[
'SAVE_SETTINGS']; ?></button>&
nbsp;
319 <
a class=
"btn btn-default pull-right" href=
"index.php?plugin=blog"><
i class=
"glyphicon glyphicon-backward"></
i> &
nbsp;<?php echo
$lang[
'BACK']; ?></
a><br>
324 value=
"<?php echo $_GET['blogid']; ?>"
331 <div
class=
"box box-default">
332 <div
class=
"box-body">
333 <ul
class=
"nav nav-tabs">
334 <li
class=
"active"><
a data-toggle=
"tab" href=
"#blog"><
i class=
"fa fa-wordpress"></
i> &
nbsp;<?php echo
$lang[
'BLOG']; ?></
a></li>
335 <li><
a data-toggle=
"tab" href=
"#layout"><
i class=
"fa fa-object-group"></
i> &
nbsp;<?php echo
$lang[
'LAYOUT']; ?></
a></li>
336 <li><
a data-toggle=
"tab" href=
"#sortation"><
i class=
"fa fa-sort"></
i> &
nbsp;<?php echo
$lang[
'SORTATION']; ?></
a></li>
337 <li><
a data-toggle=
"tab" href=
"#comments"><
i class=
"fa fa-comment-o"></
i> &
nbsp;<?php echo
$lang[
'COMMENTS']; ?></
a></li>
340 <div
class=
"tab-content">
341 <div
id=
"blog" class=
"tab-pane fade in active">
343 <div
class=
"col-md-6">
344 <h3><
i class=
"fa fa-wordpress"></
i> <?php echo
$lang[
'BLOG']; ?></h3>
345 <label
for=
"name"><?php echo
$lang[
'BLOG']; ?></label><br>
349 placeholder=
"<?php echo $lang['BLOG_NAME']; ?>"
352 value=
"<?php echo $blog->name; ?>"><br><br>
354 <label
for=
"description"><?php echo
$lang[
'DESCRIPTION']; ?></label><br>
355 <textarea
class=
"form-control"
358 style=
"margin-top: 6px;"
359 placeholder=
"<?php echo $lang['BLOG_DESCRIPTION']; ?>"
361 name=
"description"><?php echo
$blog->description; ?></textarea><br><br>
363 <label
for=
"icon"><?php echo
$lang[
'ICON'] ?></label><br>
365 class=
"form-control icp icp-auto iconpicker-element iconpicker-input"
367 style=
"margin-top: 6px;"
368 placeholder=
"<?php echo $lang['BLOG_ICON']; ?>"
371 value=
"<?php echo $blog->icon; ?>"><br><br>
373 <div
class=
"col-md-6">
374 <!-- FRONTEND SETTINGS -->
375 <h3><
i class=
"fa fa-television"></
i> <?php echo
$lang[
'FRONTEND'].
" ".
$lang[
'SETTINGS']; ?></h3>
376 <input
type=
"hidden" name=
"frontendIcon" value=
"0">
377 <label
for=
"frontendIcon">
378 <input
type=
"checkbox"
385 <input
type=
"hidden" name=
"showTitle" value=
"0">
386 <label
for=
"showTitle">
387 <input
type=
"checkbox"
391 value=
"1" <?php echo $titleChecked; ?>> <?php echo
$lang[
'SHOW_TITLE_IN_FRONTEND']; ?>
394 <input
type=
"hidden" name=
"showDesc" value=
"0">
395 <label
for=
"showDesc">
396 <input
type=
"checkbox"
404 <input
type=
"hidden" name=
"showDate" value=
"0">
405 <label
for=
"showDate">
406 <input
type=
"checkbox"
414 <input
type=
"hidden" name=
"showAuthor" value=
"0">
415 <label
for=
"showAuthor">
416 <input
type=
"checkbox"
424 <input
type=
"hidden" name=
"permaLink" value=
"0">
425 <label
for=
"permaLink">
426 <input
type=
"checkbox"
434 <input
type=
"hidden" name=
"spacer" value=
"0">
436 <input
type=
"checkbox"
444 <input
type=
"hidden" name=
"preview" value=
"0">
445 <label
for=
"preview">
446 <input
type=
"checkbox"
459 <div
id=
"layout" class=
"tab-pane fade in">
461 <div
class=
"col-md-6">
463 <h3><
i class=
"fa fa-object-group"></
i> <?php echo
$lang[
'LAYOUT']; ?></h3>
465 <label
for=
"layout0">
466 <input
type=
"radio" name=
"layout" id=
"layout0" value=
"0" <?php echo $layout0Checked; ?>>
467 <img src=
"http://placehold.it/120x80">&
nbsp;&
nbsp; <?php echo
$lang[
'BLOG_LAYOUT_1COL_TEXTBLOG']; ?>
469 <label
for=
"layout1">
470 <input
type=
"radio" name=
"layout" id=
"layout1" value=
"1" <?php echo $layout1Checked; ?>>
471 <img src=
"http://placehold.it/120x80">&
nbsp;&
nbsp; <?php echo
$lang[
'BLOG_LAYOUT_2COL_TEASER_L']; ?>
473 <label
for=
"layout2">
474 <input
type=
"radio" name=
"layout" id=
"layout2" value=
"2" <?php echo $layout2Checked; ?>>
475 <img src=
"http://placehold.it/120x80">&
nbsp;&
nbsp; <?php echo
$lang[
'BLOG_LAYOUT_2COL_TEASER_R']; ?>
477 <label
for=
"layout3">
478 <input
type=
"radio" name=
"layout" id=
"layout3" value=
"3" <?php echo $layout3Checked; ?>>
479 <img src=
"http://placehold.it/120x80">&
nbsp;&
nbsp; <?php echo
$lang[
'BLOG_LAYOUT_3COL_NEWSPAPER']; ?>
481 <label
for=
"layout4">
482 <input
type=
"radio" name=
"layout" id=
"layout4" value=
"4" <?php echo $layout4Checked; ?>>
483 <img src=
"http://placehold.it/120x80">&
nbsp;&
nbsp; <?php echo
$lang[
'BLOG_LAYOUT_1COL_YOUTUBE']; ?>
487 <div
class=
"col-md-6">
488 <h3><?php echo
$lang[
'HELP']; ?></h3>
489 <div
id=
"layout0Help"><?php echo
$lang[
'LAYOUT_0_HELP']; ?></div>
495 <div
id=
"sortation" class=
"tab-pane fade in">
497 <div
class=
"col-md-6">
498 <!-- BLOG ENTRY SORTATION -->
499 <h3><
i class=
"fa fa-sort-alpha-asc"></
i> <?php echo
$lang[
'SORTATION']; ?></h3>
501 <div
class=
"col-md-6">
503 <label
for=
"sequenceDate">
504 <input
type=
"radio" name=
"sequence" id=
"sequenceDate" value=
"0" <?php echo $sequenceDateChecked; ?>>
505 <?php echo
$lang[
'SORTATION_CHRONOLOGIC']; ?>
507 <label
for=
"sequenceTitle">
508 <input
type=
"radio" name=
"sequence" id=
"sequenceTitle" value=
"1" <?php echo $sequenceTitleChecked; ?>>
509 <?php echo
$lang[
'SORTATION_ALPHABETICAL']; ?>
513 <div
class=
"col-md-6">
516 <input
type=
"radio" name=
"sortation" id=
"asc" value=
"0" <?php echo $ascChecked; ?>>
517 <?php echo
$lang[
'ASC']; ?>
520 <input
type=
"radio" name=
"sortation" id=
"desc" value=
"1" <?php echo $descChecked; ?>>
521 <?php echo
$lang[
'DESC']; ?>
527 <div
class=
"col-md-6">
528 <!-- ACCESS CONTROL / PRIVACY -->
529 <h3><
i class=
"fa fa-eye"></
i> <?php echo
$lang[
'PRIVACY']; ?></h3>
530 <label
for=
"gid"><?php echo
$lang[
'MINIMUM_GID_TO_VIEW_BLOG']; ?></label>
532 <select
name=
"gid" id=
"gid" class=
"form-control">
533 <option value=
"<?php print \YAWK\sys::getRoleId($db, $blog->blogid, "blog
"); ?>"><?php print \YAWK\sys::getRole(
$db,
$blog->blogid,
"blog"); ?></option>
539 print
"<option value=\"".$gid[
'id'].
"\"";
540 if (isset(
$blog->gid)) {
543 print
" selected=\"selected\"";
545 else if(
$blog->gid ===
$gid[
'id'] && !$_POST[
'gid'])
547 print
" selected=\"selected\"";
550 print
">".$gid[
'value'].
"</option>";
555 <h3><
i class=
"fa fa-list-ol"></
i>&
nbsp; <?php echo
$lang[
'LIMIT']; ?></h3>
556 <label
for=
"limitEntries"><?
PHP echo
$lang[
'LIMIT_ENTRIES']; ?></label>
557 <input
id=
"limitEntries" name=
"limitEntries" type=
"text" placeholder=
"<?php echo $lang['LIMIT_DESC']; ?>" value=
"<?php echo $blog->limitEntries; ?>" class=
"form-control">
563 <div
id=
"comments" class=
"tab-pane fade">
566 <div
class=
"col-md-6">
567 <h3><
i class=
"fa fa-comment-o"></
i> <?php echo
$lang[
'COMMENTS']; ?></h3>
570 <label
for=
"comment_on">
571 <input
type=
"radio" name=
"comments" id=
"comment_on" value=
"0"<?php echo
" $commentsOnChecked"; ?>>
572 <?php echo
$lang[
'COMMENTS'].
" ".
$lang[
'FORBIDDEN']; ?>
574 <label
for=
"comment_off">
575 <input
type=
"radio" name=
"comments" id=
"comment_off" value=
"1"<?php echo
" $commentsOffChecked"; ?>>
576 <?php echo
$lang[
'COMMENTS'].
" ".
$lang[
'ALLOWED']; ?>
583 <div
class=
"col-md-6">
585 <h3><
i class=
"fa fa-thumbs-o-up"></
i> <?php echo
$lang[
'VOTING']; ?></h3>
588 <label
for=
"voting_off">
589 <input
type=
"radio" name=
"voting" id=
"voting_off" value=
"0" <?php echo $votingOffChecked; ?>>
590 <?php echo
$lang[
'VOTING'].
" ".
$lang[
'FORBIDDEN']; ?>
592 <label
for=
"voting_on">
593 <input
type=
"radio" name=
"voting" id=
"voting_on" value=
"1" <?php echo $votingOnChecked; ?>>
594 <?php echo
$lang[
'VOTING'].
" ".
$lang[
'ALLOWED']; ?>
599 <label
for=
"showTotalVotes"><?php echo
$lang[
'SHOW_TOTAL_VOTES']; ?></label>
600 <select
class=
"form-control" id=
"showTotalVotes" name=
"showTotalVotes">
print $lang['FILEMAN_UPLOAD']
if(isset($_GET['blogid'])) $blog name
static draw($type, $title, $text, $redirect, $delay)
static getTitle($title, $subtext)
Header title on top of every page.
static inject(array $lang, string $pathToFile)
allow plugins to inject language tags to $lang array
This class serves methods to create backup from files.
<!-- 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);});})