6 * - iCatId, shows applications that belong to the category identified by iCatId
9 // application environment
11 require(BASE
."include/"."incl.php");
12 require_once(BASE
."include/"."appdb.php");
13 require_once(BASE
."include/"."category.php");
19 $m = new htmlmenu("Admin");
20 $m->add('Edit this Category', BASE
."objectManager.php?iId=${aClean[iCatId]}&sClass=category&sAction=edit");
22 /* We only allow deletion of the category if it is empty */
23 $oCat = new category($aClean['iCatId']);
24 if(!sizeof($oCat->aApplicationsIds
))
25 $m->add('Delete this Category', BASE
."objectManager.php?iId=${aClean[iCatId]}&sClass=category&sAction=delete");
30 $iCatId = isset($aClean['iCatId']) ?
$aClean['iCatId'] : 0;
31 // list sub categories
32 $oCat = new Category( $iCatId );
33 $sCatFullPath = Category
::make_cat_path($oCat->getCategoryPath());
34 $subs = $oCat->aSubcatsIds
;
37 if($_SESSION['current']->hasPriv("admin") && isset($aClean['iCatId']) && $aClean['iCatId'] != 0 )
38 apidb_sidebar_add("admin_menu");
41 apidb_header("Browse Applications");
43 echo "<div class='default_container'>\n";
47 echo html_frame_start("",'98%','',2);
48 echo "<p><b>Category: ". $sCatFullPath ."</b><br>\n";
49 echo html_frame_end();
51 echo html_frame_start("","98%","",0);
53 $oTable = new Table();
54 $oTable->SetWidth("100%");
55 $oTable->SetBorder(0);
56 $oTable->SetCellPadding(3);
57 $oTable->SetCellSpacing(1);
59 $oTableRow = new TableRow();
60 $oTableRow->SetClass("color4");
61 $oTableRow->AddTextCell("Sub Category");
62 $oTableRow->AddTextCell("Description");
63 $oTableRow->AddTextCell("No. Apps");
64 $oTable->SetHeader($oTableRow);
66 while(list($i,$iSubcatId) = each($subs))
68 $oSubCat= new Category($iSubcatId);
71 $sColor = ($i %
2) ?
"color0" : "color1";
73 $oTableRowHighlight = GetStandardRowHighlight($i);
75 $sUrl = "appbrowse.php?iCatId=$iSubcatId";
77 $oTableRowClick = new TableRowClick($sUrl);
78 $oTableRowClick->SetHighlight($oTableRowHighlight);
80 //get number of apps in this sub-category
81 $iAppcount = $oSubCat->getApplicationCount();
84 $sDesc = substr(stripslashes($oSubCat->sDescription
),0,70);
87 $oTableRow = new TableRow();
88 $oTableRow->SetClass($sColor);
89 $oTableRow->SetRowClick($oTableRowClick);
91 $oTableCell = new TableCell($oSubCat->sName
);
92 $oTableCell->SetCellLink($sUrl);
93 $oTableRow->AddCell($oTableCell);
94 $oTableRow->AddTextCell("$sDesc ");
95 $oTableRow->AddTextCell("$iAppcount ");
97 $oTable->AddRow($oTableRow);
101 echo $oTable->GetString();
103 echo html_frame_end( count($subs) . ' categories');
108 // list applications in this category
109 $apps = $oCat->aApplicationsIds
;
112 echo html_frame_start("",'98%','',2);
113 echo "<p><b>Category: ". $sCatFullPath ."</b><br>\n";
114 echo html_frame_end();
116 echo html_frame_start("","98%","",0);
118 $oTable = new Table();
119 $oTable->SetWidth("100%");
120 $oTable->SetBorder(0);
121 $oTable->SetCellPadding(3);
122 $oTable->SetCellSpacing(1);
124 $oTableRow = new TableRow();
125 $oTableRow->SetClass("color4");
126 $oTableRow->AddTextCell("Application name");
127 $oTableRow->AddTextCell("Description");
128 $oTableRow->AddTextCell("No. Versions");
130 $oTable->SetHeader($oTableRow);
132 while(list($i, $iAppId) = each($apps))
134 $oApp = new Application($iAppId);
137 $sColor = ($i %
2) ?
"color0" : "color1";
139 $oTableRowHighlight = GetStandardRowHighlight($i);
141 $sUrl = $oApp->objectMakeUrl();
143 $oTableRowClick = new TableRowClick($sUrl);
144 $oTableRowClick->SetHighlight($oTableRowHighlight);
147 $sDesc = util_trim_description($oApp->sDescription
);
150 $oTableRow = new TableRow();
151 $oTableRow->SetRowClick($oTableRowClick);
152 $oTableRow->SetClass($sColor);
153 $oTableRow->AddTextCell($oApp->objectMakeLink());
154 $oTableRow->AddTextCell("$sDesc ");
155 $oTableRow->AddTextCell(sizeof($oApp->aVersionsIds
));
157 $oTable->AddRow($oTableRow);
161 echo $oTable->GetString();
163 echo html_frame_end( count($apps) . " applications in this category");
167 //if ($aClean['iCatId'] != 0)
169 // log_category_visit($cat->id);