aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2018-12-26 17:58:50 +0100
committervincent-peugnet <v.peugnet@free.fr>2018-12-26 17:58:50 +0100
commitb596f5d1c15ce3e2df50c756fd56080192e438ef (patch)
tree507299e1322c8596166a5b98610a68e5c712b52b
parent1181795d8fa682571bd7e970eeefd43ed90aa30b (diff)
downloadwcms-b596f5d1c15ce3e2df50c756fd56080192e438ef.tar.gz
wcms-b596f5d1c15ce3e2df50c756fd56080192e438ef.zip
feature: pages authors
-rw-r--r--app/class/art2.php21
-rw-r--r--app/class/controllerart.php2
-rw-r--r--app/view/templates/editrightbar.php10
-rw-r--r--app/view/templates/user.php2
4 files changed, 34 insertions, 1 deletions
diff --git a/app/class/art2.php b/app/class/art2.php
index 524caf6..5e0478e 100644
--- a/app/class/art2.php
+++ b/app/class/art2.php
@@ -35,6 +35,7 @@ class Art2
protected $templateoptions;
protected $favicon;
protected $thumbnail;
+ protected $authors;
protected $affcount;
protected $editcount;
@@ -107,6 +108,7 @@ class Art2
$this->settemplateoptions(['externalcss', 'externaljavascript', 'favicon', 'reccursivecss', 'quickcss']);
$this->setfavicon('');
$this->setthumbnail('');
+ $this->setauthors([]);
$this->setaffcount(0);
$this->seteditcount(0);
}
@@ -406,6 +408,11 @@ class Art2
return $this->thumbnail;
}
+ public function authors($type = 'array')
+ {
+ return $this->authors;
+ }
+
public function affcount($type = 'int')
{
return $this->affcount;
@@ -688,6 +695,13 @@ class Art2
}
}
+ public function setauthors($authors)
+ {
+ if(is_array($authors)) {
+ $this->authors = $authors;
+ }
+ }
+
public function setaffcount($affcount)
{
if (is_int($affcount)) {
@@ -727,6 +741,13 @@ class Art2
$this->addeditcount();
}
+ public function addauthor(string $id)
+ {
+ if(!in_array($id, $this->authors)) {
+ $this->authors[] = $id;
+ }
+ }
+
}
diff --git a/app/class/controllerart.php b/app/class/controllerart.php
index c097df4..9a4edbe 100644
--- a/app/class/controllerart.php
+++ b/app/class/controllerart.php
@@ -149,6 +149,7 @@ class Controllerart extends Controller
{
$this->setart($id, 'artlog');
$this->importart();
+ var_dump($this->art);
}
public function add($id)
@@ -215,6 +216,7 @@ class Controllerart extends Controller
$this->art->hydrate($_POST);
$this->art->hydrate($date);
$this->art->updateedited();
+ $this->art->addauthor($this->user->id());
$this->artmanager->update($this->art);
}
diff --git a/app/view/templates/editrightbar.php b/app/view/templates/editrightbar.php
index 80a0b02..8ee402d 100644
--- a/app/view/templates/editrightbar.php
+++ b/app/view/templates/editrightbar.php
@@ -63,6 +63,16 @@
</ul>
</details>
+
+ <h3>Authors</h3>
+ <ul>
+ <?php
+ foreach ($art->authors() as $author) {
+ echo '<li>⬖ ' . $author .'</li>';
+ }
+
+ ?>
+ </ul>
</div>
diff --git a/app/view/templates/user.php b/app/view/templates/user.php
index 026a0de..957f17f 100644
--- a/app/view/templates/user.php
+++ b/app/view/templates/user.php
@@ -59,7 +59,7 @@ foreach ($userlist as $user ) {
</td>
<td>
- <input type="password" name="password" placeholder="<?= str_repeat('°', $user->password('int')) ?>" minlength="4" maxlength="64" >
+ <input type="password" name="password" placeholder="<?= str_repeat('⦁', $user->password('int')) ?>" minlength="4" maxlength="64" >
</td>
<td>