Rearrange and explain the TODOs a bit better.
[rockboxthemes.git] / public / index.php
blobb52bab2586473281aee314068cb034592702fed2
1 <?php
2 /***************************************************************************
3 * __________ __ ___.
4 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
5 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
6 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
7 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
8 * \/ \/ \/ \/ \/
9 * $Id$
11 * Copyright (C) 2009 Jonas Häggqvist
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
21 ****************************************************************************/
23 require_once('preconfig.inc.php');
25 /* Decide what to do */
26 if (isset($_REQUEST['target']) && isset($_REQUEST['themename'])) {
27 $site->showtheme($_REQUEST['target'], $_REQUEST['themename']);
29 elseif (isset($_REQUEST['target'])) {
30 $values['themes'] = $site->listthemes($_REQUEST['target']);
31 $lcd = $site->target2lcd($_REQUEST['target']);
32 $t->assign('mainlcd', $lcd['mainlcd']);
33 $template = 'themelist.tpl';
35 elseif (isset($_REQUEST['theme'])) {
36 $site->showtheme($_REQUEST['theme']);
38 else {
39 $values['targets'] = $site->listtargets();
40 $template = 'frontpage.tpl';
42 $t->render($template, $values);