| 4 | | //This program is free software; you can redistribute it and/or |
|---|
| 5 | | //modify it under the terms of the GNU General Public License |
|---|
| 6 | | //as published by the Free Software Foundation; either version 2 |
|---|
| 7 | | //of the License, or (at your option) any later version. |
|---|
| | 4 | // This program is free software; you can redistribute it and/or |
|---|
| | 5 | // modify it under the terms of the GNU General Public License |
|---|
| | 6 | // as published by the Free Software Foundation, version 2 |
|---|
| | 7 | // of the License. |
|---|
| 9 | | //This program is distributed in the hope that it will be useful, |
|---|
| 10 | | //but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 11 | | //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 12 | | //GNU General Public License for more details. |
|---|
| | 9 | // This program is distributed in the hope that it will be useful, |
|---|
| | 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| | 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| | 12 | // GNU General Public License for more details. |
|---|
| 36 | | $txtdom = $active_modules[$key]['rawname']; |
|---|
| 37 | | if ($txtdom == 'core') $txtdom = 'amp'; |
|---|
| 38 | | echo "<tr colspan=\"2\" width='100%'><td><br /><strong>".sprintf("%s",dgettext($txtdom,$active_modules[$key]['name']))."</strong></td></tr>"; |
|---|
| | 26 | |
|---|
| | 27 | $sub_heading_id = $txtdom = $active_modules[$key]['rawname']; |
|---|
| | 28 | if ($active_modules[$key]['rawname'] == 'featurecodeadmin' || ($quietmode && !isset($_REQUEST[$sub_heading_id]))) { |
|---|
| | 29 | continue; // featurecodes are fetched below |
|---|
| | 30 | } |
|---|
| | 31 | if ($txtdom == 'core') { |
|---|
| | 32 | $txtdom = 'amp'; |
|---|
| | 33 | } |
|---|
| | 34 | $sub_heading = dgettext($txtdom,$active_modules[$key]['name']); |
|---|
| | 35 | $module_select[$sub_heading_id] = $sub_heading; |
|---|
| | 36 | $sub_heading .= " "._("Extensions"); |
|---|
| | 37 | $html_txt_arr[$sub_heading] = "<div class=\"$sub_heading_id\"><table border=\"0\" width=\"75%\"><tr colspan=\"2\" width='100%'><td><br /><strong>".sprintf("%s",$sub_heading)."</strong></td></tr>\n"; |
|---|
| 41 | | // if from featurecodeadmin then skip as we deal with those later |
|---|
| 42 | | if ($active_modules[$key]['rawname'] != 'featurecodeadmin') |
|---|
| 43 | | { |
|---|
| 44 | | echo "<tr width=\"90%\"><td>".(trim($description[1])==''?$exten:$description[1])."</td><td width=\"10%\" align=\"right\">".$exten."</td></tr>"; |
|---|
| 45 | | } |
|---|
| | 40 | $html_txt_arr[$sub_heading] .= "<tr width=\"90%\"><td>".(trim($description[1])==''?$exten:$description[1])."</td><td width=\"10%\" align=\"right\">".$exten."</td></tr>\n"; |
|---|
| | 41 | } |
|---|
| | 42 | $html_txt_arr[$sub_heading] .= "</table></div>"; |
|---|
| | 43 | } |
|---|
| | 44 | |
|---|
| | 45 | // Now, get all featurecodes. |
|---|
| | 46 | // |
|---|
| | 47 | $sub_heading_id = 'featurecodeadmin'; |
|---|
| | 48 | if (!$quietmode || isset($_REQUEST[$sub_heading_id])) { |
|---|
| | 49 | $featurecodes = featurecodes_getAllFeaturesDetailed(); |
|---|
| | 50 | $sub_heading = dgettext($txtdom,$active_modules['featurecodeadmin']['name']); |
|---|
| | 51 | $module_select[$sub_heading_id] = $sub_heading; |
|---|
| | 52 | $html_txt_arr[$sub_heading] = "<div class=\"$sub_heading_id\"><table border=\"0\" width=\"75%\"><tr colspan=\"2\" width='100%'><td><br /><strong>".sprintf("%s",$sub_heading)."</strong></td></tr>\n"; |
|---|
| | 53 | foreach ($featurecodes as $item) { |
|---|
| | 54 | $bind_domains = array(); |
|---|
| | 55 | if (isset($bind_domains[$item['modulename']]) || (extension_loaded('gettext') && is_dir("modules/".$item['modulename']."/i18n"))) { |
|---|
| | 56 | if (!isset($bind_domains[$item['modulename']])) { |
|---|
| | 57 | $bind_domains[$item['modulename']] = true; |
|---|
| | 58 | bindtextdomain($item['modulename'],"modules/".$item['modulename']."/i18n"); |
|---|
| | 59 | bind_textdomain_codeset($item['modulename'], 'utf8'); |
|---|
| | 60 | } |
|---|
| 47 | | } |
|---|
| 48 | | // Now, get all featurecodes. Code gracefully 'borrowed' from featurecodeadmin |
|---|
| 49 | | foreach($featurecodes as $item) { |
|---|
| 50 | | $bind_domains = array(); |
|---|
| 51 | | if (isset($bind_domains[$item['modulename']]) || (extension_loaded('gettext') && is_dir("modules/".$item['modulename']."/i18n"))) { |
|---|
| 52 | | if (!isset($bind_domains[$item['modulename']])) { |
|---|
| 53 | | $bind_domains[$item['modulename']] = true; |
|---|
| 54 | | bindtextdomain($item['modulename'],"modules/".$item['modulename']."/i18n"); |
|---|
| 55 | | bind_textdomain_codeset($item['modulename'], 'utf8'); |
|---|
| 56 | | } |
|---|
| | 62 | $moduleena = ($item['moduleenabled'] == 1 ? true : false); |
|---|
| | 63 | $featureena = ($item['featureenabled'] == 1 ? true : false); |
|---|
| | 64 | $featurecodedefault = (isset($item['defaultcode']) ? $item['defaultcode'] : ''); |
|---|
| | 65 | $featurecodecustom = (isset($item['customcode']) ? $item['customcode'] : ''); |
|---|
| | 66 | $thiscode = ($featurecodecustom != '') ? $featurecodecustom : $featurecodedefault; |
|---|
| | 67 | $thismodena = ($moduleena != '') ? $featurecodecustom : $featurecodedefault; |
|---|
| | 68 | $txtdom = $item['modulename']; |
|---|
| | 69 | // if core then get translations from amp |
|---|
| | 70 | if ($txtdom == 'core') { |
|---|
| | 71 | $txtdom = 'amp'; |
|---|
| | 72 | } |
|---|
| | 73 | textdomain($txtdom); |
|---|
| | 74 | if ($featureena && $moduleena) { |
|---|
| | 75 | $html_txt_arr[$sub_heading] .= "<tr width=\"90%\"><td>".sprintf(dgettext($txtdom,$item['featuredescription']))."</td><td width=\"10%\" align=\"right\">".$thiscode."</td></tr>\n"; |
|---|
| | 76 | } |
|---|
| | 77 | } |
|---|
| 58 | | $moduleena = ($item['moduleenabled'] == 1 ? true : false); |
|---|
| 59 | | $featureena = ($item['featureenabled'] == 1 ? true : false); |
|---|
| 60 | | $featurecodedefault = (isset($item['defaultcode']) ? $item['defaultcode'] : ''); |
|---|
| 61 | | $featurecodecustom = (isset($item['customcode']) ? $item['customcode'] : ''); |
|---|
| 62 | | $thiscode = ($featurecodecustom != '') ? $featurecodecustom : $featurecodedefault; |
|---|
| 63 | | $thismodena = ($moduleena != '') ? $featurecodecustom : $featurecodedefault; |
|---|
| 64 | | $txtdom = $item['modulename']; |
|---|
| 65 | | // if core then get translations from amp |
|---|
| 66 | | if ($txtdom == 'core') $txtdom = 'amp'; |
|---|
| 67 | | textdomain($txtdom); |
|---|
| 68 | | if ($featureena == true && $moduleena == true) |
|---|
| 69 | | echo "<tr width=\"90%\"><td>".sprintf(dgettext($txtdom,$item['featuredescription']))."</td><td width=\"10%\" align=\"right\">".$thiscode."</td></tr>"; |
|---|
| 70 | | }; |
|---|
| | 79 | $html_txt_arr[$sub_heading] .= "</table></div>"; |
|---|
| | 80 | ksort($html_txt_arr); |
|---|
| | 81 | $html_txt .= implode("\n",$html_txt_arr); |
|---|
| | 82 | |
|---|
| | 83 | if (!$quietmode) { |
|---|
| | 84 | asort($module_select); |
|---|
| | 85 | $rnav_txt = '<div class="rnav"><form name="print" action="'.$_SERVER['PHP_SELF'].'?quietmode=on&'.$_SERVER['QUERY_STRING'].'" target=\"_blank\" method="post"><ul>'; |
|---|
| | 86 | foreach ($module_select as $id => $sub) { |
|---|
| | 87 | $rnav_txt .= "<li><input type=\"checkbox\" value=\"$id\" name=\"$id\" id=\"$id\" class=\"disp_filter\" CHECKED /><label id=\"lab_$id\" name=\"lab_$id\" for=\"$id\">$sub</label></li>\n"; |
|---|
| | 88 | } |
|---|
| | 89 | $rnav_txt .= "</ul><hr><div style=\"text-align:center\"><input type=\"submit\" value=\""._("Printer Friendly Page")."\" /></div>\n"; |
|---|
| | 90 | echo $rnav_txt; |
|---|