| 1 |
<?php |
<?php |
| 2 |
// $Id: update.compare.inc,v 1.8.2.5 2009/06/09 11:08:32 goba Exp $ |
// $Id: update.compare.inc,v 1.8.2.6 2009/09/28 13:22:02 goba Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 52 |
*/ |
*/ |
| 53 |
function _update_process_info_list(&$projects, $list, $project_type) { |
function _update_process_info_list(&$projects, $list, $project_type) { |
| 54 |
foreach ($list as $file) { |
foreach ($list as $file) { |
| 55 |
if (empty($file->status)) { |
// A disabled base theme of an enabled sub-theme still has all of its code |
| 56 |
|
// run by the sub-theme, so we include it in our "enabled" projects list. |
| 57 |
|
if (!$file->status && !empty($file->sub_themes)) { |
| 58 |
|
foreach ($file->sub_themes as $key => $name) { |
| 59 |
|
// Build a list of enabled sub-themes. |
| 60 |
|
if ($list[$key]->status) { |
| 61 |
|
$file->enabled_sub_themes[$key] = $name; |
| 62 |
|
} |
| 63 |
|
} |
| 64 |
|
// If there are no enabled subthemes, we should ingore this theme and go |
| 65 |
|
// on to the next one. |
| 66 |
|
if (empty($file->enabled_sub_themes)) { |
| 67 |
|
continue; |
| 68 |
|
} |
| 69 |
|
} |
| 70 |
|
elseif (empty($file->status)) { |
| 71 |
// Skip disabled modules or themes. |
// Skip disabled modules or themes. |
| 72 |
continue; |
continue; |
| 73 |
} |
} |
| 104 |
} |
} |
| 105 |
|
|
| 106 |
$project_name = $file->info['project']; |
$project_name = $file->info['project']; |
| 107 |
|
|
| 108 |
|
// Add a list of sub-themes that "depend on" the project and a list of base |
| 109 |
|
// themes that are "required by" the project. |
| 110 |
|
if ($project_name == 'drupal') { |
| 111 |
|
// Drupal core is always required, so this extra info would be noise. |
| 112 |
|
$sub_themes = array(); |
| 113 |
|
$base_themes = array(); |
| 114 |
|
} |
| 115 |
|
else { |
| 116 |
|
// Add list of enabled sub-themes. |
| 117 |
|
$sub_themes = !empty($file->enabled_sub_themes) ? $file->enabled_sub_themes : array(); |
| 118 |
|
// Add list of base themes. |
| 119 |
|
$base_themes = !empty($file->base_themes) ? $file->base_themes : array(); |
| 120 |
|
} |
| 121 |
|
|
| 122 |
if (!isset($projects[$project_name])) { |
if (!isset($projects[$project_name])) { |
| 123 |
// Only process this if we haven't done this project, since a single |
// Only process this if we haven't done this project, since a single |
| 124 |
// project can have multiple modules or themes. |
// project can have multiple modules or themes. |
| 128 |
'datestamp' => $file->info['datestamp'], |
'datestamp' => $file->info['datestamp'], |
| 129 |
'includes' => array($file->name => $file->info['name']), |
'includes' => array($file->name => $file->info['name']), |
| 130 |
'project_type' => $project_name == 'drupal' ? 'core' : $project_type, |
'project_type' => $project_name == 'drupal' ? 'core' : $project_type, |
| 131 |
|
'sub_themes' => $sub_themes, |
| 132 |
|
'base_themes' => $base_themes, |
| 133 |
); |
); |
| 134 |
} |
} |
| 135 |
else { |
else { |
| 136 |
$projects[$project_name]['includes'][$file->name] = $file->info['name']; |
$projects[$project_name]['includes'][$file->name] = $file->info['name']; |
| 137 |
$projects[$project_name]['info']['_info_file_ctime'] = max($projects[$project_name]['info']['_info_file_ctime'], $file->info['_info_file_ctime']); |
$projects[$project_name]['info']['_info_file_ctime'] = max($projects[$project_name]['info']['_info_file_ctime'], $file->info['_info_file_ctime']); |
| 138 |
$projects[$project_name]['datestamp'] = max($projects[$project_name]['datestamp'], $file->info['datestamp']); |
$projects[$project_name]['datestamp'] = max($projects[$project_name]['datestamp'], $file->info['datestamp']); |
| 139 |
|
$projects[$project_name]['sub_themes'] = array_merge($projects[$project_name]['sub_themes'], $sub_themes); |
| 140 |
|
$projects[$project_name]['base_themes'] = array_merge($projects[$project_name]['base_themes'], $base_themes); |
| 141 |
} |
} |
| 142 |
} |
} |
| 143 |
} |
} |