From 504a57b238fabb89b07636490087a2bcd81ae77a Mon Sep 17 00:00:00 2001 From: Charlie Root Date: Fri, 6 Jul 2012 18:54:43 -0300 Subject: [PATCH] pkg_edit - add show_disable_value option to select_source xml option --- usr/local/www/pkg_edit.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/usr/local/www/pkg_edit.php b/usr/local/www/pkg_edit.php index faaf992245..9c4841e92d 100755 --- a/usr/local/www/pkg_edit.php +++ b/usr/local/www/pkg_edit.php @@ -58,7 +58,7 @@ function domTT_title($title_msg){ if (!empty($title_msg)){ $title_msg=preg_replace("/\s+/"," ",$title_msg); $title_msg=preg_replace("/'/","\'",$title_msg); - return "onmouseout=\"this.style.color = ''; domTT_mouseout(this, event);\" onmouseover=\"domTT_activate(this, event, 'content', '{$title_msg}', 'trail', true, 'delay', 0, 'fade', 'both', 'fadeMax', 93, 'styleClass', 'niceTitle');\""; + return "onmouseout=\"this.style.color = ''; domTT_mouseout(this, event);\" onmouseover=\"domTT_activate(this, event, 'content', '{$title_msg}', 'trail', true, 'delay', 0, 'fade', 'both', 'fadeMax', 93, 'delay',300,'styleClass', 'niceTitle');\""; } } @@ -596,6 +596,11 @@ if ($pkg['tabs'] <> "") { $source_url = $pkga['source']; eval("\$pkg_source_txt = &$source_url;"); $input=""; + #check if show disable option is present on xml + if(isset($pkga['show_disable_value'])){ + array_push($pkg_source_txt, array(($pkga['source_name']? $pkga['source_name'] : $pkga['name'])=> $pkga['show_disable_value'], + ($pkga['source_value']? $pkga['source_value'] : $pkga['value'])=> $pkga['show_disable_value'])); + } foreach ($pkg_source_txt as $opt) { $source_name =($pkga['source_name']? $opt[$pkga['source_name']] : $opt[$pkga['name']]); $source_value =($pkga['source_value'] ? $opt[$pkga['source_value']] : $opt[$pkga['value']]); @@ -937,7 +942,7 @@ function display_row($trc, $value, $fieldname, $type, $rowhelper, $size) { $fieldname .= '[]'; $multiple = 'multiple'; } - echo "\n"; $ifaces = get_configured_interface_with_descr(); $additional_ifaces = $rowhelper['add_to_interfaces_selection']; if (!empty($additional_ifaces)) @@ -955,7 +960,9 @@ function display_row($trc, $value, $fieldname, $type, $rowhelper, $size) { echo "\n"; break; case "select_source": - echo "\n"; + if(isset($rowhelper['show_disable_value'])) + echo "\n"; $source_url = $rowhelper['source']; eval("\$pkg_source_txt = &$source_url;"); foreach($pkg_source_txt as $opt) {