1 | <div class = "titlePage"> |
---|
2 | <h2>{'Extended author'|@translate}</h2> |
---|
3 | </div> |
---|
4 | |
---|
5 | <!-- create the form for EAeating and editing authors --> |
---|
6 | <form action='{$E_AUTHOR_PATH}-{if $edit == 0}create{else}update{/if}' |
---|
7 | method='POST'> |
---|
8 | <fieldset> |
---|
9 | <legend>{if $edit == 0}{'Create author'|@translate} |
---|
10 | {else}{'Update author'|@translate}{/if}</legend> |
---|
11 | <!-- If $edit != 0 we should remember the id of the author that is |
---|
12 | edited --> |
---|
13 | {if $edit != 0}<input type='hidden' name='id' id='id' value='{$EAid}' />{/if} |
---|
14 | <!-- Put all the attributes of the author in a nice table --> |
---|
15 | <table> |
---|
16 | <tr> |
---|
17 | <td>{'Name'|@translate}</td> |
---|
18 | <td><input type='text' name='name' id='name' value='{$EAname}' /></td> |
---|
19 | </tr> |
---|
20 | <tr> |
---|
21 | <td>{'Code'|@translate}</td> |
---|
22 | <td><input type='text' name='code' id='code' value='{$EAcode}' /></td> |
---|
23 | </tr> |
---|
24 | <tr> |
---|
25 | <td>{'URL'|@translate}</td> |
---|
26 | <td><input type='text' name='url' id='url' value='{$EAurl}' /></td> |
---|
27 | </tr> |
---|
28 | <tr> |
---|
29 | <td>{'Description'|@translate}</td> |
---|
30 | <td><textarea name='descr' id='descr'>{$EAdescr}</textarea></td> |
---|
31 | </tr> |
---|
32 | <tr> |
---|
33 | <td>{'Default'|@translate} {'copright'|@translate}</td> |
---|
34 | <td> |
---|
35 | <select name="copyrightID"> |
---|
36 | <option value="0">--</option> |
---|
37 | {html_options options=$EAcopyrights selected=$EAcopyright_id} |
---|
38 | </select> |
---|
39 | </td> |
---|
40 | </tr> |
---|
41 | <tr> |
---|
42 | <td></td> |
---|
43 | <td><input type='submit' value="{if $edit == 0}{'Create'|@translate}{else}{'Update'|@translate}{/if}" /></td> |
---|
44 | </tr> |
---|
45 | </table> |
---|
46 | </fieldset> |
---|
47 | </form> |
---|
48 | |
---|
49 | <!-- If we are on the 'homepage', show a table of all authors --> |
---|
50 | {if $edit == 0} |
---|
51 | <form> |
---|
52 | <fieldset> |
---|
53 | <legend>{'Edit author'|@translate}</legend> |
---|
54 | <table> |
---|
55 | <tr> |
---|
56 | <!-- create a nice header row --> |
---|
57 | <th>{'Name'|@translate}</th> |
---|
58 | <th>{'Code'|@translate}</th> |
---|
59 | <th>{'URL'|@translate}</th> |
---|
60 | <th>{'Description'|@translate}</th> |
---|
61 | <th>{'Copyright'|@translate}</th> |
---|
62 | <th>{'Actions'|@translate}</th> |
---|
63 | </tr> |
---|
64 | <!-- Loop over all copyrights --> |
---|
65 | {if not empty($EAs)} |
---|
66 | {foreach from=$EAs item=EA} |
---|
67 | {strip} |
---|
68 | <tr class="{cycle values="row1,row2"}"> <!-- This gives nicely colored |
---|
69 | table rows --> |
---|
70 | <td>{$EA.name}</td> |
---|
71 | <td>{$EA.code}</td> |
---|
72 | <td><a href="{$EA.url}">{$EA.url}</a></td> |
---|
73 | <td>{$EA.descr}</td> |
---|
74 | <td>{$EAcopyrights[$EA.copyright_id]}</td> |
---|
75 | <!-- Show nice Edit and Delete icons --> |
---|
76 | <td> |
---|
77 | <a href="{$E_AUTHOR_PATH}-edit&id={$EA.author_id}"> |
---|
78 | <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/edit_s.png" |
---|
79 | alt="{'Edit'|@translate}" title="{'Edit'|@translate}" /> |
---|
80 | </a> |
---|
81 | <a href="{$E_AUTHOR_PATH}-delete&id={$EA.author_id}" onclick="return confirm(document.getElementById('btn_delete').title + '\n\n' + '{'Are you sure?'|@translate|@escape:'javascript'}');"> |
---|
82 | <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/delete.png" |
---|
83 | id="btn_delete" alt="{'Delete'|@translate}" title="{'Delete author'|@translate}" /> |
---|
84 | </a> |
---|
85 | </td> |
---|
86 | </tr> |
---|
87 | {/strip} |
---|
88 | {/foreach} |
---|
89 | {/if} |
---|
90 | </table> |
---|
91 | </fieldset> |
---|
92 | </form> |
---|
93 | {/if} |
---|