Add some comments
[rockboxthemes.git] / public / index.php
blob33ef49d81f1ad5596b1173d671d34dc2827f8a5a
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 /* This currently doesn't exist - but might show more details about a theme */
27 if (isset($_REQUEST['target']) && isset($_REQUEST['themename'])) {
28 $site->showtheme($_REQUEST['target'], $_REQUEST['themename']);
30 /* Show all themes for a specific target */
31 elseif (isset($_REQUEST['target'])) {
32 $values['themes'] = $site->listthemes($_REQUEST['target']);
33 $lcd = $site->target2lcd($_REQUEST['target']);
34 $t->assign('mainlcd', $lcd['mainlcd']);
35 $template = 'themelist.tpl';
37 /* Just show the frontpage */
38 else {
39 $values['targets'] = $site->listtargets();
40 $template = 'frontpage.tpl';
43 $t->render($template, $values);