YaWK  24.1
Yet another WebKit
tourdates-toggle.php
Go to the documentation of this file.
1 <?php
2 // check if language is set
3 if (!isset($language) || (!isset($lang)))
4 { // inject (add) language tags to core $lang array
5  $lang = \YAWK\language::inject(@$lang, "../system/plugins/tourdates/language/");
6 }
7 include '../system/plugins/tourdates/classes/tourdates.php';
8 if (!isset($tourdates))
9 { // create new obj
11  if (isset($_GET['id']))
12  { // escape var
13  $id = $db->quote($_GET['id']);
14  $tourdates->loadProperties($db, $id);
15  }
16 }
17 // check status and toggle it
18 if ($tourdates->published === '1')
19 { // published, toggle to OFF
20  $tourdates->published = 0;
21 }
22 else
23 { // not published, toggle to ON
24  $tourdates->published = 1;
25 }
26 
27 if ($tourdates->toggleOffline($db, $tourdates->id, $tourdates->published))
28 {
29  \YAWK\backend::setTimeout("index.php?plugin=tourdates", 0);
30 }
31 else
32 { // toggle failed, throw error
33  print \YAWK\alert::draw("danger", "Error", "Could not toggle tourdate status.","plugin-tourdates","4200");
34 }
print $lang['FILEMAN_UPLOAD']
$tourdates
Definition: tourdates.php:80
Tour Dates Plugin hands you a simple but nice, clean bootstraped & sortable Data Table....
Definition: tourdates.php:22
static setTimeout($location, $wait)
Definition: backend.php:106
static inject(array $lang, string $pathToFile)
allow plugins to inject language tags to $lang array
Definition: language.php:439
if(!isset($db)) $id
print $_GET['id']
Definition: page-edit.php:357