YaWK  24.1
Yet another WebKit
blog-newitem.php
Go to the documentation of this file.
1 <?php
2 
3 use YAWK\alert;
5 use YAWK\db;
6 use YAWK\language;
7 use YAWK\PLUGINS\BLOG\blog;
8 use YAWK\sys;
9 
10 include '../system/classes/editor.php';
11 include '../system/plugins/blog/classes/blog.php';
12 // check if blog object is set
13 if (!isset($blog)) { $blog = new blog(); }
14 // check if language is set
15 if (!isset($language) || (!isset($lang)))
16 { // inject (add) language tags to core $lang array
17  $lang = language::inject(@$lang, "../system/plugins/blog/language/");
18 }
19 if (!isset($db)){
20  $db = new db();
21 }
22 
23 if (isset($_POST['create']) && isset($_POST['blogid']))
24 {
25  $blog = new blog();
26  $blog->blogid = $db->quote($_POST['blogid']);
27  $blog->title = $db->quote($_POST['title']);
28  $blog->subtitle = $db->quote($_POST['subtitle']);
29  $blog->published = $db->quote($_POST['published']);
30  $blog->teasertext = $db->quote($_POST['teasertext']);
31  $blog->blogtext = $db->quote($_POST['blogtext']);
32  $blog->date_publish = $db->quote($_POST['date_publish']);
33  $blog->date_unpublish = $db->quote($_POST['date_unpublish']);
34  $blog->thumbnail = $db->quote($_POST['thumbnail']);
35  $blog->youtubeUrl = $db->quote($_POST['youtubeUrl']);
36  $blog->weblink = $db->quote($_POST['weblink']);
37  $blog->meta_local = "Meta Tag Description";
38  $blog->meta_keywords = "Keyword 1, Keyword2, ...";
39 
40  if ($blog->createItem($db, $blog->blogid, $blog->title, $blog->subtitle, $blog->published, $blog->teasertext, $blog->blogtext, $blog->date_publish, $blog->date_unpublish, $blog->thumbnail, $blog->youtubeUrl, $blog->weblink, $blog->meta_local, $blog->meta_keywords)) {
41  // echo YAWK\alert::draw("success", "Success!", "Your entry $blog->title was saved.","plugin=blog&pluginpage=blog-entries&blogid=".$blog->blogid."", 9800);
42  alert::draw("success", "$lang[SUCCESS]", "$blog->title $lang[SAVED]", "plugin=blog&pluginpage=blog-entries&blogid=".$blog->blogid."", 1200);
43  sys::setSyslog($db, 5, 0, "blog item $blog->title saved", 0, 0, 0, 0);
44  }
45  else
46  { // create failed, throw error
47  alert::draw("danger", "$lang[ERROR]", "$lang[BLOG_ADD_ITEM_FAILED]","","3800");
48  sys::setSyslog($db, 7, 1, "unable to save blog item $blog->title", 0, 0, 0, 0);
49  }
50 }
51 
52 // LOAD EDITOR JS + SETTINGS
53 // echo \YAWK\editor::getEditor($db);
54 ?>
55 
56 <!-- bootstrap date-timepicker -->
57 <link type="text/css" href="../system/engines/datetimepicker/css/datetimepicker.min.css" rel="stylesheet"/>
58 <script type="text/javascript" src="../system/engines/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
59 
60 <script type="text/javascript">
61  /* start own JS bootstrap function
62  ...on document ready... letsego! */
63  $(document).ready(function () {
64 
65  $('#datetimepicker1').datetimepicker({
66  format: 'YYYY-MM-DD HH:mm:ss'
67  });
68 
69  $('#datetimepicker2').datetimepicker({
70  format: 'YYYY-MM-DD HH:mm:ss'
71  });
72 
73  });//]]> /* END document.ready */
74  /* ...end admin jQ controlls */
75 </script>
76 <!-- end datetimepicker -->
77 
78 <?php
79 // TEMPLATE WRAPPER - HEADER & breadcrumbs
80 echo "
81 <!-- Content Wrapper. Contains page content -->
82 <div class=\"content-wrapper\" id=\"content-FX\">
83  <!-- Content Header (Page header) -->
84  <section class=\"content-header\">";
85 /* draw Title on top */
86 $blog::getBlogTitle($blog->name, $lang['ADD'], $blog->icon);
87 echo"<ol class=\"breadcrumb\">
88  <li><a href=\"index.php\" title=\"$lang[DASHBOARD]\"><i class=\"fa fa-dashboard\"></i> $lang[DASHBOARD]</a></li>
89  <li><a href=\"index.php?page=plugins\" title=\"$lang[PLUGINS]\"> $lang[PLUGINS]</a></li>
90  <li><a href=\"index.php?plugin=blog\" title=\"$lang[BLOG]\"> $lang[BLOG]</a></li>
91  <li class=\"active\"><a href=\"index.php?plugin=blog&pluginpage=blog-newitem\" title=\"$lang[ADD_ENTRY]\"> $lang[ADD_ENTRY]</a></li>
92  </ol>
93  </section>
94  <!-- Main content -->
95  <section class=\"content\">";
96 /* page content start here */
97 ?>
98 <?php
99 // get settings for editor
101 ?>
102 <!-- include summernote css/js-->
103 <!-- include codemirror (codemirror.css, codemirror.js, xml.js) -->
104 <link rel="stylesheet" type="text/css" href="../system/engines/codemirror/codemirror.min.css">
105 <link rel="stylesheet" type="text/css" href="../system/engines/codemirror/themes/<?php echo $editorSettings['editorTheme']; ?>.css">
106 <link rel="stylesheet" type="text/css" href="../system/engines/codemirror/show-hint.min.css">
107 <script type="text/javascript" src="../system/engines/codemirror/codemirror-compressed.js"></script>
108 <script type="text/javascript" src="../system/engines/codemirror/auto-refresh.js"></script>
109 
110 <!-- SUMMERNOTE -->
111 <link href="../system/engines/summernote/dist/summernote.css" rel="stylesheet">
112 <script src="../system/engines/summernote/dist/summernote.min.js"></script>
113 <script src="../system/engines/summernote/dist/summernote-cleaner.js"></script>
114 <script src="../system/engines/summernote/dist/summernote-image-attributes.js"></script>
115 <script src="../system/engines/summernote/dist/summernote-floats-bs.js"></script>
116 <script type="text/javascript">
117  $(document).ready(function() {
118 // textarea that will be transformed into editor
119  var editor = ('textarea#summernote');
120  var editor2 = ('textarea#summernote2');
121  var savebutton = ('#savebutton');
122  var savebuttonIcon = ('#savebuttonIcon');
123 // ok, lets go...
124 // we need to check if user clicked on save button
125  $(savebutton).click(function() {
126  $(savebutton).removeClass('btn btn-success').addClass('btn btn-warning');
127  $(savebuttonIcon).removeClass('fa fa-check').addClass('fa fa-spinner fa-spin fa-fw');
128 // to save, even if the editor is currently opened in code view
129 // we need to check if codeview is currently active:
130  if ($(editor).summernote('codeview.isActivated')) {
131 // if so, turn it off.
132  $(editor).summernote('codeview.deactivate');
133  }
134 
135  if ($(editor2).summernote('codeview.isActivated')) {
136 // if so, turn it off.
137  $(editor2).summernote('codeview.deactivate');
138  }
139 // to display images in frontend correctly, we need to change the path of every image.
140 // to do that, the current value of textarea will be read into var text and search/replaced
141 // and written back into the textarea. utf-8 encoding/decoding happens in php, before saving into db.
142 // get the value of summernote textarea
143  if ( $(editor).length) { // check if element exists in dom to load editor correctly
144  var text = $(editor).val();
145  // search for <img> tags and revert src ../ to set correct path for frontend
146  var frontend = text.replace(/<img src=\x22..\/media/g,"<img src=\x22media");
147  // put the new string back into <textarea>
148  $(editor).val(frontend); // to make sure that saving works
149  }
150 
151  if ( $(editor2).length) { // check if element exists in dom to load editor correctly
152  // do the same thing for the 2nd textarea:
153  var text2 = $(editor2).val();
154  // search for <img> tags and revert src ../ to set correct path for frontend
155  var frontend2 = text2.replace(/<img src=\x22..\/media/g, "<img src=\x22media");
156  // put the new string back into <textarea>
157  $(editor2).val(frontend2); // to make sure that saving works
158  }
159  });
160 
161  // BEFORE SUMMERNOTE loads: 3 important lines of code!
162  // to display images in backend correctly, we need to change the path of every image.
163  // procedure is the same as above (see #savebutton.click)
164  // get the value of summernote textarea
165 
166  if ( $(editor).length) { // check if element exists in dom to load editor correctly
167  var text = $(editor).val();
168  // search for <img> tags and update src ../ to get images viewed in summernote
169  var backend = text.replace(/<img src=\"media/g, "<img src=\"../media");
170  // put the new string back into <textarea>
171  $(editor).val(backend); // set new value into textarea
172  }
173 
174  if ( $(editor2).length) { // check if element exists in dom to load editor correctly
175  // do the same thing for the 2nd textarea:
176  var text2 = $(editor2).val();
177  // search for <img> tags and update src ../ to get images viewed in summernote
178  var backend2 = text2.replace(/<img src=\"media/g, "<img src=\"../media");
179  // put the new string back into <textarea>
180  $(editor2).val(backend2); // set new value into textarea
181  }
182  <?php
183  // check if codeview is enabled on default
184  if ($editorSettings['editorAutoCodeview'] === "true")
185  {
186  // summernote.init -
187  // LOAD SUMMERNOTE IN CODEVIEW ON STARTUP
188  echo "$(editor).on('summernote.init', function() {
189  // toggle editor to codeview
190  $(editor).summernote('codeview.toggle');
191  });";
192  echo "$(editor2).on('summernote.init', function() {
193  // toggle editor to codeview
194  $(editor2).summernote('codeview.toggle');
195  });";
196  }
197  ?>
198 
199  // INIT SUMMERNOTE EDITOR
200  $('#summernote').summernote({ // set editor itself
201  height: <?php echo $editorSettings['editorTeaserHeight']; ?>, // set editor height
202  minHeight: null, // set minimum height of editor
203  maxHeight: null, // set maximum height of editor
204  focus: true, // set focus to editable area after initializing summernote
205 
206  // popover tooltips
207  popover: {
208  image: [
209  ['imagesize', ['imageSize100', 'imageSize50', 'imageSize25']],
210  /* ['float', ['floatLeft', 'floatRight', 'floatNone']], // those are the old regular float buttons */
211  ['floatBS', ['floatBSLeft', 'floatBSNone', 'floatBSRight']], // bootstrap class buttons (float/pull)
212  ['custom', ['imageAttributes', 'imageShape']], // forked plugin: image-attributes.js
213  ['remove', ['removeMedia']]
214  ]
215  },
216  // language for plugin image-attributes.js
217  lang: '<?php echo $lang['CURRENT_LANGUAGE']; ?>',
218 
219  // powerup the codeview with codemirror theme
220  codemirror: { // codemirror options
221  theme: '<?php echo $editorSettings['editorTheme']; ?>', // codeview theme
222  lineNumbers: <?php echo $editorSettings['editorLineNumbers']; ?>, // display lineNumbers true|false
223  undoDepth: <?php echo $editorSettings['editorUndoDepth']; ?>, // how many undo steps should be saved? (default: 200)
224  smartIndent: <?php echo $editorSettings['editorSmartIndent']; ?>, // better indent
225  indentUnit: <?php echo $editorSettings['editorIndentUnit']; ?>, // how many spaces auto indent? (default: 2)
226  scrollbarStyle: null, // styling of the scrollbars
227  matchBrackets: <?php echo $editorSettings['editorMatchBrackets']; ?>, // highlight corresponding brackets
228  autoCloseBrackets: <?php echo $editorSettings['editorCloseBrackets'];?>, // auto insert close brackets
229  autoCloseTags: <?php echo $editorSettings['editorCloseTags']; ?>, // auto insert close tags after opening
230  value: "<html>\n " + document.documentElement.innerHTML + "\n</html>", // all html
231  mode: "htmlmixed", // editor mode
232  matchTags: {bothTags: <?php echo $editorSettings['editorMatchTags']; ?>}, // hightlight matching tags: both
233  extraKeys: {"Ctrl-J": "toMatchingTag", "Ctrl-Space": "autocomplete"}, // press ctrl-j to jump to next matching tab
234  styleActiveLine: <?php echo $editorSettings['editorActiveLine']; ?>, // highlight the active line (where the cursor is)
235  autoRefresh: true
236  },
237 
238  // plugin: summernote-cleaner.js
239  // this allows to copy/paste from word, browsers etc.
240  cleaner: { // does the job well: no messy code anymore!
241  action: 'both', // both|button|paste 'button' only cleans via toolbar button, 'paste' only clean when pasting content, both does both options.
242  newline: '<br>' // Summernote's default is to use '<p><br></p>'
243 
244  // silent mode:
245  // from my pov it is not necessary to notify the user about the code cleaning process.
246  // it throws just a useless, annoying bubble everytime you hit the save button.
247  // BUT: if you need this notification, you can enable it by uncommenting the following 3 lines
248  // notTime:2400, // Time to display notifications.
249  // notStyle:'position:absolute;bottom:0;left:2px', // Position of notification
250  // icon:'<i class="note-icon">[Your Button]</i>' // Display an icon
251  }
252  }); // end summernote
253 
254 
255  // INIT SUMMERNOTE 2 EDITOR
256  $('#summernote2').summernote({ // set editor itself
257  height: <?php echo $editorSettings['editorHeight']; ?>, // set editor height
258  minHeight: null, // set minimum height of editor
259  maxHeight: null, // set maximum height of editor
260  focus: false, // set focus to editable area after initializing summernote
261 
262  // popover tooltips
263  popover: {
264  image: [
265  ['imagesize', ['imageSize100', 'imageSize50', 'imageSize25']],
266  /* ['float', ['floatLeft', 'floatRight', 'floatNone']], // those are the old regular float buttons */
267  ['floatBS', ['floatBSLeft', 'floatBSNone', 'floatBSRight']], // bootstrap class buttons (float/pull)
268  ['custom', ['imageAttributes', 'imageShape']], // forked plugin: image-attributes.js
269  ['remove', ['removeMedia']]
270  ]
271  },
272  // language for plugin image-attributes.js
273  lang: '<?php echo $lang['CURRENT_LANGUAGE']; ?>',
274 
275  // powerup the codeview with codemirror theme
276  codemirror: { // codemirror options
277  theme: '<?php echo $editorSettings['editorTheme']; ?>', // codeview theme
278  lineNumbers: <?php echo $editorSettings['editorLineNumbers']; ?>, // display lineNumbers true|false
279  undoDepth: <?php echo $editorSettings['editorUndoDepth']; ?>, // how many undo steps should be saved? (default: 200)
280  smartIndent: <?php echo $editorSettings['editorSmartIndent']; ?>, // better indent
281  indentUnit: <?php echo $editorSettings['editorIndentUnit']; ?>, // how many spaces auto indent? (default: 2)
282  scrollbarStyle: null, // styling of the scrollbars
283  matchBrackets: <?php echo $editorSettings['editorMatchBrackets']; ?>, // highlight corresponding brackets
284  autoCloseBrackets: <?php echo $editorSettings['editorCloseBrackets'];?>, // auto insert close brackets
285  autoCloseTags: <?php echo $editorSettings['editorCloseTags']; ?>, // auto insert close tags after opening
286  value: "<html>\n " + document.documentElement.innerHTML + "\n</html>", // all html
287  mode: "htmlmixed", // editor mode
288  matchTags: {bothTags: <?php echo $editorSettings['editorMatchTags']; ?>}, // hightlight matching tags: both
289  extraKeys: {"Ctrl-J": "toMatchingTag", "Ctrl-Space": "autocomplete"}, // press ctrl-j to jump to next matching tab
290  styleActiveLine: <?php echo $editorSettings['editorActiveLine']; ?>, // highlight the active line (where the cursor is)
291  autoRefresh: true
292  },
293 
294  // plugin: summernote-cleaner.js
295  // this allows to copy/paste from word, browsers etc.
296  cleaner: { // does the job well: no messy code anymore!
297  action: 'both', // both|button|paste 'button' only cleans via toolbar button, 'paste' only clean when pasting content, both does both options.
298  newline: '<br>' // Summernote's default is to use '<p><br></p>'
299 
300  // silent mode:
301  // from my pov it is not necessary to notify the user about the code cleaning process.
302  // it throws just a useless, annoying bubble everytime you hit the save button.
303  // BUT: if you need this notification, you can enable it by uncommenting the following 3 lines
304  // notTime:2400, // Time to display notifications.
305  // notStyle:'position:absolute;bottom:0;left:2px', // Position of notification
306  // icon:'<i class="note-icon">[Your Button]</i>' // Display an icon
307  }
308  }); // end summernote
309  }); // end document ready
310 </script>
311 <form name="form" role="form" action="index.php?plugin=blog&pluginpage=blog-newitem" method="post">
312 
313  <div class="row">
314  <div class="col-md-9">
315  <label for="blogtitle"><?php print $lang['TITLE']; ?></label>
316  <input type="text"
317  class="form-control input-lg"
318  id="title"
319  name="title">
320  <br>
321  <?php if ($blog->layout !== "0")
322  {
323  echo "
324  <!-- EDITOR -->
325  <label for=\"summernote\">$lang[TEASER_TEXT]</label>
326  <textarea
327  id=\"summernote\"
328  class=\"form-control\"
329  style=\"margin-top:10px;\"
330  name=\"teasertext\"></textarea>";
331  }
332  ?>
333  <!-- EDITOR -->
334  <label for="summernote2"><?php echo $lang['BLOG_TEXT']; ?></label>
335  <textarea
336  id="summernote2"
337  class="form-control"
338  style="margin-top:10px;"
339  name="blogtext"
340  cols="50"
341  rows="18"></textarea>
342  </div> <!-- end left col -->
343 
344  <div class="col-md-3">
345  <!-- right col -->
346  <!-- SAVE BUTTON -->
347  <button type="submit"
348  id="savebutton"
349  name="save"
350  class="btn btn-success pull-right">
351  <i id="savebuttonIcon" class="fa fa-check"></i> &nbsp;<?php print $lang['ADD_ENTRY']; ?>
352  </button>
353 
354  <!-- CANCEL BUTTON -->
355  <a class="btn btn-default pull-right" href="index.php?plugin=blog&pluginpage=blog-entries&blogid=<?php echo $_GET['blogid']; ?>">
356  <i id="cancelbuttonIcon" class="fa fa-backward"></i> &nbsp;<?php print $lang['BACK']; ?>
357  </a>
358 
359  <br><br><br>
360 
361  <?php
362  // SETTINGS: filename + subtitle
363  $header = "<i class=\"fa fa-file-text-o\"></i>&nbsp; $lang[SETTINGS] <small>$lang[TITLE] &amp; $lang[FILENAME]</small>";
364  $content = "<label for=\"filename\">$lang[FILENAME]</label><br>
365  <input type=\"text\"
366  class=\"form-control\"
367  name=\"filename\"
368  id=\"filename\"
369  size=\"64\"
370  maxlength=\"255\">
371  <label for=\"subtitle\">$lang[SUBTITLE]</label><br>
372  <input type=\"text\"
373  class=\"form-control\"
374  name=\"subtitle\"
375  id=\"subtitle\"
376  size=\"64\"
377  maxlength=\"255\">";
378  echo AdminLTE::drawCollapsableBox($header, $content);
379  ?>
380 
381  <!-- PUBLISHING -->
382  <div class="box box-default">
383  <div class="box-header with-border">
384  <h3 class="box-title"><i class="fa fa-clock-o"></i>
385  &nbsp;<?php echo "$lang[PUBLISHING] <small>$lang[EFFECTIVE_TIME] &amp; $lang[PRIVACY]</small>"; ?>
386  </h3>
387  <!-- box-tools -->
388  <div class="box-tools pull-right">
389  <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
390  </button>
391  </div>
392  <!-- /.box-tools -->
393  </div>
394  <!-- /.box-header -->
395  <div class="box-body" style="display: block;">
396 
397  <!-- start publish datetimepicker -->
398  <label for="datetimepicker1"><i class="fa fa-calendar"></i> <?php print $lang['START_PUBLISH']; ?></label><br>
399  <input
400  class="form-control"
401  id="datetimepicker1"
402  type="text"
403  name="date_publish"
404  maxlength="19"
405  value="<?php echo date("Y-m-d H:i:s"); ?>"
406 
407  <!-- end publish datetimepicker -->
408  <label for="datetimepicker2"><i class="fa fa-ban"></i> <?php print $lang['END_PUBLISH']; ?></label><br>
409  <input
410  type="text"
411  class="form-control"
412  id="datetimepicker2"
413  name="date_unpublish"
414  maxlength="19"
415  value="">
416 
417  <!-- group id selector -->
418  <label for="gidselect"><i class="fa fa-users"></i> <?php print $lang['PAGE_VISIBLE']; ?></label>
419  <select id="gidselect" name="itemgid" class="form-control">
420  <?php
421  foreach(YAWK\sys::getGroups($db, "pages") as $role) {
422  print "<option value=\"".$role['id']."\"";
423  if (isset($_POST['gid'])) {
424  if($_POST['gid'] === $role['id']) {
425  print " selected=\"selected\"";
426  }
427  else if($blog->itemgid === $role['id'] && !$_POST['itemgid']) {
428  print " selected=\"selected\"";
429  }
430  }
431  print ">".$role['value']."</option>";
432  }
433  ?>
434  </select>
435 
436  <!-- PAGE ON / OFF STATUS -->
437  <label for="published"><i class="fa fa-eye"></i> <?php print $lang['ENTRY'];print"&nbsp;";print $lang['ONLINE']; ?></label><br>
438  <?php if($blog->published == 1){
439  $publishedHtml = "<option value=\"1\" selected=\"selected\">$lang[ONLINE]</option>";
440  $publishedHtml .= "<option value=\"0\" >$lang[OFFLINE]</option>";
441  } else {
442  $publishedHtml = "<option value=\"0\" selected=\"selected\">$lang[OFFLINE]</option>";
443  $publishedHtml .= "<option value=\"1\" >$lang[ONLINE]</option>";
444  } ?>
445  <select id="published" name="published" class="form-control">
446  <?php echo $publishedHtml; ?>
447  </select>
448  </div>
449  <!-- /.box-body -->
450  </div>
451 
452  <!-- META TAGS -->
453  <div class="box box-default">
454  <div class="box-header with-border">
455  <h3 class="box-title"><i class="fa fa-google"></i>&nbsp;&nbsp;<?php echo "$lang[META_TAGS] <small>$lang[SEO]"; ?></h3>
456  <!-- box-tools -->
457  <div class="box-tools pull-right">
458  <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
459  </button>
460  </div>
461  <!-- /.box-tools -->
462  </div>
463  <!-- /.box-header -->
464  <div class="box-body" style="display: block;">
465  <!-- LOCAL META SITE DESCRIPTION -->
466  <label for="metadescription"><?php echo "$lang[META_DESC]"; ?></label><br>
467  <textarea cols="64"
468  rows="2"
469  id="metadescription"
470  class="form-control"
471  maxlength="255"
472  placeholder="<?php echo "$lang[PAGE_DESC_PLACEHOLDER]"; ?>"
473  name="metadescription"></textarea>
474  <!-- LOCAL META SITE KEYWORDS -->
475  <label for="metakeywords"><?php echo "$lang[META_KEYWORDS]"; ?></label>
476  <input type="text"
477  size="64"
478  id="metakeywords"
479  class="form-control"
480  placeholder="<?php echo "$lang[KEYWORD] 1, $lang[KEYWORD] 2, $lang[KEYWORD] 3..."; ?>"
481  name="metakeywords">
482  </div>
483  <!-- /.box-body -->
484  </div>
485 
486  <!-- blog thumbnail -->
487  <div class="box box-default">
488  <div class="box-header with-border">
489  <h3 class="box-title"><i class="fa fa-photo"></i>&nbsp;&nbsp;<?php echo "$lang[TEASER] <small>$lang[TEASER_IMG]</small>"; ?></h3>
490  <!-- box-tools -->
491  <div class="box-tools pull-right">
492  <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
493  </button>
494  </div>
495  <!-- /.box-tools -->
496  </div>
497  <!-- /.box-header -->
498  <div class="box-body" style="display: block;">
499  <!-- THUMBNAIL IMAGE -->
500  <label for="thumbnail"><?php print $lang['THUMBNAIL']; ?>&nbsp;</label><br>
501  <input
502  type="text"
503  class="form-control"
504  id="thumbnail"
505  name="thumbnail"
506  size="64"
507  maxlength="255"
508  placeholder="media/images/anyfile.jpg">
509  <label for="thumbnail"><i class="fa fa-youtube"></i> &nbsp;<?php print $lang['YOUTUBEURL']; ?>&nbsp;</label><br>
510  <!-- YouTube Link -->
511  <input
512  type="text"
513  class="form-control"
514  id="youtubeUrl"
515  name="youtubeUrl"
516  size="64"
517  maxlength="255"
518  placeholder="https://www.youtube.com/embed/1A2B3C4D5E6F">
519  </div>
520  <!-- /.box-body -->
521  </div>
522 
523  <!-- blog thumbnail -->
524  <div class="box box-default">
525  <div class="box-header with-border">
526  <h3 class="box-title"><i class="fa fa-bars"></i>&nbsp;&nbsp;<?php echo "$lang[SUBMENU] <small>$lang[SUBMENU_SUBTEXT]</small>"; ?></h3>
527  <!-- box-tools -->
528  <div class="box-tools pull-right">
529  <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
530  </button>
531  </div>
532  <!-- /.box-tools -->
533  </div>
534  <!-- /.box-header -->
535  <div class="box-body" style="display: block;">
536  <!-- SUB MENU SELECTOR -->
537  <label for="menu"><?php echo $lang['SUBMENU']; ?></label>
538  <select name="menu" class="form-control">
539  <option value="0"><?php echo $lang['NO_MENU_SELECTED']; ?></option>
540  <?php
541  foreach(YAWK\sys::getMenus($db) as $menue){
542  print "<option value=\"".$menue['id']."\"";
543  if (isset($_POST['menu'])) {
544  if($_POST['menu'] === $menue['id']){
545  print " selected=\"selected\"";
546  }
547  else if($page->menu === $menue['id'] && !$_POST['menu']){
548  print " selected=\"selected\"";
549  }
550  }
551  print ">".$menue['name']."</option>";
552  }
553  ?>
554  </select>
555  </div>
556  <!-- /.box-body -->
557  </div>
558 
559 
560  <!-- blog thumbnail -->
561  <div class="box box-default">
562  <div class="box-header with-border">
563  <h3 class="box-title"><i class="fa fa-object-ungroup"></i>&nbsp;&nbsp;<?php echo "$lang[LAYOUT] <small>$lang[AND] $lang[COMMENTS]</small>"; ?></h3>
564  <!-- box-tools -->
565  <div class="box-tools pull-right">
566  <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
567  </button>
568  </div>
569  <!-- /.box-tools -->
570  </div>
571  <!-- /.box-header -->
572  <div class="box-body" style="display: block;">
573  <!-- LAYOUT -->
574  <label for="itemlayout"><?php print $lang['LAYOUT']; ?>&nbsp;</label><br>
575  <select name="itemlayout" id="itemlayout" class="form-control">
576  <option value="-1"><?php echo $lang['BLOG_SETTING']; ?></option>
577  <option value="0"><?php echo $lang['BLOG_LAYOUT_1COL_TEXTBLOG']; ?></option>
578  <option value="1"><?php echo $lang['BLOG_LAYOUT_2COL_TEASER_L']; ?></option>
579  <option value="2"><?php echo $lang['BLOG_LAYOUT_2COL_TEASER_R']; ?></option>
580  <option value="3"><?php echo $lang['BLOG_LAYOUT_3COL_NEWSPAPER']; ?></option>
581  <option value="4"><?php echo $lang['BLOG_LAYOUT_1COL_YOUTUBE']; ?></option>
582  </select>
583 
584  <!-- COMMENTS -->
585  <label for="itemcomments"><i class="fa fa-comment-o"></i> &nbsp;<?php print $lang['COMMENTS']; ?>&nbsp;</label><br>
586  <select name="itemcomments" id="itemcomments" class="form-control">
587  <option value="-1"><?php echo $lang['BLOG_SETTING']; ?></option>
588  <option value="1"><?php echo $lang['COMMENTS_ALLOWED']; ?></option>
589  <option value="0"><?php echo $lang['COMMENTS_FORBIDDEN']; ?></option>
590  </select>
591  </div>
592  <!-- /.box-body -->
593  </div>
594  <!-- /. ADDITIONAL BOXES-->
595  <?php
596  if (!isset($_GET['blogid']))
597  {
598  $blog->icon = $blog->getBlogProperty($db, $_GET['blogid'], "icon");
599  $blog->name = $blog->getBlogProperty($db, $_GET['blogid'], "name");
600  $blog->id = $blog->getBlogProperty($db, $_GET['blogid'], "id");
601  }
602  else
603  {
604  $blog->id = $_GET['blogid'];
605  }
606  ?>
607 
608  <!-- HIDDEN FIELDS -->
609  <input type="hidden" name="create" value="1">
610  <input type="hidden" name="blogid" value="<?php print $blog->id; ?>">
611  <input type="hidden" name="itemid" value="<?php print $blog->itemid; ?>">
612  <input type="hidden" name="pageid" value="<?php print $blog->pageid; ?>">
613  <input type="hidden" name="oldteasertext" value="<?php print $blog->teasertext; ?>">
614 
615  </div>
616  </div>
617 </form>
$blog
Definition: blog.php:122
print $blog thumbnail
Definition: blog-edit.php:583
$header
$content
$publishedHtml
$editorSettings
print & nbsp
print $lang['TITLE']
Backend class serves a few useful functions for the admin backend.
Definition: AdminLTE.php:23
Throws a fancy Bootstrap Alert (success, info, warning or danger)
Definition: alert.php:19
Mysqli database class; returns db connection object.
Definition: db.php:16
The language class - support multilingual backend.
Definition: language.php:17
static getEditorSettings($db, $typeID=0)
Returns an associative array containing the editor settings.
Definition: settings.php:377
The sys class - handles yawk's system core functions.
Definition: sys.php:17
function a
Definition: browser.js:14
var m
type
Definition: menu-new.php:35
This class serves methods to create backup from files.
Definition: AdminLTE.php:2
print $_GET['id']
Definition: page-edit.php:357
$page
Definition: pages.php:355
function i(e, t)
Definition: plyr.js:1
function g(e, t, n, r)
Definition: plyr.js:1
function s(e, t)
Definition: plyr.js:1
function d(e, n, r)
Definition: plyr.js:1
$template name
print $tourdates date
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 &ouml;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);});})