aboutsummaryrefslogtreecommitdiff
path: root/app/class
diff options
context:
space:
mode:
Diffstat (limited to 'app/class')
-rw-r--r--app/class/art2.php32
-rw-r--r--app/class/config.php2
-rw-r--r--app/class/controllerart.php2
-rw-r--r--app/class/model.php2
-rw-r--r--app/class/modelart.php2
-rw-r--r--app/class/modelrender.php13
-rw-r--r--app/class/w.article.php8
-rw-r--r--app/class/w.home.php4
-rw-r--r--app/class/w.menu.php12
9 files changed, 45 insertions, 32 deletions
diff --git a/app/class/art2.php b/app/class/art2.php
index 4e81532..8bf2729 100644
--- a/app/class/art2.php
+++ b/app/class/art2.php
@@ -15,7 +15,7 @@ class Art2
protected $javascript;
protected $body;
protected $header;
- protected $section;
+ protected $main;
protected $nav;
protected $aside;
protected $footer;
@@ -45,7 +45,7 @@ class Art2
const LENCOULEUR = 7;
const DEBUT = '(?id=';
const FIN = ')';
- const TABS = ['section', 'css', 'header', 'body', 'nav', 'aside', 'footer', 'javascript'];
+ const TABS = ['main', 'css', 'header', 'body', 'nav', 'aside', 'footer', 'javascript'];
const VAR_DATE = ['date', 'datecreation', 'datemodif', 'daterender'];
@@ -87,7 +87,7 @@ class Art2
$this->setjavascript('');
$this->setbody('');
$this->setheader('');
- $this->setsection('');
+ $this->setmain('');
$this->setnav('');
$this->setaside('');
$this->setfooter('');
@@ -98,13 +98,13 @@ class Art2
$this->setsecure(3);
$this->setinvitepassword('invitepassword');
$this->setinvitepassword('readpassword');
- $this->setinterface('section');
+ $this->setinterface('main');
$this->setlinkfrom([]);
$this->setlinkto([]);
$this->settemplatebody('');
$this->settemplatecss('');
$this->settemplatejavascript('');
- $this->settemplateoptions(['externalcss', 'externaljavascript', 'favicon', 'reccursive', 'quickcss']);
+ $this->settemplateoptions(['externalcss', 'externaljavascript', 'favicon', 'reccursivecss', 'quickcss']);
$this->setfavicon('');
$this->setthumbnail('');
$this->setaffcount(0);
@@ -250,9 +250,9 @@ class Art2
return $this->header;
}
- public function section($type = 'string')
+ public function main($type = 'string')
{
- return $this->section;
+ return $this->main;
}
public function nav($type = "string")
@@ -536,10 +536,10 @@ class Art2
}
}
- public function setsection($section)
+ public function setmain($main)
{
- if (strlen($section) < self::LENTEXT and is_string($section)) {
- $this->section = $section;
+ if (strlen($main) < self::LENTEXT and is_string($main)) {
+ $this->main = $main;
}
}
@@ -557,14 +557,18 @@ class Art2
}
}
- public function setexternalcss(array $externalcss)
+ public function setexternalcss($externalcss)
{
- $this->externalcss = $externalcss;
+ if(is_array($externalcss)) {
+ $this->externalcss = array_values(array_filter($externalcss));
+ }
}
public function setexternalscript(array $externalscript)
{
- $this->externalscript = $externalscript;
+ if(is_array($externalscript)) {
+ $this->externalscript = array_values(array_filter($externalscript));
+ }
}
public function setfooter($footer)
@@ -664,7 +668,7 @@ class Art2
public function settemplateoptions($templateoptions)
{
if(is_array($templateoptions)) {
- $this->templateoptions = $templateoptions;
+ $this->templateoptions = array_filter($templateoptions);
}
}
diff --git a/app/class/config.php b/app/class/config.php
index 7d2320e..b778d83 100644
--- a/app/class/config.php
+++ b/app/class/config.php
@@ -15,7 +15,7 @@ abstract class Config
protected static $basepath = '';
protected static $route404;
protected static $existnot = 'This page does not exist yet';
- protected static $defaultbody = '%HEADER%'. PHP_EOL .PHP_EOL . '%NAV%'. PHP_EOL .PHP_EOL . '%ASIDE%'. PHP_EOL .PHP_EOL . '%SECTION%'. PHP_EOL .PHP_EOL . '%FOOTER%';
+ protected static $defaultbody = '%HEADER%'. PHP_EOL .PHP_EOL . '%NAV%'. PHP_EOL .PHP_EOL . '%ASIDE%'. PHP_EOL .PHP_EOL . '%MAIN%'. PHP_EOL .PHP_EOL . '%FOOTER%';
protected static $defaultart = '';
protected static $defaultfavicon = '';
protected static $showeditmenu = true;
diff --git a/app/class/controllerart.php b/app/class/controllerart.php
index 3ada9d1..ee99b6a 100644
--- a/app/class/controllerart.php
+++ b/app/class/controllerart.php
@@ -118,7 +118,7 @@ class Controllerart extends Controller
if ($this->importart() && $this->canedit()) {
- $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()];
+ $tablist = ['main' => $this->art->main(), '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()];
$faviconlist = $this->mediamanager->listfavicon();
$idlist = $this->artmanager->list();
diff --git a/app/class/model.php b/app/class/model.php
index 78abbfa..ee8de26 100644
--- a/app/class/model.php
+++ b/app/class/model.php
@@ -14,7 +14,7 @@ abstract class Model
const MEDIA_EXTENSIONS = array('jpeg', 'jpg', 'JPG', 'png', 'gif', 'mp3', 'mp4', 'mov', 'wav', 'flac', 'pdf');
const MEDIA_TYPES = ['image', 'video', 'sound', 'other'];
- const TEXT_ELEMENTS = ['header', 'nav', 'section', 'aside', 'footer'];
+ const TEXT_ELEMENTS = ['header', 'nav', 'main', 'aside', 'footer'];
const EDIT_SYMBOLS = ['pen', 'tool', 'none'];
public static function dirtopath($dir)
diff --git a/app/class/modelart.php b/app/class/modelart.php
index 03163e3..e8203e1 100644
--- a/app/class/modelart.php
+++ b/app/class/modelart.php
@@ -2,7 +2,7 @@
class Modelart extends Modeldb
{
- const SELECT = ['title', 'id', 'description', 'tag', 'date', 'datecreation', 'datemodif', 'daterender', 'css', 'quickcss', 'javascript', 'body', 'header', 'section', 'nav', 'aside', 'footer', 'render', 'secure', 'invitepassword', 'interface', 'linkfrom', 'linkto', 'template', 'affcount', 'editcount'];
+ const SELECT = ['title', 'id', 'description', 'tag', 'date', 'datecreation', 'datemodif', 'daterender', 'css', 'quickcss', 'javascript', 'body', 'header', 'main', 'nav', 'aside', 'footer', 'render', 'secure', 'invitepassword', 'interface', 'linkfrom', 'linkto', 'template', 'affcount', 'editcount'];
const BY = ['datecreation', 'title', 'id', 'description', 'datemodif', 'secure'];
const ORDER = ['DESC', 'ASC'];
diff --git a/app/class/modelrender.php b/app/class/modelrender.php
index c76fa69..dba363b 100644
--- a/app/class/modelrender.php
+++ b/app/class/modelrender.php
@@ -50,7 +50,7 @@ class Modelrender extends Modelart
$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) {
+ $templatebody = preg_replace_callback('~\%(MAIN|ASIDE|NAV|HEADER|FOOTER)!\%~', function ($match) use ($templateid) {
return '%'. $match[1] . '.' . $templateid . '%';
}, $templateart->body());
} else {
@@ -69,7 +69,7 @@ class Modelrender extends Modelart
public function getbody(string $body)
{
$rend = $this;
- $body = preg_replace_callback('~\%(SECTION|ASIDE|NAV|HEADER|FOOTER)((:[a-z0-9-_]+|!)(\+([a-z0-9-_]+|!))*)?\%~', function ($match) use ($rend) {
+ $body = preg_replace_callback('~\%(MAIN|ASIDE|NAV|HEADER|FOOTER)((:[a-z0-9-_]+|!)(\+([a-z0-9-_]+|!))*)?\%~', function ($match) use ($rend) {
$element = strtolower($match[1]);
$getelement = '';
if (isset($match[2]) && !empty($match[2])) {
@@ -147,6 +147,15 @@ class Modelrender extends Modelart
}
$head .= '<meta name="description" content="' . $this->art->description() . '" />' . PHP_EOL;
$head .= '<meta name="viewport" content="width=device-width" />' . PHP_EOL;
+
+ foreach ($this->art->externalcss() as $externalcss) {
+ $head .= '<link href="'.$externalcss.'" rel="stylesheet" />' . PHP_EOL;
+ }
+
+ foreach ($this->art->externalscript() as $externalscript) {
+ $head .= '<script src="'.$externalscript.'"></script>' . PHP_EOL;
+ }
+
$head .= '<link href="' . Model::globalpath() . 'fonts.css" rel="stylesheet" />' . PHP_EOL;
$head .= '<link href="' . Model::globalpath() . 'global.css" rel="stylesheet" />' . PHP_EOL;
diff --git a/app/class/w.article.php b/app/class/w.article.php
index 2476353..6c504f8 100644
--- a/app/class/w.article.php
+++ b/app/class/w.article.php
@@ -5,19 +5,19 @@ if ($app->exist($_GET['id'])) {
$art = $app->get($_GET['id']);
if (isset($_GET['edit']) and $_GET['edit'] == 1 and $app->session() >= $app::EDITOR) {
- echo '<section class=edit>';
+ echo '<main class=edit>';
$aff->edit($art, $app, $app->getlister(['id', 'title']), $config->fontsize(), $app->getlistermedia($app::MEDIA_DIR, 'image'));
$aff->aside($app);
- echo '</section>';
+ echo '</main>';
} else {
- echo '<section class="lecture">';
+ echo '<main class="lecture">';
$art->autotaglistupdate($app->taglist($app->getlister(['id', 'title', 'description', 'tag']), $art->autotaglist()));
$aff->lecture($art, $app);
- echo '</section>';
+ echo '</main>';
}
} else {
diff --git a/app/class/w.home.php b/app/class/w.home.php
index 8ba8b44..a23c60f 100644
--- a/app/class/w.home.php
+++ b/app/class/w.home.php
@@ -3,7 +3,7 @@
$aff->header();
-echo '<section class="home">';
+echo '<main class="home">';
if ($app->session() >= $app::EDITOR) {
@@ -80,6 +80,6 @@ if ($app->session() >= $app::EDITOR) {
-echo '</section>';
+echo '</main>';
?> \ No newline at end of file
diff --git a/app/class/w.menu.php b/app/class/w.menu.php
index 8e89ed1..ecce576 100644
--- a/app/class/w.menu.php
+++ b/app/class/w.menu.php
@@ -4,7 +4,7 @@
if ($app->session() >= $app::EDITOR) {
if ($_GET['aff'] == 'admin' && $app->session() >= $app::ADMIN) {
- echo '<section>';
+ echo '<main>';
echo '<h1>Admin</h1>';
$aff->admincss($config, $app);
@@ -18,25 +18,25 @@ if ($app->session() >= $app::EDITOR) {
$aff->admintable($config, $status, $app->tablelist($config->dbname()));
$aff->admindisplay($config->color4());
- echo '</section>';
+ echo '</main>';
} elseif ($_GET['aff'] == 'media') {
echo '<h1>Media</h1>';
- echo '<section>';
+ echo '<main>';
echo '<article>';
$aff->addmedia($app);
$aff->medialist($app->getlistermedia($app::MEDIA_DIR), $app::MEDIA_DIR);
echo '</article>';
- echo '</section>';
+ echo '</main>';
} elseif ($_GET['aff'] == 'record') {
echo '<h1>Record</h1>';
- echo '<section>';
+ echo '<main>';
$aff->recordlist($app);
- echo '</section>';
+ echo '</main>';
} elseif ($_GET['aff'] == 'info') {