[795] | 1 | var externals = function(data) |
---|
| 2 | { |
---|
| 3 | if (_checkError(data)) |
---|
| 4 | return; |
---|
| 5 | |
---|
| 6 | var content_id_3 = document.getElementById("content_id_3"); |
---|
| 7 | if (data.length == 0) |
---|
| 8 | { |
---|
| 9 | var parag = document.createElement("P"); |
---|
| 10 | parag.className = "text_dsp"; |
---|
| 11 | parag.innerHTML = "Não existem aplicações externas"; |
---|
| 12 | content_id_3.appendChild(parag); |
---|
| 13 | } |
---|
| 14 | else |
---|
| 15 | { |
---|
| 16 | elem = document.getElementById("table_ext"); |
---|
| 17 | if (elem) { |
---|
| 18 | elem.parentNode.removeChild(elem); |
---|
| 19 | } |
---|
| 20 | |
---|
| 21 | draw_externals_grid(data, 3); |
---|
| 22 | } |
---|
| 23 | }; |
---|
| 24 | |
---|
| 25 | function draw_externals_folder() |
---|
| 26 | { |
---|
| 27 | cExecute ("$this.bo_userinterface.externals", externals, ""); |
---|
| 28 | } |
---|
| 29 | |
---|
| 30 | function draw_externals_grid(data, page) |
---|
| 31 | { |
---|
[1449] | 32 | |
---|
[795] | 33 | var content_id_3 = document.getElementById("content_id_3"); |
---|
| 34 | |
---|
[1449] | 35 | // altura mínima do conteiner |
---|
[1455] | 36 | if(is_ie){ |
---|
| 37 | content_id_3.style.height = "260px"; |
---|
| 38 | } else { |
---|
| 39 | content_id_3.style.minHeight = "260px"; |
---|
| 40 | } |
---|
[795] | 41 | |
---|
[1449] | 42 | (function loop(i) { |
---|
[795] | 43 | |
---|
[1449] | 44 | if(i < data.length){ |
---|
[795] | 45 | |
---|
[1449] | 46 | var external_link = data[i].wf_ext_link; |
---|
| 47 | var ext = data[i]; |
---|
| 48 | var ext_name_dsp = ext.name; |
---|
[795] | 49 | |
---|
[1449] | 50 | if (ext_name_dsp.length > 40) { |
---|
| 51 | ext_name_dsp = ext_name_dsp.substr(0,40) + "..."; |
---|
| 52 | } |
---|
[795] | 53 | |
---|
[1449] | 54 | var div_element = document.createElement("DIV"); |
---|
[795] | 55 | |
---|
[1449] | 56 | div_element.style.width = '106px'; |
---|
| 57 | if(is_ie) { |
---|
| 58 | div_element.style.styleFloat = "left"; |
---|
| 59 | div_element.style.height = '150px'; |
---|
[795] | 60 | } else { |
---|
[1449] | 61 | div_element.style.cssFloat = "left"; |
---|
| 62 | div_element.style.height = '100px' |
---|
[795] | 63 | } |
---|
| 64 | |
---|
[1449] | 65 | div_element.style.padding = '7px'; |
---|
| 66 | div_element.style.paddingTop = "25px"; |
---|
[795] | 67 | |
---|
[1449] | 68 | div_element.style.cursor = 'pointer'; |
---|
| 69 | div_element.onclick = function() { var external_window = window.open(external_link,'extwindow'); external_window.opener = null;}; |
---|
| 70 | |
---|
| 71 | |
---|
| 72 | var div_ext_img = document.createElement("DIV"); |
---|
| 73 | div_ext_img.style.width = "100%"; |
---|
| 74 | div_ext_img.style.textAlign = 'center'; |
---|
| 75 | div_ext_img.innerHTML = "<img src ='" + ext.image + "' width='32' height='32'>"; |
---|
| 76 | |
---|
| 77 | var div_ext_txt = document.createElement("DIV"); |
---|
| 78 | div_ext_txt.style.width = "100%"; |
---|
| 79 | div_ext_txt.style.textAlign = 'center'; |
---|
| 80 | div_ext_txt.style.paddingTop = '5px'; |
---|
| 81 | div_ext_txt.innerHTML = '<span style="font-size: 11px !important;">'+ext_name_dsp+'</span>'; |
---|
| 82 | |
---|
| 83 | div_element.appendChild(div_ext_img); |
---|
| 84 | div_element.appendChild(div_ext_txt); |
---|
| 85 | |
---|
| 86 | content_id_3.appendChild(div_element); |
---|
| 87 | |
---|
[795] | 88 | loop(i+1); |
---|
| 89 | } |
---|
[1449] | 90 | })(0) |
---|
[795] | 91 | |
---|
[1449] | 92 | var div_bottom = document.createElement("DIV"); |
---|
| 93 | div_bottom.style.width = "100%"; |
---|
| 94 | div_bottom.style.clear = 'both'; |
---|
| 95 | |
---|
| 96 | content_id_3.appendChild(div_bottom); |
---|
| 97 | |
---|
[795] | 98 | } |
---|