protected function _getHighlightManage($manage) { Wind::import('SRV:forum.srv.manage.PwThreadManageDoHighlight'); $do = new PwThreadManageDoHighlight($manage); if (!$this->doAction) { if ($this->singleData) { Wind::import("LIB:utility.PwHighlight"); $hightlight = new PwHighlight(); $hightlightStyle = $hightlight->parseHighlight($this->singleData['highlight']); $overtime = Wekit::load('forum.PwOvertime')->getOvertimeByTidAndType($this->singleData['tid'], 'highlight'); $hightlightOvertime = $overtime && $overtime['overtime'] ? Pw::time2str($overtime['overtime'], 'Y-m-d') : ''; } else { $hightlightStyle = array('color' => '#F50'); $hightlightOvertime = ''; } $this->setOutput($hightlightStyle, 'hightlightStyle'); $this->setOutput($hightlightOvertime, 'hightlightOvertime'); } else { list($bold, $italic, $underline, $color, $highlightOvertime) = $this->getInput(array('bold', 'italic', 'underline', 'color', 'highlight_overtime'), 'post'); Wind::import("LIB:utility.PwHighlight"); $hightlight = new PwHighlight(); $hightlight->setColor($color); $hightlight->setBold($bold); $hightlight->setItalic($italic); $hightlight->setUnderline($underline); $do->setHighlight($hightlight->getHighlight()); $do->setOvertime($highlightOvertime); $do->setReason($this->getInput('reason', 'post')); if (!$color && !$bold && !$italic && !$underline) { $this->doCancel[] = 'dohighlight'; } } return $do; }
private function _buildSignKey($list, $ishighlight = null) { $content = $_tType = $_fid = $_aTid = array(); $_tid = array_keys($list); $content = $this->_getContent($_tid); foreach ($list as $v) { $_fid[] = $v['fid']; $_tType[] = $v['topic_type']; if ($content[$v['tid']]['aids']) { $_aTid[] = $v['tid']; } } $forums = $this->_getForum($_fid); $tTypes = $this->_getTopicType($_tType); $attachs = $this->_getAttachs($_aTid); if ($ishighlight) { Wind::import('LIB:utility.PwHighlight'); $highlight = new PwHighlight(); } foreach ($list as $k => $v) { if (!$forums[$v['fid']]['isshow']) { $v = array(); } $list[$k]['subject'] = $this->_formatTitle($v['subject']); if ($ishighlight) { $styleArr = $highlight->parseHighlight($v['highlight']); $list[$k]['__style'] = array($styleArr['bold'], $styleArr['underline'], $styleArr['italic'], $styleArr['color']); } $list[$k]['url'] = WindUrlHelper::createUrl('bbs/read/run', array('tid' => $v['tid'], 'fid' => $v['fid']), '', 'pw'); $list[$k]['content'] = $this->_formatDes($content[$k]['content']); $list[$k]['created_time'] = $this->_formatTime($v['created_time']); $list[$k]['lastpost_time'] = $this->_formatTime($v['lastpost_time']); $list[$k]['created_space'] = WindUrlHelper::createUrl('space/index/run', array('uid' => $v['created_userid']), '', 'pw'); $list[$k]['created_smallavatar'] = Pw::getAvatar($v['created_userid'], 'small'); $list[$k]['created_middleavatar'] = Pw::getAvatar($v['created_userid'], 'middle'); $list[$k]['created_bigavatar'] = Pw::getAvatar($v['created_userid'], 'big'); $list[$k]['lastpost_smallavatar'] = Pw::getAvatar($v['lastpost_userid'], 'small'); $list[$k]['lastpost_middleavatar'] = Pw::getAvatar($v['lastpost_userid'], 'middle'); $list[$k]['lastpost_space'] = WindUrlHelper::createUrl('space/index/run', array('uid' => $v['lastpost_userid']), '', 'pw'); $list[$k]['forum_name'] = $this->_filterForumHtml($forums[$v['fid']]['name']); $list[$k]['forum_url'] = WindUrlHelper::createUrl('bbs/thread/run', array('fid' => $v['fid']), '', 'pw'); $list[$k]['tType'] = isset($tTypes[$v['topic_type']]['name']) ? $tTypes[$v['topic_type']]['name'] : ''; $list[$k]['tType_url'] = isset($tTypes[$v['topic_type']]['id']) ? WindUrlHelper::createUrl('bbs/thread/run', array('fid' => $v['fid'], 'type' => $tTypes[$v['topic_type']]['id']), '', 'pw') : ''; $list[$k]['thumb_attach'] = $attachs[$v['tid']]['path'] ? $attachs[$v['tid']]['path'] : ''; } return $list; }