Ejemplo n.º 1
0
 /**
  * @param string $value
  *
  * @return array
  */
 protected function fetchMenuItemTypes($value = '')
 {
     $menuItemTypes = [1 => $this->translator->t('menus', 'module'), 2 => $this->translator->t('menus', 'dynamic_page'), 3 => $this->translator->t('menus', 'hyperlink')];
     if ($this->articlesHelpers) {
         $menuItemTypes[4] = $this->translator->t('menus', 'article');
     }
     return $this->formsHelper->choicesGenerator('mode', $menuItemTypes, $value);
 }
Ejemplo 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());
     }
     $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()];
 }
Ejemplo 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(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()];
 }
Ejemplo n.º 4
0
 /**
  * @param array $currentUserRoles
  *
  * @return array
  */
 protected function fetchUserRoles(array $currentUserRoles = [])
 {
     $roles = $this->acl->getAllRoles();
     $availableUserRoles = [];
     foreach ($roles as $role) {
         $availableUserRoles[$role['id']] = str_repeat('  ', $role['level']) . $role['name'];
     }
     return $this->formsHelpers->choicesGenerator('roles', $availableUserRoles, $currentUserRoles);
 }
Ejemplo n.º 5
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']);
 }
Ejemplo 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());
     }
     $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()];
 }
Ejemplo n.º 7
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)];
 }
Ejemplo n.º 8
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()];
 }
Ejemplo n.º 9
0
 /**
  * @param string $currentArea
  * @return array
  */
 protected function fetchAreas($currentArea = '')
 {
     $areas = array_values(AreaEnum::getAreas());
     return $this->formsHelper->choicesGenerator('area', array_combine($areas, $areas), $currentArea);
 }
Ejemplo n.º 10
0
 /**
  * @param int $currentGender
  *
  * @return array
  */
 protected function fetchGenderField($currentGender)
 {
     $genders = [1 => $this->translator->t('users', 'gender_not_specified'), 2 => $this->translator->t('users', 'gender_female'), 3 => $this->translator->t('users', 'gender_male')];
     return $this->formsHelpers->choicesGenerator('gender', $genders, $currentGender);
 }
Ejemplo n.º 11
0
Archivo: Date.php Proyecto: acp3/core
 /**
  * Gibts ein Array mit den möglichen Datumsformaten aus,
  * um diese als Dropdownmenü darstellen zu können
  *
  * @param string $currentDateFormat
  *
  * @return array
  */
 public function dateFormatDropdown($currentDateFormat = '')
 {
     $dateFormats = ['short' => $this->translator->t('system', 'date_format_short'), 'long' => $this->translator->t('system', 'date_format_long')];
     return $this->formsHelper->choicesGenerator('dateformat', $dateFormats, $currentDateFormat);
 }