aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2018-12-04 20:39:48 +0100
committervincent-peugnet <v.peugnet@free.fr>2018-12-04 20:39:48 +0100
commit42e89ac398bdf2a98167b0b71123c98e297b2130 (patch)
tree623c5e42d9b40a7372f17c070e2b39f52dc44ed1 /app
parentdd14929505e3fd0bc1710ed757b501d3ec1f6ca1 (diff)
downloadwcms-42e89ac398bdf2a98167b0b71123c98e297b2130.tar.gz
wcms-42e89ac398bdf2a98167b0b71123c98e297b2130.zip
editor right bar
Diffstat (limited to 'app')
-rw-r--r--app/class/art2.php92
-rw-r--r--app/class/controlleradmin.php11
-rw-r--r--app/class/controllerart.php11
-rw-r--r--app/class/modelart.php34
-rw-r--r--app/class/modelrender.php42
-rw-r--r--app/view/templates/admin.php14
-rw-r--r--app/view/templates/backtopbar.php22
-rw-r--r--app/view/templates/confirmdelete.php2
-rw-r--r--app/view/templates/edit.php4
-rw-r--r--app/view/templates/editleftbar.php78
-rw-r--r--app/view/templates/editrightbar.php60
-rw-r--r--app/view/templates/edittabs.php2
-rw-r--r--app/view/templates/font.php10
13 files changed, 259 insertions, 123 deletions
diff --git a/app/class/art2.php b/app/class/art2.php
index 000c391..0023989 100644
--- a/app/class/art2.php
+++ b/app/class/art2.php
@@ -26,7 +26,9 @@ class Art2
protected $interface;
protected $linkfrom;
protected $linkto;
- protected $template;
+ protected $templatebody;
+ protected $templatecss;
+ protected $templatejavascript;
protected $affcount;
protected $editcount;
@@ -90,7 +92,9 @@ class Art2
$this->setinterface('section');
$this->setlinkfrom([]);
$this->setlinkto([]);
- $this->settemplate([]);
+ $this->settemplatebody('');
+ $this->settemplatecss('');
+ $this->settemplatejavascript('');
$this->setaffcount(0);
$this->seteditcount(0);
}
@@ -217,25 +221,6 @@ class Art2
}
}
-
- public function csstemplate(App $app)
- {
- $data = [];
- $temp = '';
- if (!empty($this->template())) {
- if ($app->exist($this->template()) and !in_array($this->template(), $data)) {
- $template = $app->get($this->template());
- $temp = $temp . $template->css($app);
- $data[] = $template->id();
-
- }
-
- }
- $cssprint = str_replace('url(/', 'url(' . $app::MEDIA_DIR, $temp . $this->css);
- return $cssprint;
- }
-
-
public function javascript($type = 'string')
{
return $this->javascript;
@@ -251,16 +236,6 @@ class Art2
return $this->header;
}
- public function md($expand = false)
- {
- if ($expand == true) {
- $md = str_replace('](=', '](?id=', $this->section);
- } else {
- $md = $this->section;
- }
- return $md;
- }
-
public function section($type = 'string')
{
return $this->section;
@@ -345,13 +320,27 @@ class Art2
}
- public function template($type = 'array')
+ public function templatebody($type = 'string')
{
- if ($type == 'json') {
- return json_encode($this->template);
- } elseif ($type = 'array') {
- return $this->template;
- }
+ return $this->templatebody;
+ }
+
+ public function templatecss($type = 'string')
+ {
+ return $this->templatecss;
+ }
+
+ public function templatejavascript($type = 'string')
+ {
+ return $this->templatejavascript;
+ }
+
+ function template()
+ {
+ $template['body'] = $this->templatebody;
+ $template['css'] = $this->templatecss;
+ $template['javascript'] = $this->templatejavascript;
+ return $template;
}
public function affcount($type = 'int')
@@ -573,24 +562,25 @@ class Art2
}
}
- public function settemplate($template)
+ public function settemplatebody($templatebody)
{
- if (is_string($template)) {
- $templatearray = json_decode($template, true);
+ if(is_string($templatebody)) {
+ $this->templatebody = $templatebody;
}
- if (is_array($template)) {
- $templatearray = $template;
+ }
+
+ public function settemplatecss($templatecss)
+ {
+ if(is_string($templatecss)) {
+ $this->templatecss = $templatecss;
}
- if(is_object($template)) {
- $templatearray = (array) $template;
+ }
+
+ public function settemplatejavascript($templatejavascript)
+ {
+ if(is_string($templatejavascript)) {
+ $this->templatejavascript = $templatejavascript;
}
- $this->template = array_map(function ($value) {
- if(empty($value)) {
- return null;
- } else {
- return $value;
- }
- }, $templatearray);
}
public function setaffcount($affcount)
diff --git a/app/class/controlleradmin.php b/app/class/controlleradmin.php
index 0829916..86d6db1 100644
--- a/app/class/controlleradmin.php
+++ b/app/class/controlleradmin.php
@@ -15,7 +15,10 @@ class Controlleradmin extends Controller
} else {
$defaultartexist = true;
}
- $admin = ['artlist' => $artlist, 'defaultartexist' => $defaultartexist];
+
+ $globalcss = file_get_contents(Model::GLOBAL_DIR . 'global.css');
+
+ $admin = ['artlist' => $artlist, 'defaultartexist' => $defaultartexist, 'globalcss' => $globalcss];
$this->showtemplate('admin', $admin);
}
}
@@ -25,11 +28,13 @@ class Controlleradmin extends Controller
if(!isset($_POST['showeditmenu'])) {
$_POST['showeditmenu'] = false;
}
+ $globalcss = file_put_contents(Model::GLOBAL_DIR . 'global.css', $_POST['globalcss']);
+
Config::hydrate($_POST);
- if(Config::savejson() !== false) {
+ if(Config::savejson() !== false && $globalcss !== false) {
$this->routedirect('admin');
} else {
- echo 'Can\'t write config file';
+ echo 'Can\'t write config file or global css file';
}
}
diff --git a/app/class/controllerart.php b/app/class/controllerart.php
index 0dee8e7..f64cda8 100644
--- a/app/class/controllerart.php
+++ b/app/class/controllerart.php
@@ -116,9 +116,14 @@ class Controllerart extends Controller
if ($this->importart() && $this->canedit()) {
- $tablist = ['section' => $this->art->md(), 'css' => $this->art->css(), 'header' => $this->art->header(), 'nav' => $this->art->nav(), 'aside' => $this->art->aside(), 'footer' => $this->art->footer(), 'body' => $this->art->body(), 'javascript' => $this->art->javascript()];
+ $tablist = ['section' => $this->art->section(), 'css' => $this->art->css(), 'header' => $this->art->header(), 'nav' => $this->art->nav(), 'aside' => $this->art->aside(), 'footer' => $this->art->footer(), 'body' => $this->art->body(), 'javascript' => $this->art->javascript()];
- $artlist = $this->artmanager->list();
+ $idlist = $this->artmanager->list();
+
+
+ $artlist = $this->artmanager->getlister();
+ $tagartlist = $this->artmanager->tagartlist($this->art->tag('array'), $artlist);
+ $lasteditedartlist = $this->artmanager->lasteditedartlist(5, $artlist);
if (isset($_SESSION['workspace'])) {
$showleftpanel = $_SESSION['workspace']['showleftpanel'];
@@ -129,7 +134,7 @@ class Controllerart extends Controller
}
$fonts = [];
- $this->showtemplate('edit', ['art' => $this->art, 'artexist' => true, 'tablist' => $tablist, 'artlist' => $artlist, 'showleftpanel' => $showleftpanel, 'showrightpanel' => $showrightpanel, 'fonts' => $fonts]);
+ $this->showtemplate('edit', ['art' => $this->art, 'artexist' => true, 'tablist' => $tablist, 'artlist' => $idlist, 'showleftpanel' => $showleftpanel, 'showrightpanel' => $showrightpanel, 'fonts' => $fonts, 'tagartlist' => $tagartlist, 'lasteditedartlist' => $lasteditedartlist]);
} else {
$this->routedirect('artread/', ['art' => $this->art->id()]);
}
diff --git a/app/class/modelart.php b/app/class/modelart.php
index e9f6ec3..54a6613 100644
--- a/app/class/modelart.php
+++ b/app/class/modelart.php
@@ -107,9 +107,12 @@ class Modelart extends Modeldb
}
-
-
-
+ /**
+ * @param array $artlist List of Art2
+ * @param array $tagchecked list of tags
+ * @param string $tagcompare string, can be 'OR' or 'AND', set the tag filter method
+ * @return array $array
+ */
public function filtertagfilter(array $artlist, array $tagchecked, $tagcompare = 'OR')
{
@@ -168,9 +171,30 @@ class Modelart extends Modeldb
return $taglist;
}
- public function count()
+ /**
+ * @param array $taglist list of tags
+ * @param array $artlist list of Art2
+ * @return array list of tags each containing list of id
+ */
+
+ public function tagartlist(array $taglist, array $artlist)
{
- return $this->bdd->query(' SELECT COUNT(*) FROM ' . $this->arttable . ' ')->fetchColumn();
+ $tagartlist = [];
+ foreach ($taglist as $tag) {
+ $tagartlist[$tag] = $this->filtertagfilter($artlist, [$tag]);
+ }
+ return $tagartlist;
+ }
+
+ public function lasteditedartlist(int $last , array $artlist)
+ {
+ $this->artlistsort($artlist, 'datemodif', -1);
+ $artlist = array_slice($artlist, 0, $last);
+ $idlist = [];
+ foreach ($artlist as $art) {
+ $idlist[] = $art->id();
+ }
+ return $idlist;
}
}
diff --git a/app/class/modelrender.php b/app/class/modelrender.php
index 43e40a9..484fae3 100644
--- a/app/class/modelrender.php
+++ b/app/class/modelrender.php
@@ -9,6 +9,7 @@ class Modelrender extends Modelart
protected $sum = [];
const SUMMARY = '%SUMMARY%';
+ const REMPLACE_SELF_ELEMENT = false;
public function __construct($router)
@@ -45,10 +46,17 @@ class Modelrender extends Modelart
public function readbody()
{
- if (isset($this->art->template('array')['body'])) {
- $templateid = $this->art->template('array')['body'];
- $tempalteart = $this->get($templateid);
- $body = $tempalteart->body() . PHP_EOL . $this->art->body();
+ if (!empty($this->art->templatebody())) {
+ $templateid = $this->art->templatebody();
+ $templateart = $this->get($templateid);
+ if(self::REMPLACE_SELF_ELEMENT) {
+ $templatebody = preg_replace_callback('~\%(SECTION|ASIDE|NAV|HEADER|FOOTER)!\%~', function ($match) use ($templateid) {
+ return '%'. $match[1] . '.' . $templateid . '%';
+ }, $templateart->body());
+ } else {
+ $templatebody = $templateart->body();
+ }
+ $body = $templatebody . PHP_EOL . $this->art->body();
} else {
$body = $this->art->body();
}
@@ -58,11 +66,11 @@ class Modelrender extends Modelart
public function getbody(string $body)
{
$rend = $this;
- $body = preg_replace_callback('~\%(SECTION|ASIDE|NAV|HEADER|FOOTER)(:(((\.|)?([\w-_]+|\!))*))?\%~', function ($match) use ($rend) {
+ $body = preg_replace_callback('~\%(SECTION|ASIDE|NAV|HEADER|FOOTER)((\.([a-z0-9-_]+|!))*|!)?\%~', function ($match) use ($rend) {
$element = strtolower($match[1]);
$getelement = '';
- if (isset($match[3]) && !empty($match[3])) {
- $templatelist = str_replace('!', $this->art->id(), explode('.', $match[3]));
+ if (isset($match[2]) && !empty($match[2])) {
+ $templatelist = str_replace('!', $this->art->id(), explode('.', ltrim($match[2], '.')));
foreach ($templatelist as $template) {
if ($template === $rend->art->id()) {
$templateelement = $rend->art->$element();
@@ -96,7 +104,7 @@ class Modelrender extends Modelart
public function write()
{
file_put_contents(Model::RENDER_DIR . $this->art->id() . '.css', $this->art->css());
- file_put_contents(Model::RENDER_DIR . $this->art->id() . '.quick.css', $this->art->quickcss());
+ //file_put_contents(Model::RENDER_DIR . $this->art->id() . '.quick.css', $this->art->quickcss());
file_put_contents(Model::RENDER_DIR . $this->art->id() . '.js', $this->art->javascript());
}
@@ -133,20 +141,20 @@ class Modelrender extends Modelart
$head .= '<link href="' . Model::globalpath() . 'fonts.css" rel="stylesheet" />' . PHP_EOL;
$head .= '<link href="' . Model::globalpath() . 'global.css" rel="stylesheet" />' . PHP_EOL;
- if (isset($this->art->template('array')['quickcss'])) {
- $tempaltequickcssart = $this->art->template('array')['quickcss'];
- $head .= '<link href="' . Model::renderpath() . $tempaltequickcssart . '.quick.css" rel="stylesheet" />' . PHP_EOL;
- }
- $head .= '<link href="' . Model::renderpath() . $this->art->id() . '.quick.css" rel="stylesheet" />' . PHP_EOL;
+ // if (!empty($this->art->templatecss())) {
+ // $tempaltequickcssart = $this->art->templatecss();
+ // $head .= '<link href="' . Model::renderpath() . $tempaltequickcssart . '.quick.css" rel="stylesheet" />' . PHP_EOL;
+ // }
+ // $head .= '<link href="' . Model::renderpath() . $this->art->id() . '.quick.css" rel="stylesheet" />' . PHP_EOL;
- if (isset($this->art->template('array')['css'])) {
- $tempaltecssart = $this->art->template('array')['css'];
+ if (!empty($this->art->templatecss())) {
+ $tempaltecssart = $this->art->templatecss();
$head .= '<link href="' . Model::renderpath() . $tempaltecssart . '.css" rel="stylesheet" />' . PHP_EOL;
}
$head .= '<link href="' . Model::renderpath() . $this->art->id() . '.css" rel="stylesheet" />' . PHP_EOL;
- if (isset($this->art->template('array')['javascript'])) {
- $templatejsart = $this->art->template('array')['javascript'];
+ if (!empty($this->art->templatejavascript())) {
+ $templatejsart = $this->art->templatejavascript;
$head .= '<script src="' . Model::renderpath() . $templatejsart . '.js" async/></script>' . PHP_EOL;
}
$head .= '<script src="' . Model::renderpath() . $this->art->id() . '.js" async/></script>' . PHP_EOL;
diff --git a/app/view/templates/admin.php b/app/view/templates/admin.php
index d913186..7f94833 100644
--- a/app/view/templates/admin.php
+++ b/app/view/templates/admin.php
@@ -12,6 +12,9 @@
<form action="<?= $this->url('adminupdate') ?>" method="post">
+ <input type="submit" value="Update configuration">
+
+
<h2>Passwords</h2>
<label for="admin">Admin password</label>
<input type="password" name="admin" id="admin" value="<?= Config::admin() ?>">
@@ -19,7 +22,7 @@
<input type="password" name="editor" id="editor" value="<?= Config::editor() ?>">
<h2>Page creation</h2>
- <label for="defaultart">Create new page based on an already existing one</label>
+ <label for="defaultart">Create new page BODY based on an already existing one</label>
<select name="defaultart" id="defaultart">
<option value="" <?= Config::defaultart() === '' || !$defaultartexist ? 'selected' : '' ?>>--use default BODY element--</option>
<?php
@@ -33,7 +36,7 @@
<?php
if(empty(!$defaultartexist || Config::defaultart())) {
?>
- <label for="defaultbody">Or edit default BODY element</label>
+ <label for="defaultbody">Edit default BODY element</label>
<textarea name="defaultbody" id="defaultbody" cols="30" rows="10"><?= Config::defaultbody() ?></textarea>
<?php
}
@@ -65,7 +68,12 @@
}
?>
- <input type="submit" value="submit">
+ <h2>CSS</h2>
+
+ <label for="globalcss">Edit global css that will apply to every pages</label>
+ <textarea name="globalcss" id="globalcss" cols="30" rows="10"><?= $globalcss ?></textarea>
+
+ <input type="submit" value="Update configuration">
</form>
diff --git a/app/view/templates/backtopbar.php b/app/view/templates/backtopbar.php
index 1f4a246..a06c304 100644
--- a/app/view/templates/backtopbar.php
+++ b/app/view/templates/backtopbar.php
@@ -1,29 +1,38 @@
<div id="topbar">
+<span id="user">
+
<?php if($user->isvisitor()) { ?>
-<form action="<?= $this->url('log') ?>" method="post">
+<form action="<?= $this->url('log') ?>" method="post" id="connect">
<input type="password" name="pass" id="loginpass" placeholder="password">
<input type="submit" name="log" value="login">
</form>
-<?php } else { ?>
+<?php } else { ?>
-<form action="<?= $this->url('log') ?>" method="post">
+<span>
+User level : <?= $user->level() ?>
+</span>
+
+
+<form action="<?= $this->url('log') ?>" method="post" id="connect">
<input type="submit" name="log" value="logout">
</form>
-<span>
-User level : <?= $user->level() ?>
+
+
</span>
+
+
+
<?php } ?>
<?php if($user->iseditor()) { ?>
-
<span>
<a href="<?= $this->url('home') ?>">home</a>
<?php
@@ -34,6 +43,7 @@ if($user->isadmin()) {
<?php
}
?>
+| <i><a href="https://github.com/vincent-peugnet/wcms" target="_blank">github↝</a></i>
</span>
diff --git a/app/view/templates/confirmdelete.php b/app/view/templates/confirmdelete.php
index e05f6da..7d8f62a 100644
--- a/app/view/templates/confirmdelete.php
+++ b/app/view/templates/confirmdelete.php
@@ -11,7 +11,7 @@
<h1>Delete</h1>
<ul>
-<li>Id : <?= $art->title() ?></li>
+<li>Id : <?= $art->id() ?></li>
<li>Title : <?= $art->title() ?></li>
<li>Article(s) linked to this one : <?= $art->linkto('sort') ?></li>
<li>Article(s) linked from this one : <?= $art->linkfrom('sort') ?></li>
diff --git a/app/view/templates/edit.php b/app/view/templates/edit.php
index 8071964..346d5bb 100644
--- a/app/view/templates/edit.php
+++ b/app/view/templates/edit.php
@@ -19,8 +19,8 @@
<div id="workspace">
<?php $this->insert('editleftbar', ['art' => $art, 'tablist' => $tablist, 'artlist' => $artlist, 'showleftpanel' => $showleftpanel]) ?>
- <?php $this->insert('edittabs', ['tablist' => $tablist, 'opentab' => $art->interface(), 'template' => $art->template()]) ?>
- <?php $this->insert('editrightbar', ['art' => $art, 'artlist' => $artlist, 'showrightpanel' => $showrightpanel, 'fonts' => $fonts]) ?>
+ <?php $this->insert('edittabs', ['tablist' => $tablist, 'opentab' => $art->interface(), 'templates' => $art->template()]) ?>
+ <?php $this->insert('editrightbar', ['art' => $art, 'artlist' => $artlist, 'showrightpanel' => $showrightpanel, 'templates' => $art->template(), 'tagartlist' => $tagartlist, 'lasteditedartlist' => $lasteditedartlist]) ?>
</div>
diff --git a/app/view/templates/editleftbar.php b/app/view/templates/editleftbar.php
index 2f184af..73468bf 100644
--- a/app/view/templates/editleftbar.php
+++ b/app/view/templates/editleftbar.php
@@ -24,37 +24,73 @@
<input type="time" name="ptime" value="<?= $art->date('ptime') ?>" id="time">
</fieldset>
</details>
- <details>
+ <details open>
<summary>Advanced</summary>
<fieldset>
<h3>Template options</h3>
- <ul>
+ <label for="templatebody">BODY template</label>
+ <select name="templatebody" id="templatebody">
+ <option value="" <?= empty($art->templatebody()) ? 'selected' : '' ?>>--no template--</option>
+ <?php
+ foreach ($artlist as $template) {
+ ?>
+ <option value="<?= $template ?>" <?= $art->templatebody() === $template ? 'selected' : '' ?>><?= $template ?></option>
+ <?php
+ }
+ ?>
+ </select>
+
+
+ <label for="templatecss">CSS template</label>
+ <select name="templatecss" id="templatecss">
+ <option value="" <?= empty($art->templatecss()) ? 'selected' : '' ?>>--no template--</option>
+ <?php
+ foreach ($artlist as $template) {
+ ?>
+ <option value="<?= $template ?>" <?= $art->templatecss() === $template ? 'selected' : '' ?>><?= $template ?></option>
+ <?php
+ }
+ ?>
+ </select>
+
<?php
- foreach ($tablist as $element => $value) {
- if(isset($art->template()[$element])) {
- $template = $art->template()[$element];
- } else {
- $template = '';
- }
- echo '<li>';
- echo '<label for="'.$element.'template">'.$element.'</label>';
- echo '<select name="template['.$element.']" id="'.$element.'template">';
+ if(!empty($art->templatecss())) {
?>
- <option value="" <?= $template === '' ? 'selected' : '' ?>>--no template--</option>
+ <div class="subtemplate">
+ <input type="checkbox" name="iquickcss" id="iquickcss">
+ <label for="iquickcss">Quickcss</label>
+ </div>
+ <div class="subtemplate">
+ <input type="checkbox" name="iexternalcss" id="iexternalcss">
+ <label for="iexternalcss">External CSS</label>
+ </div>
+ <div class="subtemplate">
+ <input type="checkbox" name="iicon" id="iicon">
+ <label for="iicon">Page Icon</label>
+ </div>
<?php
- foreach ($artlist as $artid ) {
-
- ?>
- <option value="<?= $artid ?>" <?= $template === $artid ? 'selected' : '' ?>><?= $artid ?></option>
- <?php
- }
- echo '</select>';
- echo '</li>';
}
+ ?>
+
+ <label for="templatejavascript">Javascript template</label>
+ <select name="templatejavascript" id="templatejavascript">
+ <option value="" <?= empty($art->templatejavascript()) ? 'selected' : '' ?>>--no template--</option>
+ <?php
+ foreach ($artlist as $template) {
+ ?>
+ <option value="<?= $template ?>" <?= $art->templatejavascript() === $template ? 'selected' : '' ?>><?= $template ?></option>
+ <?php
+ }
?>
- </ul>
+ </select>
+ <div class="subtemplate">
+ <input type="checkbox" name="iexternaljs" id="iexternaljs">
+ <label for="iexternaljs">external js</label>
+ </div>
+
+
</fieldset>
</details>
<details id="editcss" open>
diff --git a/app/view/templates/editrightbar.php b/app/view/templates/editrightbar.php
index fa249ef..9572678 100644
--- a/app/view/templates/editrightbar.php
+++ b/app/view/templates/editrightbar.php
@@ -2,26 +2,66 @@
<input id="showrightpanel" name="workspace[showrightpanel]" value="1" class="toggle" type="checkbox" <?= $showrightpanel == true ? 'checked' : '' ?>>
<label for="showrightpanel" class="toogle">◧</label>
<div id="rightbarpanel" class="panel">
- <details id="linkassist" open>
- <summary>Links</summary>
+
+
+ <details id="lastedited" open>
+ <summary>Last edited</summary>
+ <ul>
+ <?php
+ foreach ($lasteditedartlist as $id) {
+ ?>
+ <li><a href="<?= $this->uart('artedit', $id) ?>"><?= $id === $art->id() ? '★' : '✎' ?> <?= $id ?></a></li>
<?php
- foreach ($artlist as $item ) {
+ }
+
+ ?>
+ </ul>
+
+ </details>
+
+
+ <details id="tags" open>
+ <summary>Tags</summary>
+ <?php
+ foreach ($tagartlist as $tag => $idlist) {
+ if(count($idlist) > 1) {
?>
- <a href="<?= $this->uart('artedit', $item) ?>" target="_blank"><?= $item ?></a>
+ <strong><?= $tag ?></strong>
<?php
+
+ echo '<ul>';
+ foreach ($idlist as $id) {
+ if($id === $art->id()) {
+ echo '<li>★ '.$id.'</li>';
+ } else {
+ ?>
+ <li><a href="<?= $this->uart('artedit', $id) ?>">✎ <?= $id ?></a></li>
+ <?php
+ }
+ }
+ }
+ echo '</ul>';
}
?>
+
</details>
- <details id="fonts" open>
- <summary>Fonts</summary>
- <select multiple>
+
+ <details id="tempaltes" open>
+ <summary>Templates</summary>
+ <ul>
<?php
- foreach ($fonts as $font ) {
- echo '<option value="'.$font.'">'.$font.'</option>';
+ foreach ($templates as $template => $id) {
+ if(!empty($id)) {
+ ?>
+ <li><?= $template ?> : <?= $id ?> <a href="<?= $this->uart('artedit', $id) ?>">✎</a></li>
+ <?php
+ }
}
+
?>
- </select>
+ </ul>
+
</details>
</div>
diff --git a/app/view/templates/edittabs.php b/app/view/templates/edittabs.php
index 6e1562a..0829c48 100644
--- a/app/view/templates/edittabs.php
+++ b/app/view/templates/edittabs.php
@@ -7,7 +7,7 @@ foreach ($tablist as $key => $value) {
<input name="interface" type="radio" value="<?= $key ?>" id="tab<?= $key ?>" class="checkboxtab" <?= $key == $opentab ? 'checked' : '' ?> >
- <label for="tab<?= $key ?>" <?= empty($template[$key]) ? '' : 'title="template : '.$template[$key].'" ' ?> class="<?= empty($template[$key]) ? '' : 'template' ?> <?= empty($value) ? '' : 'edited' ?>"><?= $key ?> </label>
+ <label for="tab<?= $key ?>" <?= empty($templates[$key]) ? '' : 'title="template : '.$templates[$key].'" ' ?> class="<?= empty($templates[$key]) ? '' : 'template' ?> <?= empty($value) ? '' : 'edited' ?>"><?= $key ?> </label>
<?php
diff --git a/app/view/templates/font.php b/app/view/templates/font.php
index 1bd64a2..6e55686 100644
--- a/app/view/templates/font.php
+++ b/app/view/templates/font.php
@@ -11,9 +11,17 @@
<section class="font">
+<h1>Fonts</h1>
+
+
+<div>
<a href="<?= $this->url('fontrender') ?>">⚡ Render</a>
+</div>
+<div>
<a href="<?= $fontfile ?>" target="_blank">👓 View font CSS file</a>
+</div>
+<h2>Add Font</h2>
<form action="<?= $this->url('fontadd') ?>" method="post" enctype="multipart/form-data">
<label for="font">Font file <i>(<?= $fonttypes ?>)</i></label>
@@ -24,6 +32,8 @@
</form>
+<h2>Font stock</h2>
+
<table id="fontlist">
<tr>
<th>font</th>