/** * @param loginUser string * checks what the user tries to do and showes the memberPage */ public function memberPage($loginUser) { if ($this->classMemberPageView->wantToEditUser()) { $this->userID = $this->classMemberPageView->getUserID(); $this->editFeild = $this->classMemberPageView->showEditFeild($this->classMemberPageView->getUserID()); } if ($this->classMemberPageView->adminWantsToEditUser()) { $this->changeMemberPassword(); } if ($this->classMemberPageView->wantToDeleteUser()) { $this->areYouSureFeild = $this->classMemberPageView->areYouSureFeild($this->classMemberPageView->getUserID()); } if ($this->classMemberPageView->triedToDeleteUser()) { $this->classPostModel->deleteUser($this->classMemberPageView->getDeleteUserId()); $this->classFrontPageView->setMessage(\frontPageView\FrontPageView::DELETE_USER); } $this->classMemberPageView->showMembers($loginUser, $this->classUserModel->loadUsers(), $this->editFeild, $this->areYouSureFeild); }
/** * @param loginUser string * check what the user does and show's * the selected users gallery */ public function galleryPage($loginUser) { $galleryOwner = trim(strip_tags($this->classGalleryPageView->getMembersGallery())); if ($this->classGalleryPageView->userWantToLookAtPic()) { $this->selectedPic = $this->handleSelectedPic($loginUser); } if ($this->classGalleryPageView->userWantToDeletePic()) { $this->areYouSureField = $this->classGalleryPageView->areYouSureFeild($this->classGalleryPageView->getPicID(), $this->classGalleryPageView->getDeleteTitle()); } if ($this->classGalleryPageView->triedToDeletePic()) { if ($this->classGalleryModel->deletePic($this->classGalleryPageView->getDeleteUserId(), $loginUser)) { $this->classFrontPageView->setMessage(\frontPageView\FrontPageView::DELETE_PIC); } } if ($this->classGalleryPageView->userWantToEditPic()) { $picObj = $this->classGalleryModel->getPicByID($this->classGalleryPageView->getPicID()); $this->editForm = $this->classGalleryPageView->getEditMenu($picObj); } if ($this->classGalleryPageView->getEditGalleryButton()) { $newTitle = $this->classGalleryPageView->getNewTitle(); $newDescription = $this->classGalleryPageView->getNewDescription(); if ($this->validateGalleryInput($newTitle, $newDescription)) { if ($this->classGalleryModel->updatePic($this->classGalleryPageView->getEditGalleryButtonID(), $newTitle, $newDescription, $loginUser)) { $this->classFrontPageView->setMessage(\frontPageView\FrontPageView::EDIT_GALLERY_SUCCESS); } } } if ($this->classGalleryPageView->tryToUploadGallery()) { $this->handlePic($loginUser); } if ($this->classUserModel->checkIfValid($galleryOwner)) { $this->classGalleryPageView->showGalleryNotFound($loginUser, $galleryOwner); } else { $this->classGalleryPageView->showGalleryPage($this->classGalleryModel->loadGallery($galleryOwner), $loginUser, $galleryOwner, $this->editForm, $this->areYouSureField, $this->selectedPic); } }