protected function content() { $t = (new Layout())->getTag(); /** @var User $user */ $user = $this->user; $dataToggle = "data-toggle"; $dataRel = "data-rel"; /** @noinspection PhpMethodParametersCountMismatchInspection */ return $this->setContent(get_called_class(), '', $t->div(a::c1ass('content'), $t->div(a::c1ass('row'), $t->div(a::c1ass('col-md-3'), $t->div(a::c1ass('panel widget light-widget panel-bd-top'), $t->div(a::c1ass('panel-heading no-title')), $t->div(a::c1ass('panel-body'), $t->div(a::c1ass('text-center vd_info-parent'), $t->img(a::alt('Your Avatar '), a::src(asset('img/profile-icon.png')))), $t->h2(a::c1ass('font-semibold mgbt-xs-5'), $user->getFullName()), $t->h4($user->getPosition()), $t->p(a::c1ass('mgtp-20 font-x13'), trans('layout.details')), $t->div(a::c1ass('font-x13'), $t->table(a::c1ass('table table-striped table-hover'), $t->tr($t->td('Status'), $t->td($t->span(a::c1ass('label label-' . $this->getStatusColor($user)), $user->getStatus()))), $t->tr($t->td('E-mail'), $t->td($t->a(a::href('mailto:' . $user->getEmail()), $user->getEmail()))), $t->tr($t->td(trans('menu.member.info', ['date' => ''])), $t->td($user->getCreated()->format('d.m.Y') . ' r.'))))))), $t->div(a::c1ass('col-md-9'), $t->div(a::c1ass('tabs widget'), $t->ul(a::c1ass('nav nav-tabs widget'), $t->li(a::c1ass('active'), $t->a(a::$dataToggle('tab'), a::href('#activity-tab'), trans('menu.activity'))), $t->li($t->a(a::$dataToggle('tab'), a::href('#groups-tab'), trans('menu.groups'))), $t->li($t->a(a::$dataToggle('tab'), a::href('#projects-tab'), trans('menu.projects')))), $this->renderEditButton($t, $user), $t->div(a::c1ass('tab-content'), $t->div(a::id('activity-tab'), a::c1ass('tab-pane active'), $t->div(a::c1ass('col-md-12 pd-5'), $t->h3(a::c1ass('mgbt-xs-15 font-semibold'), $t->i(a::c1ass('fa fa-globe mgr-10 profile-icon')), trans('menu.activity')), $t->div($t->div(a::c1ass('content-list'), $t->div(a::$dataRel('scroll'), new ActivitiesList($user->getActivities())))))), $t->div(a::id('groups-tab'), a::c1ass('tab-pane'), $t->div(a::c1ass('col-md-12 pd-5'), $t->h3(a::c1ass('mgbt-xs-15 font-semibold'), $t->i(a::c1ass('fa fa-users mgr-10 profile-icon')), trans('menu.groups')))), $t->div(a::id('projects-tab'), a::c1ass('tab-pane'), $t->div(a::c1ass('col-md-12 pd-5'), $t->h3(a::c1ass('mgbt-xs-15 font-semibold'), $t->i(a::c1ass('fa fa-folder mgr-10 profile-icon')), trans('menu.projects')))))))))); }
/** * @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); }
/** * @param Tag $t * @return mixed */ private function getImageFromData($t) { /** @noinspection PhpUndefinedMethodInspection */ $icon = $this->getData()[1]->getIcon(); if ($icon != null) { /** @noinspection PhpMethodParametersCountMismatchInspection */ return $t->img(a::src($icon), a::c1ass('img-circle'), a::alt('User Image')); } else { return $t->i(a::c1ass('fa fa-user fa-3x white')); } }