Merge remote-tracking branch 'origin/new/bug_8315'
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / authorities-toolbar.inc
1 <div id="toolbar">
2 <script type="text/javascript">
3         //<![CDATA[
4
5         // prepare DOM for YUI Toolbar
6
7          $(document).ready(function() {
8             $("#newmenuc").empty();
9             $("#delAuthc").empty();
10         $("#savemenuc").empty();
11             yuiToolbar();
12          });
13
14         // YUI Toolbar Functions
15
16         function yuiToolbar() {   
17         
18                 var newmenu = [
19                         [% FOREACH authtypesloo IN authtypesloop %]{ text: "[% authtypesloo.authtypetext %]", url: "/cgi-bin/koha/authorities/authorities.pl?authtypecode=[% authtypesloo.value %]"},
20 [% END %]
21                 ]
22
23             new YAHOO.widget.Button({
24                 type: "menu",
25             label: _("New authority"),
26                 name: "newmenubutton",
27                 menu: newmenu,
28                 container: "newmenuc"
29             });  
30                 
31                 var editButton = new YAHOO.widget.Button("editAuth");
32                 
33                 var delAuthButton = new YAHOO.widget.Button({
34           id: "delAuth", 
35           type: "button", 
36           label: _("Delete"), 
37           container: "delAuthc",
38                   onclick: {fn: confirm_deletion }
39         });
40
41         var savemenu = [
42             { text: _("MADS (XML)"), url: "/cgi-bin/koha/authorities/export.pl?format=mads&op=export&authid=[% authid %]" },
43             { text: _("MARCXML"), url: "/cgi-bin/koha/authorities/export.pl?format=marcxml&op=export&authid=[% authid %]" },
44             { text: _("MARC (non-Unicode/MARC-8)"), url: "/cgi-bin/koha/authorities/export.pl?format=marc8&op=export&authid=[% authid %]" },
45             { text: _("MARC (Unicode/UTF-8)"), url: "/cgi-bin/koha/authorities/export.pl?format=utf8&op=export&authid=[% authid %]" },
46         ];
47
48         new YAHOO.widget.Button({
49             type: "menu",
50             label: _("Save"),
51             name: "savemenubutton",
52             menu: savemenu,
53             container: "savemenuc"
54         });
55         }
56
57         //]]>
58         </script>
59   <form name="f2" method="post" action="authorities.pl">        
60   
61 [% IF ( authid ) %]  <a id="editAuth" href="authorities.pl?authid=[% authid %]">Edit</a>
62     
63     [% UNLESS ( count ) %]
64     <span id="delAuthc"><a id="delAuth" href="javascript:confirm_deletion()">Delete</a></span>
65     [% END %]
66     <span id="savemenuc">Save</span>
67 [% ELSE %]&nbsp;[% END %]
68   
69   <span id="newmenuc">
70         <label for="add_authtypecode">New: </label>
71         <select id="add_authtypecode" name="authtypecode">
72 [% FOREACH authtypesloo IN authtypesloop %]
73   [% IF ( authtypesloo.selected ) %]
74         <option value="[% authtypesloo.value %]" selected="selected">[% authtypesloo.authtypetext %]</option>
75   [% ELSE %]
76         <option value="[% authtypesloo.value %]">[% authtypesloo.authtypetext %]</option>
77   [% END %]
78 [% END %]
79         </select>
80       <input type="submit" value="Add" class="button" />
81   </span></form>
82 </div>