| 1 |
<?php |
| 2 |
/** |
| 3 |
* Select.php |
| 4 |
* |
| 5 |
* Select form field. |
| 6 |
* |
| 7 |
* PHP versions 5 |
| 8 |
* |
| 9 |
* @author Alexander Schneider <alexanderschneider85@gmail.com> |
| 10 |
* @copyright 2008-2017 Alexander Schneider |
| 11 |
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 |
| 12 |
* @version SVN: $id$ |
| 13 |
* @link http://wordpress.org/extend/plugins/user-access-manager/ |
| 14 |
*/ |
| 15 |
|
| 16 |
/** |
| 17 |
* @var \UserAccessManager\Form\Select $select |
| 18 |
*/ |
| 19 |
?> |
| 20 |
<th scope="row"> |
| 21 |
<label for="uam_<?php echo $select->getId(); ?>"> |
| 22 |
<?php echo $select->getLabel(); ?> |
| 23 |
</label> |
| 24 |
</th> |
| 25 |
<td> |
| 26 |
<select id="uam_<?php echo $select->getId(); ?>" |
| 27 |
name="config_parameters[<?php echo $select->getId(); ?>]"> |
| 28 |
<?php |
| 29 |
$possibleValues = $select->getPossibleValues(); |
| 30 |
|
| 31 |
foreach ($possibleValues as $possibleValue) { |
| 32 |
?> |
| 33 |
<option value="<?php echo $possibleValue->getValue(); ?>" <?php |
| 34 |
if ($select->getValue() === $possibleValue->getValue()) { |
| 35 |
echo 'selected="selected"'; |
| 36 |
} |
| 37 |
?> > |
| 38 |
<?php echo $possibleValue->getLabel(); ?> |
| 39 |
</option> |
| 40 |
<?php |
| 41 |
} |
| 42 |
?> |
| 43 |
</select> |
| 44 |
<br/> |
| 45 |
<p><?php echo $select->getDescription(); ?></p> |
| 46 |
</td> |