diff options
Diffstat (limited to 'public/w')
-rw-r--r-- | public/w/home.php | 19 | ||||
-rw-r--r-- | public/w/index.php | 87 | ||||
-rw-r--r-- | public/w/menu.php | 17 |
3 files changed, 98 insertions, 25 deletions
diff --git a/public/w/home.php b/public/w/home.php index 4966c62..7115918 100644 --- a/public/w/home.php +++ b/public/w/home.php @@ -19,7 +19,7 @@ if ($app->session() >= $app::EDITOR) { } if(isset($_GET['submit']) && $_GET['submit'] == 'reset') { $opt = new Opt(Art::classvarlist()); - } else { + } elseif(isset($_SESSION['opt'])) { $opt->hydrate($_SESSION['opt']); } @@ -37,17 +37,26 @@ if ($app->session() >= $app::EDITOR) { $filter = array_intersect($filtertagfilter, $filtersecure); $table2 = []; + $table2invert = []; foreach ($table as $art) { - if (in_array($art->id(), $filter)) { - $table2[] = $art; - } + if (in_array($art->id(), $filter)) { + $table2[] = $art; + } else { + $table2invert[] = $art; + } + + + } + + if(!empty($opt->invert())) { + $table2 = $table2invert; } $app->artlistsort($table2, $opt->sortby(), $opt->order()); - $aff->home2table($app, $table2); + $aff->home2table($app, $table2, $app->getlister()); } diff --git a/public/w/index.php b/public/w/index.php index d9b9d5c..5a3fe4e 100644 --- a/public/w/index.php +++ b/public/w/index.php @@ -154,25 +154,84 @@ if (isset($_POST['action'])) { case 'massedit': if (isset($_POST['id'])) { foreach ($_POST['id'] as $id) { - $art = new Art(['id' => $id]); - if ($_POST['massedit'] == 'delete' && $app->exist($id)) { - $app->delete($art); - } - if ($_POST['massedit'] >= 0 && $app->exist($id)) { + if ($app->exist($id)) { $art = $app->get($id); - $art->setsecure($_POST['massedit']); - $app->update($art); + + switch ($_POST['massaction']) { + case 'do': + switch ($_POST['massedit']) { + case 'delete': + $app->delete($art); + break; + + case 'erasetag': + $art->settag(''); + $app->update($art); + break; + + case 'erasetemplate': + $art->settemplate(''); + $app->update($art); + break; + + case 'not published': + $art->setsecure(2); + $app->update($art); + break; + + case 'private': + $art->setsecure(1); + $app->update($art); + break; + + case 'public': + $art->setsecure(0); + $app->update($art); + break; + } + break; + + case 'set template': + if (isset($_POST['masstemplate'])) { + $art->settemplate($_POST['masstemplate']); + $app->update($art); + } + break; + + case 'add tag': + if (isset($_POST['targettag'])) { + $art = $app->get($id); + $tagstring = strip_tags(trim(strtolower($_POST['targettag']))); + $taglist = str_replace(' ', '', $tagstring); + $taglist = explode(",", $taglist); + foreach ($taglist as $tag) { + if (!in_array($tag, $art->tag('array'))) { + $newtaglist = $art->tag('array'); + array_push($newtaglist, $tag); + $art->settag($newtaglist); + } + } + $app->update($art); + } + break; + + } + + + + } header('Location: ./'); } - + break; } - break; - } - } + + + + if (isset($_POST['actiondb'])) { $app->setbdd($config); @@ -200,7 +259,7 @@ if (isset($_GET['id'])) { if (!isset($_GET['edit'])) { $_GET['edit'] = 0; } - $aff->arthead($art, $config->cssread(), $_GET['edit']); + $aff->arthead($art, $app::CSS_READ_DIR, $config->cssread(), $_GET['edit']); } else { $aff->head($_GET['id'], ''); @@ -235,15 +294,13 @@ if (isset($_GET['message'])) { $aff->nav($app); - - if (array_key_exists('id', $_GET)) { $app->bddinit($config); include('article.php'); } elseif (array_key_exists('tag', $_GET)) { $app->bddinit($config); echo '<h4>' . $_GET['tag'] . '</h4>'; - $aff->tag($app->getlister(['id', 'titre', 'intro', 'tag'], 'id'), $_GET['tag'], $app); + $aff->tag($app->getlister(['id', 'titre', 'intro', 'tag']), $_GET['tag'], $app); } elseif (array_key_exists('lien', $_GET)) { $app->bddinit($config); echo '<h4><a href="?id=' . $_GET['lien'] . '">' . $_GET['lien'] . '</a></h4>'; diff --git a/public/w/menu.php b/public/w/menu.php index b2495f2..58cc93e 100644 --- a/public/w/menu.php +++ b/public/w/menu.php @@ -11,19 +11,22 @@ if ($app->session() >= $app::EDITOR) { $aff->adminpassword($config); $aff->admindb($config); if ($app->setbdd($config)) { - //var_dump($app->tablelist($config->dbname())); - echo '<p>database status : OK</p>'; + $status = "OK"; + } else { + $status = "Not Connected"; } - $aff->admintable($config, $app->tablelist($config->dbname())); + $aff->admintable($config, $status, $app->tablelist($config->dbname())); echo '</section>'; } elseif ($_GET['aff'] == 'media') { echo '<h1>Media</h1>'; echo '<section>'; + echo '<article>'; $aff->addmedia($app); - $aff->medialist($app); + $aff->medialist($app->getlistermedia($app::MEDIA_DIR), $app::MEDIA_DIR); + echo '</article>'; echo '</section>'; } elseif ($_GET['aff'] == 'record') { @@ -34,7 +37,11 @@ if ($app->session() >= $app::EDITOR) { echo '</section>'; - } elseif ($_GET['aff'] == 'map') { + } elseif ($_GET['aff'] == 'info') { + + + + } elseif ($_GET['aff'] == 'map' && $app->session() >= $app::INVITE) { $app->bddinit($config); $aff->map($app, $config->domain()); } else { |