aboutsummaryrefslogtreecommitdiff
path: root/app/view
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2019-01-22 02:04:53 +0100
committervincent-peugnet <v.peugnet@free.fr>2019-01-22 02:04:53 +0100
commit695908c7ab2a5d5f011f616d2af3368da7131a6f (patch)
treecbd6c2a43495e77863d3611e2f6b12985b1111d8 /app/view
parenta8ed9070e7773f3147a33dbee7d45ce24bd8959d (diff)
downloadwcms-695908c7ab2a5d5f011f616d2af3368da7131a6f.tar.gz
wcms-695908c7ab2a5d5f011f616d2af3368da7131a6f.zip
home columns and download function added
Diffstat (limited to 'app/view')
-rw-r--r--app/view/templates/home.php43
-rw-r--r--app/view/templates/homeopt.php8
-rw-r--r--app/view/templates/user.php9
3 files changed, 54 insertions, 6 deletions
diff --git a/app/view/templates/home.php b/app/view/templates/home.php
index 5860975..9636d7e 100644
--- a/app/view/templates/home.php
+++ b/app/view/templates/home.php
@@ -44,6 +44,17 @@
<input type="submit" name="massaction" value="do" onclick="confirmSubmit(event, 'Are you sure')" >
+
+ <?php
+
+ $array = ['id' => [ 'getadress' => true,
+ 'label' => 'id',
+ 'show' => true]
+ ]
+
+
+ ?>
+
<input type="hidden" name="action" value="massedit">
</div>
@@ -55,15 +66,31 @@
<th>edit</th>
<th>see</th>
<th class="delete">del</th>
+ <?php if($user->isadmin()) { ?>
+ <th class="download">dl</th>
+ <?php } if($columns['tag']) { ?>
<th class="tag"><a href="<?= $opt->getadress('tag') ?>">tag</a></th>
+ <?php } if($columns['description']) { ?>
<th class="summary">summary</th>
+ <?php } if($columns['linkto']) { ?>
<th class="linkto"><a href="<?= $opt->getadress('linkto') ?>">to</a></th>
+ <?php } if($columns['linkfrom']) { ?>
<th class="linkfrom"><a href="<?= $opt->getadress('linkfrom') ?>">from</a></th>
+ <?php } if($columns['datemodif']) { ?>
<th class="datemodif"><a href="<?= $opt->getadress('datemodif') ?>">last modification</a></th>
+ <?php } if($columns['datecreation']) { ?>
<th class="datecreation"><a href="<?= $opt->getadress('datecreation') ?>">date of creation</a></th>
+ <?php } if($columns['date']) { ?>
<th class="date"><a href="<?= $opt->getadress('date') ?>">date</a></th>
+ <?php } if($columns['secure']) { ?>
<th class="secure"><a href="<?= $opt->getadress('secure') ?>">privacy</a></th>
+ <?php } if($columns['visitcount']) { ?>
<th class="visitcount"><a href="<?= $opt->getadress('visitcount') ?>">visit</a></th>
+ <?php } if($columns['editcount']) { ?>
+ <th class="editcount"><a href="<?= $opt->getadress('editcount') ?>">edit</a></th>
+ <?php } if($columns['affcount']) { ?>
+ <th class="affcount"><a href="<?= $opt->getadress('affcount') ?>">aff</a></th>
+ <?php } ?>
</tr>
<?php foreach ($table2 as $item) { ?>
<tr>
@@ -72,15 +99,31 @@
<td><a href="<?= $this->uart('artedit', $item->id()) ?>">✏</a></td>
<td><a href="<?= $this->uart('artread/', $item->id()) ?>" target="_blank">👁</a></td>
<td class="delete"><a href="<?= $this->uart('artdelete', $item->id()) ?>" >✖</a></td>
+ <?php if($user->isadmin()) { ?>
+ <td><a href="<?= $this->uart('artdownload', $item->id()) ?>" download>↓</a></td>
+ <?php } if($columns['tag']) { ?>
<td class="tag"><a title="<?= $item->tag('string') ?>"><?= $item->tag('sort') ?></a></td>
+ <?php } if($columns['description']) { ?>
<td class="summary" title="<?= $item->description() ?>"><?= $item->description('short') ?></td>
+ <?php } if($columns['linkto']) { ?>
<td class="linkto"><a title="<?= $item->linkto('string') ?>" ><?= $item->linkto('sort') ?></a></td>
+ <?php } if($columns['linkfrom']) { ?>
<td class="linkfrom"><a title="<?= $item->linkfrom('string') ?>" ><?= $item->linkfrom('sort') ?></a></td>
+ <?php } if($columns['datemodif']) { ?>
<td class="datemodif"><?= $item->datemodif('hrdi') ?></td>
+ <?php } if($columns['datecreation']) { ?>
<td class="datecreation"><?= $item->datecreation('hrdi') ?></td>
+ <?php } if($columns['date']) { ?>
<td class="date"><?= $item->date('dmy') ?></td>
+ <?php } if($columns['secure']) { ?>
<td class="secure"><?= $item->secure('string') ?></td>
+ <?php } if($columns['visitcount']) { ?>
<td class="visitcount"><?= $item->visitcount() ?></td>
+ <?php } if($columns['editcount']) { ?>
+ <td class="editcount"><?= $item->editcount() ?></td>
+ <?php } if($columns['affcount']) { ?>
+ <td class="affcount"><?= $item->affcount() ?></td>
+ <?php } ?>
</tr>
<?php }?>
diff --git a/app/view/templates/homeopt.php b/app/view/templates/homeopt.php
index 5dab881..4008a71 100644
--- a/app/view/templates/homeopt.php
+++ b/app/view/templates/homeopt.php
@@ -84,16 +84,16 @@ if ($in = true || $out = true) {
<h2>Columns</h2>
-<form action="" method="post">
+<form action="<?= $this->url('homecolumns') ?>" method="post">
<ul>
<?php
-foreach ($opt->col() as $col) {
+foreach (Model::COLUMNS as $col) {
?>
<li>
- <input type="checkbox" name="col[]" id="col_<?= $col ?>">
+ <input type="checkbox" name="columns[]" value="<?= $col ?>" id="col_<?= $col ?>" <?= in_array($col, $user->columns()) ? 'checked' : '' ?>>
<label for="col_<?= $col ?>"><?= $col ?></label>
</li>
<?php
@@ -103,6 +103,8 @@ foreach ($opt->col() as $col) {
</ul>
+<input type="submit" value="update columns">
+
</form>
<?php } ?>
diff --git a/app/view/templates/user.php b/app/view/templates/user.php
index 451d3ce..0f9ac7b 100644
--- a/app/view/templates/user.php
+++ b/app/view/templates/user.php
@@ -15,17 +15,19 @@
-<form action="" method="post">
+<form action="<?= $this->url('userpref') ?>" method="post">
-<h2>Connexion Options</h2>
+<h2>Preferences</h2>
-<input type="number" name="cookie" id="cookie">
+<input type="number" name="cookie" value="<?= $getuser->cookie() ?>" id="cookie" min="0" max="365">
<label for="cookie">Cookie conservation time <i>(In days)</i></label>
<input type="submit" value="submit">
</form>
+<?php if($user->isadmin()) { ?>
+
<h1>Admin panel</h1>
<table>
@@ -108,6 +110,7 @@ foreach ($userlist as $user ) {
</table>
+<?php } ?>
</main>