diff --git a/browse_newest_apps.php b/browse_newest_apps.php
deleted file mode 100644
index 26c538a..0000000
--- a/browse_newest_apps.php
+++ /dev/null
@@ -1,69 +0,0 @@
- 200 || $aClean['iNumVersions'] < 0)
- $aClean['iNumVersions'] = 25;
-
-apidb_header("Browse Newest Applications");
-
-/* Selector for how many versions to view */
-echo "
';
-echo '
';
-
-/* Query the database for the n newest versions */
-$hResult = query_parameters("SELECT appId, appName, description, submitTime FROM appFamily WHERE
- queued = 'false' ORDER BY appId DESC LIMIT ?",
- $aClean['iNumVersions']);
-
-if($hResult)
-{
- echo html_frame_start("", "90%", '', 0);
- echo html_table_begin("width=\"100%\" align=\"center\"");
- echo "\n";
- echo "| Submission Date | \n";
- echo "Application | \n";
- echo "Description |
\n";
-
- $c = 1;
- while($row = mysql_fetch_object($hResult))
- {
- $oApp = new application($row->appId);
- $bgcolor = ($c % 2) ? "color0" : "color1";
- $link = $oApp->objectMakeLink();
- echo "";
- echo "| ".print_short_date(mysqltimestamp_to_unixtimestamp($row->submitTime))." | \n";
- echo "$link | \n";
- echo "$row->description |
\n";
- $c++;
- }
-
- echo html_table_end();
- echo html_frame_end();
-}
-
-apidb_footer();
-
-?>
diff --git a/include/browse_newest_apps.php b/include/browse_newest_apps.php
new file mode 100644
index 0000000..60fe59a
--- /dev/null
+++ b/include/browse_newest_apps.php
@@ -0,0 +1,140 @@
+iAppId = $iAppId;
+ }
+
+ if($oRow)
+ {
+ $this->iAppId = $oRow->appId;
+ }
+ }
+
+ function objectGetEntries($bQueued, $bRejected, $iRows = 0, $iStart = 0)
+ {
+ // We don't implement queues or rejected applications
+ if($bQueued || $bRejected)
+ return false;
+
+
+ // if row limit is 0 we want to fetch all rows
+ if(!$iRows)
+ {
+ $iRows = browse_newest_apps::objectGetEntriesCount($bQueued, $bRejected);
+ }
+
+ $sQuery = "SELECT appId, appName, description, submitTime FROM appFamily WHERE".
+ " queued = '?' ORDER BY appId DESC LIMIT ?,?";
+
+ return query_parameters($sQuery, $bQueued ? "true" : "false",
+ $iStart, $iRows);
+ }
+
+ function objectGetEntriesCount($bQueued, $bRejected)
+ {
+ // We don't implement queues or rejected applications
+ if($bQueued || $bRejected)
+ {
+ return 0;
+ }
+
+ return application::objectGetEntriesCount($bQueued, $bRejected);
+ }
+
+ function objectGetHeader()
+ {
+ $aCells = array(
+ array("Submission Date", "color=\"white\""),
+ array("Application", "color=\"white\""),
+ array("Description", "color=\"white\""));
+
+ return $aCells;
+ }
+
+ function objectGetTableRow()
+ {
+ $oApp = new application($this->iAppId);
+ $aCells = array(
+ array(print_short_date(mysqltimestamp_to_unixtimestamp($oApp->sSubmitTime)),
+ "width=\"20%\""),
+ $oApp->objectMakeLink(),
+ util_trim_description($oApp->sDescription));
+
+
+ $oTableRow = new TableRow($aCells);
+ return $oTableRow;
+ }
+
+ function objectGetItemsPerPage($bQueued = false)
+ {
+ $aItemsPerPage = array(25, 50, 100, 200);
+ $iDefaultPerPage = 25;
+ return array($aItemsPerPage, $iDefaultPerPage);
+ }
+
+ function objectGetId()
+ {
+ return $this->iAppId;
+ }
+
+ // stub implementation
+ function allowAnonymousSubmissions()
+ {
+ return false;
+ }
+
+ // stub canEdit() out, no one can edit these entries
+ function canEdit()
+ {
+ return false;
+ }
+
+ // stub implementation
+ function display()
+ {
+ }
+
+ // stub implementation
+ function outputEditor()
+ {
+ }
+
+ // stub implementation
+ function getOutputEditorValues($aValues)
+ {
+ }
+
+ // stub implementation
+ function objectMakeLink()
+ {
+ $oApp = new Application($this->iAppId);
+ return $oApp->objectMakeLink();
+ }
+
+ // stub implementation
+ function objectMakeUrl()
+ {
+ }
+
+ // stub implementation
+ function mustBeQueued()
+ {
+ return false;
+ }
+}
+
+?>
diff --git a/include/sidebar.php b/include/sidebar.php
index 48a2703..d0c7482 100644
--- a/include/sidebar.php
+++ b/include/sidebar.php
@@ -20,7 +20,8 @@ function global_sidebar_menu()
$g = new htmlmenu("AppDB");
$g->add("Screenshots", BASE."viewScreenshots.php");
$g->add("Browse Apps", BASE."appbrowse.php");
- $g->add("Browse Newest Apps", BASE."browse_newest_apps.php");
+ $g->add("Browse Newest Apps", BASE."objectManager.php?sClass=browse_newest_apps&".
+ "bIsQueue=false&sTitle=Newest%20apps");
$g->add("Downloadable Apps", BASE."browse_downloadable.php");
$g->add("Browse Apps by Rating", BASE."browse_by_rating.php");
$g->add("Top 25", BASE."votestats.php");
diff --git a/objectManager.php b/objectManager.php
index 5cf5872..ba541cf 100644
--- a/objectManager.php
+++ b/objectManager.php
@@ -22,6 +22,7 @@ require_once(BASE.'include/objectManager.php');
require_once(BASE.'include/application_queue.php');
require_once(BASE.'include/version_queue.php');
require_once(BASE.'include/testData_queue.php');
+require_once(BASE.'include/browse_newest_apps.php');
/* if we have no valid class name we should abort */
if(!$aClean['sClass'])
diff --git a/unit_test/test_om_objects.php b/unit_test/test_om_objects.php
index 9eac332..cd0b2f6 100644
--- a/unit_test/test_om_objects.php
+++ b/unit_test/test_om_objects.php
@@ -10,6 +10,7 @@ require_once(BASE.'include/maintainer.php');
require_once(BASE.'include/testData_queue.php');
require_once(BASE.'include/version_queue.php');
require_once(BASE.'include/application_queue.php');
+require_once(BASE.'include/browse_newest_apps.php');
/* internal function */
function test_class($sClassName, $aTestMethods)
@@ -25,6 +26,11 @@ function test_class($sClassName, $aTestMethods)
return false;
}
+ // TODO: work around for 'browse_newest_apps' class
+ // since we can't create a new database object of browse_newest_apps
+ if($sClassName == "browse_newest_apps")
+ return true;
+
/* Set up test user */
global $test_email, $test_password;
if(!$oUser = create_and_login_user())
@@ -278,6 +284,7 @@ function test_object_methods()
$aTestClasses = array("application",
"application_queue",
+ "browse_newest_apps",
"distribution",
"downloadurl",
"maintainer",