From ea03a6bc2807e5986fd0de8fc9c213b5609a7add Mon Sep 17 00:00:00 2001 From: markjcrane Date: Sat, 15 Aug 2015 19:58:47 -0600 Subject: [PATCH] Make the destinations class easier to read. --- resources/classes/destinations.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/classes/destinations.php b/resources/classes/destinations.php index ec81998200..3f8bff2970 100644 --- a/resources/classes/destinations.php +++ b/resources/classes/destinations.php @@ -192,7 +192,6 @@ class destinations { $response .= " \n"; $label2 = $label; foreach ($row['result']['data'] as $data) { - $did = ($label2 == 'destinations') ? true : false; $select_value = $row['select_value'][$destination_type]; $select_label = $row['select_label']; foreach ($row['field'] as $key => $value) { @@ -218,9 +217,10 @@ class destinations { $select_value = str_replace("\${context}", $_SESSION['context'], $select_value); //to do: context can come from the array $select_label = str_replace("\${domain_name}", $_SESSION['domain_name'], $select_label); $select_label = str_replace("\${context}", $_SESSION['context'], $select_label); + $select_label = trim($select_label); if ($select_value == $destination_value) { $selected = "selected='selected' "; $select_found = true; } else { $selected = ''; } - if ($did) { $select_label = format_phone(trim($select_label)); } - $response .= " \n"; + if ($label2 == 'destinations') { $select_label = format_phone($select_label); } + $response .= " \n"; } $response .= " \n"; unset($text);