/**
  * @param \ACP3\Core\View\Event\TemplateEvent $templateEvent
  */
 public function onWysiwygTextareaBefore(TemplateEvent $templateEvent)
 {
     $arguments = $templateEvent->getParameters();
     if ($this->modules->isActive('emoticons') && !empty($arguments['id'])) {
         echo $this->emoticonsHelper->emoticonsList($arguments['id']);
     }
 }
 /**
  * @inheritdoc
  */
 public function validate(array $formData)
 {
     $this->validator->addConstraint(Core\Validation\ValidationRules\FormTokenValidationRule::class)->addConstraint(Core\Validation\ValidationRules\InArrayValidationRule::class, ['data' => $formData, 'field' => 'dateformat', 'message' => $this->translator->t('system', 'select_date_format'), 'extra' => ['haystack' => ['long', 'short']]])->addConstraint(Core\Validation\ValidationRules\IntegerValidationRule::class, ['data' => $formData, 'field' => 'sidebar', 'message' => $this->translator->t('system', 'select_sidebar_entries')])->addConstraint(Core\Validation\ValidationRules\InArrayValidationRule::class, ['data' => $formData, 'field' => 'overlay', 'message' => $this->translator->t('gallery', 'select_use_overlay'), 'extra' => ['haystack' => [0, 1]]])->addConstraint(Core\Validation\ValidationRules\IntegerValidationRule::class, ['data' => $formData, 'field' => 'thumbwidth', 'message' => $this->translator->t('gallery', 'invalid_image_width_entered')])->addConstraint(Core\Validation\ValidationRules\IntegerValidationRule::class, ['data' => $formData, 'field' => 'width', 'message' => $this->translator->t('gallery', 'invalid_image_width_entered')])->addConstraint(Core\Validation\ValidationRules\IntegerValidationRule::class, ['data' => $formData, 'field' => 'thumbheight', 'message' => $this->translator->t('gallery', 'invalid_image_height_entered')])->addConstraint(Core\Validation\ValidationRules\IntegerValidationRule::class, ['data' => $formData, 'field' => 'height', 'message' => $this->translator->t('gallery', 'invalid_image_height_entered')]);
     if ($this->modules->isActive('comments') === true) {
         $this->validator->addConstraint(Core\Validation\ValidationRules\InArrayValidationRule::class, ['data' => $formData, 'field' => 'comments', 'message' => $this->translator->t('gallery', 'select_allow_comments'), 'extra' => ['haystack' => [0, 1]]]);
     }
     $this->validator->validate();
 }
 /**
  * @inheritdoc
  */
 public function validate(array $formData)
 {
     $this->validator->addConstraint(Core\Validation\ValidationRules\FormTokenValidationRule::class)->addConstraint(Core\Validation\ValidationRules\InArrayValidationRule::class, ['data' => $formData, 'field' => 'dateformat', 'message' => $this->translator->t('system', 'select_date_format'), 'extra' => ['haystack' => ['long', 'short']]]);
     if ($this->modules->isActive('emoticons')) {
         $this->validator->addConstraint(Core\Validation\ValidationRules\InArrayValidationRule::class, ['data' => $formData, 'field' => 'emoticons', 'message' => $this->translator->t('comments', 'select_emoticons'), 'extra' => ['haystack' => [0, 1]]]);
     }
     $this->validator->validate();
 }
 /**
  * @inheritdoc
  */
 public function validate(array $formData)
 {
     $this->validator->addConstraint(Core\Validation\ValidationRules\FormTokenValidationRule::class)->addConstraint(Core\Validation\ValidationRules\InArrayValidationRule::class, ['data' => $formData, 'field' => 'dateformat', 'message' => $this->translator->t('system', 'select_date_format'), 'extra' => ['haystack' => ['long', 'short']]])->addConstraint(Core\Validation\ValidationRules\IntegerValidationRule::class, ['data' => $formData, 'field' => 'sidebar', 'message' => $this->translator->t('system', 'select_sidebar_entries')])->addConstraint(Core\Validation\ValidationRules\NumberGreaterThanValidationRule::class, ['data' => $formData, 'field' => 'readmore_chars', 'message' => $this->translator->t('news', 'type_in_readmore_chars'), 'extra' => ['value' => 0]])->addConstraint(Core\Validation\ValidationRules\NumberGreaterThanValidationRule::class, ['data' => $formData, 'field' => 'readmore', 'message' => $this->translator->t('news', 'select_activate_readmore'), 'extra' => ['haystack' => [0, 1]]])->addConstraint(Core\Validation\ValidationRules\InArrayValidationRule::class, ['data' => $formData, 'field' => 'category_in_breadcrumb', 'message' => $this->translator->t('news', 'select_display_category_in_breadcrumb'), 'extra' => ['haystack' => [0, 1]]]);
     if ($this->modules->isActive('comments') === true) {
         $this->validator->addConstraint(Core\Validation\ValidationRules\InArrayValidationRule::class, ['data' => $formData, 'field' => 'comments', 'message' => $this->translator->t('news', 'select_allow_comments'), 'extra' => ['haystack' => [0, 1]]]);
     }
     $this->validator->validate();
 }
 /**
  * @inheritdoc
  */
 public function validate(array $formData)
 {
     $this->validator->addConstraint(Core\Validation\ValidationRules\FormTokenValidationRule::class)->addConstraint(Core\Validation\ValidationRules\InArrayValidationRule::class, ['data' => $formData, 'field' => 'dateformat', 'message' => $this->translator->t('system', 'select_date_format'), 'extra' => ['haystack' => ['long', 'short']]])->addConstraint(Core\Validation\ValidationRules\InArrayValidationRule::class, ['data' => $formData, 'field' => 'notify', 'message' => $this->translator->t('guestbook', 'select_notification_type'), 'extra' => ['haystack' => [0, 1, 2]]])->addConstraint(Core\Validation\ValidationRules\InArrayValidationRule::class, ['data' => $formData, 'field' => 'overlay', 'message' => $this->translator->t('guestbook', 'select_use_overlay'), 'extra' => ['haystack' => [0, 1]]]);
     if ($formData['notify'] != 0) {
         $this->validator->addConstraint(Core\Validation\ValidationRules\EmailValidationRule::class, ['data' => $formData, 'field' => 'notify_email', 'message' => $this->translator->t('system', 'wrong_email_format')]);
     }
     if ($this->modules->isActive('emoticons') === true) {
         $this->validator->addConstraint(Core\Validation\ValidationRules\InArrayValidationRule::class, ['data' => $formData, 'field' => 'emoticons', 'message' => $this->translator->t('guestbook', 'select_emoticons'), 'extra' => ['haystack' => [0, 1]]]);
     }
     if ($this->modules->isActive('newsletter') === true) {
         $this->validator->addConstraint(Core\Validation\ValidationRules\InArrayValidationRule::class, ['data' => $formData, 'field' => 'newsletter_integration', 'message' => $this->translator->t('guestbook', 'select_newsletter_integration'), 'extra' => ['haystack' => [0, 1]]]);
     }
     $this->validator->validate();
 }
Exemple #6
0
 /**
  * Überprüft die Modulabhängigkeiten beim Installieren eines Moduls
  *
  * @param \ACP3\Core\Modules\Installer\SchemaInterface $schema
  *
  * @return array
  */
 public function checkInstallDependencies(Core\Modules\Installer\SchemaInterface $schema)
 {
     $dependencies = $this->getDependencies($schema->getModuleName());
     $modulesToEnable = [];
     if (!empty($dependencies)) {
         foreach ($dependencies as $dependency) {
             if ($this->modules->isActive($dependency) === false) {
                 $moduleInfo = $this->modules->getModuleInfo($dependency);
                 $modulesToEnable[] = $moduleInfo['name'];
             }
         }
     }
     return $modulesToEnable;
 }
 /**
  * @param string $mode
  * @param string $moduleName
  * @param string $uri
  * @param int    $articleId
  *
  * @return bool
  */
 protected function isValidLink($mode, $moduleName, $uri, $articleId)
 {
     switch ($mode) {
         case 1:
             return $this->modules->isActive($moduleName);
         case 2:
             return $this->internalUriValidationRule->isValid($uri);
         case 3:
             return !empty($uri);
         case 4:
             if ($this->modules->isActive('articles')) {
                 return $this->articleExistsValidationRule->isValid($articleId);
             }
     }
     return false;
 }
Exemple #8
0
 /**
  * Überpüft, ob eine Modulaktion existiert und der Benutzer darauf Zugriff hat
  *
  * @param string $resource
  *
  * @return boolean
  */
 public function hasPermission($resource)
 {
     if (!empty($resource) && $this->modules->controllerActionExists($resource) === true) {
         $resourceParts = explode('/', $resource);
         if ($this->modules->isActive($resourceParts[1]) === true) {
             return $this->canAccessResource($resource);
         }
     }
     return false;
 }
 private function configureFullToolbar()
 {
     $this->config['extraPlugins'] = 'codemirror,divarea,lineutils,oembed,widget';
     if ($this->filemanagerHelpers instanceof \ACP3\Modules\ACP3\Filemanager\Helpers) {
         $this->applyFileManagerPaths();
     }
     // Toolbar configuration
     $this->config['toolbarGroups'] = [['name' => 'document', 'groups' => ['mode', 'document', 'doctools']], ['name' => 'clipboard', 'groups' => ['clipboard', 'undo']], ['name' => 'editing', 'groups' => ['find', 'selection', 'spellchecker']], ['name' => 'forms'], '/', ['name' => 'basicstyles', 'groups' => ['basicstyles', 'cleanup']], ['name' => 'paragraph', 'groups' => ['list', 'indent', 'blocks', 'align', 'bidi']], ['name' => 'links'], ['name' => 'insert'], '/', ['name' => 'styles'], ['name' => 'colors'], ['name' => 'tools'], ['name' => 'others'], ['name' => 'about']];
     // Include emoticons, if available
     if ($this->modules->isActive('emoticons') === true) {
         $this->applyEmoticons();
     }
 }