diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2018-10-07 05:55:26 +0200 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2018-10-07 05:55:26 +0200 |
commit | 74ccedd6544daac0845a044b5e6d71d577578c69 (patch) | |
tree | 2ec348bfc818fbc2859922ac71f866c407ce0a7b /class/class.w.app.php | |
parent | 67b20c49ec4e5efb4526fc64ef679dfb6dd41e30 (diff) | |
download | wcms-74ccedd6544daac0845a044b5e6d71d577578c69.tar.gz wcms-74ccedd6544daac0845a044b5e6d71d577578c69.zip |
2.9 map + filter fix + markdownextra
Diffstat (limited to 'class/class.w.app.php')
-rw-r--r-- | class/class.w.app.php | 51 |
1 files changed, 42 insertions, 9 deletions
diff --git a/class/class.w.app.php b/class/class.w.app.php index d8751ab..0c9d6a3 100644 --- a/class/class.w.app.php +++ b/class/class.w.app.php @@ -331,7 +331,7 @@ class App public function tag(array $artlist, $tagchecked) { $artcheckedlist = []; - foreach($artlist as $art) { + foreach ($artlist as $art) { if (in_array($tagchecked, $art->tag('array'))) { $artcheckedlist[] = $art; } @@ -343,7 +343,7 @@ class App { $taglist = []; foreach ($tagcheckedlist as $tag) { - $taglist[$tag] = $this->tag($artlist, $tag); + $taglist[$tag] = $this->tag($artlist, $tag); } return $taglist; } @@ -446,12 +446,12 @@ class App { $arttable = strip_tags($arttable); $tablename = str_clean($tablename); - if($this->tableexist($dbname, $arttable) && !$this->tableexist($dbname, $tablename)) { + if ($this->tableexist($dbname, $arttable) && !$this->tableexist($dbname, $tablename)) { $duplicate = " CREATE TABLE `$tablename` LIKE `$arttable`;"; $alter = "ALTER TABLE `$tablename` ADD PRIMARY KEY (`id`);"; $insert = "INSERT `$tablename` SELECT * FROM `$arttable`;"; - + $req = $this->bdd->query($duplicate . $alter . $insert); return 'tableduplicated'; @@ -516,7 +516,7 @@ class App } - public function getlistermedia($dir, $type="all") + public function getlistermedia($dir, $type = "all") { if ($handle = opendir($dir)) { $list = []; @@ -525,12 +525,12 @@ class App $media = $this->getmedia($entry, $dir); - + $media->analyse(); - if(in_array($type, self::MEDIA_TYPES)) { - if($media->type() == $type) { - $list[] = $media; + if (in_array($type, self::MEDIA_TYPES)) { + if ($media->type() == $type) { + $list[] = $media; } } else { $list[] = $media; @@ -656,6 +656,39 @@ class App + // ________________________________________________________ M A P ________________________________________________________ + + + public function map(array $getlister, $lb = PHP_EOL) + { + + $map = ""; + $link = ""; + $style = ""; + foreach ($getlister as $item) { + if($item->secure() == 2) { + $style = $style . $lb . $item->id() . '{' . $item->titre() . '}'; + } elseif ($item->secure() == 1) { + $style = $style . $lb . $item->id() . '(' . $item->titre() . ')'; + + } else { + $style = $style . $lb . $item->id() . '((' . $item->titre() . '))'; + } + foreach ($item->lien('array') as $lien) { + $map = $map . $lb . $item->id() . ' --> ' . $lien; + $link = $link . $lb . 'click ' . $lien . ' "./?id=' . $lien . '"'; + + } + $link = $link . $lb . 'click ' . $item->id() . ' "./?id=' . $item->id() . '"'; + } + return $map . $link . $style; + + } + + + + + //_________________________________________________________ S E S ________________________________________________________ public function login($pass, $config) |