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