示例#1
0
 /**
  * @test
  */
 public function setFeGroupSetsFegroup()
 {
     $expected = $this->getMock('\\TYPO3\\CMS\\Extbase\\Domain\\Model\\FrontendUserGroup');
     $this->proxy->setFeGroup($expected);
     $actual = $this->proxy->_get('feGroup');
     $this->assertEquals($expected, $actual);
 }
 /**
  * Creates a new bookmark and forwards to show action
  *
  * @param Tx_PtExtlist_Domain_Model_Bookmark_Bookmark $bookmark
  */
 public function createAction(Tx_PtExtlist_Domain_Model_Bookmark_Bookmark $bookmark)
 {
     // Check whether user is allowed to create public bookmarks
     if ($this->request->hasArgument('isPublic') && $this->request->getArgument('isPublic') == '1') {
         if ($this->userIsAllowedToCreatePublicBookmarks()) {
             $bookmark->setIsPublic(true);
         } else {
             // TODO show some message, that user is not allowed to create public bookmarks
             $this->forward('show');
         }
     }
     // Check, whether user is allowed to create group bookmarks
     if ($this->request->hasArgument('feGroup') && $this->request->getArgument('feGroup') > 0) {
         if ($this->userIsAllowedToCreateGroupBookmarks()) {
             $bookmark->setFeGroup($this->request->getArgument('feGroup'));
         } else {
             $this->forward('show');
         }
     }
     $bookmark->setPid($this->settings['bookmarks']['bookmarksPid']);
     $this->bookmarkManager->addContentToBookmark($bookmark);
     $this->bookmarksRepository->add($bookmark);
     $this->persistenceManager->persistAll();
     $this->forward('show');
 }