PageRenderTime 49ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/Wordpress/warp/systems/wordpress/config/layouts/fields/position.php

https://github.com/dominikkucharski/Warp-Framework
PHP | 24 lines | 10 code | 6 blank | 8 comment | 2 complexity | 0b5ed63ca2350818020c1c9d22552320 MD5 | raw file
  1. <?php
  2. /**
  3. * @package Warp Theme Framework
  4. * @author YOOtheme http://www.yootheme.com
  5. * @copyright Copyright (C) YOOtheme GmbH
  6. * @license http://www.gnu.org/licenses/gpl.html GNU/GPL
  7. */
  8. printf('<select %s>', $control->attributes(compact('name')));
  9. foreach ($this['system']->xml->find('positions > position') as $position) {
  10. // set attributes
  11. $attributes = array('value' => $position->text());
  12. // is checked ?
  13. if ($position->text() == $value) {
  14. $attributes = array_merge($attributes, array('selected' => 'selected'));
  15. }
  16. printf('<option %s>%s</option>', $control->attributes($attributes), $position->text());
  17. }
  18. printf('</select>');