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

@ -24,6 +24,11 @@
$oModuleController->insertModuleConfig('poll', $config);
$this->setMessage('success_updated');
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;
}
}
/**
@ -32,9 +37,10 @@
function procPollAdminDeleteChecked() {
// Display an error no post is selected
$cart = Context::get('cart');
if(!$cart) return $this->stop('msg_cart_is_null');
$poll_srl_list= explode('|@|', $cart);
if(is_array($cart)) $poll_srl_list = $cart;
else $poll_srl_list= explode('|@|', $cart);
$poll_count = count($poll_srl_list);
if(!$poll_count) return $this->stop('msg_cart_is_null');
// Delete the post
@ -47,6 +53,11 @@
}
$this->setMessage( sprintf(Context::getLang('msg_checked_poll_is_deleted'), $poll_count) );
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispPollAdminList');
header('location:'.$returnUrl);
return;
}
}
/**