public function prepareData()
 {
     parent::prepareData();
     $this->form = new CoreForm('post');
     $this->createFormFields();
     $this->errorMessageContainer = new CoreFormValidationMessageContainer();
     if (CoreServices::get('request')->isSetGet('logout')) {
         $this->logAction('logout');
         CoreServices::get('access')->logout();
         $this->currentUser = null;
     } elseif ($this->form->isSubmitted()) {
         $this->addFormValidators();
         CoreServices::get('access')->logout();
         $this->currentUser = null;
         $this->form->setFieldValuesFromRequest();
         $this->errorMessageContainer = $this->form->getValidationResults();
         if (!$this->errorMessageContainer->isAnyErrorMessage()) {
             CoreServices::get('access')->login($this->form->getField('adminName')->getValue(), $this->form->getField('password')->getValue(), $this->errorMessageContainer);
             $this->logAction('login');
         }
     }
     if (!$this->form->isSubmitted() || !$this->errorMessageContainer->isAnyErrorMessage()) {
         $adminId = CoreServices::get('access')->getCurrentUserId();
         if ($adminId) {
             $this->currentUser = CoreServices::get('access')->getCurrentUserData();
             $redirectAddress = $this->getFirstAccessiblePage();
             if ($redirectAddress == CoreServices::get('url')->getCurrentPageUrl()) {
                 $this->errorMessageContainer->addMessage('youHaveNoPermissions');
             } else {
                 CoreUtils::redirect($redirectAddress);
             }
         }
     }
 }
 public function assignDisplayVariables()
 {
     parent::assignDisplayVariables();
     $display = CoreServices2::getDisplay();
     $display->assign('recordList', $this->recordList);
     if ($this->searchForm) {
         $display->assign('searchForm', $this->searchForm);
     }
     if ($this->deletionForm) {
         $display->assign('deletionForm', $this->deletionForm);
     }
 }
 /**
  * Likely to be overwritten if initAdditions() is not empty.
  */
 public function assignDisplayVariables()
 {
     parent::assignDisplayVariables();
     $display = CoreServices::get('display');
     $display->assign('mainForm', $this->form);
     $display->assign('recordOldValues', $this->recordOldValues);
     $display->assign('pagePath', $this->pagePath);
     if ($this->record['id']) {
         $display->assign('recordId', $this->record['id']);
     }
     if (!is_null($this->errorMessageContainer) && $this->errorMessageContainer->isAnyErrorMessage()) {
         $display->assign('formErrorMessages', $this->errorMessageContainer);
     }
 }
 /**
  * Likely to be overwritten if initAdditions() is not empty.
  */
 public function assignDisplayVariables()
 {
     parent::assignDisplayVariables();
     $display = CoreServices2::getDisplay();
     $children = $this->recordList;
     unset($children[$this->rootId]);
     $display->assign('recordList', $children);
     $display->assign('rootRecord', $this->recordList[$this->rootId]);
     $display->assign('mainForm', $this->form);
     if (!is_null($this->errorMessageContainer) && $this->errorMessageContainer->isAnyErrorMessage()) {
         $display->assign('formErrorMessages', $this->errorMessageContainer);
     }
     $display->assign('addButtonOff', 1);
 }
 /**
  * Likely to be overwritten if initAdditions() is not empty.
  */
 public function assignDisplayVariables()
 {
     parent::assignDisplayVariables();
     //CoreServices::get('display')->assign('shownColumns', $this->getShownColumns());
     CoreServices::get('display')->assign('shownColumns', $this->getFilterTypes());
     CoreServices::get('display')->assign('recordList', $this->recordList);
     CoreServices::get('display')->assign('pagination', $this->pagination);
     CoreServices::get('display')->assign('filterForm', $this->filterForm);
 }