From fd5b106e22b12b659666f4b85b81c09aefc2bdf2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jonas=20H=C3=A4ggqvist?= Date: Tue, 17 Mar 2009 22:18:51 +0100 Subject: [PATCH] Add some comments --- public/admin.php | 3 +++ public/index.php | 7 ++++--- public/upload.php | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/public/admin.php b/public/admin.php index 8a58b2e..9f26acb 100644 --- a/public/admin.php +++ b/public/admin.php @@ -65,6 +65,7 @@ else { $t->assign('themes', $themes); $t->assign('approved', $approved); } + /* Adding a target */ elseif (isset($_REQUEST['addtarget'])) { $site->addtarget( $_REQUEST['shortname'], @@ -76,11 +77,13 @@ else { ); $t->assign('adminmsg', 'Target added'); } + /* Run checkwps on all themes */ elseif (isset($_REQUEST['runcheckwps'])) { $results = $site->checkallthemes(); $template = 'checkthemes.tpl'; $t->assign('checkwpsresults', $results); } + /* Or just show the front page */ if (!isset($template)) { $t->assign('title', 'Admin'); $t->assign('targets', $site->listtargets()); diff --git a/public/index.php b/public/index.php index b52bab2..33ef49d 100644 --- a/public/index.php +++ b/public/index.php @@ -23,21 +23,22 @@ require_once('preconfig.inc.php'); /* Decide what to do */ +/* This currently doesn't exist - but might show more details about a theme */ if (isset($_REQUEST['target']) && isset($_REQUEST['themename'])) { $site->showtheme($_REQUEST['target'], $_REQUEST['themename']); } +/* Show all themes for a specific target */ elseif (isset($_REQUEST['target'])) { $values['themes'] = $site->listthemes($_REQUEST['target']); $lcd = $site->target2lcd($_REQUEST['target']); $t->assign('mainlcd', $lcd['mainlcd']); $template = 'themelist.tpl'; } -elseif (isset($_REQUEST['theme'])) { - $site->showtheme($_REQUEST['theme']); -} +/* Just show the frontpage */ else { $values['targets'] = $site->listtargets(); $template = 'frontpage.tpl'; } + $t->render($template, $values); ?> diff --git a/public/upload.php b/public/upload.php index a8dd1eb..0c191e7 100644 --- a/public/upload.php +++ b/public/upload.php @@ -113,11 +113,13 @@ function checkuploadfiles(&$site, &$err) { if (isset($_REQUEST['author'])) { $err = array(); + /* First we do some checking of the uploaded data */ checkuploadfields($site, $err); checkuploadfiles($site, $err); if (count($err) > 0) { $t->assign('errors', $err); } + /* If that went wrong, go on and include the theme */ else { /* * At this stage, the theme has been validated, any possible errors -- 2.11.4.GIT