/** * This action renders the template used by the splash screen popup */ public function splash() { //the list of extensions the splash provides an explanation for. $defaultExtIds = array('items', 'tests', 'TestTaker', 'groups', 'delivery', 'results'); //check if the user is a noob $this->setData('firstTime', TaoCe::isFirstTimeInTao()); //load the extension data $defaultExtensions = array(); $additionalExtensions = array(); foreach (MenuService::getPerspectivesByGroup(Perspective::GROUP_DEFAULT) as $i => $perspective) { if (in_array((string) $perspective->getId(), $defaultExtIds)) { $defaultExtensions[strval($perspective->getId())] = array('id' => $perspective->getId(), 'name' => $perspective->getName(), 'extension' => $perspective->getExtension(), 'description' => $perspective->getDescription()); } else { $additionalExtensions[$i] = array('id' => $perspective->getId(), 'name' => $perspective->getName(), 'extension' => $perspective->getExtension()); } //Test if access $access = false; foreach ($perspective->getChildren() as $section) { if (tao_models_classes_accessControl_AclProxy::hasAccess($section->getAction(), $section->getController(), $section->getExtensionId())) { $access = true; break; } } if (in_array((string) $perspective->getId(), $defaultExtIds)) { $defaultExtensions[strval($perspective->getId())]['enabled'] = $access; } else { $additionalExtensions[$i]['enabled'] = $access; } } $this->setData('extensions', array_merge($defaultExtensions, $additionalExtensions)); $this->setData('defaultExtensions', $defaultExtensions); $this->setData('additionalExtensions', $additionalExtensions); $this->setView('splash.tpl'); }
/** * Get perspective data depending on the group set in structure.xml * * @param $groupId * @return array */ private function getNavigationElementsByGroup($groupId) { $entries = array(); foreach (MenuService::getPerspectivesByGroup($groupId) as $i => $perspective) { $binding = $perspective->getBinding(); $children = $this->getMenuElementChildren($perspective); if (!empty($binding) || !empty($children)) { $entry = array('perspective' => $perspective, 'children' => $children); if (!is_null($binding)) { $entry['binding'] = $perspective->getExtension() . '/' . $binding; } $entries[$i] = $entry; } } return $entries; }