Пример #1
0
 /**
  * @param Tag $t
  * @param array $activities
  * @return mixed
  */
 public function renderActivities($t, $activities)
 {
     $activitiesHTML = array();
     $sortedActivities = array();
     /** @var Activity $activity */
     foreach ($activities as $activity) {
         array_push($sortedActivities, $activity);
     }
     usort($sortedActivities, array("Solvre\\Utils\\ActivityType", "compare"));
     /** @var Activity $activity */
     foreach ($sortedActivities as $activity) {
         $login = $activity->getUser()->getLogin();
         /** @noinspection PhpMethodParametersCountMismatchInspection */
         array_push($activitiesHTML, $t->li($t->div(a::c1ass('menu-icon'), $t->a(a::href('/user/' . $login), $t->img(a::alt(strtolower($login)), $this->renderImage($activity)))), $t->div(a::c1ass('menu-info no-transform'), $t->a(a::href('/user/' . strtolower($login)), $activity->getUser()->getFullName()), ' ', $this->renderMessage($activity), $this->renderObjectName($t, $activity)), $t->div(a::c1ass('menu-text'), $this->renderContent($t, $activity)), $t->div(a::c1ass('menu-text'), $t->div(a::c1ass('menu-info no-transform'), $t->span(a::c1ass('menu-date'), a::title($activity->getCreated()->format("Y-m-d H:i")), $this->renderActivityTime($activity))))));
     }
     return $t->ul(a::c1ass('list-wrapper'), $activitiesHTML);
 }