| @@ 264-289 (lines=26) @@ | ||
| 261 | * |
|
| 262 | * @return array|bool |
|
| 263 | */ |
|
| 264 | public function get_handler_field_info_by_field_variable($variable) |
|
| 265 | { |
|
| 266 | $variable = Database::escape_string($variable); |
|
| 267 | $sql = "SELECT * FROM {$this->table} |
|
| 268 | WHERE |
|
| 269 | variable = '$variable' AND |
|
| 270 | extra_field_type = $this->extraFieldType"; |
|
| 271 | $result = Database::query($sql); |
|
| 272 | if (Database::num_rows($result)) { |
|
| 273 | $row = Database::fetch_array($result, 'ASSOC'); |
|
| 274 | $row['display_text'] = ExtraField::translateDisplayName($row['variable'], $row['display_text']); |
|
| 275 | ||
| 276 | // All the options of the field |
|
| 277 | $sql = "SELECT * FROM $this->table_field_options |
|
| 278 | WHERE field_id='".intval($row['id'])."' |
|
| 279 | ORDER BY option_order ASC"; |
|
| 280 | $result = Database::query($sql); |
|
| 281 | while ($option = Database::fetch_array($result)) { |
|
| 282 | $row['options'][$option['id']] = $option; |
|
| 283 | } |
|
| 284 | ||
| 285 | return $row; |
|
| 286 | } else { |
|
| 287 | return false; |
|
| 288 | } |
|
| 289 | } |
|
| 290 | ||
| 291 | /** |
|
| 292 | * Get all the field info for tags |
|
| @@ 297-322 (lines=26) @@ | ||
| 294 | * |
|
| 295 | * @return array|bool |
|
| 296 | */ |
|
| 297 | public function get_handler_field_info_by_tags($variable) |
|
| 298 | { |
|
| 299 | $variable = Database::escape_string($variable); |
|
| 300 | $sql = "SELECT * FROM {$this->table} |
|
| 301 | WHERE |
|
| 302 | variable = '$variable' AND |
|
| 303 | extra_field_type = $this->extraFieldType"; |
|
| 304 | $result = Database::query($sql); |
|
| 305 | if (Database::num_rows($result)) { |
|
| 306 | $row = Database::fetch_array($result, 'ASSOC'); |
|
| 307 | $row['display_text'] = ExtraField::translateDisplayName($row['variable'], $row['display_text']); |
|
| 308 | ||
| 309 | // All the tags of the field |
|
| 310 | $sql = "SELECT * FROM $this->table_field_tag |
|
| 311 | WHERE field_id='".intval($row['id'])."' |
|
| 312 | ORDER BY id ASC"; |
|
| 313 | $result = Database::query($sql); |
|
| 314 | while ($option = Database::fetch_array($result, 'ASSOC')) { |
|
| 315 | $row['options'][$option['id']] = $option; |
|
| 316 | } |
|
| 317 | ||
| 318 | return $row; |
|
| 319 | } else { |
|
| 320 | return false; |
|
| 321 | } |
|
| 322 | } |
|
| 323 | ||
| 324 | /** |
|
| 325 | * @param int $fieldId |
|