Esempio n. 1
0
 /**
  * @return array|\Symfony\Component\HttpFoundation\RedirectResponse
  */
 public function execute()
 {
     if ($this->request->getPost()->count() !== 0) {
         return $this->executePost($this->request->getPost()->all());
     }
     $settings = $this->config->getSettings(Users\Installer\Schema::MODULE_NAME);
     return ['languages' => $this->formsHelpers->yesNoCheckboxGenerator('language_override', $settings['language_override']), 'registration' => $this->formsHelpers->yesNoCheckboxGenerator('enable_registration', $settings['enable_registration']), 'form' => array_merge(['mail' => $settings['mail']], $this->request->getPost()->all()), 'form_token' => $this->formTokenHelper->renderFormToken()];
 }
Esempio n. 2
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()];
 }
Esempio n. 3
0
 /**
  * @return array|\Symfony\Component\HttpFoundation\RedirectResponse
  */
 public function execute()
 {
     if ($this->request->getPost()->count() !== 0) {
         return $this->executePost($this->request->getPost()->all());
     }
     $settings = $this->config->getSettings(Newsletter\Installer\Schema::MODULE_NAME);
     return ['html' => $this->formsHelper->yesNoCheckboxGenerator('html', $settings['html']), 'form' => array_merge($settings, $this->request->getPost()->all()), 'form_token' => $this->formTokenHelper->renderFormToken()];
 }
Esempio n. 4
0
 /**
  * @return array|\Symfony\Component\HttpFoundation\RedirectResponse
  */
 public function execute()
 {
     if ($this->request->getPost()->count() !== 0) {
         return $this->executePost($this->request->getPost()->all());
     }
     $settings = $this->config->getSettings(Feeds\Installer\Schema::MODULE_NAME);
     $feedTypes = ['RSS 1.0' => 'RSS 1.0', 'RSS 2.0' => 'RSS 2.0', 'ATOM' => 'ATOM'];
     return ['feed_types' => $this->formsHelper->choicesGenerator('feed_type', $feedTypes, $settings['feed_type']), 'form' => array_merge($settings, $this->request->getPost()->all()), 'form_token' => $this->formTokenHelper->renderFormToken()];
 }
Esempio n. 5
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()];
 }
Esempio n. 6
0
 /**
  * @return array|\Symfony\Component\HttpFoundation\RedirectResponse
  */
 public function execute()
 {
     if ($this->request->getPost()->count() !== 0) {
         return $this->executePost($this->request->getPost()->all());
     }
     $defaults = ['first_name' => '', 'last_name' => '', 'mail' => ''];
     $salutations = [0 => $this->translator->t('newsletter', 'salutation_unspecified'), 1 => $this->translator->t('newsletter', 'salutation_female'), 2 => $this->translator->t('newsletter', 'salutation_male')];
     return ['salutation' => $this->formsHelper->choicesGenerator('salutation', $salutations), 'form' => array_merge($defaults, $this->request->getPost()->all()), 'form_token' => $this->formTokenHelper->renderFormToken()];
 }
Esempio n. 7
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();
     }
 }
Esempio n. 8
0
 /**
  * @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;
 }
Esempio n. 9
0
 /**
  * @param $systemSettings
  * @return array
  */
 protected function fetchWysiwygEditors($systemSettings)
 {
     $services = $this->get('core.wysiwyg.wysiwyg_factory')->getWysiwygEditors();
     $wysiwyg = [];
     foreach ($services as $serviceId => $editorInstance) {
         /** @var \ACP3\Core\WYSIWYG\AbstractWYSIWYG $editorInstance */
         $wysiwyg[$serviceId] = $editorInstance->getFriendlyName();
     }
     return $this->formsHelper->choicesGenerator('wysiwyg', $wysiwyg, $systemSettings['wysiwyg']);
 }
Esempio n. 10
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()];
 }
Esempio n. 11
0
 /**
  * @return array|\Symfony\Component\HttpFoundation\RedirectResponse
  */
 public function execute()
 {
     if ($this->request->getPost()->count() !== 0) {
         return $this->executePost($this->request->getPost()->all());
     }
     $settings = $this->config->getSettings(News\Installer\Schema::MODULE_NAME);
     if ($this->modules->isActive('comments') === true) {
         $this->view->assign('allow_comments', $this->formsHelper->yesNoCheckboxGenerator('comments', $settings['comments']));
     }
     return ['dateformat' => $this->get('core.helpers.date')->dateFormatDropdown($settings['dateformat']), 'readmore' => $this->formsHelper->yesNoCheckboxGenerator('readmore', $settings['readmore']), 'readmore_chars' => $this->request->getPost()->get('readmore_chars', $settings['readmore_chars']), 'sidebar_entries' => $this->formsHelper->recordsPerPage((int) $settings['sidebar'], 1, 10, 'sidebar'), 'category_in_breadcrumb' => $this->formsHelper->yesNoCheckboxGenerator('category_in_breadcrumb', $settings['category_in_breadcrumb']), 'form_token' => $this->formTokenHelper->renderFormToken()];
 }
Esempio n. 12
0
 /**
  * @return array|\Symfony\Component\HttpFoundation\RedirectResponse
  */
 public function execute()
 {
     if ($this->request->getPost()->count() !== 0) {
         return $this->executePost($this->request->getPost()->all());
     }
     $settings = $this->config->getSettings(Files\Installer\Schema::MODULE_NAME);
     if ($this->commentsHelpers) {
         $this->view->assign('comments', $this->formsHelper->yesNoCheckboxGenerator('comments', $settings['comments']));
     }
     return ['dateformat' => $this->get('core.helpers.date')->dateFormatDropdown($settings['dateformat']), 'sidebar_entries' => $this->formsHelper->recordsPerPage((int) $settings['sidebar'], 1, 10, 'sidebar'), 'form_token' => $this->formTokenHelper->renderFormToken()];
 }
Esempio n. 13
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];
 }
Esempio n. 14
0
File: Index.php Progetto: acp3/cms
 /**
  * @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')];
 }
Esempio n. 15
0
 /**
  * Gibt alle angelegten Artikel zurück
  *
  * @param integer $id
  *
  * @return array
  */
 public function articlesList($id = 0)
 {
     $articles = $this->articleRepository->getAll();
     $cArticles = count($articles);
     if ($cArticles > 0) {
         for ($i = 0; $i < $cArticles; ++$i) {
             $articles[$i]['selected'] = $this->formsHelper->selectEntry('articles', $articles[$i]['id'], $id);
         }
     }
     return $articles;
 }
Esempio n. 16
0
 /**
  * @return array
  */
 protected function fetchModules()
 {
     $modules = $this->modules->getActiveModules();
     foreach ($modules as $name => $info) {
         if ($info['active'] && in_array('categories', $info['dependencies']) === true) {
             $modules[$name]['selected'] = $this->formsHelper->selectEntry('module', $info['id']);
         } else {
             unset($modules[$name]);
         }
     }
     return $modules;
 }
Esempio n. 17
0
 /**
  * @return array|\Symfony\Component\HttpFoundation\RedirectResponse
  */
 public function execute()
 {
     if ($this->request->getPost()->count() !== 0) {
         return $this->executePost($this->request->getPost()->all());
     }
     $settings = $this->config->getSettings(Comments\Installer\Schema::MODULE_NAME);
     // Emoticons erlauben
     if ($this->modules->isActive('emoticons') === true) {
         $this->view->assign('allow_emoticons', $this->formsHelper->yesNoCheckboxGenerator('emoticons', $settings['emoticons']));
     }
     return ['dateformat' => $this->get('core.helpers.date')->dateFormatDropdown($settings['dateformat']), 'form_token' => $this->formTokenHelper->renderFormToken()];
 }
Esempio n. 18
0
File: Helpers.php Progetto: acp3/cms
 /**
  * Gibt die für die Suche verfügbaren Module zurück
  *
  * @return array
  */
 public function getModules()
 {
     $searchModules = [];
     foreach ($this->availableModulesRegistrar->getAvailableModuleNames() as $module) {
         if ($this->acl->hasPermission('frontend/' . $module) === true) {
             $info = $this->modules->getModuleInfo($module);
             $name = $info['name'];
             $searchModules[$name] = ['dir' => $module, 'checked' => $this->formsHelper->selectEntry('mods', $module, $module, 'checked'), 'name' => $name];
         }
     }
     ksort($searchModules);
     return $searchModules;
 }
Esempio n. 19
0
 /**
  * @param int $id
  *
  * @return array|\Symfony\Component\HttpFoundation\RedirectResponse
  * @throws \ACP3\Core\Controller\Exception\ResultNotExistsException
  */
 public function execute($id)
 {
     $guestbook = $this->guestbookModel->getOneById($id);
     if (empty($guestbook) === false) {
         $settings = $this->config->getSettings(Guestbook\Installer\Schema::MODULE_NAME);
         $this->title->setPageTitlePostfix($guestbook['name']);
         if ($this->request->getPost()->count() !== 0) {
             return $this->executePost($this->request->getPost()->all(), $settings, $id);
         }
         return ['form' => array_merge($guestbook, $this->request->getPost()->all()), 'form_token' => $this->formTokenHelper->renderFormToken(), 'can_use_emoticons' => $settings['emoticons'] == 1, 'activate' => $settings['notify'] == 2 ? $this->formsHelper->yesNoCheckboxGenerator('active', $guestbook['active']) : []];
     }
     throw new Core\Controller\Exception\ResultNotExistsException();
 }
Esempio n. 20
0
 /**
  * @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;
 }
Esempio n. 21
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();
 }
Esempio n. 22
0
 /**
  * Returns the SEO form fields
  *
  * @param string $path
  *
  * @return array
  */
 public function formFields($path = '')
 {
     if (!empty($path)) {
         $path .= !preg_match('/\\/$/', $path) ? '/' : '';
         $alias = $this->request->getPost()->get('alias', $this->aliases->getUriAlias($path, true));
         $keywords = $this->request->getPost()->get('seo_keywords', $this->metaStatements->getKeywords($path));
         $description = $this->request->getPost()->get('seo_description', $this->metaStatements->getDescription($path));
         $robots = $this->metaStatements->getSeoInformation($path, 'robots', 0);
     } else {
         $alias = $keywords = $description = '';
         $robots = 0;
     }
     return ['alias' => $alias, 'keywords' => $keywords, 'description' => $description, 'robots' => $this->formsHelper->choicesGenerator('seo_robots', $this->getRobotsChoicesGeneratorValues(), $robots)];
 }
Esempio n. 23
0
 /**
  * @return array|\Symfony\Component\HttpFoundation\RedirectResponse
  */
 public function execute()
 {
     if ($this->request->getPost()->count() !== 0) {
         return $this->executePost($this->request->getPost()->all());
     }
     $settings = $this->config->getSettings(Guestbook\Installer\Schema::MODULE_NAME);
     $notificationTypes = [0 => $this->translator->t('guestbook', 'no_notification'), 1 => $this->translator->t('guestbook', 'notify_on_new_entry'), 2 => $this->translator->t('guestbook', 'notify_and_enable')];
     if ($this->modules->isActive('emoticons') === true) {
         $this->view->assign('allow_emoticons', $this->formsHelper->yesNoCheckboxGenerator('emoticons', $settings['emoticons']));
     }
     if ($this->modules->isActive('newsletter') === true) {
         $this->view->assign('newsletter_integration', $this->formsHelper->yesNoCheckboxGenerator('newsletter_integration', $settings['newsletter_integration']));
     }
     return ['dateformat' => $this->get('core.helpers.date')->dateFormatDropdown($settings['dateformat']), 'notify' => $this->formsHelper->choicesGenerator('notify', $notificationTypes, $settings['notify']), 'overlay' => $this->formsHelper->yesNoCheckboxGenerator('overlay', $settings['overlay']), 'form' => array_merge(['notify_email' => $settings['notify_email']], $this->request->getPost()->all()), 'form_token' => $this->formTokenHelper->renderFormToken()];
 }
Esempio n. 24
0
 /**
  * @param array $menuItem
  *
  * @return array
  */
 protected function fetchModules(array $menuItem = [])
 {
     $modules = $this->modules->getAllModules();
     foreach ($modules as $row) {
         $row['dir'] = strtolower($row['dir']);
         $modules[$row['name']]['selected'] = $this->formsHelper->selectEntry('module', $row['dir'], !empty($menuItem) && $menuItem['mode'] == 1 ? $menuItem['uri'] : '');
     }
     return $modules;
 }
Esempio n. 25
0
 /**
  * List all available menu items
  *
  * @param integer $parentId
  * @param integer $leftId
  * @param integer $rightId
  *
  * @return array
  */
 public function menuItemsList($parentId = 0, $leftId = 0, $rightId = 0)
 {
     // Menüpunkte einbinden
     if (empty($this->menuItems)) {
         $this->menuItems = $this->menusCache->getMenusCache();
     }
     $output = [];
     if (count($this->menuItems) > 0) {
         foreach ($this->menuItems as $row) {
             if (!($row['left_id'] >= $leftId && $row['right_id'] <= $rightId)) {
                 $row['selected'] = $this->formsHelper->selectEntry('parent_id', $row['id'], $parentId);
                 $row['spaces'] = str_repeat('&nbsp;&nbsp;', $row['level']);
                 // Titel für den aktuellen Block setzen
                 $output[$row['block_name']]['title'] = $row['block_title'];
                 $output[$row['block_name']]['menu_id'] = $row['block_id'];
                 $output[$row['block_name']]['items'][] = $row;
             }
         }
     }
     return $output;
 }
 /**
  * @param int $roleParentId
  * @param int $roleLeftId
  * @param int $roleRightId
  *
  * @return array
  */
 protected function fetchRoles($roleParentId = 0, $roleLeftId = 0, $roleRightId = 0)
 {
     $roles = $this->acl->getAllRoles();
     $cRoles = count($roles);
     for ($i = 0; $i < $cRoles; ++$i) {
         if ($roles[$i]['left_id'] >= $roleLeftId && $roles[$i]['right_id'] <= $roleRightId) {
             unset($roles[$i]);
         } else {
             $roles[$i]['selected'] = $this->formsHelper->selectEntry('roles', $roles[$i]['id'], $roleParentId);
             $roles[$i]['name'] = str_repeat('&nbsp;&nbsp;', $roles[$i]['level']) . $roles[$i]['name'];
         }
     }
     return $roles;
 }
Esempio n. 27
0
 /**
  * Listet alle Kategorien eines Moduls auf
  *
  * @param string $module
  * @param string $categoryId
  * @param boolean $categoryCreate
  * @param string $formFieldName
  * @param string $customText
  *
  * @return array
  */
 public function categoriesList($module, $categoryId = '', $categoryCreate = false, $formFieldName = 'cat', $customText = '')
 {
     $categories = [];
     $categories['custom_text'] = !empty($customText) ? $customText : $this->translator->t('system', 'pls_select');
     $categories['name'] = $formFieldName;
     $categories['categories'] = $this->categoriesCache->getCache($module);
     $cData = count($categories['categories']);
     for ($i = 0; $i < $cData; ++$i) {
         $categories['categories'][$i]['selected'] = $this->formsHelper->selectEntry($formFieldName, $categories['categories'][$i]['id'], $categoryId);
     }
     if ($categoryCreate === true && $this->acl->hasPermission('admin/categories/index/create') === true) {
         $categories['create']['name'] = $formFieldName . '_create';
         $categories['create']['value'] = $this->request->getPost()->get('create', ['name' => ''])['name'];
     }
     return $categories;
 }
Esempio n. 28
0
 /**
  * @param int $value
  *
  * @return array
  */
 protected function fetchIsSuperUser($value = 0)
 {
     return $this->formsHelpers->yesNoCheckboxGenerator('super_user', $value);
 }
Esempio n. 29
0
 /**
  * @param int $blockId
  * @param int $parentId
  * @param int $leftId
  * @param int $rightId
  * @param int $displayMenuItem
  *
  * @return array
  */
 public function createMenuItemFormFields($blockId = 0, $parentId = 0, $leftId = 0, $rightId = 0, $displayMenuItem = 1)
 {
     return ['blocks' => $this->menusDropDown($blockId), 'display' => $this->formsHelper->yesNoCheckboxGenerator('display', $displayMenuItem), 'menuItems' => $this->menusHelper->menuItemsList($parentId, $leftId, $rightId)];
 }
 /**
  * @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);
 }