Merge branch 'org.openembedded.dev' of git@git.openembedded.net:openembedded into...
[vuplus_openembedded] / contrib / feed-browser / section.php
1 <?php
2
3 /*
4  * (c) Koen Kooi 2006, 2007, 2008, 2009
5  * (c) Marcin Juszkiewicz 2006, 2007
6  *
7  * This php script is intended to do the following:
8  *
9  * - have searchable webfronted for the feed like packages.ubuntu.com
10  *
11  * ToDo:
12  *
13  * - search functionality
14  * - provide feed-management functionality
15  * - allow uploading of new software
16  *
17  *
18  * This program is free software; you can redistribute it and/or  modify it under
19  * the terms of the GNU General Public License as published by the Free
20  * Software Foundation; either version 2 of the License.
21  * 
22  * This program is distributed in the hope that it will be useful,  but WITHOUT
23  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
24  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
25  * 
26  * You should have received a copy of the GNU Library General Public License along
27  * with this library; see the file COPYING.LIB.  If not, write to the Free
28  * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
29  * USA.
30  *
31  */
32
33 require_once 'includes/config.inc';
34 require_once 'includes/functions.inc';
35
36 if(!check_database())
37 {
38         die("Database not found and cannot be created.");
39 }
40
41 if (isset($_POST["action"]) && $_POST["action"] != "") {
42         $action = $_POST["action"];
43 } else {
44         print "Invalid action: $action";
45         exit;
46 }
47
48 if (isset($_POST["pkgsearch"]) && $_POST["pkgsearch"] != "") {
49         $pkgsearch = $_POST["pkgsearch"];
50 }
51
52 if (isset($_POST["section"]) && $_POST["section"] != "") {
53         $section = $_POST["section"];
54 }
55
56 if (isset($_POST["arch"]) && $_POST["arch"] != "") {
57         $arch = $_POST["arch"];
58 } else {
59         $arch = "";
60 }
61
62 if (isset($_POST["pkgname"]) && $_POST["pkgname"] != "") {
63         $pkgname = $_POST["pkgname"];
64 }
65
66
67 //print("$action");
68 switch($action) {
69 case "sectionslist":
70                                 echo sectionslist();
71                                 break;
72 case "searchletter":                            
73                                 echo searchletter(); 
74                                 break;
75 case "pkgquery":
76                                 echo searchpkg("%{$pkgsearch}%", $arch);
77                                 break;
78 case "pkgname":
79                                 echo pkgdetails($pkgname);
80                                 break;
81 case "section":
82                                 echo searchsection($section);
83                                 break;
84
85 ?>