Commit 3fba3a02 authored by Martyn Smith's avatar Martyn Smith Committed by Martyn Smith
Browse files

pass viewid to artefact renderers

parent 1623f172
......@@ -291,7 +291,7 @@ function template_locate($templatename, $fetchdb=true) {
*
* @returns string the html of the rendered template
*/
function template_render($template, $mode, $data=array()) {
function template_render($template, $mode, $data=array(), $view_id=null) {
if (isset($template['parseddata'])) {
$td = $template['parseddata'];
}
......@@ -316,6 +316,10 @@ function template_render($template, $mode, $data=array()) {
$options = array();
if ($view_id) {
$options['viewid'] = $view_id;
}
if (isset($t['width']) && isset($t['height'])) {
$attr['style'][] = 'width: ' . $t['width'] . 'px;height: ' . $t['height'] . 'px;';
$options['width'] = $t['width'];
......
......@@ -290,7 +290,7 @@ class View {
$template = template_locate($this->get('template'));
return template_render($template, TEMPLATE_RENDER_READONLY, $data);
return template_render($template, TEMPLATE_RENDER_READONLY, $data, $this->get('id'));
}
public function delete() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment