-
Notifications
You must be signed in to change notification settings - Fork 0
/
renderer.php
23 lines (18 loc) · 1003 Bytes
/
renderer.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
class block_scratch_pad_renderer extends plugin_renderer_base {
public function html() {
$html = '';
$html .= html_writer::start_tag('div', array('class'=>'tools'));
foreach(['#f00', '#ff0', '#0f0', '#0ff', '#00f', '#f0f', '#000', '#fff'] as $color) {
$html .= "<a href='#scratch_pad_canvas' data-color='" .$color. "' style='background: " .$color. ";'></a>";
}
$html .= html_writer::end_tag('div');
$html .= html_writer::start_tag('div', array('class'=>'tools'));
foreach([3, 5, 10, 15] as $size) {
$html .= "<a href='#scratch_pad_canvas' data-size='" .$size. "' style='background:#000;padding: " .$size. "px;border-radius: 50%;margin: 0 5px;'></a>";
}
$html .= html_writer::end_tag('div');
$html .= html_writer::tag('a', 'Start', array('class'=>'btn btn-success btn-sm', 'id'=>'startCanvas'));
return html_writer::tag('div', $html, array('style'=>'text-align:center;min-height: 50px;'));
}
}