| Line 152... |
Line 152... |
| 152 |
echo $this->ToString(); |
152 |
echo $this->ToString(); |
| 153 |
|
153 |
|
| 154 |
// Return true |
154 |
// Return true |
| 155 |
return true; |
155 |
return true; |
| 156 |
} |
156 |
} |
| - |
|
157 |
|
| - |
|
158 |
function FillFields($data) { |
| - |
|
159 |
foreach($data as $key => $value) { |
| - |
|
160 |
$this->HTML = preg_replace('/<input type="text" name="' . $key . '\" ([^>]+)>/', '<input type="text" name="' . $key . '" value="' . $value . '"$1>', $this->HTML); |
| - |
|
161 |
$this->HTML = preg_replace('/<textarea name="' . $key . '\"([^>]*)><\/textarea>/', '<textarea name="' . $key . '"$1>' . $value . '</textarea>', $this->HTML); |
| - |
|
162 |
|
| - |
|
163 |
if ( isset($value) ) { |
| - |
|
164 |
$this->HTML = preg_replace('/<input type="checkbox" name="' . $key . '\" ([^>]+)>/', '<input type="checkbox" name="' . $key . '" checked="checked"$1>', $this->HTML); |
| - |
|
165 |
|
| - |
|
166 |
if ( preg_match('/<input type="radio" name="' . $key .'" value="' . $value . '" ([^>]+)>/', $this->HTML)) { |
| - |
|
167 |
$this->HTML = preg_replace('/<input type="radio" name="' . $key .'" value="' . $value . '" ([^>]+)>/', '<input type="radio" name="' . $key . '" value="' . $value . '" checked="checked"$1>', $this->HTML); |
| - |
|
168 |
} |
| - |
|
169 |
} |
| - |
|
170 |
|
| - |
|
171 |
if ( preg_match('/<select name="' . $key . '"([^>]*)>(.*)<option value="' . $value . '"(.*)<\/select>/s', $this->HTML) ) { |
| - |
|
172 |
$this->HTML = preg_replace('/<select name="' . $key . '"([^>]*)>(.*)<option value="' . $value . '"(.*)<\/select>/s', |
| - |
|
173 |
'<select name="' . $key . '"$1>$2<option value="' . $value . '" selected="selected"$3</select>', $this->HTML); |
| - |
|
174 |
} |
| - |
|
175 |
} |
| - |
|
176 |
} |
| 157 |
} |
177 |
} |
| 158 |
?> |
178 |
?> |
| 159 |
|
179 |
|