/** * Returns HTML to show the last edit or an empty string when the user has not edited * * @return String HTML string representing the last edit by the user */ protected function getLastEditHtml() { $rev = $this->userInfo->getLastEdit(); if ($rev) { $daysAgo = $this->getDaysAgo(new MWTimestamp(wfTimestamp(TS_UNIX, $rev->getTimestamp()))); $html = Html::openElement('div', array('class' => 'card')) . Html::openElement('div', array('class' => 'container image')) . Html::openElement('div', array('class' => 'caption')) . $this->msg('mobile-frontend-profile-last-edit', $rev->getTitle(), $daysAgo, $this->targetUser->getName())->parse() . '</div>' . '</div>' . '</div>'; } else { $html = ''; } return $html; }
public function getTemplateData($templateParser) { $data = $this->getUserFooterData(); $rev = $this->userInfo->getLastEdit(); $cards = array(); if ($rev) { $daysAgo = $this->getDaysAgo(new MWTimestamp(wfTimestamp(TS_UNIX, $rev->getTimestamp()))); $cards[] = $templateParser->processTemplate('userprofileCard', array('caption' => $this->msg('mobile-frontend-profile-last-edit', $rev->getTitle(), $daysAgo, $this->targetUser->getName())->parse())); } $thank = $this->userInfo->getLastThanking(); if ($thank) { $user = $thank['user']; $cards[] = $templateParser->processTemplate('userprofileCard', array('caption' => $this->msg('mobile-frontend-profile-last-thank', $user, $this->targetUser)->parse())); } Hooks::run('SpecialUserProfileCards', array(&$cards, $this->targetUser)); if (count($cards) > 0) { $data['hasActivity'] = true; $data['heading'] = $this->msg('mobile-frontend-profile-activity-heading')->text(); $data['cards'] = $cards; } return $data; }