From 95ada5c09026882f384a4a386916b1b2decbfce9 Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Fri, 9 Aug 2019 12:04:52 +0200 Subject: Feature : %CONNECT% + fix terminal.css --- app/class/modelrender.php | 80 ++++++++++++++++++--------------------------- app/view/templates/user.php | 10 +++++- assets/css/terminal.css | 2 +- composer.json | 2 +- 4 files changed, 43 insertions(+), 51 deletions(-) diff --git a/app/class/modelrender.php b/app/class/modelrender.php index cc3b753..fb6e002 100644 --- a/app/class/modelrender.php +++ b/app/class/modelrender.php @@ -289,6 +289,8 @@ class Modelrender extends Modelart $text = $this->autourl($text); + $text = $this->authenticate($text); + return $text; } @@ -420,54 +422,6 @@ class Modelrender extends Modelart return $text; } - public function aautomedialist(string $text) : string - { - - - - $text = preg_replace_callback( - '~\%MEDIA:(([a-z0-9-_]+(\/([a-z0-9-_])+)*))\%~', - function ($matches) { - $dir = trim($matches[1], '/'); - $mediamanager = new Modelmedia(); - - - - if (is_dir(Model::MEDIA_DIR . $dir)) { - $medialist = $mediamanager->getlistermedia(Model::MEDIA_DIR . $dir . '/'); - - $dirid = str_replace('/', '-', $dir); - - $ul = '
' . PHP_EOL; - - foreach ($medialist as $media) { - $ul .= '
'; - if ($media->type() == 'image') { - $ul .= '' . $media->id() . ''; - } elseif ($media->type() == 'sound') { - $ul .= '
' . PHP_EOL; - } - - $ul .= '
' . PHP_EOL; - - return $ul; - } else { - return 'directory "' . $dir . '" not found'; - } - }, - $text - ); - - return $text; - } - - function sumparser($text) { @@ -605,6 +559,36 @@ class Modelrender extends Modelart + /** + * @param string $text content to analyse and replace + * + * @return string text ouput + */ + public function authenticate(string $text) + { + $id = $this->art->id(); + $regex = '~\%CONNECT(\?dir=([a-zA-Z0-9-_]+))?\%~'; + $text = preg_replace_callback($regex, function ($matches) use ($id) { + if(isset($matches[2])) { + $id = $matches[2]; + } + $form = '
+ + + + +
'; + return $form; + + }, $text); + return $text; + } + + + + + + public function linkfrom() { sort($this->linkfrom); diff --git a/app/view/templates/user.php b/app/view/templates/user.php index 4717ee6..6e302f8 100644 --- a/app/view/templates/user.php +++ b/app/view/templates/user.php @@ -49,7 +49,7 @@ - + @@ -84,6 +84,10 @@ + + @@ -138,6 +142,10 @@ foreach ($userlist as $user ) { expiredate('hrdi') ?> + + diff --git a/assets/css/terminal.css b/assets/css/terminal.css index 1ab9408..b6df0f7 100644 --- a/assets/css/terminal.css +++ b/assets/css/terminal.css @@ -24,7 +24,7 @@ div#topbar, article#main, main.media div, main.home div#options, main.info nav, border-color: white; } -.editor div#leftbarpanel, .editor div#rightbarpanel { +.editor div#leftbarpanel, .editor div#rightbarpanel, .tabs textarea { border: solid 1px; } diff --git a/composer.json b/composer.json index f66f519..b6b86e0 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "w-cms", "description": "point'n think", - "version": "1.3.0", + "version": "1.3.1", "require": { "michelf/php-markdown": "^1.8", "league/plates": "3.*", -- cgit v1.2.3
idpasswordhashlevelset expiration dateactionexpireidpasswordhashlevelset expiration dateactionexpireconnect
+ +
+ connectcount() ?> +