function _deleteBlogBlockedHosts() { $blockedHosts = new BlockedHosts(); // loop through the array of things to remove $errorMessage = ""; $successMessage = ""; $numOk = 0; foreach ($this->_blockedIds as $blockedId) { // get the post $blockedHost = $blockedHosts->getBlockedHost($blockedId, $this->_blogInfo->getId()); $this->notifyEvent(EVENT_PRE_BLOCK_HOST_DELETE, array("host" => &$blockedHost)); $result = $blockedHosts->remove($blockedId, $this->_blogInfo->getId()); if (!$result) { $errorMessage .= $this->_locale->pr("error_deleting_blocked_host", $blockedHost->getHost()) . "<br/>"; } else { $numOk++; if ($numOk > 1) { $successMessage = $this->_locale->pr("blocked_hosts_deleted_ok", $numOk); } else { $successMessage = $this->_locale->pr("blocked_host_deleted_ok", $blockedHost->getHost()); } $this->notifyEvent(EVENT_POST_BLOCK_HOST_DELETE, array("host" => &$blockedHost)); } } $this->_view = new AdminBlogBlockedHostsView($this->_blogInfo); if ($errorMessage != "") { $this->_view->setErrorMessage($errorMessage); } if ($successMessage != "") { $this->_view->setSuccessMessage($successMessage); } $this->setCommonData(); // clear the cache CacheControl::resetBlogCache($this->_blogInfo->getId()); // better to return true if everything fine return true; }