issue 46 apply validator to poll module

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8548 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ovclas 2011-06-30 00:54:10 +00:00
parent a65976f913
commit f020e75e09
11 changed files with 67 additions and 19 deletions

View file

@ -119,6 +119,7 @@
if(!$srl) continue;
$item_srls[] = $srl;
}
// If there is no response item, display an error
if(!count($item_srls)) return new Object(-1, 'msg_check_poll_item');
// Make sure is the poll has already been taken
@ -167,6 +168,11 @@
$this->add('poll_srl', $poll_srl);
$this->add('tpl',$tpl);
$this->setMessage('success_poll');
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispPollAdminConfig');
header('location:'.$returnUrl);
return;
}
}
/**