File classes/Builds.php changed (mode: 100644) (index cc492af..765093b) |
... |
... |
class Builds |
118 |
118 |
{ |
{ |
119 |
119 |
return $x->buildsetid; |
return $x->buildsetid; |
120 |
120 |
} |
} |
|
121 |
|
|
|
122 |
|
/** |
|
123 |
|
* @brief Custom key comparison function for a dictionary. |
|
124 |
|
* |
|
125 |
|
* Treats keys with slashes in them as greater than other keys. |
|
126 |
|
* |
|
127 |
|
* @param a First key. |
|
128 |
|
* @param b Second key. |
|
129 |
|
* |
|
130 |
|
* @returns Value less than, equal to or greater than zero to indicate |
|
131 |
|
* order. |
|
132 |
|
*/ |
|
133 |
|
public static function builderCmp($a, $b) |
|
134 |
|
{ |
|
135 |
|
$condA = (strpos($a, '/') !== false); |
|
136 |
|
$condB = (strpos($b, '/') !== false); |
|
137 |
|
if ($condA ^ $condB) { |
|
138 |
|
return $condA ? 1 : -1; |
|
139 |
|
} |
|
140 |
|
return strcmp($a, $b); |
|
141 |
|
} |
121 |
142 |
} |
} |
122 |
143 |
|
|
123 |
144 |
?> |
?> |
File dashboard.php changed (mode: 100644) (index 5842312..75029cd) |
... |
... |
function displayDashboard() |
56 |
56 |
function printBuildTable($buildsets, $builders) |
function printBuildTable($buildsets, $builders) |
57 |
57 |
{ |
{ |
58 |
58 |
// sort builders by their name |
// sort builders by their name |
59 |
|
uksort($builders, "builderCmp"); |
|
|
59 |
|
uksort($builders, "Builds::builderCmp"); |
60 |
60 |
|
|
61 |
61 |
// output table header |
// output table header |
62 |
62 |
print '<table class="dashboard"><tr><td></td>' . "\n"; |
print '<table class="dashboard"><tr><td></td>' . "\n"; |
|
... |
... |
function printBuildTable($buildsets, $builders) |
101 |
101 |
print "</table>\n"; |
print "</table>\n"; |
102 |
102 |
} |
} |
103 |
103 |
|
|
104 |
|
/** |
|
105 |
|
* @brief Custom key comparison function. |
|
106 |
|
* |
|
107 |
|
* Treats keys with slashes in them as greater than other keys. |
|
108 |
|
* |
|
109 |
|
* @param a First key. |
|
110 |
|
* @param b Second key. |
|
111 |
|
* |
|
112 |
|
* @returns Value less than, equal to or greater than zero to indicate order. |
|
113 |
|
*/ |
|
114 |
|
function builderCmp($a, $b) |
|
115 |
|
{ |
|
116 |
|
$condA = (strpos($a, '/') !== false); |
|
117 |
|
$condB = (strpos($b, '/') !== false); |
|
118 |
|
if ($condA ^ $condB) { |
|
119 |
|
return $condA ? 1 : -1; |
|
120 |
|
} |
|
121 |
|
return strcmp($a, $b); |
|
122 |
|
} |
|
123 |
|
|
|
124 |
104 |
/** |
/** |
125 |
105 |
* @brief Checks whether particular status has associated output. |
* @brief Checks whether particular status has associated output. |
126 |
106 |
* |
* |