Advertisement
vanchelo

Untitled

Nov 15th, 2012
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.87 KB | None | 0 0
  1. class QuipCommentApproveProcessor extends modObjectProcessor {
  2.     public $classKey = 'quipComment';
  3.     public $permission = 'quip.comment_approve';
  4.     public $languageTopics = array('quip:default');
  5.  
  6.     /** @var quipComment $comment */
  7.     public $comment;
  8.  
  9.     public function initialize() {
  10.         $id = $this->getProperty('id');
  11.         if (empty($id)) return $this->modx->lexicon('quip.comment_err_ns');
  12.         $this->comment = $this->modx->getObject($this->classKey,$id);
  13.         if (empty($this->comment)) return $this->modx->lexicon('quip.comment_err_nf');
  14.         return parent::initialize();
  15.     }
  16.  
  17.     public function process() {
  18.         if ($this->comment->approve() === false) {
  19.             return $this->failure($this->modx->lexicon('quip.comment_err_save'));
  20.         }
  21.  
  22.         return $this->success();
  23.     }
  24. }
  25. return 'QuipCommentApproveProcessor';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement