--- FreeBSD/tinderbox/webui/module/moduleBuilds.php 2007/11/02 20:55:00 1.1.1.1 +++ FreeBSD/tinderbox/webui/module/moduleBuilds.php 2007/11/16 23:00:00 1.1.1.1.2.3 @@ -24,42 +24,32 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # +# $Paefchen: FreeBSD/tinderbox/webui/module/moduleBuilds.php,v 1.1.1.1.2.2 2007/11/15 15:31:35 as Exp $ # $MCom: portstools/tinderbox/webui/module/moduleBuilds.php,v 1.6 2005/12/26 22:33:53 marcus Exp $ # -require_once 'module/module.php'; - class moduleBuilds extends module { - function moduleBuilds() { - $this->module(); - } - - function display_list_builds() { - global $pkgdir; - global $pkguri; - + public function display_list_builds() { $builds = $this->TinderboxDS->getAllBuilds(); - if( is_array( $builds ) && count( $builds ) > 0 ) { - $data = $this->get_list_data( $builds ); - foreach( $data as $res ) + if (is_array($builds) && count($builds) > 0) { + $data = $this->get_list_data($builds); + foreach ($data as $res) $sort[] = $res['name']; - array_multisort( $sort, SORT_ASC, $data ); - $this->template_assign( 'data', $data ); - $this->template_assign( 'no_list', false ); - } else { - $this->template_assign( 'no_list', true ); + array_multisort($sort, SORT_ASC, $data); + $this->template_assign('data', $data); + $this->template_assign('no_list', false); } + else { + $this->template_assign('no_list', true); + } $this->template_assign( 'maintainers', $this->TinderboxDS->getAllMaintainers() ); return $this->template_parse( 'list_builds.tpl' ); } function get_list_data( $builds ) { - global $pkgdir; - global $pkguri; - $i = 0; foreach( $builds as $build ) { $status = $build->getBuildStatus(); @@ -96,20 +86,19 @@ class moduleBuilds extends module { $data[$i]['status_field_class'] = $status_field_class; $data[$i]['name'] = $name; $data[$i]['description'] = $description; - if( is_dir( $pkgdir.'/'.$name ) ) { - $data[$i]['packagedir'] = $pkguri.'/'.$name.'/'; + if( is_dir( PKGDIR.'/'.$name ) ) { + $data[$i]['packagedir'] = PKGURL.'/'.$name.'/'; } else { $data[$i]['packagedir'] = false; } $data[$i]['results'] = $results; $i++; } - return $data; } - function get_all_builds() { + public function get_all_builds() { $all_builds_raw = $this->TinderboxDS->getAllBuilds(); $all_builds = array(); foreach( $all_builds_raw as $build ) { @@ -118,4 +107,5 @@ class moduleBuilds extends module { return $all_builds; } } + ?>