-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadd_chapter.php
29 lines (26 loc) · 1.08 KB
/
add_chapter.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
require "load.php";
$page = "titles";
if (!$logged || !$level->addChap()) header("Location: account.php") && exit;
$title = new Title(cat($_GET["slug"] ?? $_GET["id"]));
$page = "titles";
if ($logged && $level->addChap()) {
$error = false;
if (isset($_POST["addChapter"])) {
$number = cat($_POST["number"]);
$lang = cat($_POST["lang"]);
$name = clean($_POST["name"]);
$data = clean($_POST["data"]);
$notes = clean($_POST["notes"]);
$return = $editor->addChapter($number, $lang, $title->getId(), $name, $data, $notes, $account["id"]);
if ($return === true)
$number++ && header("Refresh: 0; url=add_chapter.php?slug={$title->getSlug()}&number={$number}&lang={$lang}");
else
$error = true;
}
}
include "themes/{$thme}/parts/header.php";
echo $core->title("Add Chapter for " . $title->getName(), $config["seperator"], $config["title"]);
include "themes/{$thme}/parts/menu.php";
include "themes/{$thme}/render/add_chapter.php";
include "themes/{$thme}/parts/footer.php";