Beispiel #1
0
 /**
  * @return array|\Symfony\Component\HttpFoundation\RedirectResponse
  */
 public function execute()
 {
     if ($this->request->getPost()->count() !== 0) {
         return $this->executePost($this->request->getPost()->all());
     }
     $copy = [1 => $this->translator->t('contact', 'send_copy_to_sender')];
     return ['form' => array_merge($this->getFormDefaults(), $this->request->getPost()->all()), 'copy' => $this->formsHelper->checkboxGenerator('copy', $copy, 0), 'contact' => $this->config->getSettings(Contact\Installer\Schema::MODULE_NAME), 'form_token' => $this->formTokenHelper->renderFormToken()];
 }
Beispiel #2
0
 /**
  * @return array|\Symfony\Component\HttpFoundation\RedirectResponse
  */
 public function execute()
 {
     $settings = $this->config->getSettings(Newsletter\Installer\Schema::MODULE_NAME);
     if ($this->request->getPost()->count() !== 0) {
         return $this->executePost($this->request->getPost()->all(), $settings);
     }
     $actions = [1 => $this->translator->t('newsletter', 'send_and_save'), 0 => $this->translator->t('newsletter', 'only_save')];
     return ['settings' => $settings, 'test' => $this->formsHelper->yesNoCheckboxGenerator('test', 0), 'action' => $this->formsHelper->checkboxGenerator('action', $actions, 1), 'form' => array_merge(['title' => '', 'text' => '', 'date' => ''], $this->request->getPost()->all()), 'form_token' => $this->formTokenHelper->renderFormToken()];
 }
Beispiel #3
0
 /**
  * @return array|JsonResponse|\Symfony\Component\HttpFoundation\RedirectResponse|void
  */
 public function execute()
 {
     $rememberMe = [1 => $this->translator->t('users', 'remember_me')];
     $this->view->assign('remember_me', $this->forms->checkboxGenerator('remember', $rememberMe, 0));
     if ($this->user->isAuthenticated() === true) {
         return $this->redirect()->toNewPage($this->appPath->getWebRoot());
     } elseif ($this->request->getPost()->count() > 0) {
         return $this->executePost();
     }
 }
 /**
  * @param array $file
  * @return array
  */
 protected function getOptions(array $file)
 {
     $settings = $this->config->getSettings(Files\Installer\Schema::MODULE_NAME);
     $options = [];
     if ($settings['comments'] == 1 && $this->modules->isActive('comments') === true) {
         $comments = ['1' => $this->translator->t('system', 'allow_comments')];
         $options = $this->formsHelper->checkboxGenerator('comments', $comments, $file['comments']);
     }
     return $options;
 }
Beispiel #5
0
 /**
  * @return array|\Symfony\Component\HttpFoundation\RedirectResponse
  */
 public function execute()
 {
     if ($this->request->getPost()->count() !== 0) {
         return $this->executePost($this->request->getPost()->all());
     }
     $seoSettings = $this->config->getSettings(Seo\Installer\Schema::MODULE_NAME);
     $robots = [1 => $this->translator->t('seo', 'robots_index_follow'), 2 => $this->translator->t('seo', 'robots_index_nofollow'), 3 => $this->translator->t('seo', 'robots_noindex_follow'), 4 => $this->translator->t('seo', 'robots_noindex_nofollow')];
     $sitemapSaveMode = [1 => $this->translator->t('seo', 'sitemap_save_mode_automatically'), 2 => $this->translator->t('seo', 'sitemap_save_mode_manually')];
     return ['robots' => $this->formsHelper->choicesGenerator('robots', $robots, $seoSettings['robots']), 'sitemap_is_enabled' => $this->formsHelper->yesNoCheckboxGenerator('sitemap_is_enabled', $seoSettings['sitemap_is_enabled']), 'sitemap_save_mode' => $this->formsHelper->checkboxGenerator('sitemap_save_mode', $sitemapSaveMode, $seoSettings['sitemap_save_mode']), 'form' => array_merge($seoSettings, $this->request->getPost()->all()), 'form_token' => $this->formTokenHelper->renderFormToken()];
 }
Beispiel #6
0
 /**
  * @return array|\Symfony\Component\HttpFoundation\RedirectResponse
  */
 public function execute()
 {
     if ($this->request->getPost()->count() !== 0) {
         return $this->executePost($this->request->getPost()->all());
     }
     $systemSettings = $this->config->getSettings(System\Installer\Schema::MODULE_NAME);
     $pageCachePurgeMode = [1 => $this->translator->t('system', 'page_cache_purge_mode_automatically'), 2 => $this->translator->t('system', 'page_cache_purge_mode_manually')];
     $mailerTypes = ['mail' => $this->translator->t('system', 'mailer_type_php_mail'), 'smtp' => $this->translator->t('system', 'mailer_type_smtp')];
     $mailerSmtpSecurity = ['none' => $this->translator->t('system', 'mailer_smtp_security_none'), 'ssl' => $this->translator->t('system', 'mailer_smtp_security_ssl'), 'tls' => $this->translator->t('system', 'mailer_smtp_security_tls')];
     return ['entries' => $this->formsHelper->recordsPerPage($systemSettings['entries']), 'wysiwyg' => $this->fetchWysiwygEditors($systemSettings), 'languages' => $this->translator->getLanguagePack($systemSettings['lang']), 'mod_rewrite' => $this->formsHelper->yesNoCheckboxGenerator('mod_rewrite', $systemSettings['mod_rewrite']), 'time_zones' => $this->get('core.helpers.date')->getTimeZones($systemSettings['date_time_zone']), 'maintenance' => $this->formsHelper->yesNoCheckboxGenerator('maintenance_mode', $systemSettings['maintenance_mode']), 'page_cache' => $this->formsHelper->yesNoCheckboxGenerator('page_cache_is_enabled', $systemSettings['page_cache_is_enabled']), 'page_cache_purge_mode' => $this->formsHelper->checkboxGenerator('page_cache_purge_mode', $pageCachePurgeMode, $systemSettings['page_cache_purge_mode']), 'cache_images' => $this->formsHelper->yesNoCheckboxGenerator('cache_images', $systemSettings['cache_images']), 'mailer_type' => $this->formsHelper->choicesGenerator('mailer_type', $mailerTypes, $systemSettings['mailer_type']), 'mailer_smtp_auth' => $this->formsHelper->yesNoCheckboxGenerator('mailer_smtp_auth', $systemSettings['mailer_smtp_auth']), 'mailer_smtp_security' => $this->formsHelper->choicesGenerator('mailer_smtp_security', $mailerSmtpSecurity, $systemSettings['mailer_smtp_security']), 'form' => array_merge($systemSettings, $this->request->getPost()->all()), 'form_token' => $this->formTokenHelper->renderFormToken()];
 }
Beispiel #7
0
 /**
  * @param string $q
  *
  * @return array|\Symfony\Component\HttpFoundation\RedirectResponse
  */
 public function execute($q = '')
 {
     if ($this->request->getPost()->count() !== 0) {
         return $this->executePost($this->request->getPost()->all());
     } elseif (!empty($q)) {
         return $this->executePost(['search_term' => (string) $q]);
     }
     $searchAreas = ['title_content' => $this->translator->t('search', 'title_and_content'), 'title' => $this->translator->t('search', 'title_only'), 'content' => $this->translator->t('search', 'content_only')];
     $sortDirections = ['asc' => $this->translator->t('search', 'asc'), 'desc' => $this->translator->t('search', 'desc')];
     return ['form' => array_merge(['search_term' => ''], $this->request->getPost()->all()), 'search_mods' => $this->searchHelpers->getModules(), 'search_areas' => $this->formsHelper->checkboxGenerator('area', $searchAreas, 'title_content'), 'sort_hits' => $this->formsHelper->checkboxGenerator('sort', $sortDirections, 'asc')];
 }
Beispiel #8
0
 /**
  * @return array|\Symfony\Component\HttpFoundation\RedirectResponse
  */
 public function execute()
 {
     if ($this->request->getPost()->count() !== 0) {
         return $this->executePost($this->request->getPost()->all());
     }
     if ($this->newsletterActive === true && $this->newsletterSubscribeHelper) {
         $newsletterSubscription = [1 => $this->translator->t('guestbook', 'subscribe_to_newsletter', ['%title%' => $this->config->getSettings(Schema::MODULE_NAME)['site_title']])];
         $this->view->assign('subscribe_newsletter', $this->formsHelper->checkboxGenerator('subscribe_newsletter', $newsletterSubscription, '1'));
     }
     return ['form' => array_merge($this->fetchFormDefaults(), $this->request->getPost()->all()), 'form_token' => $this->formTokenHelper->renderFormToken(), 'can_use_emoticons' => $this->guestbookSettings['emoticons'] == 1];
 }
 /**
  * @param int $readMoreValue
  * @param int $commentsValue
  * @return array
  */
 protected function fetchOptions($readMoreValue, $commentsValue)
 {
     $settings = $this->config->getSettings(News\Installer\Schema::MODULE_NAME);
     $options = [];
     if ($settings['readmore'] == 1) {
         $readMore = ['1' => $this->translator->t('news', 'activate_readmore')];
         $options = $this->formsHelper->checkboxGenerator('readmore', $readMore, $readMoreValue);
     }
     if ($settings['comments'] == 1 && $this->modules->isActive('comments') === true) {
         $comments = ['1' => $this->translator->t('system', 'allow_comments')];
         $options = array_merge($options, $this->formsHelper->checkboxGenerator('comments', $comments, $commentsValue));
     }
     return $options;
 }
Beispiel #10
0
 /**
  * @param int $id
  *
  * @return array|\Symfony\Component\HttpFoundation\RedirectResponse
  * @throws \ACP3\Core\Controller\Exception\ResultNotExistsException
  */
 public function execute($id)
 {
     $newsletter = $this->newsletterModel->getOneById($id);
     if (empty($newsletter) === false) {
         $this->title->setPageTitlePostfix($newsletter['title']);
         $settings = $this->config->getSettings(Newsletter\Installer\Schema::MODULE_NAME);
         if ($this->request->getPost()->count() !== 0) {
             return $this->executePost($this->request->getPost()->all(), $newsletter, $settings, $id);
         }
         $actions = [1 => $this->translator->t('newsletter', 'send_and_save'), 0 => $this->translator->t('newsletter', 'only_save')];
         return ['settings' => array_merge($settings, ['html' => $newsletter['html']]), 'test' => $this->formsHelper->yesNoCheckboxGenerator('test', 0), 'action' => $this->formsHelper->checkboxGenerator('action', $actions, 1), 'form' => array_merge($newsletter, $this->request->getPost()->all()), 'form_token' => $this->formTokenHelper->renderFormToken()];
     }
     throw new Core\Controller\Exception\ResultNotExistsException();
 }
 /**
  * @param int $currentValue
  * @return array
  */
 private function fetchCreateMenuItemOption($currentValue = 0)
 {
     $createMenuItem = [1 => $this->translator->t('menus', 'create_menu_item')];
     return $this->forms->checkboxGenerator('create', $createMenuItem, $currentValue);
 }
Beispiel #12
0
 /**
  * @param string $currentValue
  *
  * @return array
  */
 protected function getOptions($currentValue = '0')
 {
     $comments = ['1' => $this->translator->t('system', 'allow_comments')];
     return $this->formsHelper->checkboxGenerator('comments', $comments, $currentValue);
 }
Beispiel #13
0
 /**
  * @param int $value
  *
  * @return array
  */
 protected function displayBirthday($value)
 {
     $displayBirthday = [0 => $this->translator->t('users', 'birthday_hide'), 1 => $this->translator->t('users', 'birthday_display_completely'), 2 => $this->translator->t('users', 'birthday_hide_year')];
     return $this->formsHelpers->checkboxGenerator('birthday_display', $displayBirthday, $value);
 }
 /**
  * @param string $currentValue
  *
  * @return array
  */
 protected function fetchMultipleChoiceOption($currentValue)
 {
     $values = ['1' => $this->translator->t('polls', 'multiple_choice')];
     return $this->formsHelper->checkboxGenerator('multiple', $values, $currentValue);
 }