Esempio n. 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);
 }
Esempio n. 2
0
 public function index()
 {
     $t = new Tag();
     echo "\n";
     echo "\n";
     echo $t->doctype($t->html(['ng-app' => 'nameApp'], [$t->head([$t->meta(['charset' => 'utf-8']), $t->title('Angular.js Example'), $t->script(['src' => 'https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.1/angular.min.js']), $t->script([' var nameApp = angular.module(\'nameApp\', []);
                             nameApp.controller(\'NameCtrl\', function( $scope ) {
                                 $scope.names = [\'Lary\', \'Curly\', \'Moe\'];
                                 $scope.addName = function () {
                                     $scope.names.push($scope.enteredName);
                                 }
                                 //$scope.firstName = \'John\';
                                 //
                                 //$scope.$watch(\'lastName\', function(newValue, oldValue) {
                                 //    console.log(\'new value is \' + newValue);
                                 //});
                                 //
                                 //setTimeout(function(){
                                 //    $scope.lastName = \'Smith\';
                                 //    $scope.$apply();
                                 //}, 1000);
                             });'])]), $t->body(['ng-controller' => 'NameCtrl'], [$t->ul([$t->li(['ng-repeat' => 'name in names track by $index'], ['{{name}}'])]), $t->form(['ng-submit' => 'addName()'], [$t->input(['type' => 'text', 'ng-model' => 'enteredName']), $t->input(['type' => 'submit', 'value' => 'add'])])])]));
     echo "\n";
 }
Esempio n. 3
0
 private function createMenuItem($item, $icon, Tag $t)
 {
     if (AccessHelper::exists($item) && AccessHelper::hasPermission($item, $this->getLoggedUser())) {
         /** @noinspection PhpMethodParametersCountMismatchInspection */
         return $t->li($item === $this->getActive() ? a::c1ass('active') : '', [$t->a(a::href('/' . strtolower($item)), $t->i(a::c1ass('fa fa-' . strtolower($icon))), $t->span(trans('menu.' . strtolower($item))))]);
     } else {
         return '';
     }
 }
Esempio n. 4
0
 /**
  * @param $counterValue
  * @param Tag $t
  * @return array
  */
 private function makeAList($counterValue, Tag $t)
 {
     if ($this->isUserMenu()) {
         /** @var User $user */
         $user = $this->data;
         /** @var DateTime $joinDate */
         $joinDate = $user->getCreated();
         /** @noinspection PhpMethodParametersCountMismatchInspection */
         return [$t->li(a::c1ass('user-header'), $this->getImageBig($this->icon, $t), $t->p($user->getPosition(), $t->small(trans('menu.member.info', ['date' => $joinDate->format('d.m.Y') . ' r.'])))), $t->li(a::c1ass('user-footer'), $t->div(a::c1ass("pull-left"), $t->a(a::href("/profile"), a::c1ass("btn btn-default btn-flat"), trans('menu.profile'))), $t->div(a::c1ass("pull-right"), $t->a(a::href("/auth/logout"), a::c1ass("btn btn-default btn-flat"), trans('menu.sign.out'))))];
     }
     return [$t->li(a::c1ass('header'), trans('menu.unread.notification.info', ['counter' => "{$counterValue}"])), $t->li($t->ul(a::c1ass('menu'), $this->renderList($this->data, $t))), $t->li(a::c1ass('footer'), $t->a(a::href('#'), trans('menu.view.all')))];
 }
Esempio n. 5
0
 /**
  * @return string
  */
 public function render()
 {
     $t = new Tag();
     $iconClass = $this->getNotificationTemplate()->getIconClass();
     $colorClass = $this->getNotificationTemplate()->getColorClass();
     return $t->li($t->a(a::href($this->getUrl()), $t->i(a::c1ass("fa {$iconClass} text-{$colorClass}")), $this->getNotificationTemplate()->getDescription()));
 }