diff --git a/admin/tool/monitor/classes/output/managesubs/renderer.php b/admin/tool/monitor/classes/output/managesubs/renderer.php new file mode 100644 index 00000000000..7d0161f258f --- /dev/null +++ b/admin/tool/monitor/classes/output/managesubs/renderer.php @@ -0,0 +1,79 @@ +. + +/** + * Renderer class for manage subscriptions page. + * + * @package tool_monitor + * @copyright 2014 onwards Ankit Agarwal + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +namespace tool_monitor\output\managesubs; + +defined('MOODLE_INTERNAL') || die; + +/** + * Renderer class for manage subscriptions page. + * + * @since Moodle 2.8 + * @package tool_monitor + * @copyright 2014 onwards Ankit Agarwal + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class renderer extends \plugin_renderer_base { + + /** + * Get html to display on the page. + * + * @param subs $renderable renderable widget + * + * @return string to display on the mangesubs page. + */ + protected function render_subs(subs $renderable) { + $o = $this->render_table($renderable); + return $o; + } + + /** + * Get html to display on the page. + * + * @param rules $renderable renderable widget + * + * @return string to display on the mangesubs page. + */ + protected function render_rules(rules $renderable) { + $o = $this->render_table($renderable); + return $o; + } + + /** + * Get html to display on the page. + * + * @param rules|subs $renderable renderable widget + * + * @return string to display on the mangesubs page. + */ + protected function render_table($renderable) { + $o = ''; + ob_start(); + $renderable->out($renderable->pagesize, true); + $o = ob_get_contents(); + ob_end_clean(); + + return $o; + } +}