public function __construct()
 {
     $this->devices = (object) array();
     foreach (MobileDetector::devices() as $type => $device) {
         $this->devices->{$type} = (object) array('detected' => false, 'captures' => (object) array());
     }
 }
 public function appendPreferences($context)
 {
     $conf = Symphony::Configuration();
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', __('Mobile Device Detection')));
     // No Redirect Cookie:
     $label = Widget::Label(__('No Redirect Cookie'));
     $label->appendChild(Widget::Input('settings[' . self::CONF . '][' . self::CONF_COOKIE . ']', General::Sanitize($conf->get(self::CONF_COOKIE, self::CONF))));
     $group->appendChild($label);
     // Redirect URL:
     $label = Widget::Label(__('Redirect URL'));
     $label->appendChild(Widget::Input('settings[' . self::CONF . '][' . self::CONF_URL . ']', General::Sanitize($conf->get(self::CONF_URL, self::CONF))));
     $group->appendChild($label);
     // Redirect Devices:
     $label = Widget::Label(__('Redirect Devices'));
     $label->appendChild(Widget::Input('settings[' . self::CONF . '][' . self::CONF_DEVICES . ']', General::Sanitize($conf->get(self::CONF_DEVICES, self::CONF))));
     $group->appendChild($label);
     $list = new XMLElement('ul');
     $list->setAttribute('class', 'tags');
     foreach (MobileDetector::devices() as $type => $device) {
         $item = new XMLElement('li', $type);
         $list->appendChild($item);
         $list->setAttribute('data-interactive', 'data-interactive');
     }
     $group->appendChild($list);
     $context['wrapper']->appendChild($group);
 }