protected function body() { if (!$this->userHasPrivileges(User::lecturesManageAll, User::lecturesManageOwn)) { return false; } $tests = CommonQueries::GetTestsVisibleToUser(); foreach ($tests as $test) { $this->addRowToOutput([$test->getId(), $test->getDescription(), $test->getTemplate(), $test->getCount(), $test->getGenerated(), $test->getLecture()->getId(), $test->getLecture()->getName(), $test->getLecture()->getDescription()]); } return true; }
protected function body() { if (!$this->userHasPrivileges(User::lecturesManageAll, User::lecturesManageOwn)) { return false; } $attachments = CommonQueries::GetAttachmentsVisibleToActiveUser(); foreach ($attachments as $attachment) { $this->addRowToOutput([$attachment->getId(), $attachment->getName(), $attachment->getType(), $attachment->getLecture()->getId(), $attachment->getLecture()->getName(), $attachment->getLecture()->getDescription()]); } return true; }