public function saveForum($info)
{
if (empty($info['forum_id'])) {
if (empty($info['author'])) {
$info['author'] = $GLOBALS['registry']->getAuth();
}
$info['forum_id'] = $this->newForum($info['forum_name'], $info['author']);
}
$sql = 'UPDATE ' . $this->_forums_table . ' SET forum_name = ?, forum_parent_id = ?, ' . 'forum_description = ?, forum_moderated = ?, ' . 'forum_attachments = ?, forum_distribution_address = ? ' . 'WHERE forum_id = ?';
$values = array($this->convertToDriver($info['forum_name']), (int) $info['forum_parent_id'], $this->convertToDriver($info['forum_description']), (int) $info['forum_moderated'], isset($info['forum_attachments']) ? (int) $info['forum_attachments'] : abs($GLOBALS['conf']['forums']['enable_attachments']), isset($info['forum_distribution_address']) ? $info['forum_distribution_address'] : '', $info['forum_id']);
try {
$this->_db->execute($sql, $values);
} catch (Horde_Db_Exception $e) {
throw new Agora_Exception($e->getMessage());
}
$this->_updateCacheState(0);
$this->_cache->expire('agora_forum_' . $info['forum_id'], $GLOBALS['conf']['cache']['default_lifetime']);
return $info['forum_id'];
}