From 93c827446737252c36d6d9daee7e2e7a55eb911b Mon Sep 17 00:00:00 2001
From: vincent-peugnet
Date: Fri, 9 Aug 2019 15:58:37 +0200
Subject: New Feature : Alert pages have more options
---
app/view/templates/admin.php | 367 ++++++++++++++++++++++++++-----------------
app/view/templates/alert.php | 104 ++++++++++++
app/view/templates/read.php | 56 ++-----
3 files changed, 333 insertions(+), 194 deletions(-)
create mode 100644 app/view/templates/alert.php
(limited to 'app/view')
diff --git a/app/view/templates/admin.php b/app/view/templates/admin.php
index c1d7ff4..98027dc 100644
--- a/app/view/templates/admin.php
+++ b/app/view/templates/admin.php
@@ -8,237 +8,310 @@
insert('backtopbar', ['user' => $user, 'tab' => 'admin']) ?>
-
+
-
-
+
+
+
+
+ insert('navart', ['user' => $user, 'art' => $art, 'artexist' => $artexist, 'canedit' => $canedit]);
+ }
+
+ ?>
+
+
+
+
+ = !empty(Config::alerttitle()) ? '' . Config::alerttitle() . '
' : '' ?>
+
+
+
+ ';
+
+
+ if(!$artexist) {
+ if(!empty(Config::existnot())) {
+ echo '' . Config::existnot() . '
';
+ }
+ if(Config::existnotpass() && !$canedit) {
+ echo $form;
+ }
+ } else {
+
+
+
+ switch ($art->secure()) {
+ case 1:
+ if(!empty(Config::private())) {
+ echo '' . Config::private() . '
';
+ }
+ if(Config::privatepass()) {
+ echo $form;
+ }
+ break;
+
+ case 2:
+ if(!empty(Config::notpublished())) {
+ echo '' . Config::notpublished() . '
';
+ }
+ if(Config::notpublishedpass()) {
+ echo $form;
+ }
+ break;
+ }
+ }
+
+
+
+ if ($canedit) {
+ ?>
+ ⭐ Create
+
+ = empty(Config::alertlinktext()) ? Config::alertlink() : Config::alertlinktext() ?>
+
+
+
+
+
+
+
+
-
-
+
- insert('navart', ['user' => $user, 'art' => $art, 'artexist' => $artexist, 'canedit' => $canedit]);
- }
- ?>
-
- insert('navart', ['user' => $user, 'art' => $art, 'artexist' => $artexist, 'canedit' => $canedit]);
+ }
- if ($canread) {
- echo $body;
- } else {
- echo ''.$alertprivate.'
';
- }
- } else {
- if(!empty(Config::existnot())) {
- echo '' . Config::existnot() . '
';
- }
- if ($user->iseditor()) {
- ?>
- ⭐ Create
-
- ?>
-
-
+
stop('page') ?>
\ No newline at end of file
diff --git a/app/view/templates/alert.php b/app/view/templates/alert.php
new file mode 100644
index 0000000..ff29e30
--- /dev/null
+++ b/app/view/templates/alert.php
@@ -0,0 +1,104 @@
+layout('readerlayout') ?>
+
+start('head');
+?>
+
+
+ = Config::alertcss() ? '' : '' ?>
+
+
+
+stop();
+?>
+
+
+
+start('page') ?>
+
+
+
+stop() ?>
\ No newline at end of file
diff --git a/app/view/templates/read.php b/app/view/templates/read.php
index f8201cc..54b137e 100644
--- a/app/view/templates/read.php
+++ b/app/view/templates/read.php
@@ -3,69 +3,31 @@
start('head');
-if ($artexist) {
- if ($canread) {
- echo $head;
- } else {
- $this->insert('arthead', ['title' => $art->title(), 'description' => $art->description()]);
- }
-} else {
- $this->insert('arthead', ['title' => $art->id(), 'description' => $alertnotexist]);
-}
-
-
+echo $head;
$this->stop();
?>
-
-
-
-
-
-
start('page') ?>
-
stop() ?>
\ No newline at end of file
--
cgit v1.2.3