/**
  * Execute this action for generating an XML response with participation summary information
  * 
  * @return mixed
  * @access public
  * @since 4/25/05
  */
 public function execute()
 {
     if (!$this->isAuthorizedToExecute()) {
         $this->error("Permission Denied");
     }
     $node = SiteDispatcher::getCurrentNode();
     $id = RequestContext::value('participant');
     $view = new Participation_View($node);
     $idMgr = Services::getService('Id');
     $participantView = new Participation_Participant($view, $idMgr->getId($id));
     $this->start();
     print "\n\t<role id='comments' number='" . $participantView->getNumActionsByCategory('commenter') . "'/>";
     print "\n\t<role id='author' number='" . $participantView->getNumActionsByCategory('author') . "'/>";
     print "\n\t<role id='editor' number='" . $participantView->getNumActionsByCategory('editor') . "'/>";
     $this->end();
 }
Beispiel #2
0
 /**
  * Print out a row.
  * 
  * @param Participation_Participant $participant
  * @return string
  * @access public
  * @since 1/30/09
  */
 public function printAction(Participation_Participant $participants)
 {
     $participant = $participants->getId()->getIdString();
     $participantView = new Participation_Participant($this->_view, $participants->getId());
     // determine color of current row
     if ($this->_rowColor == "#F6F6F6") {
         $rowColor = "#FFFFFF";
         $this->_rowColor = "#FFFFFF";
     } else {
         $rowColor = "#F6F6F6";
         $this->_rowColor = "#F6F6F6";
     }
     ob_start();
     print "\n\t\t<tr>";
     print "\n\t\t\t<td class='participant_row' style='background-color: " . $rowColor . "'>";
     print "<a href='";
     print SiteDispatcher::quickURL('participation', 'actions', array('node' => $this->_node->getId(), 'sort' => 'timestamp', 'direction' => 'DESC', 'participant' => $participant)) . "'>";
     print $participants->getDisplayName();
     print "</a>";
     print "\n\t\t\t</td>";
     print "\n\t\t\t<td class='participant_row' style='background-color: " . $rowColor . "'>";
     print "<a href='";
     print SiteDispatcher::quickURL('participation', 'actions', array('node' => $this->_node->getId(), 'sort' => 'timestamp', 'direction' => 'DESC', 'participant' => $participant, 'role' => 'commenter')) . "'>";
     print $participantView->getNumActionsByCategory('commenter');
     print "</a>";
     print "\n\t\t\t</td>";
     print "\n\t\t\t<td class='participant_row' style='background-color: " . $rowColor . "'>";
     print "<a href='";
     print SiteDispatcher::quickURL('participation', 'actions', array('node' => $this->_node->getId(), 'sort' => 'timestamp', 'direction' => 'DESC', 'participant' => $participant, 'role' => 'author')) . "'>";
     print $participantView->getNumActionsByCategory('author');
     print "</a>";
     print "\n\t\t\t</td>";
     print "\n\t\t\t<td class='participant_row' style='background-color: " . $rowColor . "'>";
     print "<a href='";
     print SiteDispatcher::quickURL('participation', 'actions', array('node' => $this->_node->getId(), 'sort' => 'timestamp', 'direction' => 'DESC', 'participant' => $participant, 'role' => 'editor')) . "'>";
     print $participantView->getNumActionsByCategory('editor');
     print "</a>";
     print "\n\t\t\t</td>";
     print "\n\t\t</tr>";
     return ob_get_clean();
 }