| 1984 | | |
|---|
| 1985 | | //check for module-specific destination functions |
|---|
| 1986 | | foreach ($active_modules as $rawmod => $module) { |
|---|
| 1987 | | $funct = strtolower($rawmod.'_destinations'); |
|---|
| 1988 | | |
|---|
| 1989 | | //if the modulename_destinations() function exits, run it and display selections for it |
|---|
| 1990 | | if (function_exists($funct)) { |
|---|
| 1991 | | $destArray = $funct(); //returns an array with 'destination' and 'description', and optionally 'category' |
|---|
| 1992 | | if (is_Array($destArray)) { |
|---|
| 1993 | | foreach ($destArray as $dest) { |
|---|
| 1994 | | $cat = (isset($dest['category']) ? $dest['category'] : $module['displayname']); |
|---|
| 1995 | | $all_destinations[$cat][] = $dest; |
|---|
| 1996 | | $module_hash[$cat] = $rawmod; |
|---|
| 1997 | | } |
|---|
| 1998 | | } |
|---|
| 1999 | | } |
|---|
| 2000 | | } |
|---|
| | 2000 | // check for module-specific destination functions |
|---|
| | 2001 | // if isset() then we called this once, so don't call again just use the data |
|---|
| | 2002 | // this can result in significant savings in IVRs and other pages that present |
|---|
| | 2003 | // multiple destinations |
|---|
| | 2004 | // |
|---|
| | 2005 | if (!isset($drawselect_destinations)) { |
|---|
| | 2006 | foreach ($active_modules as $rawmod => $module) { |
|---|
| | 2007 | $funct = strtolower($rawmod.'_destinations'); |
|---|
| | 2008 | |
|---|
| | 2009 | //if the modulename_destinations() function exits, run it and display selections for it |
|---|
| | 2010 | if (function_exists($funct)) { |
|---|
| | 2011 | $destArray = $funct(); //returns an array with 'destination' and 'description', and optionally 'category' |
|---|
| | 2012 | if (is_Array($destArray)) { |
|---|
| | 2013 | foreach ($destArray as $dest) { |
|---|
| | 2014 | $cat = (isset($dest['category']) ? $dest['category'] : $module['displayname']); |
|---|
| | 2015 | $drawselect_destinations[$cat][] = $dest; |
|---|
| | 2016 | $drawselects_module_hash[$cat] = $rawmod; |
|---|
| | 2017 | } |
|---|
| | 2018 | } |
|---|
| | 2019 | } |
|---|
| | 2020 | } |
|---|
| | 2021 | if (!isset($drawselect_destinations)) { |
|---|
| | 2022 | $drawselect_destinations = array(); |
|---|
| | 2023 | } |
|---|
| | 2024 | if (!isset($drawselects_module_hash)) { |
|---|
| | 2025 | $drawselects_module_hash = array(); |
|---|
| | 2026 | } |
|---|
| | 2027 | } |
|---|
| 2026 | | bindtextdomain($module_hash[$cat],"modules/".$module_hash[$cat]."/i18n"); |
|---|
| 2027 | | bind_textdomain_codeset($module_hash[$cat], 'utf8'); |
|---|
| 2028 | | $label_text = dgettext($module_hash[$cat],$cat); |
|---|
| | 2053 | bindtextdomain($drawselects_module_hash[$cat],"modules/".$drawselects_module_hash[$cat]."/i18n"); |
|---|
| | 2054 | bind_textdomain_codeset($drawselects_module_hash[$cat], 'utf8'); |
|---|
| | 2055 | $label_text = dgettext($drawselects_module_hash[$cat],$cat); |
|---|