From 0c59d4f79148a9cce81b1c87bc41e476c55d0d94 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 25 Jun 2008 14:58:38 -0400 Subject: [PATCH] index.php and its associates --- includes/class_sort.php | 13 ++++++++++--- includes/framework | 2 +- includes/functions.php | 2 +- includes/pagination.php | 4 ++-- index.php | 15 ++++++++++----- 5 files changed, 24 insertions(+), 12 deletions(-) diff --git a/includes/class_sort.php b/includes/class_sort.php index 8052ecd..ad10e6e 100644 --- a/includes/class_sort.php +++ b/includes/class_sort.php @@ -394,7 +394,13 @@ class ListSorter } $image = ((in_array($this->sortkey, $columns) AND $sortable) ? $this->fetch_sort_image() : ''); $name = implode(' / ', $build); - eval('$output .= "' . $this->registry->template->fetch('list_head') . '";'); + + $tpl = new BSTemplate('list_head'); + $tpl->vars = array( + 'name' => $name, + 'image' => $image + ); + $output .= $tpl->evaluate()->getTemplate(); } return $output; @@ -433,8 +439,9 @@ class ListSorter $fields .= "\n\t$data"; } - eval('$output = "' . $this->registry->template->fetch('trackerhome_bits') . '";'); - return $output; + $tpl = new BSTemplate('trackerhome_bits'); + $tpl->vars = $bug; + return $tpl->evaluate()->getTemplate(); } // ################################################################### diff --git a/includes/framework b/includes/framework index 52ca011..37e9be2 160000 --- a/includes/framework +++ b/includes/framework @@ -1 +1 @@ -Subproject commit 52ca011af1b57c332904401df6e59d9e2702e4ad +Subproject commit 37e9be2f508ddc69a792364682dd5db1a2e41213 diff --git a/includes/functions.php b/includes/functions.php index 8091875..5bd5a43 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -684,7 +684,7 @@ function ProcessBugDataForDisplay($bug, $color = '') $bug['lastposttime'] = ($bug['hiddendisplay'] ? $bug['hiddenlastposttime'] : $bug['lastposttime']); $bug['lastpost'] = ($bug['hiddendisplay'] ? $bug['hiddenlastpostbyname'] : $bug['lastpostbyname']); - $bug['lastposttime'] = $bugsys->datef->format(bugdar::$options['dateformat'], $bug['lastposttime']); + $bug['lastposttime'] = BSApp::$date->format(bugdar::$options['dateformat'], $bug['lastposttime']); return $bug; } diff --git a/includes/pagination.php b/includes/pagination.php index c641bcc..52a69c2 100644 --- a/includes/pagination.php +++ b/includes/pagination.php @@ -56,7 +56,7 @@ class Pagination extends BSPagination 'nolink' => $isCurrent, 'number' => $pagenumber ); - return $template->evaluate(); + return $template->evaluate()->getTemplate(); } /** @@ -73,7 +73,7 @@ class Pagination extends BSPagination 'pagebits' => $bits, 'paginator' => $this ); - return $template->evaluate(); + return $template->evaluate()->getTemplate(); } } diff --git a/index.php b/index.php index 586ea39..29034ff 100644 --- a/index.php +++ b/index.php @@ -47,7 +47,7 @@ $pagination->processIncomingData(); // ################################################################### -$count = $db->query_first(" +$count = $db->queryFirst(" SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "bug WHERE (!hidden OR (hidden AND product IN (" . fetch_on_bits('canviewhidden') . "))" . (can_perform('canviewownhidden') ? " OR (hidden AND userid = " . bugdar::$userinfo['userid'] . " AND product IN (" . fetch_on_bits('canviewownhidden') . "))" : "") . ") @@ -65,20 +65,25 @@ $pagination->splitPages(); $bugs_fetch = $db->query($sort->fetch_sql_query(null, $pagination->fetchLimit($pagination->getPage() - 1) . ", " . $pagination->getPerPage())); -while ($bug = $db->fetch_array($bugs_fetch)) +foreach ($bugs_fetch as $bug) { - $funct->exec_swap_bg('altcolor', ''); + BSFunctions::swap_css_classes('altcolor', ''); $bug = ProcessBugDataForDisplay($bug, $funct->bgcolour); $bugs .= $sort->constructRow($bug); } -$db->free_result($bugs_fetch); +$bugs_fetch->free(); $columnHeads = $sort->constructColumnHeaders(true, 'p=' . $pagination->page . '&pp=' . $pagination->perpage); $show['pagenav'] = ($pagination->getPageCount() > 1); $pagenav = $pagination->constructPageNav($sort->fetch_sort_link($sort->sortkey)); -eval('$template->flush("' . $template->fetch('trackerhome') . '");'); +$tpl = new BSTemplate('trackerhome'); +$tpl->vars = array( + 'columnHeads' => $columnHeads, + 'bugs' => $bugs +); +$tpl->evaluate()->flush(); /*=====================================================================*\ || ################################################################### -- 2.22.5