Commit cec6ede2 authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files

Allow the filelist template to include images and folders. Made an

upgrade for this. Fixed a foreach warning in lib/view.php
parent e721e459
......@@ -26,6 +26,8 @@
defined('INTERNAL') || die();
require_once('template.php');
function xmldb_core_upgrade($oldversion=0) {
$status = true;
......@@ -219,7 +221,6 @@ function xmldb_core_upgrade($oldversion=0) {
}
if ($oldversion < 2007021600) {
require_once('template.php');
$template = template_parse('gallery');
upgrade_template('gallery', $template);
}
......@@ -229,6 +230,11 @@ function xmldb_core_upgrade($oldversion=0) {
insert_record('event_type', (object)array('name' => 'deleteview'));
}
if ($oldversion < 2007021902) {
$template = template_parse('filelist');
upgrade_template('filelist', $template);
}
return $status;
}
......
......@@ -8,11 +8,11 @@
<tr>
<td>
{{block type="label" id="tpl_fileslabel1"}}<br>
{{block type="artefact" id="tpl_files1" artefacttype="file" format="listself"}}<br>
{{block type="artefact" id="tpl_files1" plugintype="file" format="listself"}}<br>
{{block type="label" id="tpl_fileslabel2"}}<br>
{{block type="artefact" id="tpl_files2" artefacttype="file" format="listself"}}<br>
{{block type="artefact" id="tpl_files2" plugintype="file" format="listself"}}<br>
{{block type="label" id="tpl_fileslabel3"}}<br>
{{block type="artefact" id="tpl_files3" artefacttype="file" format="listself"}}<br>
{{block type="artefact" id="tpl_files3" plugintype="file" format="listself"}}<br>
</td>
<td>{{block type="label" id="tpl_freelabel"}}</td>
</tr>
......
......@@ -27,7 +27,7 @@
defined('INTERNAL') || die();
$config = new StdClass;
$config->version = 2007021901;
$config->version = 2007021902;
$config->release = '0.7.0.dev';
$config->minupgradefrom = 2007011600;
$config->minupgraderelease = '0.4.0 (build tag BUILD_20070122)';
......
......@@ -205,15 +205,17 @@ class View {
public function find_artefact_children($artefact, $allchildren, &$refs) {
$children = array();
foreach ($allchildren as $child) {
if ($child->parent != $artefact->id) {
continue;
if ($allchildren) {
foreach ($allchildren as $child) {
if ($child->parent != $artefact->id) {
continue;
}
$children[$child->id] = array();
$children[$child->id]['artefact'] = $child;
$refs[$child->id] = $child;
$children[$child->id]['children'] = $this->find_artefact_children($child,
$allchildren, $refs);
}
$children[$child->id] = array();
$children[$child->id]['artefact'] = $child;
$refs[$child->id] = $child;
$children[$child->id]['children'] = $this->find_artefact_children($child,
$allchildren, $refs);
}
return $children;
......
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