diff options
author | Simon Rettberg | 2016-05-03 19:03:09 +0200 |
---|---|---|
committer | Simon Rettberg | 2016-05-03 19:03:09 +0200 |
commit | 50404f3b23b7fd6aeae4c9d2f6df0ea25e984e66 (patch) | |
tree | 05e99fdffa696434960d7c77966c0bc36d6339e8 /modules-available/imgmanagement/page.inc.php | |
parent | Second half of merge.... (diff) | |
download | slx-admin-50404f3b23b7fd6aeae4c9d2f6df0ea25e984e66.tar.gz slx-admin-50404f3b23b7fd6aeae4c9d2f6df0ea25e984e66.tar.xz slx-admin-50404f3b23b7fd6aeae4c9d2f6df0ea25e984e66.zip |
WIP
Diffstat (limited to 'modules-available/imgmanagement/page.inc.php')
-rw-r--r-- | modules-available/imgmanagement/page.inc.php | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/modules-available/imgmanagement/page.inc.php b/modules-available/imgmanagement/page.inc.php new file mode 100644 index 00000000..dc19cb2a --- /dev/null +++ b/modules-available/imgmanagement/page.inc.php @@ -0,0 +1,63 @@ +<?php + +class Page_Imgmanagement extends Page +{ + + private $page; + private $baselocation; + private $images; + + protected function doPreprocess() + { + + User::load(); + if (!User::hasPermission('baseconfig_local')) { + Message::addError('no-permission'); + Util::redirect('?do=Main'); + } + + error_reporting(E_ALL); + ini_set('display_errors','on'); + + Session::get('token'); + + } + + protected function doRender() + { + error_reporting(E_ALL); + ini_set('display_errors','on'); + + $actives = array(); + $deactives = array(); + + $res = Database::simpleQuery("SELECT id, name, path, userid, is_template, is_active, description FROM images ORDER BY id DESC"); + while ($row = $res->fetch(PDO::FETCH_ASSOC)) { + if($row['is_active']) + $actives[] = array( + 'id' => $row['id'], + 'name' => $row['name'], + 'path' => $row['path'], + 'userid' => $row['userid'], + 'is_template' => $row['is_template'], + 'is_active' => $row['is_active'], + 'description' => $row['description'] + ); + else + $deactives[] = array( + 'id' => $row['id'], + 'name' => $row['name'], + 'path' => $row['path'], + 'userid' => $row['userid'], + 'is_template' => $row['is_template'], + 'is_active' => $row['is_active'], + 'description' => $row['description'] + ); + + } + + Render::addTemplate('page-imgmanagement', array( + 'deactives' => $deactives, + 'actives' => $actives)); + } +} |