\n";
if (count($messages) > 1) {
$output .= "
\n";
- foreach($messages as $message) {
+ while (list($key, $message) = each($messages)) {
$output .= ' - '. $message ."
\n";
}
$output .= "
\n";
@@ -505,7 +507,7 @@ function theme_links($links, $delimiter
$output = array();
if (is_array($links)) {
- foreach ($links as $key => $link) {
+ while (list($key, $link) = each($links)) {
// Automatically add a class to each link and convert all _ to - for XHTML compliance
if (isset($link['attributes']) && isset($link['attributes']['class'])) {
$link['attributes']['class'] .= ' '. str_replace('_', '-', $key);
@@ -698,7 +700,7 @@ function theme_table($header, $rows, $at
if (count($header)) {
$ts = tablesort_init($header);
$output .= '
';
- foreach ($header as $cell) {
+ while (list($key, $cell) = each($header)) {
$cell = tablesort_header($cell, $header, $ts);
$output .= _theme_table_cell($cell, TRUE);
}
@@ -708,12 +710,12 @@ function theme_table($header, $rows, $at
// Format the table rows:
$output .= "
\n";
if (count($rows)) {
- foreach ($rows as $number => $row) {
+ while (list($number, $row) = each($rows)) {
$attributes = array();
// Check if we're dealing with a simple or complex row
if (isset($row['data'])) {
- foreach ($row as $key => $value) {
+ while (list($key, $value) = each($row)) {
if ($key == 'data') {
$cells = $value;
}
@@ -738,7 +740,7 @@ function theme_table($header, $rows, $at
// Build row
$output .= ' ';
$i = 0;
- foreach ($cells as $cell) {
+ while (list($key, $cell) = each($cells)) {
$cell = tablesort_cell($cell, $header, $ts, $i++);
$output .= _theme_table_cell($cell);
}
@@ -854,10 +856,10 @@ function theme_item_list($items = array(
if (!empty($items)) {
$output .= "<$type" . drupal_attributes($attributes) . '>';
- foreach ($items as $item) {
+ while (list($k, $item) = each($items)) {
$attributes = array();
if (is_array($item)) {
- foreach ($item as $key => $value) {
+ while (list($key, $value) = each($item)) {
if ($key == 'data') {
$data = $value;
}
@@ -928,7 +930,7 @@ function theme_blocks($region) {
$output = '';
if ($list = block_list($region)) {
- foreach ($list as $key => $block) {
+ while (list($key, $block) = each($list)) {
// $key == module_delta
$output .= theme('block', $block);
}
@@ -1024,5 +1026,4 @@ function _theme_table_cell($cell, $heade
}
return $output;
-}
-
+}
\ No newline at end of file
Index: includes/xmlrpc.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/xmlrpc.inc,v
retrieving revision 1.37
diff -u -F^f -r1.37 xmlrpc.inc
--- includes/xmlrpc.inc 13 Jul 2006 18:24:23 -0000 1.37
+++ includes/xmlrpc.inc 11 Aug 2006 16:40:27 -0000
@@ -28,7 +28,7 @@ function xmlrpc_value($data, $type = FAL
$xmlrpc_value->type = $type;
if ($type == 'struct') {
// Turn all the values in the array into new xmlrpc_values
- foreach ($xmlrpc_value->data as $key => $value) {
+ while (list($key, $value) = each($xmlrpc_value->data)) {
$xmlrpc_value->data[$key] = xmlrpc_value($value);
}
}
@@ -104,7 +104,7 @@ function xmlrpc_value_get_xml($xmlrpc_va
break;
case 'array':
$return = ''."\n";
- foreach ($xmlrpc_value->data as $item) {
+ while (list($key, $item) = each($xmlrpc_value->data)) {
$return .= ' '. xmlrpc_value_get_xml($item) ."\n";
}
$return .= '';
@@ -112,7 +112,7 @@ function xmlrpc_value_get_xml($xmlrpc_va
break;
case 'struct':
$return = ''."\n";
- foreach ($xmlrpc_value->data as $name => $value) {
+ while (list($name, $value) = each($xmlrpc_value->data)) {
$return .= " ". check_plain($name) ."";
$return .= xmlrpc_value_get_xml($value)."\n";
}
@@ -332,7 +332,7 @@ function xmlrpc_request($method, $args)
EOD;
- foreach ($xmlrpc_request->args as $arg) {
+ while (list($key, $arg) = each($xmlrpc_request->args)) {
$xmlrpc_request->xml .= '';
$v = xmlrpc_value($arg);
$xmlrpc_request->xml .= xmlrpc_value_get_xml($v);
@@ -429,7 +429,7 @@ function _xmlrpc() {
if (is_array($args[0])) {
$method = 'system.multicall';
$multicall_args = array();
- foreach ($args[0] as $call) {
+ while (list($key, $call) = each($args[0])) {
$multicall_args[] = array('methodName' => array_shift($call),'params' => $call);
}
$args = array($multicall_args);
Index: includes/xmlrpcs.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/xmlrpcs.inc,v
retrieving revision 1.21
diff -u -F^f -r1.21 xmlrpcs.inc
--- includes/xmlrpcs.inc 5 Jul 2006 11:45:51 -0000 1.21
+++ includes/xmlrpcs.inc 11 Aug 2006 16:40:27 -0000
@@ -38,7 +38,8 @@ function xmlrpc_server($callbacks) {
// We build an array of all method names by combining the built-ins
// with those defined by modules implementing the _xmlrpc hook.
// Built-in methods are overridable.
- foreach (array_merge($defaults, (array)$callbacks) as $key => $callback) {
+ $merged = array_merge($defaults, (array)$callbacks);
+ while (list($key, $callback) = each($merged)) {
// we could check for is_array($callback)
if (is_int($key)) {
$method = $callback[0];
@@ -163,7 +164,7 @@ function xmlrpc_server_call($xmlrpc_serv
return xmlrpc_error(-32602, t('Server error. Wrong number of method parameters.'));
}
// Check the argument types
- foreach ($signature as $key => $type) {
+ while (list($key, $type) = each($signature)) {
$arg = $args[$key];
switch ($type) {
case 'int':
@@ -218,7 +219,7 @@ function xmlrpc_server_multicall($method
// See http://www.xmlrpc.com/discuss/msgReader$1208
$return = array();
$xmlrpc_server = xmlrpc_server_get();
- foreach ($methodcalls as $call) {
+ while (list($key, $call) = each($methodcalls)) {
$ok = TRUE;
if (!isset($call['methodName']) || !isset($call['params'])) {
$result = xmlrpc_error(3, t('Invalid syntax for system.multicall.'));
@@ -300,7 +301,7 @@ function xmlrpc_server_method_signature(
}
// We array of types
$return = array();
- foreach ($xmlrpc_server->signatures[$methodname] as $type) {
+ while (list($key, $type) = each($xmlrpc_server->signatures[$methodname])) {
$return[] = $type;
}
return $return;
Index: modules/watchdog/watchdog.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/watchdog/watchdog.module,v
retrieving revision 1.147
diff -u -F^f -r1.147 watchdog.module
--- modules/watchdog/watchdog.module 10 Aug 2006 15:42:33 -0000 1.147
+++ modules/watchdog/watchdog.module 11 Aug 2006 16:40:27 -0000
@@ -87,7 +87,8 @@ function watchdog_overview() {
$classes = array(WATCHDOG_NOTICE => 'watchdog-notice', WATCHDOG_WARNING => 'watchdog-warning', WATCHDOG_ERROR => 'watchdog-error');
$names['all'] = t('all messages');
- foreach (_watchdog_get_message_types() as $type) {
+ $types = _watchdog_get_message_types();
+ while (list($key, $type) = each($types)) {
$names[$type] = t('%type messages', array('%type' => t($type)));
}