. /** * This file contains backup and restore output renderers * * @package moodlecore * @copyright 2010 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ /** * The primary renderer for the backup. * * Can be retrieved with the following code: * get_renderer('core','backup'); * ?> * * @copyright 2010 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class core_backup_renderer extends plugin_renderer_base { /** * Renderers a progress bar for the backup or restore given the items that * make it up. * @param array $items An array of items * @return string */ public function progress_bar(array $items) { foreach ($items as &$item) { $text = $item['text']; unset($item['text']); if (array_key_exists('link', $item)) { $link = $item['link']; unset($item['link']); $item = html_writer::link($link, $text, $item); } else { $item = html_writer::tag('span', $text, $item); } } return html_writer::tag('div', join(get_separator(), $items), array('class'=>'backup_progress clearfix')); } /** * Prints a dependency notification * @param string $message * @return string */ public function dependency_notification($message) { return html_writer::tag('div', $message, array('class'=>'notification dependencies_enforced')); } }