public function validate_cmts_id($arg, $check_enabled) { if (false === ($comments = GWF_Comments::getByID($arg))) { return $this->lang('err_comments'); } if ($check_enabled && !$comments->isEnabled()) { return $this->lang('err_disabled'); } return false; }
public function sanitize($check_enabled = true) { if ('' === ($cmts_id = Common::getGetString('cmts_id'))) { return $this->module->error('err_comments'); } if (false === ($c = GWF_Comments::getByID($cmts_id))) { return $this->module->error('err_comments'); } if ($check_enabled) { if (!$c->isEnabled()) { return $this->module->error('err_disabled'); } } $this->comments = $c; return false; }
/** * Get the comments thread for this comment. * @return GWF_Comments */ public function getComments() { return GWF_Comments::getByID($this->getVar('cmt_cid')); }