public function init()
{
$translator = \Zend_Registry::get('container')->getService('translator');
$this->repository = $this->_helper->entity->getRepository('Newscoop\\Entity\\User\\Staff');
$this->form = new Admin_Form_Staff($this->_helper->acl->isAllowed('user', 'manage'));
$this->form->setAction('')->setMethod('post');
if ($this->_helper->acl->isAllowed('user', 'manage')) {
// set form user groups
$groups = array();
$groupRepository = $this->_helper->entity->getRepository('Newscoop\\Entity\\User\\Group');
foreach ($groupRepository->findAll() as $group) {
$groups[$group->getId()] = $group->getName();
}
$this->form->getElement('groups')->setMultioptions($groups);
}
// set form countries
$countries = array('' => $translator->trans('Select country', array(), 'user_subscriptions'));
foreach (Country::GetCountries(1) as $country) {
$countries[$country->getCode()] = $country->getName();
}
$this->form->getElement('country')->setMultioptions($countries);
}