diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2018-11-05 13:41:27 +0100 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2018-11-05 13:41:27 +0100 |
commit | e7bdf04e3e58aa2c1821918b72753f274d3684fb (patch) | |
tree | ba336324aeb65509f67f4791e06d08a70f3f12f1 /w/view/templates | |
parent | 85824de70ded75c98bd50220160e2171fdc8df41 (diff) | |
download | wcms-e7bdf04e3e58aa2c1821918b72753f274d3684fb.tar.gz wcms-e7bdf04e3e58aa2c1821918b72753f274d3684fb.zip |
render function only body
Diffstat (limited to 'w/view/templates')
-rw-r--r-- | w/view/templates/arthead.php | 6 | ||||
-rw-r--r-- | w/view/templates/navart.php | 2 | ||||
-rw-r--r-- | w/view/templates/read.php | 34 | ||||
-rw-r--r-- | w/view/templates/readerlayout.php | 15 |
4 files changed, 49 insertions, 8 deletions
diff --git a/w/view/templates/arthead.php b/w/view/templates/arthead.php new file mode 100644 index 0000000..b137c7f --- /dev/null +++ b/w/view/templates/arthead.php @@ -0,0 +1,6 @@ +<meta charset="utf8" /> +<meta name="viewport" content="width=device-width" /> +<link rel="shortcut icon" href="./media/logo.png" type="image/x-icon"> +<title><?= $title ?></title> +<meta name="description" content="<?= $description ?>"> +<link rel="stylesheet" href="./css/soft.css">
\ No newline at end of file diff --git a/w/view/templates/navart.php b/w/view/templates/navart.php index 0ddba17..d591307 100644 --- a/w/view/templates/navart.php +++ b/w/view/templates/navart.php @@ -1,4 +1,4 @@ -<div class="menu"> +<div class="menu" style="all: initial; position: fixed; top: 0; right: 0;"> <?= $user->level() ?> <div id="dropmenu"> diff --git a/w/view/templates/read.php b/w/view/templates/read.php index 4964a47..35b1e7d 100644 --- a/w/view/templates/read.php +++ b/w/view/templates/read.php @@ -1,6 +1,22 @@ -<?php $this->layout('layout', ['title' => $art->title(), 'description' => $art->description()]) ?> +<?php $this->layout('readerlayout') ?> +<?php +$this->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]); +} + + + +$this->stop(); +?> @@ -16,22 +32,26 @@ - <?php $this->insert('navart', ['user' => $user, 'art' => $art, 'artexist' => $artexist]) ?> + <?php + if ($readernav) { + $this->insert('navart', ['user' => $user, 'art' => $art, 'artexist' => $artexist]); + } + ?> <?php - if($artexist) { + if ($artexist) { - if($display) { - $this->insert('readart', ['art' => $art]); + if ($canread) { + echo $body; } else { - echo '<h1>You dont have enought rights to see this article</h1>'; + echo '<h1>'.$alertprivate.'</h1>'; } } else { - echo '<h1>This article does not exist yet</h1>'; + echo '<h1>' . $alertnotexist . '</h1>'; if ($cancreate) { $this->insert('readcreate', ['id' => $art->id()]); } diff --git a/w/view/templates/readerlayout.php b/w/view/templates/readerlayout.php new file mode 100644 index 0000000..51ab406 --- /dev/null +++ b/w/view/templates/readerlayout.php @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<html> +<head> + + <?=$this->section('head')?> + + +</head> + + + +<?=$this->section('page')?> + + +</html>
\ No newline at end of file |