diff --git a/page.printextensions.php b/page.printextensions.php index 82e8ecc..9e98b5e 100644 --- a/page.printextensions.php +++ b/page.printextensions.php @@ -12,39 +12,49 @@ // GNU General Public License for more details. $dispnum = 'printextensions'; +$tabindex = isset($tabindex) && $tabindex ? $tabindex : 0; $exact = false; if (isset($_POST['search_pattern'])) { - if (isset($_POST['exact'])) { - $search_pattern = $_POST['search_pattern']; - $exact = true; - } else if (isset($_POST['bounded'])) { - $search_pattern = '/^'.$_POST['search_pattern'].'$/'; - } else if (isset($_POST['regex'])) { - $search_pattern = '/'.$_POST['search_pattern'].'/'; - } + if (isset($_POST['exact'])) { + $search_pattern = $_POST['search_pattern']; + $exact = true; + } else if (isset($_POST['bounded'])) { + $search_pattern = '/^'.$_POST['search_pattern'].'$/'; + } else if (isset($_POST['regex'])) { + $search_pattern = '/'.$_POST['search_pattern'].'/'; + } } else { - $search_pattern = ''; + $search_pattern = ''; } if (!$quietmode) { -?> -

-
- - - - - - - - - -
- " tabindex=""> - " tabindex=""> - " tabindex=""> -
-
- +

+
+ + + + + + + + + +
+ + + + + " tabindex=""> + " tabindex=""> + " tabindex=""> +
+
+ $discription, + 'status' => 'INUSE', + 'edit_url' => 'config.php?type=setup&display=did&extdisplay=' . $exten + ); + } +} + if ($search_pattern != '') { - $found=0; - foreach ($full_list as $module => $entries) { - $this_module = $module; - foreach (array_keys($entries) as $exten) { - if (($exact === true && $search_pattern != $exten) || ($exact === false && !preg_match($search_pattern,$exten))) { - unset($full_list[$module][$exten]); - } else { - $found++; - if ($exact && $found == 1) { - $found_url = $full_list[$module][$exten]['edit_url']; - } - } - if (!count($full_list[$this_module])) { - unset($full_list[$this_module]); - } - } - } + $found=0; + foreach ($full_list as $module => $entries) { + $this_module = $module; + foreach (array_keys($entries) as $exten) { + if (($exact === true && $search_pattern != $exten) + || ($exact === false && !preg_match($search_pattern,$exten))) { + unset($full_list[$module][$exten]); + } else { + $found++; + if ($exact && $found == 1) { + $found_url = $full_list[$module][$exten]['edit_url']; + } + } + if (!count($full_list[$this_module])) { + unset($full_list[$this_module]); + } + } + } } if ($exact && $found ==1) { - redirect($found_url); + redirect($found_url); } if ($search_pattern != '' && $found == 0) { - $html_txt .= '

'._("No Matches for the Requested Search").'





'; + $html_txt .= '

'._("No Matches for the Requested Search").'





'; } foreach ($full_list as $key => $value) { $sub_heading_id = $txtdom = $active_modules[$key]['rawname']; - if ($active_modules[$key]['rawname'] == 'featurecodeadmin' || ($quietmode && !isset($_REQUEST[$sub_heading_id]))) { + + if (isset($active_modules[$key]['rawname']) && $active_modules[$key]['rawname'] == 'featurecodeadmin' + || ($quietmode && !isset($_REQUEST[$sub_heading_id]))) { continue; // featurecodes are fetched below } - if ($txtdom == 'core') { + if ($key == 'did') { + $txtdom = 'amp'; + $active_modules[$key]['name'] = 'Inbound Routes'; + $core_heading = $sub_heading = dgettext($txtdom, $active_modules[$key]['name']); + } elseif ($txtdom == 'core') { $txtdom = 'amp'; $active_modules[$key]['name'] = 'Extensions'; - $core_heading = $sub_heading = dgettext($txtdom,$active_modules[$key]['name']); + $core_heading = $sub_heading = dgettext($txtdom, $active_modules[$key]['name']); } else { - $sub_heading = dgettext($txtdom,$active_modules[$key]['name']); + $sub_heading = dgettext($txtdom, $active_modules[$key]['name']); } $module_select[$sub_heading_id] = $sub_heading; $textext = _("Extension"); $html_txt_arr[$sub_heading] = "
\n"; foreach ($value as $exten => $item) { $description = explode(":",$item['description'],2); - $label_desc = trim($description[1])==''?$exten:$description[1]; - if ($quietmode) { - $label_exten = $exten; - } else { - $label_exten = "$exten"; - $label_desc = "$label_desc"; - } + $label_desc = trim($description[1])==''?$exten:$description[1]; + if ($quietmode) { + $label_exten = $exten; + } else { + $label_exten = "$exten"; + $label_desc = "$label_desc"; + } $html_txt_arr[$sub_heading] .= "\n"; } $html_txt_arr[$sub_heading] .= "

".sprintf("%s",$sub_heading)."

".$textext."
$label_desc".$label_exten."
"; @@ -129,7 +160,9 @@ function core_top($a, $b) { } } -if (is_array($html_txt_arr)) uksort($html_txt_arr, 'core_top'); +if (is_array($html_txt_arr)) { + uksort($html_txt_arr, 'core_top'); +} if (!$quietmode) { //asort($module_select); if (is_array($module_select)) uasort($module_select, 'core_top'); @@ -145,7 +178,8 @@ function core_top($a, $b) { $html_txt_arr[$sub_heading] = "
\n"; foreach ($featurecodes as $item) { $bind_domains = array(); - if (isset($bind_domains[$item['modulename']]) || (extension_loaded('gettext') && is_dir("modules/".$item['modulename']."/i18n"))) { + if (isset($bind_domains[$item['modulename']]) + || (extension_loaded('gettext') && is_dir("modules/".$item['modulename']."/i18n"))) { if (!isset($bind_domains[$item['modulename']])) { $bind_domains[$item['modulename']] = true; bindtextdomain($item['modulename'],"modules/".$item['modulename']."/i18n"); @@ -158,11 +192,11 @@ function core_top($a, $b) { $featurecodecustom = (isset($item['customcode']) ? $item['customcode'] : ''); $thiscode = ($featurecodecustom != '') ? $featurecodecustom : $featurecodedefault; - if ($search_pattern != '') { - if (!isset($full_list['featurecodeadmin'][$thiscode])) { - continue; - } - } + if ($search_pattern != '') { + if (!isset($full_list['featurecodeadmin'][$thiscode])) { + continue; + } + } $txtdom = $item['modulename']; // if core then get translations from amp @@ -171,54 +205,55 @@ function core_top($a, $b) { } textdomain($txtdom); if ($featureena && $moduleena) { - $label_desc = sprintf(dgettext($txtdom,$item['featuredescription'])); - if (!$quietmode) { - $thiscode = "$thiscode"; - $label_desc = "$label_desc"; - } + $label_desc = sprintf(dgettext($txtdom,$item['featuredescription'])); + if (!$quietmode) { + $thiscode = "$thiscode"; + $label_desc = "$label_desc"; + } $html_txt_arr[$sub_heading] .= "\n"; } } } + $html_txt_arr[$sub_heading] .= "

".sprintf("%s",$sub_heading)."
$label_desc".$thiscode."
"; $html_txt .= implode("\n",$html_txt_arr); if (!$quietmode && ($search_pattern == '' || $found > 0)) { $rnav_txt = '
'; - $rnav_txt .= ''; - $rnav_txt .= ''; - $rnav_txt .= ''; - if ($search_pattern != '') { - $rnav_txt .= ''; - if (isset($_POST['exact'])) { - $rnav_txt .= ''; - } else if (isset($_POST['bounded'])) { - $rnav_txt .= ''; - } else if (isset($_POST['regex'])) { - $rnav_txt .= ''; - } - } - - $rnav_txt .= '
+
\n"; - echo $rnav_txt; -?> - - -"; -?> + echo $html_txt.""; +?> \ No newline at end of file