public function addWidget($fieldsetName, $values = array())
{
$fieldset = new Fieldset($fieldsetName);
$this->add($fieldset);
$name = new Element\Text('name');
$name->setLabel('Name')->setLabelAttributes(array('class' => 'col-lg-2 control-label'))->setAttribute('class', 'form-control col-lg-10')->setValue(isset($values['name']) ? $values['name'] : '');
$fieldset->add($name);
$identifier = new Element\Text('identifier');
$identifier->setLabel('Identifier')->setLabelAttributes(array('class' => 'col-lg-2 control-label'))->setAttribute('class', 'form-control col-lg-10')->setValue(isset($values['identifier']) ? $values['identifier'] : '');
$fieldset->add($identifier);
$radio = new Element\Radio('settings');
$radio->setLabel('Sharing Tool')->setLabelAttributes(array('class' => 'col-lg-2 control-label'))->setValue(isset($values['settings']) ? $values['settings'] : '');
$radioValues = array();
foreach ($this->getModel()->getDefaultStyles() as $styleName => $style) {
$radioValues[$styleName] = array('name' => $style['name'], 'options' => array('img' => isset($style['img']) ? $style['img'] : null));
}
$radio->setValueOptions($radioValues);
$fieldset->add($radio);
$customString = new Element\Textarea('custom_string');
$customString->setLabel('Custom string')->setLabelAttributes(array('class' => 'col-lg-2 control-label'))->setAttribute('class', 'form-control col-lg-10')->setValue(isset($values['custom_string']) ? $values['custom_string'] : '');
$fieldset->add($customString);
$this->add($fieldset);
$chosenList = new Element\Hidden('chosen_list');
$chosenList->setValue(isset($values['chosen_list']) ? $values['chosen_list'] : '');
$fieldset->add($chosenList);
$this->getInputFilter()->add(array('type' => 'Zend\\InputFilter\\InputFilter', 'name' => array('name' => 'name', 'required' => true), 'identifier' => array('name' => 'identifier', 'required' => true, 'validators' => array(array('name' => 'not_empty'), array('name' => 'regex', 'options' => array('pattern' => parent::IDENTIFIER_PATTERN)))), 'settings' => array('name' => 'settings', 'required' => true), 'custom_string' => array('name' => 'custom_string', 'required' => false), 'chosen_list' => array('name' => 'chosen_list', 'required' => false)), $fieldsetName);
}