/**
  * Check if there are localized records with
  *        tx_powermail_domain_model_forms.pages = ""
  *
  * @return bool
  */
 public function render()
 {
     $forms = $this->formRepository->findAllWrongLocalizedForms();
     if (count($forms) > 0) {
         return false;
     }
     return true;
 }
Exemplo n.º 2
0
 /**
  * @return Form
  */
 public function getForms()
 {
     // if elementbrowser instead of IRRE (get related form)
     if (ConfigurationUtility::isReplaceIrreWithElementBrowserActive()) {
         return $this->formRepository->findByPages($this->uid);
     }
     return $this->forms;
 }
Exemplo n.º 3
0
Arquivo: Div.php Projeto: advOpk/pwm
 /**
  * Get Field Uid List from given Form Uid
  *
  * @param \integer $formUid Form Uid
  * @return \array
  */
 public function getFieldsFromForm($formUid)
 {
     $allowedFieldTypes = array('input', 'textarea', 'select', 'check', 'radio', 'password', 'file', 'hidden', 'date', 'location', 'typoscript');
     $fields = array();
     $form = $this->formRepository->findByUid($formUid);
     if (!method_exists($form, 'getPages')) {
         return array();
     }
     foreach ($form->getPages() as $page) {
         foreach ($page->getFields() as $field) {
             // skip type submit
             if (!in_array($field->getType(), $allowedFieldTypes)) {
                 continue;
             }
             $fields[] = $field->getUid();
         }
     }
     return $fields;
 }
Exemplo n.º 4
0
 /**
  * Return uid from given field marker and form (if no IRRE)
  *
  * @param string $marker
  * @param int $formUid
  * @return Field
  */
 protected function findByMarkerAndFormAlternative($marker, $formUid = 0)
 {
     // get pages from form
     $form = $this->formRepository->findByUid($formUid);
     $pageUids = array();
     foreach ($form->getPages() as $page) {
         $pageUids[] = $page->getUid();
     }
     $query = $this->createQuery();
     $query->getQuerySettings()->setRespectStoragePage(false);
     $query->getQuerySettings()->setRespectSysLanguage(false);
     $query->matching($query->logicalAnd(array($query->equals('marker', $marker), $query->in('pages', $pageUids))));
     return $query->setLimit(1)->execute()->getFirst();
 }
Exemplo n.º 5
0
 /**
  * Returns the pages
  *
  * @return ObjectStorage
  */
 public function getPages()
 {
     // if elementbrowser instead of IRRE (sorting workarround)
     if (ConfigurationUtility::isReplaceIrreWithElementBrowserActive()) {
         $formSorting = GeneralUtility::trimExplode(',', $this->formRepository->getPagesValue($this->uid), true);
         $formSorting = array_flip($formSorting);
         $pageArray = array();
         foreach ($this->pages as $page) {
             $pageArray[$formSorting[$page->getUid()]] = $page;
         }
         ksort($pageArray);
         return $pageArray;
     }
     return $this->pages;
 }
Exemplo n.º 6
0
Arquivo: Form.php Projeto: advOpk/pwm
 /**
  * Returns the pages
  *
  * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage
  */
 public function getPages()
 {
     // if elementbrowser instead of IRRE (sorting workarround)
     $confArr = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['powermail']);
     if ($confArr['replaceIrreWithElementBrowser']) {
         $formSorting = GeneralUtility::trimExplode(',', $this->formRepository->getPagesValue($this->uid), TRUE);
         $formSorting = array_flip($formSorting);
         $pageArray = array();
         foreach ($this->pages as $page) {
             $pageArray[$formSorting[$page->getUid()]] = $page;
         }
         ksort($pageArray);
         return $pageArray;
     }
     return $this->pages;
 }