Switch the 'modify' code of admin/field.php to use templates
[bugdar.git] / favorite.php
index aed29dd94ecd8790e55d15015b0982f39ce241b9..7f86c025535fb6ac809c38b6b14048fe05546955 100644 (file)
@@ -2,7 +2,7 @@
 /*=====================================================================*\
 || ###################################################################
 || # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2009 Blue Static
 || #
 || # This program is free software; you can redistribute it and/or modify
 || # it under the terms of the GNU General Public License as published by
@@ -19,7 +19,6 @@
 || ###################################################################
 \*=====================================================================*/
 
-define('SVN', '$Id$');
 
 if (empty($_REQUEST['do']))
 {
@@ -82,7 +81,7 @@ if ($_REQUEST['do'] == 'manage')
                AND (!bug.hidden OR (bug.hidden AND bug.product IN (" . fetch_on_bits('canviewhidden') . "))" . (can_perform('canviewownhidden') ? " OR (bug.hidden AND bug.userid = " . bugdar::$userinfo['userid'] . " AND bug.product IN (" . fetch_on_bits('canviewownhidden') . "))" : "") . ")
        ");
        
-       if ($db->num_rows($favorites) < 1)
+       if ($favorites->size() < 1)
        {
                $message->error(T('You do not have any favorites in your list. To add a bug to your list, while viewing the report, click the [Add to Favorites] link next to the bug\'s ID.'));
        }
@@ -98,13 +97,12 @@ if ($_REQUEST['do'] == 'manage')
                $bugs .= $sort->constructRow($bug);
        }
        
-       eval('$template->flush("' . $template->fetch('favorites') . '");');
+       $tpl = new BSTemplate('favorites');
+       $tpl->vars = array(
+               'bugs'          => $bugs,
+               'headers'       => $headers
+       );
+       $tpl->evaluate()->flush();
 }
 
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
 ?>
\ No newline at end of file