| 37 | | |
|---|
| 38 | | ?> |
|---|
| 39 | | <script type="text/javascript" src="common/tabber-minimized.js"></script> |
|---|
| 40 | | <script type="text/javascript"> |
|---|
| 41 | | function toggleInfoPane(pane) { |
|---|
| 42 | | var style = document.getElementById(pane).style; |
|---|
| 43 | | if (style.display == 'none' || style.display == '') { |
|---|
| 44 | | style.display = 'block'; |
|---|
| 45 | | } else { |
|---|
| 46 | | style.display = 'none'; |
|---|
| 47 | | } |
|---|
| 48 | | } |
|---|
| 49 | | |
|---|
| 50 | | function check_upgrade_all() { |
|---|
| 51 | | var re = /^moduleaction\[([a-z0-9_\-]+)\]$/; |
|---|
| 52 | | for(i=0; i<document.modulesGUI.elements.length; i++) { |
|---|
| 53 | | if (document.modulesGUI.elements[i].value == 'upgrade' || document.modulesGUI.elements[i].value == 'install' ) { |
|---|
| 54 | | if (match = document.modulesGUI.elements[i].name.match(re)) { |
|---|
| 55 | | // check the box |
|---|
| 56 | | document.modulesGUI.elements[i].checked = true; |
|---|
| 57 | | // expand info pane |
|---|
| 58 | | document.getElementById('infopane_'+match[1]).style.display = 'block'; |
|---|
| 59 | | } |
|---|
| 60 | | } |
|---|
| 61 | | } |
|---|
| 62 | | } |
|---|
| 63 | | |
|---|
| 64 | | function check_download_all() { |
|---|
| 65 | | var re = /^moduleaction\[([a-z0-9_\-]+)\]$/; |
|---|
| 66 | | for(i=0; i<document.modulesGUI.elements.length; i++) { |
|---|
| 67 | | if (document.modulesGUI.elements[i].value == 'downloadinstall') { |
|---|
| 68 | | if (match = document.modulesGUI.elements[i].name.match(re)) { |
|---|
| 69 | | // check the box |
|---|
| 70 | | document.modulesGUI.elements[i].checked = true; |
|---|
| 71 | | // expand info pane |
|---|
| 72 | | document.getElementById('infopane_'+match[1]).style.display = 'block'; |
|---|
| 73 | | } |
|---|
| 74 | | } |
|---|
| 75 | | } |
|---|
| 76 | | } |
|---|
| 77 | | |
|---|
| 78 | | |
|---|
| 79 | | function showhide_upgrades() { |
|---|
| 80 | | var upgradesonly = document.getElementById('show_upgradable_only').checked; |
|---|
| 81 | | |
|---|
| 82 | | var module_re = /^module_([a-z0-9_]+)$/; // regex to match a module element id |
|---|
| 83 | | var cat_re = /^category_([a-zA-Z0-9_]+)$/; // regex to match a category element id |
|---|
| 84 | | |
|---|
| 85 | | var elements = document.getElementById('modulelist').getElementsByTagName('li'); |
|---|
| 86 | | |
|---|
| 87 | | // loop through all modules, check if there is an upgrade_<module> radio box |
|---|
| 88 | | for(i=0; i<elements.length; i++) { |
|---|
| 89 | | if (match = elements[i].id.match(module_re)) { |
|---|
| 90 | | if (!document.getElementById('upgrade_'+match[1])) { |
|---|
| 91 | | // not upgradable |
|---|
| 92 | | document.getElementById('module_'+match[1]).style.display = upgradesonly ? 'none' : 'block'; |
|---|
| 93 | | } |
|---|
| 94 | | } |
|---|
| 95 | | } |
|---|
| 96 | | |
|---|
| 97 | | |
|---|
| 98 | | |
|---|
| 99 | | // hide category headings that don't have any visible modules |
|---|
| 100 | | |
|---|
| 101 | | var elements = document.getElementById('modulelist').getElementsByTagName('div'); |
|---|
| 102 | | // loop through category items |
|---|
| 103 | | for(i=0; i<elements.length; i++) { |
|---|
| 104 | | if (elements[i].id.match(cat_re)) { |
|---|
| 105 | | var subelements = elements[i].getElementsByTagName('li'); |
|---|
| 106 | | var display = false; |
|---|
| 107 | | for(j=0; j<subelements.length; j++) { |
|---|
| 108 | | // loop through children <li>'s, find names that are module element id's |
|---|
| 109 | | if (subelements[j].id.match(module_re) && subelements[j].style.display != 'none') { |
|---|
| 110 | | // if at least one is visible, we're displaying this element |
|---|
| 111 | | display = true; |
|---|
| 112 | | break; // no need to go further |
|---|
| | 37 | if (!$quietmode) { |
|---|
| | 38 | ?> |
|---|
| | 39 | <script type="text/javascript" src="common/tabber-minimized.js"></script> |
|---|
| | 40 | <script type="text/javascript"> |
|---|
| | 41 | function toggleInfoPane(pane) { |
|---|
| | 42 | var style = document.getElementById(pane).style; |
|---|
| | 43 | if (style.display == 'none' || style.display == '') { |
|---|
| | 44 | style.display = 'block'; |
|---|
| | 45 | } else { |
|---|
| | 46 | style.display = 'none'; |
|---|
| | 47 | } |
|---|
| | 48 | } |
|---|
| | 49 | |
|---|
| | 50 | function check_upgrade_all() { |
|---|
| | 51 | var re = /^moduleaction\[([a-z0-9_\-]+)\]$/; |
|---|
| | 52 | for(i=0; i<document.modulesGUI.elements.length; i++) { |
|---|
| | 53 | if (document.modulesGUI.elements[i].value == 'upgrade' || document.modulesGUI.elements[i].value == 'install' ) { |
|---|
| | 54 | if (match = document.modulesGUI.elements[i].name.match(re)) { |
|---|
| | 55 | // check the box |
|---|
| | 56 | document.modulesGUI.elements[i].checked = true; |
|---|
| | 57 | // expand info pane |
|---|
| | 58 | document.getElementById('infopane_'+match[1]).style.display = 'block'; |
|---|
| 115 | | |
|---|
| 116 | | document.getElementById(elements[i].id).style.display = display ? 'block' : 'none'; |
|---|
| 117 | | } |
|---|
| 118 | | } |
|---|
| 119 | | |
|---|
| 120 | | } |
|---|
| 121 | | |
|---|
| 122 | | </script> |
|---|
| 123 | | <?php |
|---|
| 124 | | |
|---|
| 125 | | echo "<h2>" . _("Module Administration") . "</h2>"; |
|---|
| | 61 | } |
|---|
| | 62 | } |
|---|
| | 63 | |
|---|
| | 64 | function check_download_all() { |
|---|
| | 65 | var re = /^moduleaction\[([a-z0-9_\-]+)\]$/; |
|---|
| | 66 | for(i=0; i<document.modulesGUI.elements.length; i++) { |
|---|
| | 67 | if (document.modulesGUI.elements[i].value == 'downloadinstall') { |
|---|
| | 68 | if (match = document.modulesGUI.elements[i].name.match(re)) { |
|---|
| | 69 | // check the box |
|---|
| | 70 | document.modulesGUI.elements[i].checked = true; |
|---|
| | 71 | // expand info pane |
|---|
| | 72 | document.getElementById('infopane_'+match[1]).style.display = 'block'; |
|---|
| | 73 | } |
|---|
| | 74 | } |
|---|
| | 75 | } |
|---|
| | 76 | } |
|---|
| | 77 | |
|---|
| | 78 | |
|---|
| | 79 | function showhide_upgrades() { |
|---|
| | 80 | var upgradesonly = document.getElementById('show_upgradable_only').checked; |
|---|
| | 81 | |
|---|
| | 82 | var module_re = /^module_([a-z0-9_]+)$/; // regex to match a module element id |
|---|
| | 83 | var cat_re = /^category_([a-zA-Z0-9_]+)$/; // regex to match a category element id |
|---|
| | 84 | |
|---|
| | 85 | var elements = document.getElementById('modulelist').getElementsByTagName('li'); |
|---|
| | 86 | |
|---|
| | 87 | // loop through all modules, check if there is an upgrade_<module> radio box |
|---|
| | 88 | for(i=0; i<elements.length; i++) { |
|---|
| | 89 | if (match = elements[i].id.match(module_re)) { |
|---|
| | 90 | if (!document.getElementById('upgrade_'+match[1])) { |
|---|
| | 91 | // not upgradable |
|---|
| | 92 | document.getElementById('module_'+match[1]).style.display = upgradesonly ? 'none' : 'block'; |
|---|
| | 93 | } |
|---|
| | 94 | } |
|---|
| | 95 | } |
|---|
| | 96 | |
|---|
| | 97 | |
|---|
| | 98 | |
|---|
| | 99 | // hide category headings that don't have any visible modules |
|---|
| | 100 | |
|---|
| | 101 | var elements = document.getElementById('modulelist').getElementsByTagName('div'); |
|---|
| | 102 | // loop through category items |
|---|
| | 103 | for(i=0; i<elements.length; i++) { |
|---|
| | 104 | if (elements[i].id.match(cat_re)) { |
|---|
| | 105 | var subelements = elements[i].getElementsByTagName('li'); |
|---|
| | 106 | var display = false; |
|---|
| | 107 | for(j=0; j<subelements.length; j++) { |
|---|
| | 108 | // loop through children <li>'s, find names that are module element id's |
|---|
| | 109 | if (subelements[j].id.match(module_re) && subelements[j].style.display != 'none') { |
|---|
| | 110 | // if at least one is visible, we're displaying this element |
|---|
| | 111 | display = true; |
|---|
| | 112 | break; // no need to go further |
|---|
| | 113 | } |
|---|
| | 114 | } |
|---|
| | 115 | |
|---|
| | 116 | document.getElementById(elements[i].id).style.display = display ? 'block' : 'none'; |
|---|
| | 117 | } |
|---|
| | 118 | } |
|---|
| | 119 | |
|---|
| | 120 | } |
|---|
| | 121 | |
|---|
| | 122 | function process_module_actions(actions) { |
|---|
| | 123 | freepbx_modal_show('moduleBox'); |
|---|
| | 124 | urlStr = "config.php?type=tool&display=modules&extdisplay=process&quietmode=1"; |
|---|
| | 125 | for (var i in actions) { |
|---|
| | 126 | urlStr += "&moduleaction["+i+"]="+actions[i]; |
|---|
| | 127 | } |
|---|
| | 128 | $('#moduleBox').html('<iframe src="'+urlStr+'"></iframe>'); |
|---|
| | 129 | } |
|---|
| | 130 | function close_module_actions(goback) { |
|---|
| | 131 | //freepbx_modal_close('moduleBox'); |
|---|
| | 132 | freepbx_modal_hide('moduleBox'); |
|---|
| | 133 | if (goback) { |
|---|
| | 134 | location.href = 'config.php?display=modules&type=tool&online=<?php echo ($_REQUEST['online']?1:0); ?>'; |
|---|
| | 135 | } |
|---|
| | 136 | } |
|---|
| | 137 | |
|---|
| | 138 | </script> |
|---|
| | 139 | <div id="moduleBox" style="display:none;"> |
|---|
| | 140 | </div> |
|---|
| | 141 | <?php |
|---|
| | 142 | |
|---|
| | 143 | echo "<h2>" . _("Module Administration") . "</h2>"; |
|---|
| | 144 | } else { |
|---|
| | 145 | // $quietmode==true |
|---|
| | 146 | ?> |
|---|
| | 147 | <html><head> |
|---|
| | 148 | <link href="common/mainstyle.css" rel="stylesheet" type="text/css" /> |
|---|
| | 149 | </head><body> |
|---|
| | 150 | <?php |
|---|
| | 151 | } |
|---|