);
INSERT INTO actor.toolbar(org,label,layout) VALUES
- ( 1, 'circ', '["circ_checkout","circ_checkin","toolbarseparator","search_opac","copy_status","toolbarseparator","patron_search","patron_register","toolbarspacer","hotkeys_toggle"]' ),
- ( 1, 'cat', '["circ_checkin","toolbarseparator","search_opac","copy_status","toolbarseparator","create_marc","authority_manage","retrieve_last_record","toolbarspacer","hotkeys_toggle"]' );
+ ( 1, 'circ', '["circ_checkout","circ_checkin","toolbarseparator.1","search_opac","copy_status","toolbarseparator.2","patron_search","patron_register","toolbarspacer.3","hotkeys_toggle"]' ),
+ ( 1, 'cat', '["circ_checkin","toolbarseparator.1","search_opac","copy_status","toolbarseparator.2","create_marc","authority_manage","retrieve_last_record","toolbarspacer.3","hotkeys_toggle"]' );
-- INSERT INTO permission.grp_perm_map (grp, perm, depth, grantable) SELECT pgt.id, perm.id, aout.depth, FALSE FROM permission.grp_tree pgt, permission.perm_list perm, actor.org_unit_type aout WHERE pgt.name = 'Staff' AND aout.name = 'Branch' AND perm.code = 'ADMIN_TOOLBAR';
INSERT INTO actor.toolbar(org,label,layout) VALUES
- ( 1, 'circ', '["circ_checkout","circ_checkin","toolbarseparator","search_opac","copy_status","toolbarseparator","patron_search","patron_register","toolbarspacer","hotkeys_toggle"]' ),
- ( 1, 'cat', '["circ_checkin","toolbarseparator","search_opac","copy_status","toolbarseparator","create_marc","authority_manage","retrieve_last_record","toolbarspacer","hotkeys_toggle"]' );
+ ( 1, 'circ', '["circ_checkout","circ_checkin","toolbarseparator.1","search_opac","copy_status","toolbarseparator.2","patron_search","patron_register","toolbarspacer.3","hotkeys_toggle"]' ),
+ ( 1, 'cat', '["circ_checkin","toolbarseparator.1","search_opac","copy_status","toolbarseparator.2","create_marc","authority_manage","retrieve_last_record","toolbarspacer.3","hotkeys_toggle"]' );
-- delete from permission.grp_perm_map where perm in (select id from permission.perm_list where code ~ 'TOOLBAR'); delete from permission.perm_list where code ~ 'TOOLBAR'; drop table actor.toolbar ;
if (!def) def = util.functional.find_list( this.data.list.atb, function(e) { return e.label == button_bar; } );
if (!def) {
dump('Could not find layout for specified toolbar. Defaulting to a stock toolbar.\n');
- layout = [ 'circ_checkin', 'toolbarseparator', 'toolbarspacer', 'hotkeys_toggle' ];
+ layout = ["circ_checkout","circ_checkin","toolbarseparator","search_opac","copy_status","toolbarseparator","patron_search","patron_register","toolbarspacer","hotkeys_toggle"];
} else {
layout = JSON2js(def.layout());
}
// create new one
for (var i = 0; i < layout.length; i++) {
var e = layout[i];
- switch(e) {
- case 'toolbarseparator':
+ if (e.match('toolbarseparator')) {
toolbar.appendChild( document.createElement('toolbarseparator') );
- break;
- case 'toolbarspacer':
- var spacer = document.createElement('toolbarspacer');
- spacer.setAttribute('flex','1');
- toolbar.appendChild( spacer );
- break;
- default:
- var templates = $('palette').getElementsByAttribute('templateid',e);
- var template = templates.length > 0 ? templates[0] : null;
- if (template) {
- var clone = template.cloneNode(true);
- toolbar.appendChild( clone );
- } else {
- var label = document.createElement('label');
- label.setAttribute('value',e);
- toolbar.appendChild( label );
- }
+ } else if (e.match('toolbarspacer')) {
+ var spacer = document.createElement('toolbarspacer');
+ spacer.setAttribute('flex','1');
+ toolbar.appendChild( spacer );
+ } else {
+ var templates = $('palette').getElementsByAttribute('templateid',e);
+ var template = templates.length > 0 ? templates[0] : null;
+ if (template) {
+ var clone = template.cloneNode(true);
+ toolbar.appendChild( clone );
+ } else {
+ var label = document.createElement('label');
+ label.setAttribute('value',e);
+ toolbar.appendChild( label );
+ }
}
}
toolbar.setAttribute('hidden','false');
var value = g.layout[i];
var label;
- switch(value) {
- case 'toolbarseparator':
- label = $('adminStrings').getString('staff.admin.toolbar.toolbar_separator.list_entry');
- break;
- case 'toolbarspacer':
- label = $('adminStrings').getString('staff.admin.toolbar.toolbar_spacer.list_entry');
- break;
- default:
- label = g.data.toolbar_buttons[value];
- seen[value] = true;
- break;
+ if (value.match('toolbarseparator')) {
+ label = $('adminStrings').getString('staff.admin.toolbar.toolbar_separator.list_entry');
+ } else if (value.match('toolbarspacer')) {
+ label = $('adminStrings').getString('staff.admin.toolbar.toolbar_spacer.list_entry');
+ } else {
+ label = g.data.toolbar_buttons[value];
+ seen[value] = true;
}
var rdata3 = g.list3.append({
for (var i = values_to_add.length - 1; i >= 0; i--) { // iterate backwards so that we add them forwards
if (!values_to_add[i]) { continue; }
+ if (values_to_add[i].match('toolbarseparator') || values_to_add[i].match('toolbarspacer')) {
+ values_to_add[i] = values_to_add[i] + '.' + (new Date()).getTime();
+ }
g.layout.splice(add_after_this_position,0,values_to_add[i]);
}