ImageChoice PHPRunner Custom Edit Control
========================================

Purpose
-------
ImageChoice displays lookup records as inline image cards and stores one selected value in the current field.
It is useful for small visual choice sets, such as choosing the host team that goes the furthest.

Files
-----
EditImageChoice.php
EditImageChoice.js
imagechoice.css
sample.php

Installation
------------
Copy these files into the PHPRunner custom edit control plugin folder for ImageChoice.
Do not wrap sample.php settings in <?php ?> tags.

Common settings
---------------
$this->settings["lookup_table"] = "wc_teams";
$this->settings["key_field"] = "id";
$this->settings["label_field"] = "team_name";
$this->settings["image_field"] = "flag_url";
$this->settings["where_clause"] = "is_host = 1";
$this->settings["order_by"] = "team_name";
$this->settings["columns"] = 3;

Custom SQL mode
---------------
Use lookup_sql if you need joins. It must return ic_key, ic_label, ic_image.

Example:
$this->settings["lookup_sql"] = "SELECT id AS ic_key, team_name AS ic_label, flag_url AS ic_image FROM wc_teams WHERE is_host = 1 ORDER BY team_name";

Duplicate prevention
--------------------
Set the same picker_group for related controls and enable prevent_duplicates.
For host team selection this is usually not needed.

$this->settings["picker_group"] = "some_group";
$this->settings["prevent_duplicates"] = 1;
