diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2019-08-21 15:25:53 +0200 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2019-08-21 15:25:53 +0200 |
commit | 59e670424ef9d7769e4252fe0f83e42d39a5c9b4 (patch) | |
tree | 478df7f249f0977f0ffeccfa958e8e66cfe17780 | |
parent | 470ff90cfa4fa50a25e428454465da37aff0aa40 (diff) | |
download | wcms-59e670424ef9d7769e4252fe0f83e42d39a5c9b4.tar.gz wcms-59e670424ef9d7769e4252fe0f83e42d39a5c9b4.zip |
Fix : get list code moved to selection
-rw-r--r-- | app/class/modelhome.php | 2 | ||||
-rw-r--r-- | app/class/optlist.php | 12 | ||||
-rw-r--r-- | app/view/templates/home.php | 50 | ||||
-rw-r--r-- | app/view/templates/homemenu.php | 50 | ||||
-rw-r--r-- | assets/css/home.css | 12 | ||||
-rw-r--r-- | composer.json | 2 |
6 files changed, 76 insertions, 52 deletions
diff --git a/app/class/modelhome.php b/app/class/modelhome.php index c30da44..1154e78 100644 --- a/app/class/modelhome.php +++ b/app/class/modelhome.php @@ -11,7 +11,7 @@ class Modelhome extends Modelart { $opt = new Opt(Art2::classvarlist()); - $opt->setcol(['id', 'tag', 'linkfrom', 'linkto', 'description', 'title', 'datemodif', 'datecreation', 'date', 'secure', 'visitcount']); + $opt->setcol(['id', 'tag', 'linkfrom', 'linkto', 'description', 'title', 'datemodif', 'datecreation', 'date', 'secure', 'visitcount', 'editcount', 'affcount']); $opt->settaglist($table); $opt->setauthorlist($table); $opt->submit(); diff --git a/app/class/optlist.php b/app/class/optlist.php index 11e6f72..1fed661 100644 --- a/app/class/optlist.php +++ b/app/class/optlist.php @@ -2,6 +2,7 @@ class Optlist extends Opt { + protected $title = 1; protected $description = 0; protected $thumbnail = 0; protected $date = 0; @@ -32,6 +33,11 @@ class Optlist extends Opt // _______________________________________ G E T _____________________________________ + public function title() + { + return $this->title; + } + public function description() { return $this->description; @@ -58,9 +64,13 @@ class Optlist extends Opt } - // _______________________________________ S E T _____________________________________ + public function settitle($title) + { + $this->title = intval($title); + } + public function setdescription($description) { $this->description = intval($description); diff --git a/app/view/templates/home.php b/app/view/templates/home.php index 867baee..820d185 100644 --- a/app/view/templates/home.php +++ b/app/view/templates/home.php @@ -14,7 +14,10 @@ - <?php $this->insert('homemenu', ['user' => $user, 'opt' => $opt]) ?> + <?php + $optlist = $optlist ?? null; + $this->insert('homemenu', ['user' => $user, 'opt' => $opt, 'optlist' => $optlist]); + ?> <main class="home"> @@ -28,51 +31,6 @@ <h2>Pages (<?= count($table2) ?>)</h2> - - <details id="list" class="hidephone" <?= isset($optlist) ? 'open' : '' ?>> - <summary>Generate list</summary> - <i>Generate code to display a list of pages</i> - <form action="<?= $this->url('homequery') ?>" method="post"> - <input type="hidden" name="query" value="1"> - - <input type="hidden" name="description" value="0"> - <input type="checkbox" name="description" id="list_description" value="1" <?= isset($optlist) && $optlist->description() ? 'checked' : '' ?>> - <label for="list_description">Show description</label> - </br> - <input type="hidden" name="thumbnail" value="0"> - <input type="checkbox" name="thumbnail" id="list_thumbnail" value="1" <?= isset($optlist) && $optlist->thumbnail() ? 'checked' : '' ?>> - <label for="list_thumbnail">Show thumbnail</label> - </br> - <input type="hidden" name="date" value="0"> - <input type="checkbox" name="date" id="list_date" value="1" <?= isset($optlist) && $optlist->date() ? 'checked' : '' ?>> - <label for="list_date">Show date</label> - </br> - <input type="hidden" name="author" value="0"> - <input type="checkbox" name="author" id="list_author" value="1" <?= isset($optlist) && $optlist->author() ? 'checked' : '' ?>> - <label for="list_author">Show author(s)</label> - </br> - <select name="style" id="list_style"> - <option value="0">list</option> - <option value="1" <?= isset($optlist) && $optlist->style() == 1 ? 'selected' : '' ?>>div</option> - </select> - <input type="submit" value="generate"> - </form> - - <?php - if (isset($optlist)) { - echo '<code>' . $optlist->getcode() . '</code>'; - } - - ?> - </details> - - - - <form action="/massedit" method="post"> - - </form> - - <div class="scroll"> <table id="home2table"> diff --git a/app/view/templates/homemenu.php b/app/view/templates/homemenu.php index 1003f7d..0a22513 100644 --- a/app/view/templates/homemenu.php +++ b/app/view/templates/homemenu.php @@ -61,18 +61,62 @@ </div> </details> - <details class="hidephone" id="actions"> - <summary>Actions</summary> + + + + + + <details class="hidephone" id="selection" <?= !empty($optlist) ? 'open' : '' ?>> + <summary>Selection</summary> <div class="submenu"> <h2>Rendering</h2> <form action="<?= $this->url('homerenderall') ?>" method="post"> - Render all pages + Render selected pages </br> <input type="submit" value="renderall"> </form> + <h2>Get LIST code</h2> + <i>Generate code to display a list of pages</i> + <form action="<?= $this->url('homequery') ?>" method="post"> + <input type="hidden" name="query" value="1"> + + <input type="hidden" name="title" value="0"> + <input type="checkbox" name="title" id="list_title" value="1" <?= !empty($optlist) && !$optlist->title() ? '' : 'checked' ?>> + <label for="list_title">Show title</label> + </br> + <input type="hidden" name="description" value="0"> + <input type="checkbox" name="description" id="list_description" value="1" <?= !empty($optlist) && $optlist->description() ? 'checked' : '' ?>> + <label for="list_description">Show description</label> + </br> + <input type="hidden" name="thumbnail" value="0"> + <input type="checkbox" name="thumbnail" id="list_thumbnail" value="1" <?= !empty($optlist) && $optlist->thumbnail() ? 'checked' : '' ?>> + <label for="list_thumbnail">Show thumbnail</label> + </br> + <input type="hidden" name="date" value="0"> + <input type="checkbox" name="date" id="list_date" value="1" <?= !empty($optlist) && $optlist->date() ? 'checked' : '' ?>> + <label for="list_date">Show date</label> + </br> + <input type="hidden" name="author" value="0"> + <input type="checkbox" name="author" id="list_author" value="1" <?= !empty($optlist) && $optlist->author() ? 'checked' : '' ?>> + <label for="list_author">Show author(s)</label> + </br> + <select name="style" id="list_style"> + <option value="0">list</option> + <option value="1" <?= !empty($optlist) && $optlist->style() == 1 ? 'selected' : '' ?>>div</option> + </select> + <input type="submit" value="generate"> + </form> + <?php if(!empty($optlist)) { ?> + <code><?= $optlist->getcode() ?></code> + <?php } ?> </div> </details> + + + + + <details class="hidephone" id="bookmarks"> <summary>Bookmarks</summary> <div class="submenu"> diff --git a/assets/css/home.css b/assets/css/home.css index edc1cb7..1c056b8 100644 --- a/assets/css/home.css +++ b/assets/css/home.css @@ -63,6 +63,18 @@ aside.home details#bookmarks ul { padding: 2%; } + +details#selection code { + overflow: auto; + max-width: 300px; + display: block; + white-space: nowrap; + color: #7b97b9; + background-color: #252525; + padding: 1%; + font-size: 12px; +} + main.home article#main { width: 100%; } diff --git a/composer.json b/composer.json index 2696734..00cd634 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "w-cms", "description": "point'n think", - "version": "1.5.2", + "version": "1.5.3", "require": { "michelf/php-markdown": "^1.8", "league/plates": "3.*", |