/** * @param xPDOObject|quipThread $object * @return boolean */ public function prepareRow(xPDOObject $object) { if (!$object->checkPolicy('view')) { return false; } $threadArray = $object->toArray(); $resourceTitle = $object->get('pagetitle'); if (!empty($resourceTitle)) { $threadArray['url'] = $object->makeUrl(); } $cls = ''; $cls .= $object->checkPolicy('truncate') ? ' truncate' : ''; $cls .= $object->checkPolicy('remove') ? ' remove' : ''; $threadArray['perm'] = $cls; return $threadArray; }
/** * @param xPDOObject|quipComment $object * @return array */ public function prepareRow(xPDOObject $object) { $commentArray = $object->toArray(); $commentArray['url'] = $object->makeUrl(); $commentArray['cls'] = $this->defaultCls; $commentArray['createdon'] = strftime('%a %b %d, %Y %I:%M %p', strtotime($commentArray['createdon'])); if (empty($commentArray['pagetitle'])) { $commentArray['pagetitle'] = $this->modx->lexicon('quip.view'); } if (empty($commentArray['username'])) { $commentArray['username'] = $commentArray['name']; } $commentArray['body'] = str_replace('<br />', '', $commentArray['body']); return $commentArray; }