Exemplo n.º 1
0
 protected function createComponentContactsGroupsMenu($name)
 {
     $c = new \App\Components\MenuControl($this, $name);
     $c->setLabel("securityModule.public.contacts.groupsMenu");
     $groups = $this->sportGroupService->getAllSportGroups(null, true);
     $gid = $this->getParameter("gid");
     foreach ($groups as $g) {
         $id = null;
         if (is_numeric($gid)) {
             $id = $g->getId();
         } else {
             $id = $g->getAbbr();
         }
         $name = $g->getSportType() !== null ? "{$g->getName()} ({$g->getSportType()->getName()})" : "{$g->getName()}";
         $node = $c->addNode($name, ":Security:Public:default", null, ["param" => $id]);
         if ($id == $gid || ($gid == self::ROOT_GROUP || $gid === null) && $id == self::ROOT_GROUP) {
             $c->setCurrentNode($node);
         }
     }
     return $c;
 }
Exemplo n.º 2
0
 /**
  * Back-only sub menu control factory
  * @param string $name
  * @return \App\Components\MenuControl
  */
 public function createComponentBackSubMenu($name)
 {
     $c = new \App\Components\MenuControl($this, $name);
     $c->setLabel("systemModule.navigation.options");
     $c->addNode("systemModule.navigation.back", ":Payments:Admin:default");
     return $c;
 }
Exemplo n.º 3
0
 protected function createComponentBackShowForumSubMenu($name)
 {
     $c = new \App\Components\MenuControl($this, $name);
     $c->setLabel("systemModule.navigation.options");
     $forumAlias = $this->getEntity()->getAlias();
     $abbr = $this->getParameter("abbr");
     $c->addNode("systemModule.navigation.back", ":Communication:Forum:showForum", true, ["param" => ["id" => $forumAlias, "abbr" => $abbr]]);
     return $c;
 }
Exemplo n.º 4
0
 public function createComponentSubMenu($name)
 {
     $c = new \App\Components\MenuControl($this, $name);
     $c->setLabel("systemModule.navigation.options");
     $c->addNode("communicationModule.messaging.inbox", ":Communication:Messaging:inbox");
     $c->addNode("communicationModule.messaging.outbox", ":Communication:Messaging:outbox");
     $c->addNode("communicationModule.messaging.deleted", ":Communication:Messaging:deleted");
     $c->addNode("communicationModule.messaging.messageAdd", ":Communication:Messaging:createMessage");
     $c->addNode("systemModule.navigation.back", ":System:Default:userRoot");
     return $c;
 }
Exemplo n.º 5
0
 protected function createComponentWebProfileMenu($name)
 {
     $c = new \App\Components\MenuControl($this, $name);
     $group = $data = null;
     $gid = $this->getParameter("gid");
     try {
         if (is_numeric($gid)) {
             $group = $this->sportGroupService->getSportGroup($gid);
         } else {
             $group = $this->sportGroupService->getSportGroupAbbr($gid);
         }
         $raw = $this->positionService->getPositionsWithinGroup($group);
         $data = array_filter($raw, function ($e) {
             if ($e->getRole()->getName() == $this->defaultPlayerRoleName) {
                 return true;
             }
             return false;
         });
     } catch (Exceptions\DataErrorException $ex) {
         $this->handleDataLoad($gid, "default", $ex);
     }
     $c->setLabel("{$group->getName()} ({$group->getSportType()->getName()})");
     $user = $this->getEntity();
     foreach ($data as $p) {
         $owner = $p->getOwner();
         $node = $c->addNode("{$owner->getName()} {$owner->getSurName()}", ":Users:Public:showWebProfile");
         if ($owner->getId() == $user->getId()) {
             $c->setCurrentNode($node);
         }
     }
     return $c;
 }
Exemplo n.º 6
0
 protected function createComponentStaticPagesGroupsMenu($name)
 {
     $c = new \App\Components\MenuControl($this, $name);
     $c->setLabel("systemModule.publicPages.groupsMenu");
     $groups = $this->sportGroupService->getAllSportGroups(null, true);
     $currentAbbr = null;
     $e = $this->getEntity();
     if ($this->getEntity() instanceof SportGroup) {
         $currentAbbr = $e->getAbbr();
     } elseif ($e instanceof StaticPage) {
         $currentAbbr = $e->getGroup()->getAbbr();
     }
     foreach ($groups as $g) {
         $abbr = $g->getAbbr();
         //if (!$g->getStaticPages()->isEmpty()) {
         $node = $c->addNode($g->getName(), "showGroupPages", true, ["param" => $abbr]);
         if ($currentAbbr == $abbr) {
             $c->setCurrentNode($node);
         }
         //}
     }
     return $c;
 }