| | 102 | } |
|---|
| | 103 | |
|---|
| | 104 | function featurecodeamin_getdest($exten) { |
|---|
| | 105 | return array("ext-featurecodes,$exten,1"); |
|---|
| | 106 | } |
|---|
| | 107 | |
|---|
| | 108 | function featurecodeamin_getdestinfo($dest) { |
|---|
| | 109 | if (substr(trim($dest),0,17) == 'ext-featurecodes,') { |
|---|
| | 110 | $fcs = featurecodes_getAllFeaturesDetailed(); |
|---|
| | 111 | $found = false; |
|---|
| | 112 | foreach ($fcs as $fc) { |
|---|
| | 113 | if ($fc['destination'] == $dest) { |
|---|
| | 114 | $desc = $fc['description']; |
|---|
| | 115 | $found = true; |
|---|
| | 116 | break; |
|---|
| | 117 | } |
|---|
| | 118 | } |
|---|
| | 119 | if (!$found) { |
|---|
| | 120 | return array(); |
|---|
| | 121 | } else { |
|---|
| | 122 | return array( |
|---|
| | 123 | 'description' => $desc, |
|---|
| | 124 | 'edit_url' => 'config.php?display=featurecodeadmin', |
|---|
| | 125 | ); |
|---|
| | 126 | } |
|---|
| | 127 | } else { |
|---|
| | 128 | return false; |
|---|
| | 129 | } |
|---|
| | 130 | } |
|---|
| | 131 | |
|---|
| | 132 | function featurecodes_check_destinations($dest=true) { |
|---|
| | 133 | global $active_modules; |
|---|
| | 134 | |
|---|
| | 135 | $fcs = featurecodeadmin_destinations(); |
|---|
| | 136 | |
|---|
| | 137 | $destlist = array(); |
|---|
| | 138 | if (is_array($dest) && empty($dest)) { |
|---|
| | 139 | return $destlist; |
|---|
| | 140 | } |
|---|
| | 141 | |
|---|
| | 142 | $results = array(); |
|---|
| | 143 | foreach ($fcs as $fc) { |
|---|
| | 144 | if (in_array($fc['destination'], $destlist)) { |
|---|
| | 145 | $results[] = $fc; |
|---|
| | 146 | } |
|---|
| | 147 | } |
|---|
| | 148 | |
|---|
| | 149 | foreach ($results as $result) { |
|---|
| | 150 | $destlist[] = array( |
|---|
| | 151 | 'dest' => $result['destination'], |
|---|
| | 152 | 'description' => $result['description'], |
|---|
| | 153 | 'edit_url' => 'config.php?display=featurecodeadmin', |
|---|
| | 154 | ); |
|---|
| | 155 | } |
|---|
| | 156 | return $destlist; |
|---|