Advertisement
Guest User

Untitled

a guest
May 27th, 2012
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.65 KB | None | 0 0
  1. <?php
  2. /**
  3. * @package   com_zoo
  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.  
  9. printf('<select %s>', $this->app->field->attributes(array('name' => "{$control_name}[{$name}]")));
  10.  
  11. foreach ($node->children() as $option) {
  12.  
  13.     // set attributes
  14.     $attributes = array('value' => $option->attributes()->value);
  15.  
  16.     // is checked ?
  17.     if ($option->attributes()->value == $value) {
  18.         $attributes['selected'] = 'selected';
  19.     }
  20.  
  21.     printf('<option %s>%s</option>', $this->app->field->attributes($attributes), JText::_((string) $option));
  22. }
  23.  
  24. printf('</select>');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement