+
+
+EOT;
+
+ return $html;
+}
+
+/**
+ * preparing the div html for the project summary page.
+ */
+function wptc_widget_project_summary($project) {
+
+ // get running milestone for the given project.
+ $all = wptc_get_ticket_milestones($project);
+ if (empty($all)) {
+ return "";
+ }
+ $running = $all['Running (by Due Date)'];
+ $milestoneDivs = "";
+ foreach(array_keys($running) as $milestone) {
+ $milestoneDivs = $milestoneDivs .
+ wptc_widget_milestone_summary($milestone);
+ }
+
+ $div = <<
+ Project: {$project}
+ {$milestoneDivs}
+
+EOT;
+
+ return $div;
+}
+
+/**
+ * proeparing hte trac home page.
+ */
+function wptc_widget_trac_homepage() {
+
+ // get all projects.
+ $projects = wptc_get_projects();
+ $projectDivs = "";
+ foreach($projects as $project) {
+ $projectDivs = $projectDivs .
+ wptc_widget_project_summary($project['name']);
+ }
+
+ $div = <<