/** * @param array $data * @param IContextSource $ctx * @return Message */ protected function getDescription(array $data, IContextSource $ctx) { // Build description message, piggybacking on history i18n $changeType = $data['changeType']; $actions = $this->permissions->getActions(); $key = $actions->getValue($changeType, 'history', 'i18n-message'); // find specialized message for this particular formatter type // E.g. the -irc messages. $msg = $ctx->msg($key . '-' . $this->getHistoryType()); if (!$msg->exists()) { // fallback to default msg $msg = $ctx->msg($key); } return $msg->params($this->getDescriptionParams($data, $actions, $changeType)); }
/** * Build api properties defined in FlowActions for this change type * * This is a fairly expensive function(compared to the other methods in this class). * As such its only output when specifically requested * * @param UUID $workflowId * @param AbstractRevision $revision * @param IContextSource $ctx * @param FormatterRow|null $row * @return array */ public function buildProperties(UUID $workflowId, AbstractRevision $revision, IContextSource $ctx, FormatterRow $row = null) { if ($this->includeProperties === false) { return array(); } $changeType = $revision->getChangeType(); $actions = $this->permissions->getActions(); $params = $actions->getValue($changeType, 'history', 'i18n-params'); if (!$params) { // should we have a sigil for i18n with no parameters? wfDebugLog('Flow', __METHOD__ . ": No i18n params for changeType {$changeType} on " . $revision->getRevisionId()->getAlphadecimal()); return array(); } $res = array('_key' => $actions->getValue($changeType, 'history', 'i18n-message')); foreach ($params as $param) { $res[$param] = $this->processParam($param, $revision, $workflowId, $ctx, $row); } return $res; }