Commit efbf9b28 authored by Martyn Smith's avatar Martyn Smith Committed by Martyn Smith
Browse files

Render options passed correcly to the render json script

parent 59cb8b3e
......@@ -32,9 +32,8 @@ require_once('artefact.php');
$id = param_integer('id');
$format = param_variable('format', FORMAT_ARTEFACT_LISTSELF);
$blockid = param_variable('blockid', null);
$options = array();
$options = param_variable('options', array());
log_debug($options);
if($blockid) {
log_debug('using block id: ' . $blockid);
......
......@@ -365,6 +365,7 @@ function template_render($template, $mode, $data=array(), $view_id=null) {
'artefacttype' => isset($t['artefacttype']) ? $t['artefacttype'] : null,
'plugintype' => isset($t['plugintype']) ? $t['plugintype'] : null,
'format' => isset($t['format']) ? $t['format'] : null,
'options' => $options,
);
if ( isset($data[$t['id']]) ) {
......@@ -519,7 +520,14 @@ function template_render($template, $mode, $data=array(), $view_id=null) {
}
replaceChildNodes(real_target, IMG({ src: {$spinner_url} }));
var d = loadJSONDoc('{$wwwroot}json/renderartefact.php', {'id': element.artefactid, 'format': format} );
var render_options = {
'id': element.artefactid,
'format': format
};
for (key in dstData.options) {
render_options['options[' + key + ']'] = dstData.options[key];
}
var d = loadJSONDoc('{$wwwroot}json/renderartefact.php', render_options );
d.addCallbacks(
function (response) {
real_target.innerHTML = response.data;
......
......@@ -178,7 +178,7 @@ foreach (plugins_installed('artefact') as $artefacttype) {
}
$rootinfo = substr($rootinfo, 0, -1) . '];';
$template = template_render($parsed_template, TEMPLATE_RENDER_EDITMODE, array_merge($data, $data['artefacts']));
$template = template_render($parsed_template, TEMPLATE_RENDER_EDITMODE, array_merge($data, $data['artefacts']), $view_id);
$headers = array();
if (isset($parsed_template['css'])) {
......
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