Skip to content

Commit

Permalink
MDL-20438 updated response format support
Browse files Browse the repository at this point in the history
Multiple component updates are supported now. Code cleanup and
refactoring.
  • Loading branch information
mudrd8mz committed Mar 30, 2012
1 parent 3204dae commit 7d8de6d
Show file tree
Hide file tree
Showing 3 changed files with 219 additions and 192 deletions.
18 changes: 9 additions & 9 deletions admin/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ public function plugins_overview_panel(plugin_manager $pluginman) {
if (!$plugin->is_standard()) {
$numextension++;
}
if ($plugin->available_update()) {
if ($plugin->available_updates()) {
$numupdatable++;
}
}
Expand Down Expand Up @@ -779,10 +779,11 @@ public function plugins_control_panel(plugin_manager $pluginman) {
$requiredby = '';
}

if ($updateinfo = $plugin->available_update()) {
$updateinfo = $this->plugin_available_update_info($updateinfo);
} else {
$updateinfo = '';
$updateinfo = '';
if (is_array($plugin->available_updates())) {
foreach ($plugin->available_updates() as $availableupdate) {
$updateinfo .= $this->plugin_available_update_info($availableupdate);
}
}

$notes = new html_table_cell($requiredby.$updateinfo);
Expand All @@ -801,12 +802,11 @@ public function plugins_control_panel(plugin_manager $pluginman) {
* Helper method to render the information about the available update
*
* The passed objects always provides at least the 'version' property containing
* the (higher) version of the plugin available. Other properties may be provided, see
* the specification of the protocol used by {@link available_update_checker}.
* the (higher) version of the plugin available.
*
* @param stdClass $updateinfo information about the available update for the plugin
* @param available_update_info $updateinfo information about the available update for the plugin
*/
protected function plugin_available_update_info(stdClass $updateinfo) {
protected function plugin_available_update_info(available_update_info $updateinfo) {

$box = $this->output->box_start('pluginupdateinfo');
$box .= html_writer::tag('div', get_string('updateavailable', 'core_plugin', $updateinfo->version), array('class' => 'version'));
Expand Down
Loading

0 comments on commit 7d8de6d

Please sign in to comment.