/**
	 * @param $group
	 * @param $cache
	 * @param $parent bool
	 * @return string
	 */
	protected function makeGroupRow( $group, $cache, $parent = false ) {
		$groupId = $group->getId();

		if ( $this->table->isBlacklisted( $groupId, $this->target ) !== null ) {
			return '';
		}

		# These are hidden, and the code in MessageGroupStats makes sure that
		# these are not counted in the aggregate groups they may belong.
		if ( MessageGroups::getPriority( $group ) === 'discouraged' ) {
			return '';
		}

		$stats = $cache[$groupId];

		list( $total, $translated, $fuzzy ) = $stats;
		if ( $total === null ) {
			$this->incomplete = true;
			$extra = array();
		} else {
			if ( $this->noComplete && $fuzzy === 0 && $translated === $total ) {
				return '';
			}

			if ( $this->noEmpty && $translated === 0 && $fuzzy === 0 ) {
				return '';
			}

			if ( $translated === $total ) {
				$extra = array( 'task' => 'reviewall' );
			} else {
				$extra = array();
			}
		}

		if ( !$group instanceof AggregateMessageGroup ) {
			$this->totals = MessageGroupStats::multiAdd( $this->totals, $stats );
		}

		$rowParams = array();
		$rowParams['data-groupid'] = $groupId;
		if ( is_string( $parent ) ) {
			$rowParams['data-parentgroups'] = $parent;
		} elseif ( $parent === true ) {
			$rowParams['data-ismeta'] = '1';
		}

		$out  = "\t" . Html::openElement( 'tr', $rowParams );
		$out .= "\n\t\t" . Html::rawElement( 'td', array(),
			$this->table->makeGroupLink( $group, $this->target, $extra ) );
		$out .= $this->table->makeNumberColumns( $fuzzy, $translated, $total );
		$out .= $this->getWorkflowStateCell( $groupId );

		$out .= "\n\t" . Html::closeElement( 'tr' ) . "\n";
		return $out;
	}
 /**
  * Actually creates the table for single message group, unless it
  * is blacklisted or hidden by filters.
  * @param MessageGroup $group
  * @param array $cache
  * @param MessageGroup $parent
  * @return string
  */
 protected function makeGroupRow(MessageGroup $group, array $cache, MessageGroup $parent = null)
 {
     $groupId = $group->getId();
     if ($this->table->isBlacklisted($groupId, $this->target) !== null) {
         return '';
     }
     $stats = $cache[$groupId];
     $total = $stats[MessageGroupStats::TOTAL];
     $translated = $stats[MessageGroupStats::TRANSLATED];
     $fuzzy = $stats[MessageGroupStats::FUZZY];
     // Quick checks to see whether filters apply
     if ($this->noComplete && $fuzzy === 0 && $translated === $total) {
         return '';
     }
     if ($this->noEmpty && $translated === 0 && $fuzzy === 0) {
         return '';
     }
     // Calculation of summary row values
     if (!$group instanceof AggregateMessageGroup) {
         if (!isset($this->statsCounted[$groupId])) {
             $this->totals = MessageGroupStats::multiAdd($this->totals, $stats);
             $this->statsCounted[$groupId] = true;
         }
     }
     $state = $this->getWorkflowStateValue($groupId);
     $params = $stats;
     $params[] = $state;
     $params[] = $groupId;
     $params[] = $this->getLanguage()->getCode();
     $params[] = $this->target;
     $cachekey = wfMemcKey(__METHOD__, implode('-', $params));
     $cacheval = wfGetCache(CACHE_ANYTHING)->get($cachekey);
     if (!$this->purge && is_string($cacheval)) {
         return $cacheval;
     }
     $extra = array();
     if ($total === null) {
         $this->incomplete = true;
     } elseif ($translated === $total) {
         $extra = array('action' => 'proofread');
     }
     $rowParams = array();
     $rowParams['data-groupid'] = $groupId;
     $rowParams['class'] = get_class($group);
     if ($parent) {
         $rowParams['data-parentgroup'] = $parent->getId();
     }
     $out = "\t" . Html::openElement('tr', $rowParams);
     $out .= "\n\t\t" . Html::rawElement('td', array(), $this->table->makeGroupLink($group, $this->target, $extra));
     $out .= $this->table->makeNumberColumns($stats);
     $out .= $this->getWorkflowStateCell($groupId, $state);
     $out .= "\n\t" . Html::closeElement('tr') . "\n";
     wfGetCache(CACHE_ANYTHING)->set($cachekey, $out, 3600 * 24);
     return $out;
 }
 protected function getColorLegend()
 {
     $legend = '';
     $period = $this->period;
     $statsTable = new StatsTable();
     for ($i = 0; $i <= $period; $i += 30) {
         $iFormatted = htmlspecialchars($this->getLanguage()->formatNum($i));
         $legend .= '<span style="background-color:#' . $statsTable->getBackgroundColor($period - $i, $period) . "\"> {$iFormatted}</span>";
     }
     return $legend;
 }