From 2613bc1c3b1dacfd68ad65f75ebf2237be74a4ba Mon Sep 17 00:00:00 2001 From: Denis Ovsienko Date: Mon, 7 Apr 2008 23:37:25 +0000 Subject: [PATCH] r1848 + finally stick with 2 OPTGROUP styles --- inc/functions.php | 4 ++-- inc/interface.php | 13 ++++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/inc/functions.php b/inc/functions.php index 5524e955..dff84292 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -1175,7 +1175,7 @@ function parseWikiLink ($line, $which, $strip_optgroup = FALSE) if (preg_match ('/^\[\[.+\]\]$/', $line) == 0) { if ($strip_optgroup) - return ereg_replace ('^.+\^', '', $line); + return ereg_replace ('^.+\^', '', ereg_replace ('^(.+)&', '\\1 ', $line)); else return $line; } @@ -1183,7 +1183,7 @@ function parseWikiLink ($line, $which, $strip_optgroup = FALSE) $s = explode ('|', $line); $o_value = trim ($s[0]); if ($strip_optgroup) - $o_value = ereg_replace ('^.+\^', '', $o_value); + $o_value = ereg_replace ('^.+\^', '', ereg_replace ('^(.+)&', '\\1 ', $o_value)); $a_value = trim ($s[1]); if ($which == 'a') return "${o_value}"; diff --git a/inc/interface.php b/inc/interface.php index 75da850e..6f5a7455 100644 --- a/inc/interface.php +++ b/inc/interface.php @@ -522,6 +522,11 @@ function printSelect ($rowList, $select_name, $selected_id = 1) $tmp = explode ('^', $dict_value, 2); $optgroup[$tmp[0]][$dict_key] = $tmp[1]; } + elseif (strpos ($dict_value, '&') !== FALSE) + { + $tmp = explode ('&', $dict_value, 2); + $optgroup[$tmp[0]][$dict_key] = $tmp[1]; + } else $other[$dict_key] = $dict_value; } @@ -702,7 +707,6 @@ function renderRackObject ($object_id = 0) echo "Barcode:${info['barcode']}\n"; if ($info['has_problems'] == 'yes') echo "Has problems\n"; - $attrs = getAttrValues ($object_id, TRUE); foreach (getAttrValues ($object_id, TRUE) as $record) if (!empty ($record['value'])) echo "${record['name']}:${record['a_value']}\n"; @@ -5172,4 +5176,11 @@ function renderTagRollerForRow () renderTagSelect(); } +function dump ($var) +{ + echo '
';
+	print_r ($var);
+	echo '
'; +} + ?> -- 2.25.1