| <?php require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/app.class.php"); require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/nav.class.php"); require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/menu.class.php"); $App = new App(); $Nav = new Nav(); $Menu = new Menu(); include($App->getProjectCommon()); # All on the same line to unclutter the user's desktop' |
| /* 221934 - this page to remain on eclipse.org */ |
| require_once("/home/data/httpd/eclipse-php-classes/system/dbconnection_foundation_ro.class.php"); |
| require_once("common/shared_functions.php"); |
| |
| $_dbc = new DBConnectionFoundation(); |
| $_dbh = $_dbc->connect(); |
| $query = "SELECT * FROM Projects WHERE IsComponent = 0 ORDER BY ProjectID"; |
| $result = mysql_query($query,$_dbh); |
| $rows = array(); |
| while( $row = mysql_fetch_assoc($result) ) { |
| $rows[] = $row; |
| } |
| |
| /*================================================= |
| * P R O C E S S P O S T |
| */ |
| if( isset($_REQUEST['B']) ) { |
| $projectids = array(); |
| foreach( $rows as $row ) { |
| $x = $row['ProjectID']; |
| $x = strtr( $x, '.', '_' ); |
| if( isset($_REQUEST[$x]) |
| && $_REQUEST[$x] == "on" ) { |
| $projectids[] = $row['ProjectID']; |
| } |
| } |
| if( count($projectids) > 0 ) { |
| header( 'Location: ip_log.php?projectid=' . implode( ',', $projectids ) ); |
| exit; |
| } |
| } else { |
| preg_match('/^([a-z.0-9\-_,]+)$/', $_REQUEST['projectid'], $matches); |
| $projectids = explode( ',', $matches[1] ); |
| } |
| |
| /*================================================= |
| * H E A D E R |
| */ |
| $theme = ''; |
| $pageTitle = "IP Log Selector"; |
| $pageKeywords = ''; |
| $pageAuthor = ''; |
| |
| $Nav->setLinkList(array()); // empty Nav |
| |
| ob_start(); |
| ?> |
| <div id="maincontent"> |
| <div id="midcolumn"> |
| |
| <h1>Select the Set of Project To Be Included In The IP Log</h1> |
| <form method="GET"> |
| <?php |
| function row_cmp( $a, $b ) { |
| $ia = strpos( $a['ProjectID'] . '.', '.' ); |
| $ib = strpos( $b['ProjectID'] . '.', '.' ); |
| $wa = substr( $a['ProjectID'], 0, $ia ); |
| $wb = substr( $b['ProjectID'], 0, $ib ); |
| if( $wa == $wb ) { |
| if( $a['Level'] == $b['Level'] ) { |
| return strcmp( $a['Name'], $b['Name'] ); |
| } else { |
| if( $a['Level'] < $b['Level'] ) return -1; |
| if( $a['Level'] > $b['Level'] ) return 1; |
| return 0; |
| } |
| } else { |
| return strcmp( $wa, $wb ); |
| } |
| } |
| usort( $rows, 'row_cmp' ); |
| foreach( $rows as $row ) { |
| // ---- Exclude internal and archived projects ---- |
| if( !$row['IsActive'] ) continue; |
| if( $row['ProjectID'] == "foundation-internal" |
| || $row['ParentProjectID'] == 'foundation-internal' ) continue; |
| if( $row['ProjectPhase'] == 'Archive' |
| || strpos( $row['Name'], "[archived]") |
| || strpos( $row['Name'], "[closed]" ) ) continue; |
| if( $row['Level'] == 0 ) continue; |
| |
| ?><div style="padding-left: <?= ($row['Level']-1) * 50 ?>px"> |
| <input type="checkbox" name="<?= $row['ProjectID'] ?>" value="on" |
| <?= array_search( $row['ProjectID'], $projectids ) !== FALSE ? "checked" : "" ?> |
| > <?= $row['ProjectID'] ?> <em>(<?= $row['Name'] ?>)</em> |
| </div> |
| <?php |
| } |
| ?> |
| <input type="submit" name="B" value="Generate IP Log"> |
| </form> |
| <?php |
| /*================================================= |
| * F O O T E R |
| */ |
| ?> |
| <p> |
| <center> |
| <div style="width: 60%; border: thin solid red">This page is still under construction. Please add yourself as a cc to |
| <a href="http://bugs.eclipse.org/220977">bug 220977</a> for notification when this page is completed (coming soon). |
| </div> |
| </center> |
| |
| </div><!-- midcolumn --> |
| </div><!-- maincontent --> |
| <?php |
| # Paste your HTML content between the EOHTML markers! |
| $html = ob_get_contents(); |
| ob_end_clean(); |
| |
| # Generate the web page |
| $App->generatePage($theme, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html); |
| ?> |