jbe/bsw@0: function ui_deprecated.link(args) jbe/bsw@0: if args.action then jbe/bsw@0: local params = {} jbe/bsw@0: if args.params then jbe/bsw@0: for key, value in pairs(args.params) do jbe/bsw@0: params[key] = value jbe/bsw@0: end jbe/bsw@0: end jbe/bsw@0: ui_deprecated._prepare_redirect_params(params, args.redirect_to) jbe/bsw@0: jbe/bsw@0: local attr_action = args.url or encode.url{ jbe/bsw@0: module = args.module or request.get_module(), jbe/bsw@0: action = args.action, jbe/bsw@0: id = args.id, jbe/bsw@0: params = params jbe/bsw@0: } jbe/bsw@0: local attr_class = table.concat({ 'ui_link', args.class }, ' ') jbe/bsw@0: local attr_target = args.target or '' jbe/bsw@0: local redirect_to = args.redirect_to jbe/bsw@0: local unique_id = "unique_" .. multirand.string(32, "abcdefghijklmnopqrstuvwxyz0123456789") jbe/bsw@0: slot.put( jbe/bsw@0: '
', jbe/bsw@0: '") jbe/bsw@0: else jbe/bsw@0: local attr_class = table.concat({ 'ui_link', args.class }, ' ') jbe/bsw@0: slot.put( jbe/bsw@0: '' jbe/bsw@0: ) jbe/bsw@0: if args.icon then jbe/bsw@0: ui_deprecated.image{ image = 'ui/icon/' .. args.icon } jbe/bsw@0: end jbe/bsw@0: if args.image then jbe/bsw@0: ui_deprecated.image{ image = args.image } jbe/bsw@0: end jbe/bsw@0: if args.label then jbe/bsw@0: slot.put(args.label) jbe/bsw@0: end jbe/bsw@0: slot.put('') jbe/bsw@0: end jbe/bsw@0: end