1 <!-- BEGIN switch_xs_enabled -->
\r
5 // This will convert simple select box to nicer one with <optgroup> tags.
\r
8 $str = $this->vars['S_JUMPBOX_SELECT'];
\r
11 $pos = strpos($str, '<option');
\r
14 $start = substr($str, 0, $pos);
\r
15 $str = substr($str, $pos, strlen($str));
\r
22 $str = strrev($str);
\r
23 $pos = strpos($str, strrev('</option>'));
\r
26 $end = strrev(substr($str, 0, $pos));
\r
27 $str = substr($str, $pos, strlen($str));
\r
33 $str = trim(strrev($str));
\r
34 // getting all options
\r
35 while(strlen($str) > 0)
\r
37 $pos = strpos($str, '</option>');
\r
41 $item = trim(substr($str, 0, $pos));
\r
42 $str = trim(substr($str, $pos, strlen($str)));
\r
52 $pos = strpos($item, '>') + 1;
\r
54 $text = substr($item, $pos, strlen($item));
\r
55 $item = substr($item, 0, $pos);
\r
56 $pos = strpos($text, '<');
\r
59 $text = substr($text, 0, $pos);
\r
61 // checking if item is selected
\r
62 if(strpos($str1, ' selected'))
\r
67 $pos = strpos($item, 'value="');
\r
71 $str1 = substr($item, $pos, strlen($item));
\r
72 $pos = strpos($str1, '"');
\r
73 $value = substr($str1, 0, $pos);
\r
78 'selected' => $selected
\r
84 for($i=0; $i<count($options); $i++)
\r
86 $item = $options[$i];
\r
87 if(($item['value'] == -1) && ($item['text'] === ' '))
\r
91 $text .= '</optgroup>';
\r
94 if(count($options) - $i >= 2)
\r
96 $item = $options[$i+1];
\r
99 $text .= '<optgroup label="' . $item['text'] . '">';
\r
104 $text .= '<option value="' . $item['value'] . '"';
\r
105 if($item['selected'])
\r
107 $text .= ' selected="selected"';
\r
109 $text .= '>' . $item['text'] . '</option>';
\r
114 $text .= '</optgroup>';
\r
117 $this->vars['S_JUMPBOX_SELECT'] = $text;
\r
120 <!-- END switch_xs_enabled -->
\r
121 <table cellspacing="0" cellpadding="0" border="0">
\r
123 <form method="get" name="jumpbox" action="{S_JUMPBOX_ACTION}" onsubmit="if(document.jumpbox.f.value == -1){return false;}">
\r
124 <td nowrap="nowrap">{S_JUMPBOX_SELECT} <input type="submit" value="{L_GO}" class="liteoption" /> </td>
\r