Commit 3ceceba2 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

View user lists viewable views

parent b9861502
......@@ -212,6 +212,7 @@ $string['myviews'] = 'My Views';
$string['submitview'] = 'Submit View';
$string['submitviewquestion'] = 'If you submit this view for assessment, you will not be able to edit the view or any of its associated artefacts until your tutor has finished marking the view. Are you sure you want to submit this view now?';
$string['viewdeleted'] = 'View deleted';
$string['views'] = 'Views';
$string['viewsubmittedto'] = 'This view has been submitted to %s';
// view user
......
......@@ -22,6 +22,17 @@
{/if}
{/foreach}
{foreach from=$VIEWS key=key item=item name=view}
{if $smarty.foreach.view.first}
<h4>{str section=mahara tag=views}</h4>
<ul>
{/if}
<li><a href="{$WWWROOT}view/view.php?id={$key}">{$item}</a></li>
{if $smarty.foreach.view.last}
</ul>
{/if}
{/foreach}
</div>
{include file="footer.tpl"}
......@@ -65,6 +65,16 @@ else {
}
}
}
// Get viewable views
$views = array();
if ($allviews = get_records_array('view', 'owner', $userid)) {
foreach ($allviews as $view) {
if (can_view_view($view->id)) {
$views[$view->id] = $view->title;
}
}
}
}
$smarty = smarty();
......@@ -72,6 +82,7 @@ $smarty->assign('searchform',searchform());
$smarty->assign('NAME',$name);
$smarty->assign('USERFIELDS',$userfields);
$smarty->assign('PROFILE',$profile);
$smarty->assign('VIEWS',$views);
$smarty->display('user/view.tpl');
?>
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