YaWK  24.1
Yet another WebKit
page-edit.php
Go to the documentation of this file.
1 <?php
2 // IMPORT REQUIRED CLASSES
3 use YAWK\backend;
4 use YAWK\db;
5 use YAWK\language;
6 use YAWK\settings;
7 use YAWK\sys;
8 use YAWK\user;
9 use YAWK\widget;
10 
11 // CHECK REQUIRED OBJECTS
12 if (!isset($page)) // if no page object is set
13 { // create new page object
14  $page = new YAWK\page();
15 }
16 if (!isset($db))
17 { // create database object
18  $db = new db();
19 }
20 if (!isset($lang))
21 { // create language object
22  $lang = new language();
23 }
24 
25 if (isset($_GET['id'])){
26  $id = $db->quote($_GET['id']);
27  $page->loadPropertiesByID($db,$id);
28 }
29 if(isset($_POST['save'])){
30  $page->deleteContent("../");
31  $page->id = $db->quote($_POST['id']);
32  $page->gid = $db->quote($_POST['gid']);
33  $page->title = $db->quote($_POST['title']);
34  $page->alias = $db->quote($_POST['alias']);
35  $page->searchstring = $db->quote($_POST['searchstring']);
36  $page->published = $db->quote($_POST['published']);
37  $page->date_publish = $db->quote($_POST['date_publish']);
38  $page->date_unpublish = $db->quote($_POST['date_unpublish']);
39  $page->bgimage = $db->quote($_POST['bgimage']);
40  $page->language = $db->quote($_POST['language']);
41  $page->meta_local = $db->quote($_POST['meta_local']);
42  $page->meta_keywords = $db->quote($_POST['meta_keywords']);
43  // after preparing the vars, update db + write content
44  if($page->save($db)) {
45  // encode chars
46  // $_POST['content'] = \YAWK\sys::encodeChars($_POST['content']);
47  $_POST['content'] = utf8_encode($_POST['content']);
48  $_POST['content'] = utf8_decode($_POST['content']);
49  // write content to file
50  if ($page->writeContent(stripslashes(str_replace('\r\n', '', ($_POST['content']))))) {
51  print YAWK\alert::draw("success", "$lang[SUCCESS]", "$lang[PAGE_SAVED]","", 800);
52  }
53  else {
54  print YAWK\alert::draw("warning", "$lang[ERROR]", "$lang[FILE] $page->alias $lang[NOT_SAVED]. $lang[CHECK_CHMOD]", "", "8200");
55 
56  }
57  }
58  else {
59  print YAWK\alert::draw("warning", "$lang[ERROR]", "$lang[PAGE_DB_FAILED] $page->alias $lang[DB_WRITE_FAILED]", "", "8200");
60  }
61 }
62 // path to cms
64 // path to cms
66 
67 /* alias string manipulation */
68 $page->alias = mb_strtolower($page->alias); // lowercase
69 $page->alias = str_replace(" ", "-", $page->alias); // replace all ' ' with -
70 // special chars
71 $specialChars = array("/ä/", "/ü/", "/ö/", "/Ä/", "/Ü/", "/Ö/", "/ß/"); // array of special chars
72 $replacedChars = array("ae", "ue", "oe", "ae", "ue", "oe", "ss"); // array of replacement chars
73 $page->alias = preg_replace($specialChars, $replacedChars, $page->alias); // replace with preg
74 $page->alias = preg_replace("/[^a-z0-9\-\/]/i", "", $page->alias); // final check: just numbers and chars are allowed
75 
76 // make sure that user cannot change index' article name (index.php/html)
77 if ($page->alias === "index") { $readonly = "readonly"; }
78 ?>
79 
80 <!-- bootstrap date-timepicker -->
81 <link type="text/css" href="../system/engines/datetimepicker/css/datetimepicker.min.css" rel="stylesheet">
82 <script type="text/javascript" src="../system/engines/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
83 <style>
84  /* Add a border and hover effect to draggable components */
85  #sidebar .component {
86  border: 1px solid #ccc;
87  margin-bottom: 10px;
88  padding: 6px;
89  cursor: grab;
90  transition: all 0.3s;
91  }
92 
93  #sidebar .component:hover {
94  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
95  transform: scale(1.02);
96  }
97 
98  /* Add a border and hover effect to the main area (drop zone */
99  #main-area {
100  min-height: 800px;
101  border: 2px dashed #ccc;
102  padding: 20px;
103  background-color: #f8f9fa;
104  width: 100%;
105  padding: 15px;
106  padding-bottom: 120px;
107  }
108 
109  #main-area.hover {
110  border-color: #007bff;
111  background-color: #e9ecef;
112  }
113 
114  .col-md-9 {
115  padding: 0;
116  }
117 
118  #code-editor {
119  height: 800px;
120  display: none;
121  }
122 
123 
124  .component-controls i {
125  cursor: pointer;
126  position: relative;
127  color: #000;
128  }
129 
130  .component {
131  position: relative;
132  /* your other styles for the component */
133  }
134 
135  .component-controls {
136  position: absolute;
137  top: 0;
138  right: 0;
139  z-index: 100000;
140  padding: 4px; /* Add this line */
141  }
142 
143 
144  .component:hover {
145  border: 1px solid red;
146  }
147  .hovered .component-controls {
148  border: 2px solid red;
149  display: block;
150  }
151 
152 </style>
153 
154 <?php
155 // get settings for editor
156 $editorSettings = settings::getEditorSettings($db, 14);
157 ?>
158 <!-- include summernote css/js-->
159 <!-- include codemirror (codemirror.css, codemirror.js, xml.js) -->
160 <link rel="stylesheet" type="text/css" href="../system/engines/codemirror/codemirror.min.css">
161 <link rel="stylesheet" type="text/css" href="../system/engines/codemirror/themes/<?php echo $editorSettings['editorTheme']; ?>.css">
162 <link rel="stylesheet" type="text/css" href="../system/engines/codemirror/show-hint.min.css">
163 <script type="text/javascript" src="../system/engines/codemirror/codemirror-compressed.js"></script>
164 <script type="text/javascript" src="../system/engines/codemirror/auto-refresh.js"></script>
165 
166 <!-- SUMMERNOTE -->
167 <link href="../system/engines/summernote/dist/summernote.css" rel="stylesheet">
168 <script src="../system/engines/summernote/dist/summernote.min.js"></script>
169 <script src="../system/engines/summernote/dist/summernote-cleaner.js"></script>
170 <script src="../system/engines/summernote/dist/summernote-image-attributes.js"></script>
171 <script src="../system/engines/summernote/dist/summernote-floats-bs.js"></script>
172 
173 <script type="text/javascript">
174  function saveHotkey() {
175  // simply disables save event for chrome
176  $(window).keypress(function (event) {
177  if (!(event.which === 115 && (navigator.platform.match("Mac") ? event.metaKey : event.ctrlKey)) && !(event.which === 19)) return true;
178  event.preventDefault();
179  formmodified=0; // do not warn user, just save.
180  return false;
181  });
182  // used to process the cmd+s and ctrl+s events
183  $(document).keydown(function (event) {
184  if (event.which === 83 && (navigator.platform.match("Mac") ? event.metaKey : event.ctrlKey)) {
185  event.preventDefault();
186  $('#savebutton').click(); // SAVE FORM AFTER PRESSING STRG-S hotkey
187  formmodified=0; // do not warn user, just save.
188  // save(event);
189  return false;
190  }
191  });
192  }
193  saveHotkey();
194  $(document).ready(function() {
195  // textarea that will be transformed into editor
196  var editor = ('textarea#summernote');
197  var savebutton = ('#savebutton');
198  var savebuttonIcon = ('#savebuttonIcon');
199  // ok, lets go...
200  // we need to check if user clicked on save button
201  $(savebutton).click(function() {
202  $(savebutton).removeClass('btn btn-success').addClass('btn btn-warning');
203  $(savebuttonIcon).removeClass('fa fa-check').addClass('fa fa-spinner fa-spin fa-fw');
204  // to save, even if the editor is currently opened in code view
205  // we need to check if codeview is currently active:
206  if ($(editor).summernote('codeview.isActivated')) {
207  // if so, turn it off.
208  $(editor).summernote('codeview.deactivate');
209  }
210  // to display images in frontend correctly, we need to change the path of every image.
211  // to do that, the current value of textarea will be read into var text and search/replaced
212  // and written back into the textarea. utf-8 encoding/decoding happens in php, before saving into db.
213  // get the value of summernote textarea
214  if ( $(editor).length) { // check if element exists in dom to load editor correctly
215  var text = $(editor).val();
216  // search for <img> tags and revert src ../ to set correct path for frontend
217  var frontend = text.replace(/<img src=\x22..\/media/g,"<img src=\x22media");
218  // put the new string back into <textarea>
219  $(editor).val(frontend); // to make sure that saving works
220  }
221 
222  });
223 
224  // BEFORE SUMMERNOTE loads: 3 important lines of code!
225  // to display images in backend correctly, we need to change the path of every image.
226  // procedure is the same as above (see #savebutton.click)
227  // get the value of summernote textarea
228 
229  if ( $(editor).length) { // check if element exists in dom to load editor correctly
230  var text = $(editor).val();
231  // search for <img> tags and update src ../ to get images viewed in summernote
232  var backend = text.replace(/<img src=\x22media/g, "<img src=\x22../media");
233  // put the new string back into <textarea>
234  $(editor).val(backend); // set new value into textarea
235  }
236 
237  <?php
238  if ($editorSettings['editorAutoCodeview'] === "true")
239  {
240  // summernote.init -
241  // LOAD SUMMERNOTE IN CODEVIEW ON STARTUP
242  echo "$(editor).on('summernote.init', function() {
243  // toggle editor to codeview
244  $(editor).summernote('codeview.toggle');
245  });";
246  }
247  ?>
248 
249  // INIT SUMMERNOTE EDITOR
250  $("#summernote").summernote({ // set editor itself
251  height: <?php echo $editorSettings['editorHeight']; ?>, // set editor height
252  minHeight: null, // set minimum height of editor
253  maxHeight: null, // set maximum height of editor
254  focus: true, // set focus to editable area after initializing summernote
255 
256  // popover tooltips
257  popover: {
258  image: [
259  ['imagesize', ['imageSize100', 'imageSize50', 'imageSize25']],
260  /* ['float', ['floatLeft', 'floatRight', 'floatNone']], // those are the old regular float buttons */
261  ['floatBS', ['floatBSLeft', 'floatBSNone', 'floatBSRight']], // bootstrap class buttons (float/pull)
262  ['custom', ['imageAttributes', 'imageShape']], // forked plugin: image-attributes.js
263  ['remove', ['removeMedia']]
264  ]
265  },
266  // language for plugin image-attributes.js
267  lang: '<?php echo $lang['CURRENT_LANGUAGE']; ?>',
268 
269  // powerup the codeview with codemirror theme
270  codemirror: { // codemirror options
271  theme: '<?php echo $editorSettings['editorTheme']; ?>', // codeview theme
272  lineNumbers: <?php echo $editorSettings['editorLineNumbers']; ?>, // display lineNumbers true|false
273  undoDepth: <?php echo $editorSettings['editorUndoDepth']; ?>, // how many undo steps should be saved? (default: 200)
274  smartIndent: <?php echo $editorSettings['editorSmartIndent']; ?>, // better indent
275  indentUnit: <?php echo $editorSettings['editorIndentUnit']; ?>, // how many spaces auto indent? (default: 2)
276  scrollbarStyle: null, // styling of the scrollbars
277  matchBrackets: <?php echo $editorSettings['editorMatchBrackets']; ?>, // highlight corresponding brackets
278  autoCloseBrackets: <?php echo $editorSettings['editorCloseBrackets'];?>, // auto insert close brackets
279  autoCloseTags: <?php echo $editorSettings['editorCloseTags']; ?>, // auto insert close tags after opening
280  value: "<html>\n " + document.documentElement.innerHTML + "\n</html>", // all html
281  mode: "htmlmixed", // editor mode
282  matchTags: {bothTags: <?php echo $editorSettings['editorMatchTags']; ?>}, // hightlight matching tags: both
283  extraKeys: {"Ctrl-J": "toMatchingTag", "Ctrl-Space": "autocomplete"}, // press ctrl-j to jump to next matching tab
284  styleActiveLine: <?php echo $editorSettings['editorActiveLine']; ?>, // highlight the active line (where the cursor is)
285  autoRefresh: true
286  },
287 
288  // plugin: summernote-cleaner.js
289  // this allows to copy/paste from word, browsers etc.
290  cleaner: { // does the job well: no messy code anymore!
291  action: 'both', // both|button|paste 'button' only cleans via toolbar button, 'paste' only clean when pasting content, both does both options.
292  newline: '<br>' // Summernote's default is to use '<p><br></p>'
293 
294  // silent mode:
295  // from my pov it is not necessary to notify the user about the code cleaning process.
296  // it throws just a useless, annoying bubble everytime you hit the save button.
297  // BUT: if you need this notification, you can enable it by uncommenting the following 3 lines
298  // notTime:2400, // Time to display notifications.
299  // notStyle:'position:absolute;bottom:0;left:2px', // Position of notification
300  // icon:'<i class="note-icon">[Your Button]</i>' // Display an icon
301  }
302  }); // end summernote
303  }); // end document ready
304 </script>
305 
306 <script type="text/javascript" >
307  $(document).ready(function() {
308 // load datetimepicker (start time)
309  $('#datetimepicker1').datetimepicker({
310  format: 'YYYY-MM-DD HH:mm:ss'
311  });
312 // load 2nd datetimepicker (end time)
313  $('#datetimepicker2').datetimepicker({
314  format: 'YYYY-MM-DD HH:mm:ss'
315 
316  });
317 
318  }); //]]> /* END document.ready */
319  /* ...end admin jQ controlls */
320 </script>
321 
322 <?php
323 // TEMPLATE WRAPPER - HEADER & breadcrumbs
324 echo "
325 <!-- Content Wrapper. Contains page content -->
326 <div class=\"content-wrapper\" id=\"content-FX\">
327  <!-- Content Header (Page header) -->
328  <section class=\"content-header\">";
329 /* draw Title on top */
330 echo backend::getTitle($page->title, $lang['PAGE_EDIT']);
331 echo"<ol class=\"breadcrumb\">
332  <li><a href=\"index.php\" title=\"$lang[DASHBOARD]\"><i class=\"fa fa-dashboard\"></i> $lang[DASHBOARD]</a></li>
333  <li><a href=\"index.php?page=pages\" title=\"$lang[PAGES]\"> $lang[PAGES]</a></li>
334  <li class=\"active\"><a href=\"index.php?page=page-edit\" title=\"$lang[PAGE_EDIT]\"> $lang[PAGE_EDIT]</a></li>
335  </ol>
336  </section>
337  <!-- Main content -->
338  <section class=\"content\">";
339 ?>
340 
341 <!-- FORM -->
342 <form name="form" role="form" action="index.php?page=page-edit&site=<?php print $page->alias; ?>&id=<?php echo $page->id; ?>" method="post">
343  <div class="row">
344  <div class="col-md-8">
345  <!-- EDITOR -->
346  <label for="summernote"></label>
347  <textarea id="summernote" name="content"><?php print $page->readContent("../"); ?> </textarea>
348 
349  <!-- SAVE BUTTON -->
350  <div class="text-right">
351  <button type="submit" id="savebutton" name="save" class="btn btn-success">
352  <i id="savebuttonIcon" class="fa fa-check"></i> &nbsp;<?php print $lang['SAVE_CHANGES']; ?>
353  </button>
354  </div>
355 
356  <input type="hidden" name="searchstring" value="<?php print $page->alias; ?>.html" >
357  <input type="hidden" name="id" value="<?php print $_GET['id']; ?>" >
358 
359  <br><br>
360 
361  </div>
362  <div class="col-md-4">
363  <!-- 2nd col -->
364  <!-- TITLE and FILENAME -->
365  <div class="box box-default">
366  <div class="box-header with-border">
367  <h3 class="box-title"><i class="fa fa-file-text-o"></i>&nbsp;&nbsp;<?php echo $lang['SETTINGS']; ?> <small> <?php echo "$lang[TITLE] $lang[AND] $lang[FILENAME]"; ?></small></h3>
368  <!-- box-tools -->
369  <div class="box-tools pull-right">
370  <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
371  </button>
372  </div>
373  <!-- /.box-tools -->
374  </div>
375  <div class="box-body" style="display: block;">
376  <label for="title"><?php print $lang['TITLE']; ?>
377  <?php echo backend::printTooltip($lang['TT_PAGE_TITLE']); ?>
378  </label>
379  <input id="title" class="form-control" name="title" maxlength="255" value="<?php print $page->title; ?>">
380 
381  <label for="alias"><?php echo $lang['FILENAME']; ?>
382  <?php echo backend::printTooltip($lang['TT_PAGE_FILENAME']); ?>
383  </label>
384  <input id="alias" class="form-control" name="alias" maxlength="255"
385  <?php if (isset($readonly)) { print $readonly; } ?> value="<?php print $page->alias; ?>">
386 
387  <label for="language"><?php print $lang['LANGUAGE']; ?>
388  <?php echo backend::printTooltip($lang['TT_PAGE_LANGUAGE']); ?>
389  </label>
390  <select id="language" name="language" class="form-control">
391  <?php
392  if (isset($page->language) && (!empty($page->language)))
393  {
394  echo "<option value=".$page->language." selected>$page->language</option>";
395  }
396  echo \YAWK\language::drawLanguageSelectOptions();
397  ?>
398  </select>
399  </div>
400  </div>
401 
402  <?php // draw a box containing widgets of this current page
404  ?>
405 
406 
407  <!-- CONTENT BUILDER -->
408  <div class="box box-default">
409  <div class="box-header with-border">
410  <h3 class="box-title"><i class="fa fa-cubes"></i>&nbsp;&nbsp;<?php echo $lang['CB_HEADING']; ?> <small><?php echo $lang['CB_SUBTEXT']; ?></small></h3>
411  <!-- box-tools -->
412  <div class="box-tools pull-right">
413  <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
414  </button>
415  </div>
416  <!-- /.box-tools -->
417  </div>
418  <div id="sidebar" class="box-body" style="display: block;">
419  <!-- Add draggable components here -->
420  <div class="component" data-type="jumbotron">Jumbotron</div>
421  <div class="component" data-type="accordion">Accordion</div>
422  <div class="component" data-type="card">Card</div>
423  <div class="component" data-type="cards-grid-66">2 Cards <small>(6-6 grid)</small></div>
424  <div class="component" data-type="cards-grid-444">3 Cards <small>(4-4-4 grid)</small></div>
425  <div class="component" data-type="quote">Quote</div>
426  </div>
427  </div>
428 
429  <!-- PUBLISHING -->
430  <div class="box box-default">
431  <div class="box-header with-border">
432  <h3 class="box-title"><i class="fa fa-clock-o"></i>&nbsp;&nbsp;<?php echo $lang['PUBLISHING']; ?> <small><?php echo "$lang[EFFECTIVE_TIME] $lang[AND] $lang[PRIVACY]"; ?></small></h3>
433  <!-- box-tools -->
434  <div class="box-tools pull-right">
435  <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
436  </button>
437  </div>
438  <!-- /.box-tools -->
439  </div>
440  <div class="box-body">
441  <label for="datetimepicker1"><?php print $lang['START_PUBLISH']; ?>
442  <?php echo backend::printTooltip($lang['TT_PAGE_PUBLISH_DATE']); ?>
443  </label>
444  <input class="form-control" id="datetimepicker1" name="date_publish" maxlength="19" value="<?php print $page->date_publish; ?>">
445 
446  <!-- END PUBLISH DATE -->
447  <label for="datetimepicker2"><?php print $lang['END_PUBLISH']; ?>
448  <?php echo backend::printTooltip($lang['TT_PAGE_UNPUBLISH_DATE']); ?>
449  </label>
450  <input type="text" class="form-control" id="datetimepicker2" name="date_unpublish" maxlength="19" value="<?php print $page->date_unpublish; ?>">
451 
452  <label for="gidselect"> <?php print $lang['PAGE_VISIBLE']; ?>
453  <?php echo backend::printTooltip($lang['TT_PAGE_USERGROUP']); ?>
454  </label>
455  <select id="gidselect" name="gid" class="form-control">
456  <option value="<?php print sys::getGroupId($db, $page->id, "pages"); ?>" selected><?php print user::getGroupNameFromID($db, $page->gid); ?></option>
457  <?php
458  foreach(YAWK\sys::getGroups($db, "pages") as $role) {
459  print "<option value=\"".$role['id']."\"";
460  if (isset($_POST['gid'])) {
461  if($_POST['gid'] === $role['id']) {
462  print " selected=\"selected\"";
463  }
464  else if($page->gid === $role['id'] && !$_POST['gid']) {
465  print " selected=\"selected\"";
466  }
467  }
468  print ">".$role['value']."</option>";
469  }
470  ?>
471  </select>
472 
473  <!-- PAGE ON / OFF STATUS -->
474  <label for="published"><?php print $lang['PAGE_STATUS']; ?>
475  <?php echo backend::printTooltip($lang['TT_PAGE_PUBLISH']); ?>
476  </label>
477  <?php if($page->published === '1')
478  {
479  $publishedHtml = "<option value=\"1\" selected=\"selected\">$lang[ONLINE]</option>";
480  $publishedHtml .= "<option value=\"0\" >offline</option>";
481  }
482  else
483  {
484  $publishedHtml = "<option value=\"0\" selected=\"selected\">$lang[OFFLINE]</option>";
485  $publishedHtml .= "<option value=\"1\" >online</option>";
486  }
487  ?>
488  <select id="published" name="published" class="form-control">
489  <?php echo $publishedHtml; ?>
490  </select>
491  </div>
492  </div>
493 
494  <!-- META TAGS -->
495  <div class="box box-default">
496  <div class="box-header with-border">
497  <h3 class="box-title"><i class="fa fa-google"></i>&nbsp;&nbsp;<?php echo $lang['META_TAGS']; ?> <small><?php echo $lang['PAGE_SEO']; ?></small></h3>
498  <!-- box-tools -->
499  <div class="box-tools pull-right">
500  <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
501  </button>
502  </div>
503  <!-- /.box-tools -->
504  </div>
505  <div class="box-body" style="display: block;">
506  <!-- LOCAL META SITE DESCRIPTION -->
507  <label for="meta_local"><?php echo $lang['META_DESC']; ?>
508  <?php echo backend::printTooltip($lang['TT_PAGE_METALOCAL']); ?>
509  </label>
510  <input type="text" size="64" id="meta_local" class="form-control" maxlength="255" placeholder="<?php echo $lang['META_DESC_PLACEHOLDER']; ?>" name="meta_local" value="<?php print $page->meta_local; ?>">
511  <!-- LOCAL META SITE KEYWORDS -->
512  <label for="meta_keywords"><?php echo $lang['META_KEYWORDS']; ?>
513  <?php echo backend::printTooltip($lang['TT_PAGE_KEYWORDS']); ?>
514  </label>
515  <input type="text" size="64" id="meta_keywords" class="form-control" placeholder="<?php echo $lang['META_KEYWORDS_PLACEHOLDER']; ?>" name="meta_keywords" value="<?php print $page->meta_keywords; ?>">
516  </div>
517  </div>
518 
519  <!-- BG IMAGE -->
520  <div class="box box-default">
521  <div class="box-header with-border">
522  <h3 class="box-title"><i class="fa fa-photo"></i>&nbsp;&nbsp;<?php echo $lang['BG_IMAGE']; ?> <small><?php echo $lang['SPECIFIC_PAGE']; ?></small></h3>
523  <!-- box-tools -->
524  <div class="box-tools pull-right">
525  <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
526  </button>
527  </div>
528  <!-- /.box-tools -->
529  </div>
530  <div class="box-body" style="display: block;">
531  <!-- PAGE BG IMAGE -->
532  <label for="bgimage"><?php echo $lang['BG_IMAGE']; ?></label>
533  <input id="bgimage" type="text" size="64" class="form-control" placeholder="media/images/background.jpg" name="bgimage" value="<?php print $page->bgimage; ?>">
534  </div>
535  </div>
536 </form>
static draw($type, $title, $text, $redirect, $delay)
Definition: alert.php:30
Backend class serves a few useful functions for the admin backend.
Definition: backend.php:27
static drawWidgetsOnPageBox($db, $page, $lang)
Draw a box containing all widgets that are linked with given page. Every Widget gets drawn as small b...
Definition: backend.php:550
Mysqli database class; returns db connection object.
Definition: db.php:16
The language class - support multilingual backend.
Definition: language.php:17
The default pages class. Provide all functions to handle static pages.
Definition: page.php:20
Settings class: get and set YaWK system settings.
Definition: settings.php:9
The sys class - handles yawk's system core functions.
Definition: sys.php:17
static getDirPrefix($db)
if yawk is installed into a subdirectory, use this to get this prefix directory
Definition: sys.php:1104
static getHost($db)
get hostname (url where yawk is installed) from database
Definition: sys.php:1115
The default user class. Provide all functions to handle the user object.
Definition: user.php:17
Widgets are small, useful tools that you can include everywhere in your website.
Definition: widget.php:22
if(!isset($db)) $id
function window
Definition: fuckAdBlock.js:8
c jPlayer event
type
Definition: menu-new.php:35
This class serves methods to create backup from files.
Definition: AdminLTE.php:2
$specialChars
Definition: page-edit.php:71
$host
Definition: page-edit.php:65
$publishedHtml
Definition: page-edit.php:485
$replacedChars
Definition: page-edit.php:72
if($page->alias==="index") $editorSettings
Definition: page-edit.php:156
print $_GET['id']
Definition: page-edit.php:357
print $lang['SAVE_CHANGES']
Definition: page-edit.php:352
if(!isset($page)) if(!isset($db)) if(!isset($lang)) if(isset($_GET['id'])) if(isset($_POST['save'])) $dirprefix
Definition: page-edit.php:63
$page
Definition: pages.php:355
function i(e, t)
Definition: plyr.js:1
function g(e, t, n, r)
Definition: plyr.js:1
<!-- backend language -->< h3 >< i class="fa fa-language"></i > & nbsp
$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);});})