myviews.tpl 2.81 KB
Newer Older
Clare Lenihan's avatar
Clare Lenihan committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{include file="header.tpl"}
{include file="sidebar.tpl"}
{include file="columnleftstart.tpl"}
<h2>My Views</h2>

<div class="fr"><span class="addicon"><a href="{$WWWROOT}view/edit.php">{str tag="createview" section="view"}</a></span></div>
<br>

{if $views}
<table>

{foreach from=$views item=view}
    <tr class="{cycle values=r0,r1}">
    <td>
    {if !$view.submittedto}
        <button class="fr" type="button"><strong>{str tag="deletethisview" section="view"}</strong></button>
        <button class="fr" type="button"><strong>{str tag ="editthisview" section="view"}</strong></button>
    {/if}
    <h3><a href="{$WWWROOT}view/view.php?id={$view.id}">{$view.title|escape}</a></h3>
    {if $view.description}
        {$view.description}
    {/if}
    {if !$view.submittedto}
        <button type="button">{str tag="editviewnameanddescription" section="view"}</button>
    {/if}
    <ul>
    {if $view.artefacts}
        <li>
        {str tag="artefactsinthisview" section="view"}:
        {foreach from=$view.artefacts item=artefact name=artefacts}
            <a href="{$WWWROOT}view/artefact.php?artefact={$artefact.id}&amp;view={$view.id}">{$artefact.title|escape}</a>{if !$smarty.foreach.artefacts.last}, {/if}
        {/foreach}
        </li>
    {/if}
    <li>
    {if $view.access}
        {$view.access}
        <br>
    {/if}
    {if $view.accessgroups}
        {str tag="whocanseethisview" section="view"}:
        {foreach from=$view.accessgroups item=accessgroup name=artefacts}
            {if $accessgroup.accesstype == 'loggedin'}
                {str tag="loggedin" section="view"}{elseif $accessgroup.accesstype == 'public'}
                {str tag="public" section="view"}{elseif $accessgroup.accesstype == 'friends'}
                <a href="{$WWWROOT}user/">{str tag="friends" section="view"}</a>{elseif $accessgroup.accesstype == 'group'}
                <a href="{$WWWROOT}group/view.php?id={$accessgroup.id}">{$accessgroup.name|escape}</a>{elseif $accessgroup.accesstype == 'tutorgroup'}
                <a href="{$WWWROOT}group/view.php?id={$accessgroup.id}">{$accessgroup.name|escape} ({str tag="tutors" section="view"})</a>{elseif $accessgroup.accesstype == 'user'}
                <a href="{$WWWROOT}user/view.php?id={$accessgroup.id}">{$accessgroup.id|display_name|escape}</a>{/if}{if !$smarty.foreach.artefacts.last},{/if}
        {/foreach}
    {else}
    {str tag="nobodycanseethisview" section="view"}
    {/if}
    <button type="button">{str tag="editviewaccess" section="view"}</button>
    </li>
    {if $view.submittedto}
        <li>{$view.submittedto}</li>
    {/if}
    </ul>
    {if $view.submitto}
        {$view.submitto}
    {/if}
    </td>
    </tr>
{/foreach}

</table>

<div class="center">{$pagination}</div>

{else}
{str tag="noviews" section="views"}
{/if}

{include file="columnleftend.tpl"}
{include file="footer.tpl"}