Exemplo n.º 1
0
 /**
  * @param array $formData
  *
  * @return \Symfony\Component\HttpFoundation\RedirectResponse
  */
 protected function executePost(array $formData)
 {
     return $this->actionHelper->handleSettingsPostAction(function () use($formData) {
         $this->adminFormValidation->validate($formData);
         $data = ['feed_image' => $this->secureHelper->strEncode($formData['feed_image']), 'feed_type' => $formData['feed_type']];
         return $this->config->saveSettings($data, Feeds\Installer\Schema::MODULE_NAME);
     });
 }
Exemplo n.º 2
0
 /**
  * @param array $formData
  *
  * @return \Symfony\Component\HttpFoundation\RedirectResponse
  */
 protected function executePost(array $formData)
 {
     return $this->actionHelper->handleSettingsPostAction(function () use($formData) {
         $this->adminSettingsFormValidation->validate($formData);
         $data = ['mail' => $formData['mail'], 'mailsig' => $this->secureHelper->strEncode($formData['mailsig'], true), 'html' => (int) $formData['html']];
         return $this->config->saveSettings($data, Newsletter\Installer\Schema::MODULE_NAME);
     });
 }
Exemplo n.º 3
0
 /**
  * Erzeugt eine neue Kategorie und gibt ihre ID zurück
  *
  * @param string $title
  * @param string $module
  *
  * @return integer
  */
 public function categoriesCreate($title, $module)
 {
     $moduleInfo = $this->modules->getModuleInfo($module);
     if ($this->categoryRepository->resultIsDuplicate($title, $moduleInfo['id'], '') === false) {
         $insertValues = ['id' => '', 'title' => $this->secureHelper->strEncode($title), 'picture' => '', 'description' => '', 'module_id' => $moduleInfo['id']];
         $result = $this->categoryRepository->insert($insertValues);
         $this->categoriesCache->saveCache($module);
         return $result;
     }
     return $this->categoryRepository->getOneByTitleAndModule($title, $module)['id'];
 }
Exemplo n.º 4
0
 /**
  * @param array $formData
  *
  * @return \Symfony\Component\HttpFoundation\RedirectResponse
  */
 protected function executePost(array $formData)
 {
     return $this->actionHelper->handleSettingsPostAction(function () use($formData) {
         $this->adminSettingsFormValidation->validate($formData);
         $data = ['address' => $this->secureHelper->strEncode($formData['address'], true), 'ceo' => $this->secureHelper->strEncode($formData['ceo']), 'disclaimer' => $this->secureHelper->strEncode($formData['disclaimer'], true), 'fax' => $this->secureHelper->strEncode($formData['fax']), 'mail' => $formData['mail'], 'mobile_phone' => $this->secureHelper->strEncode($formData['mobile_phone']), 'picture_credits' => $this->secureHelper->strEncode($formData['picture_credits'], true), 'telephone' => $this->secureHelper->strEncode($formData['telephone']), 'vat_id' => $this->secureHelper->strEncode($formData['vat_id'])];
         return $this->config->saveSettings($data, Contact\Installer\Schema::MODULE_NAME);
     });
 }
Exemplo n.º 5
0
 /**
  * @param array $answers
  * @param int $pollId
  *
  * @return bool|int
  */
 public function saveAnswers(array $answers, $pollId)
 {
     $bool = false;
     foreach ($answers as $row) {
         if (empty($row['id'])) {
             if (!empty($row['text']) && !isset($row['delete'])) {
                 $data = ['text' => $this->secure->strEncode($row['text']), 'poll_id' => $pollId];
                 $bool = $this->answerRepository->insert($data);
             }
         } elseif (isset($row['delete'])) {
             $this->answerRepository->delete((int) $row['id']);
         } elseif (!empty($row['text'])) {
             $data = ['text' => $this->secure->strEncode($row['text'])];
             $bool = $this->answerRepository->update($data, (int) $row['id']);
         }
     }
     return $bool;
 }
Exemplo n.º 6
0
 /**
  * @param array $formData
  * @param string $phrase
  * @return string
  */
 protected function buildEmailBody(array $formData, $phrase)
 {
     return $this->translator->t('contact', $phrase, ['%name%' => $formData['name'], '%mail%' => $formData['mail'], '%message%' => $this->secure->strEncode($formData['message'], true)]);
 }
Exemplo n.º 7
0
 /**
  * @param mixed $value
  * @return string
  */
 public function doEscape($value)
 {
     return $this->secure->strEncode($value);
 }