%doc> Creates a jquery dialog box that opens when javascript function insertImageDialog is called, allows user to select an image and specify attributes for it, then passes img tag with base64 encoded data url to a callback javascript function. Accepts the following options: callback - pass the html for the selected img to this javascript function; if omitted, will only include fields for viewing/uploading image url - to redirect to after upload, otherwise just refreshes dialog window %doc> <% include('/elements/xmlhttp.html', 'url' => $fsurl.'misc/xmlhttp-template_image.cgi', 'subs' => [ 'get_template_image' ], ) %>
<% emt('Upload New Image') %>
<% include('/elements/form-file_upload.html', 'name' => 'TemplateImageUploadForm', 'id' => 'TemplateImageUploadForm', 'action' => $fsurl.'misc/process/template_image-upload.cgi', 'num_files' => 1, 'fields' => [ 'name', 'agentnum' ], 'url' => $opt{'url'} || 'javascript:refreshImageList(1)', ) %> <% &ntable("#cccccc", 2) %> <% include( '/elements/tr-input-text.html', 'field' => 'name', 'label' => 'Name', 'required' => 1, 'id' => 'upload_form_name', ) %> <% include( '/elements/tr-select-agent.html', 'label' => "Agent", 'empty_label' => '(global)', 'agent_virt' => 1, 'agent_null_right' => 'Edit global templates', ) %> <% include( '/elements/tr-file-upload.html', 'field' => 'file', 'label' => 'File', ) %><% emt('Image Preview') %>
(<% emt('Loading image...') %>)